0
0
FreeRTOSprogramming~10 mins

Why design patterns ensure reliable multi-tasking 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 prints "Hello".

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

Complete the code to delay a task for 100 ticks.

FreeRTOS
vTaskDelay([1]);
Drag options to blanks, or click blank then click option'
A1000
B10
C100
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using milliseconds instead of ticks.
Using too large or too small values.
3fill in blank
hard

Fix the error in the task creation code to ensure the task runs properly.

FreeRTOS
xTaskCreate(vTaskFunction, "Task2", [1], NULL, 1, NULL);
Drag options to blanks, or click blank then click option'
A100
BNULL
C0
D-1
Attempts:
3 left
💡 Hint
Common Mistakes
Using zero or NULL for stack size.
Using negative numbers.
4fill in blank
hard

Fill both blanks to create a reliable queue and send data to it.

FreeRTOS
QueueHandle_t queue = xQueueCreate([1], sizeof(int));
xQueueSend(queue, &[2], portMAX_DELAY);
Drag options to blanks, or click blank then click option'
A10
Bdata
C5
Dvalue
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong queue size.
Sending undefined variables.
5fill in blank
hard

Fill all three blanks to receive data from a queue and process it safely.

FreeRTOS
int [1];
if(xQueueReceive(queue, &[2], [3]) == pdPASS) {
    process([1]);
}
Drag options to blanks, or click blank then click option'
AreceivedData
CportMAX_DELAY
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names.
Using zero timeout causing immediate return.