0
0
FreeRTOSprogramming~20 mins

Priority numbering in FreeRTOS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
FreeRTOS Priority Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Understanding FreeRTOS priority numbering
Consider a FreeRTOS system with configMAX_PRIORITIES set to 5. If a task is created with priority 3, what is the relative priority of this task compared to a task with priority 1?
ABoth tasks have the same priority.
BThe task with priority 3 has lower priority than the task with priority 1.
CThe task with priority 3 has higher priority than the task with priority 1.
DPriority numbers do not determine task priority in FreeRTOS.
Attempts:
2 left
💡 Hint

Remember, in FreeRTOS, higher numeric priority means higher task priority.

Predict Output
intermediate
2:00remaining
Effect of configMAX_PRIORITIES on task creation
If configMAX_PRIORITIES is set to 4, what happens when you try to create a task with priority 5?
AThe task is created with priority 5 without any error.
BThe system crashes immediately.
CThe task is created with priority 0 instead.
DThe task creation fails or priority is capped at the maximum allowed priority.
Attempts:
2 left
💡 Hint

Check the allowed range of priorities based on configMAX_PRIORITIES.

🔧 Debug
advanced
3:00remaining
Why does a higher priority task not run immediately?
In FreeRTOS, a task with priority 4 is created while a task with priority 3 is running. However, the higher priority task does not start running immediately. What could be the reason?
AThe scheduler is not started or preemption is disabled.
BThe task with priority 3 has a higher priority than 4.
CFreeRTOS does not support priority-based scheduling.
DThe higher priority task is blocked or suspended.
Attempts:
2 left
💡 Hint

Think about scheduler state and preemption settings.

🧠 Conceptual
advanced
3:00remaining
Priority inversion and FreeRTOS priority numbering
Which statement best describes how FreeRTOS priority numbering helps to avoid priority inversion?
APriority inversion is avoided by disabling all interrupts.
BHigher numeric priority tasks always preempt lower priority tasks, reducing priority inversion.
CFreeRTOS uses random priority assignment to avoid priority inversion.
DFreeRTOS does not handle priority inversion at all.
Attempts:
2 left
💡 Hint

Consider how task priorities affect scheduling and preemption.

Predict Output
expert
3:00remaining
Determining the number of priority levels in FreeRTOS
Given configMAX_PRIORITIES is set to 7, how many distinct priority levels can tasks have in FreeRTOS?
A7 distinct priority levels, numbered 0 to 6.
B6 distinct priority levels, numbered 1 to 6.
C8 distinct priority levels, numbered 0 to 7.
DOnly 1 priority level regardless of configMAX_PRIORITIES.
Attempts:
2 left
💡 Hint

Remember how FreeRTOS counts priority levels starting from zero.