Bird
0
0

Examine this code snippet for Method 1 stack overflow detection:

medium📝 Debug Q6 of 15
FreeRTOS - Memory Management
Examine this code snippet for Method 1 stack overflow detection:
void vApplicationStackOverflowHook(TaskHandle_t xTask, char *pcTaskName) {
    // User code
}

#define configCHECK_FOR_STACK_OVERFLOW 1

What is a common mistake that could prevent overflow detection?
ANot enabling configCHECK_FOR_STACK_OVERFLOW in FreeRTOSConfig.h
BDefining the hook function with wrong parameters
CCalling the hook function manually in tasks
DUsing Method 2 canary pattern with Method 1
Step-by-Step Solution
Solution:
  1. Step 1: Check configuration requirements

    Method 1 requires configCHECK_FOR_STACK_OVERFLOW set to 1 in FreeRTOSConfig.h to enable detection.
  2. Step 2: Identify common mistakes

    Not enabling this macro disables detection, even if hook is defined.
  3. Final Answer:

    Not enabling configCHECK_FOR_STACK_OVERFLOW in FreeRTOSConfig.h -> Option A
  4. Quick Check:

    Enable macro to activate Method 1 detection [OK]
Quick Trick: Enable configCHECK_FOR_STACK_OVERFLOW to activate detection [OK]
Common Mistakes:
  • Defining hook with incorrect parameters
  • Calling hook manually instead of automatic
  • Mixing Method 1 and Method 2 configurations

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes