Bird
0
0

Given the following code snippet, what will be the output if the task's minimum free stack space was 50 words?

medium📝 Command Output Q13 of 15
FreeRTOS - Debugging and Monitoring

Given the following code snippet, what will be the output if the task's minimum free stack space was 50 words?

UBaseType_t highWaterMark = uxTaskGetStackHighWaterMark(NULL);
printf("High water mark: %u\n", highWaterMark);
AHigh water mark: 50
BHigh water mark: 0
CHigh water mark: Stack overflow
DCompilation error
Step-by-Step Solution
Solution:
  1. Step 1: Understand uxTaskGetStackHighWaterMark output

    This function returns the minimum free stack space (in words) the task had, which is 50 in this case.
  2. Step 2: Analyze printf output

    The printf prints the unsigned integer value returned, so output will be "High water mark: 50".
  3. Final Answer:

    High water mark: 50 -> Option A
  4. Quick Check:

    Function returns minimum free stack, printed as number [OK]
Quick Trick: Function returns minimum free stack words, print as unsigned int [OK]
Common Mistakes:
  • Assuming it returns zero on no overflow
  • Thinking it returns error string
  • Confusing with stack size or usage

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes