0
0
FreeRTOSprogramming~10 mins

Why tasks are the building blocks 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 that runs the function TaskFunction.

FreeRTOS
xTaskCreate([1], "Task1", 1000, NULL, 1, NULL);
Drag options to blanks, or click blank then click option'
AvTaskStartScheduler
BTaskFunction
CxQueueCreate
DvTaskDelete
Attempts:
3 left
💡 Hint
Common Mistakes
Using scheduler or queue functions instead of the task function name.
Passing NULL instead of the task function.
2fill in blank
medium

Complete the code to start the FreeRTOS scheduler after creating tasks.

FreeRTOS
[1]();
Drag options to blanks, or click blank then click option'
AvTaskStartScheduler
BxTaskCreate
CvTaskDelay
DxQueueSend
Attempts:
3 left
💡 Hint
Common Mistakes
Calling task creation functions instead of starting the scheduler.
Using delay or queue functions here.
3fill in blank
hard

Fix the error in the task function prototype to match FreeRTOS requirements.

FreeRTOS
void [1](void *pvParameters) { /* task code */ }
Drag options to blanks, or click blank then click option'
ATaskFunction
BTaskFunction(void)
CTaskFunction(int param)
DTaskFunction()
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the parameter or using wrong parameter types.
Using empty parentheses which is invalid in C for this case.
4fill in blank
hard

Fill both blanks to create a task that runs Task1Function with priority 2.

FreeRTOS
xTaskCreate([1], "Task1", 1000, NULL, [2], NULL);
Drag options to blanks, or click blank then click option'
ATask1Function
B1
C2
DvTaskStartScheduler
Attempts:
3 left
💡 Hint
Common Mistakes
Using the scheduler function as a task function.
Setting priority to 1 instead of 2.
5fill in blank
hard

Fill both blanks to create a dictionary of task names and their priorities for tasks with priority greater than 1.

FreeRTOS
task_priorities = { [2]: [1] for [3] in tasks if tasks[[3]] > 1}
Drag options to blanks, or click blank then click option'
A{
Btasks[task]
Ctask
D}
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting the curly braces.
Using wrong variable names or missing the condition.