Bird
0
0

How can you combine Method 1 and Method 2 stack overflow detection in FreeRTOS to improve reliability?

hard📝 Application Q9 of 15
FreeRTOS - Memory Management
How can you combine Method 1 and Method 2 stack overflow detection in FreeRTOS to improve reliability?
ASet configCHECK_FOR_STACK_OVERFLOW to 2 and add manual stack pointer checks in tasks
BSet configCHECK_FOR_STACK_OVERFLOW to 1 and 2 simultaneously in FreeRTOSConfig.h
CUse Method 1 for pointer checks and Method 2 for canary checks by enabling configCHECK_FOR_STACK_OVERFLOW=2 and adding pointer checks in hook
DUse hardware watchdog instead of software detection methods
Step-by-Step Solution
Solution:
  1. Step 1: Understand combining methods

    FreeRTOS allows enabling Method 2 via configCHECK_FOR_STACK_OVERFLOW=2; Method 1 pointer checks can be added manually in the hook.
  2. Step 2: Identify correct approach

    Use Method 1 for pointer checks and Method 2 for canary checks by enabling configCHECK_FOR_STACK_OVERFLOW=2 and adding pointer checks in hook describes combining Method 2 with manual pointer checks for better detection.
  3. Final Answer:

    Use Method 1 for pointer checks and Method 2 for canary checks by enabling configCHECK_FOR_STACK_OVERFLOW=2 and adding pointer checks in hook -> Option C
  4. Quick Check:

    Combine Method 2 macro with manual pointer checks [OK]
Quick Trick: Combine Method 2 macro with manual pointer checks in hook [OK]
Common Mistakes:
  • Trying to set macro to 1 and 2 simultaneously
  • Ignoring manual pointer checks
  • Relying only on hardware watchdog

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes