Hint: Highest priority = configMAX_PRIORITIES minus one [OK]
Common Mistakes:
Using configMAX_PRIORITIES as highest priority directly
Using 0 as highest priority
Choosing a number outside the allowed range
3. Given three tasks with priorities 2, 4, and 1, which task will FreeRTOS schedule to run first?
medium
A. Task with priority 4
B. Task with priority 2
C. Task with priority 1
D. All run simultaneously
Solution
Step 1: Identify task priorities
Tasks have priorities 2, 4, and 1 respectively.
Step 2: Determine highest priority
Priority 4 is the highest number, so that task runs first.
Final Answer:
Task with priority 4 -> Option A
Quick Check:
Highest priority runs first = 4 [OK]
Hint: Task with highest priority number runs first [OK]
Common Mistakes:
Choosing the lowest priority task
Assuming tasks run in creation order
Thinking tasks run simultaneously
4. What is wrong with this priority assignment if configMAX_PRIORITIES is 3? vTaskPrioritySet(taskHandle, 3);
medium
A. Priority 3 is valid and highest
B. Priority 3 is out of range; max is 2
C. Priority must be zero
D. Priority must be negative
Solution
Step 1: Check allowed priority range
Priorities go from 0 to configMAX_PRIORITIES - 1, so 0 to 2 here.
Step 2: Validate assigned priority
Priority 3 is outside this range and invalid.
Final Answer:
Priority 3 is out of range; max is 2 -> Option B
Quick Check:
Max priority = 2, 3 is invalid [OK]
Hint: Priority must be less than configMAX_PRIORITIES [OK]
Common Mistakes:
Using configMAX_PRIORITIES as a valid priority
Assigning negative priorities
Assuming priority zero is highest
5. You have tasks with priorities 0, 1, and 2. You want the system to always run the task with priority 1 before the others, but currently priority 2 runs first. How can you fix this using FreeRTOS priority numbering?
hard
A. Set all tasks to priority 0
B. Set the task currently at 1 to priority 0
C. Set the task currently at 2 to priority 0
D. Set the priority of the task currently at 1 to 3 and others lower
Solution
Step 1: Understand current priorities
Task with priority 2 runs first because it has highest priority.
Step 2: Adjust priorities to reorder execution
Increase the priority of the task currently at 1 to a number higher than 2 (e.g., 3) so it runs first.
Step 3: Lower other tasks' priorities
Set other tasks to lower priorities to ensure the desired task runs first.
Final Answer:
Set the priority of the task currently at 1 to 3 and others lower -> Option D
Quick Check:
Higher priority number runs first, so raise desired task's priority [OK]
Hint: Raise desired task priority above others to run first [OK]
Common Mistakes:
Lowering all priorities to zero
Not increasing the desired task's priority
Assuming priority 0 is highest
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.