Bird
0
0

Identify the error in this FreeRTOS task creation code snippet:

medium📝 Debug Q14 of 15
FreeRTOS - Task Scheduling

Identify the error in this FreeRTOS task creation code snippet:

BaseType_t result = xTaskCreate(TaskFunc, "Task1", 500, NULL, 0, NULL);
if(result != pdPASS) {
    // Handle error
}

What is wrong with the priority value?

APriority 0 means lowest priority but is valid
BPriority 0 is invalid and causes error
CPriority must be greater than 5
DPriority should be a negative number
Step-by-Step Solution
Solution:
  1. Step 1: Understand priority 0 in FreeRTOS

    Priority 0 is the lowest priority and is valid in FreeRTOS.
  2. Step 2: Check if priority 0 causes error

    Priority 0 does not cause an error; task creation can succeed with it.
  3. Final Answer:

    Priority 0 means lowest priority but is valid -> Option A
  4. Quick Check:

    Priority 0 is valid lowest priority [OK]
Quick Trick: Priority 0 is valid and lowest priority in FreeRTOS [OK]
Common Mistakes:
  • Thinking priority 0 is invalid
  • Assuming priority must be > 5
  • Using negative priority values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes