0
0
FreeRTOSprogramming~10 mins

Memory usage monitoring in FreeRTOS - Interactive Code Practice

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

Complete the code to get the current free heap size in FreeRTOS.

FreeRTOS
size_t freeHeap = [1]();
Drag options to blanks, or click blank then click option'
AvTaskDelay
BxPortGetFreeHeapSize
CxTaskGetTickCount
DxQueueCreate
Attempts:
3 left
💡 Hint
Common Mistakes
Using task-related functions like xTaskGetTickCount instead of heap functions.
Confusing delay functions with memory functions.
2fill in blank
medium

Complete the code to print the minimum ever free heap size in FreeRTOS.

FreeRTOS
printf("Min free heap: %u bytes\n", [1]());
Drag options to blanks, or click blank then click option'
AvTaskDelay
BxTaskGetTickCount
CxPortGetMinimumEverFreeHeapSize
DxPortGetFreeHeapSize
Attempts:
3 left
💡 Hint
Common Mistakes
Using the current free heap size function instead of minimum ever.
Using unrelated task or delay functions.
3fill in blank
hard

Fix the error in the code to correctly get the free heap size.

FreeRTOS
size_t freeHeap = [1]();
Drag options to blanks, or click blank then click option'
AxPortGetFreeHeapSize
BvTaskGetHeapSize
CxTaskGetFreeHeapSize
DxPortGetFreeHeap
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect or non-existent function names.
Confusing task or delay functions with heap functions.
4fill in blank
hard

Fill both blanks to create a dictionary of task names and their stack high water marks.

FreeRTOS
TaskStatus_t taskStatusArray[[1]];
for (int i = 0; i < [2]; i++) {
    printf("Task: %s, Stack high water mark: %u\n", taskStatusArray[i].pcTaskName, taskStatusArray[i].usStackHighWaterMark);
}
Drag options to blanks, or click blank then click option'
AuxTaskGetNumberOfTasks
BvTaskDelay
CconfigMAX_PRIORITIES
DxPortGetFreeHeapSize
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated functions for array size or loop count.
Using constants instead of dynamic task count.
5fill in blank
hard

Fill all three blanks to create a filtered dictionary of tasks with stack high water mark below a threshold.

FreeRTOS
for (int i = 0; i < [1]; i++) {
    if (taskStatusArray[i].usStackHighWaterMark [2] [3]) {
        printf("Low stack task: %s, Water mark: %u\n", taskStatusArray[i].pcTaskName, taskStatusArray[i].usStackHighWaterMark);
    }
}
Drag options to blanks, or click blank then click option'
AuxTaskGetNumberOfTasks
B<
C100
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong comparison operators.
Using incorrect loop limits.
Confusing threshold values.