Bird
0
0

Given the following FreeRTOS configuration:

medium📝 Predict Output Q4 of 15
FreeRTOS - Memory Management
Given the following FreeRTOS configuration:
#define configCHECK_FOR_STACK_OVERFLOW 1

What will happen if a task's stack pointer exceeds its allocated stack size?
AvApplicationStackOverflowHook() is called during context switch
BThe system resets immediately without notification
CThe task is suspended silently
DNo detection occurs; overflow is ignored
Step-by-Step Solution
Solution:
  1. Step 1: Understand Method 1 behavior

    With configCHECK_FOR_STACK_OVERFLOW set to 1, FreeRTOS checks stack pointer during context switch and calls the overflow hook if overflow detected.
  2. Step 2: Match behavior with options

    vApplicationStackOverflowHook() is called during context switch correctly describes the hook call; others describe incorrect or missing behavior.
  3. Final Answer:

    vApplicationStackOverflowHook() is called during context switch -> Option A
  4. Quick Check:

    Method 1 triggers hook on overflow [OK]
Quick Trick: Method 1 calls hook on overflow during context switch [OK]
Common Mistakes:
  • Assuming system resets automatically
  • Thinking task suspends silently
  • Believing overflow is ignored

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes