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:
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.
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.
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
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
Master "Memory Management" in FreeRTOS
9 interactive learning modes - each teaches the same concept differently