Bird
0
0

You want to apply Method 2 stack overflow detection in a FreeRTOS project with multiple tasks. Which steps should you follow to ensure correct detection?

hard📝 Application Q8 of 15
FreeRTOS - Memory Management
You want to apply Method 2 stack overflow detection in a FreeRTOS project with multiple tasks. Which steps should you follow to ensure correct detection?
AEnable configCHECK_FOR_STACK_OVERFLOW=1 and manually check stack pointers in tasks
BEnable configCHECK_FOR_STACK_OVERFLOW=2, implement vApplicationStackOverflowHook, and ensure stacks have canary pattern
CDisable interrupts during task creation and monitor heap usage
DSet configCHECK_FOR_STACK_OVERFLOW=0 and rely on hardware watchdog
Step-by-Step Solution
Solution:
  1. Step 1: Enable Method 2 detection

    Set configCHECK_FOR_STACK_OVERFLOW to 2 to activate Method 2.
  2. Step 2: Implement hook and prepare stacks

    Implement vApplicationStackOverflowHook and ensure stacks have canary pattern for detection.
  3. Final Answer:

    Enable configCHECK_FOR_STACK_OVERFLOW=2, implement vApplicationStackOverflowHook, and ensure stacks have canary pattern -> Option B
  4. Quick Check:

    Method 2 requires macro, hook, and canary pattern [OK]
Quick Trick: Method 2 needs macro, hook, and canary pattern in stacks [OK]
Common Mistakes:
  • Using Method 1 macro for Method 2
  • Not implementing the hook function
  • Ignoring canary pattern placement

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes