Bird
0
0

You have a FreeRTOS task created with stack size 20 words, but it crashes with stack overflow. What is the best fix?

medium📝 Debug Q14 of 15
FreeRTOS - Task Creation and Management
You have a FreeRTOS task created with stack size 20 words, but it crashes with stack overflow. What is the best fix?
ADecrease the stack size to save memory
BIncrease the stack size to a larger value like 100 words
CChange the task priority to higher
DRemove local variables from the task
Step-by-Step Solution
Solution:
  1. Step 1: Identify cause of crash

    Stack overflow means the task's stack is too small for its needs.
  2. Step 2: Choose appropriate fix

    Increasing stack size to a larger value like 100 words prevents overflow safely.
  3. Final Answer:

    Increase the stack size to a larger value like 100 words -> Option B
  4. Quick Check:

    Stack overflow fix = increase stack size [OK]
Quick Trick: Stack overflow? Increase stack size [OK]
Common Mistakes:
  • Reducing stack size to save memory
  • Changing priority instead of stack size
  • Ignoring local variables impact

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes