Bird
0
0

Identify the error in this xTaskCreate() usage:

medium📝 Debug Q14 of 15
FreeRTOS - Task Creation and Management
Identify the error in this xTaskCreate() usage:
TaskHandle_t xHandle;
BaseType_t result = xTaskCreate(vTaskCode, "Task2", 500, NULL, 1, xHandle);
APriority must be zero
BTask name should not be in quotes
CMissing & before xHandle in last parameter
DStack size is too large
Step-by-Step Solution
Solution:
  1. Step 1: Check the task handle parameter

    The last parameter must be a pointer to the task handle variable, so it requires the address operator &.
  2. Step 2: Verify other parameters

    The task name is correctly a string in quotes, stack size 500 is valid, and priority 1 is allowed.
  3. Final Answer:

    Missing & before xHandle in last parameter -> Option C
  4. Quick Check:

    Task handle needs & operator [OK]
Quick Trick: Always pass &TaskHandle, not TaskHandle alone [OK]
Common Mistakes:
  • Passing task handle without &
  • Removing quotes from task name
  • Incorrect assumptions about stack size or priority

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes