0
0
FreeRTOSprogramming~20 mins

Stack high water mark monitoring in FreeRTOS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Stack Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding Stack High Water Mark Purpose

What does the stack high water mark value represent in FreeRTOS?

AThe maximum amount of stack space that has been used by the task since it started.
BThe total stack size allocated to the task at creation.
CThe current free stack space available for the task.
DThe number of context switches the task has performed.
Attempts:
2 left
💡 Hint

Think about what 'high water mark' means in terms of usage.

💻 Command Output
intermediate
1:30remaining
Interpreting uxTaskGetStackHighWaterMark Output

Given the following FreeRTOS code snippet, what is the output of uxTaskGetStackHighWaterMark(NULL) if the task stack size is 200 words and the function returns 50?

FreeRTOS
UBaseType_t highWaterMark = uxTaskGetStackHighWaterMark(NULL);
printf("High water mark: %u\n", highWaterMark);
AHigh water mark: 200
BHigh water mark: 50
CHigh water mark: 0
DHigh water mark: 150
Attempts:
2 left
💡 Hint

The function returns the minimum free stack space in words.

Configuration
advanced
1:30remaining
Configuring Stack Overflow Checking

Which FreeRTOS configuration option enables stack overflow checking at runtime?

AconfigUSE_PREEMPTION
BconfigUSE_IDLE_HOOK
CconfigMAX_PRIORITIES
DconfigCHECK_FOR_STACK_OVERFLOW
Attempts:
2 left
💡 Hint

Look for the option related to stack overflow detection.

Troubleshoot
advanced
2:00remaining
Diagnosing Unexpected Low Stack High Water Mark

A task with a stack size of 256 words shows a high water mark of 5. What is the most likely cause?

AThe task is using almost all its stack space, risking overflow.
BThe task has just started and has not used much stack yet.
CThe stack size is too large for the task's needs.
DThe high water mark function is returning the total stack size.
Attempts:
2 left
💡 Hint

Low high water mark means low free stack space.

🔀 Workflow
expert
2:30remaining
Steps to Monitor Stack Usage in a Running FreeRTOS System

What is the correct sequence of steps to monitor stack high water mark for a task in FreeRTOS?

A2,1,3,4
B1,3,2,4
C1,2,3,4
D1,2,4,3
Attempts:
2 left
💡 Hint

Think about the logical order from getting data to acting on it.