Bird
0
0

What will happen if a FreeRTOS task is created with a stack size that is too small for its needs?

medium📝 Predict Output Q5 of 15
FreeRTOS - Task Creation and Management
What will happen if a FreeRTOS task is created with a stack size that is too small for its needs?
AThe task will automatically increase its stack size
BThe task will be assigned a higher priority
CThe task will run slower but safely
DThe task may cause a stack overflow leading to unpredictable behavior
Step-by-Step Solution
Solution:
  1. Step 1: Understand stack overflow consequences

    If the stack is too small, the task can overwrite memory causing crashes or erratic behavior.
  2. Step 2: Verify other options

    FreeRTOS does not auto-increase stack size, nor does it slow down or change priority due to stack size.
  3. Final Answer:

    The task may cause a stack overflow leading to unpredictable behavior -> Option D
  4. Quick Check:

    Too small stack = stack overflow risk [OK]
Quick Trick: Too small stack causes overflow and crashes [OK]
Common Mistakes:
  • Believing stack size auto-adjusts
  • Thinking task slows down safely
  • Assuming priority changes with stack size

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes