0
0
FreeRTOSprogramming~10 mins

Why scheduling determines real-time behavior in FreeRTOS - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a FreeRTOS task with the correct priority.

FreeRTOS
xTaskCreate(taskFunction, "Task1", 1000, NULL, [1], NULL);
Drag options to blanks, or click blank then click option'
AtskIDLE_PRIORITY
BconfigMAX_PRIORITIES
C0
DportMAX_DELAY
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 or portMAX_DELAY as priority causes unexpected scheduling.
2fill in blank
medium

Complete the code to start the FreeRTOS scheduler.

FreeRTOS
int main(void) {
    // Setup code
    [1]();
    for(;;) {}
}
Drag options to blanks, or click blank then click option'
AvTaskSuspend
BxTaskCreate
CvTaskDelay
DvTaskStartScheduler
Attempts:
3 left
💡 Hint
Common Mistakes
Calling task creation functions instead of starting the scheduler.
3fill in blank
hard

Fix the error in the task delay call to ensure the task yields correctly.

FreeRTOS
void taskFunction(void *pvParameters) {
    for(;;) {
        // Do work
        vTaskDelay([1]);
    }
}
Drag options to blanks, or click blank then click option'
A1000
BportMAX_DELAY
C1000 / portTICK_PERIOD_MS
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using raw milliseconds causes incorrect delay timing.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps task names to their priorities for tasks with priority greater than 1.

FreeRTOS
task_priorities = {task.name: task.priority for task in tasks if task.priority [1] [2]
Drag options to blanks, or click blank then click option'
A>
B1
C<
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using < or == will select wrong tasks.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase task names to their stack sizes for tasks with stack size greater than 512.

FreeRTOS
task_info = { [1]: [2] for task in tasks if task.stack_size [3] 512 }
Drag options to blanks, or click blank then click option'
Atask.name.upper()
Btask.stack_size
C>
Dtask.name
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase names or wrong comparison operator.