Bird
0
0

Given the code snippet:

medium📝 Command Output Q13 of 15
FreeRTOS - Memory Management
Given the code snippet:
UBaseType_t freeStack = uxTaskGetStackHighWaterMark(NULL);
printf("Free stack: %u\n", freeStack);

What does this code output?
AThe total stack size of the current task
BThe current CPU usage percentage
CThe minimum free stack space left in the current task
DThe number of tasks running
Step-by-Step Solution
Solution:
  1. Step 1: Analyze uxTaskGetStackHighWaterMark(NULL)

    Passing NULL gets the current task's minimum free stack space since start.
  2. Step 2: Understand printf output

    It prints the free stack space value, not total stack or CPU info.
  3. Final Answer:

    The minimum free stack space left in the current task -> Option C
  4. Quick Check:

    NULL param = current task stack free space [OK]
Quick Trick: NULL means current task in FreeRTOS stack check [OK]
Common Mistakes:
  • Thinking it returns total stack size
  • Confusing with task count or CPU usage

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes