Bird
0
0

Identify the error in this FreeRTOS task creation code snippet:

medium📝 Debug Q6 of 15
FreeRTOS - RTOS Fundamentals
Identify the error in this FreeRTOS task creation code snippet:
xTaskCreate(TaskFunction, "Task1", 100, NULL, 2, NULL);
AStack size is too small
BTask name must be longer than 5 characters
CTask priority is invalid
DTask handle parameter is NULL, so task handle cannot be used
Step-by-Step Solution
Solution:
  1. Step 1: Analyze parameters of xTaskCreate

    The last parameter is task handle pointer; NULL means no handle stored.
  2. Step 2: Identify impact of NULL task handle

    Without handle, task cannot be referenced later, which may be an error.
  3. Final Answer:

    Task handle parameter is NULL, so task handle cannot be used -> Option D
  4. Quick Check:

    NULL task handle means no reference to created task [OK]
Quick Trick: Provide task handle pointer to track created task [OK]
Common Mistakes:
  • Assuming NULL handle is always okay
  • Confusing stack size with error
  • Thinking task name length matters

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes