How can I implement priority inheritance or ceiling protocol in my FreeRtos app?

@Middleware & OS Hello guys how can I implement priority inheritance or ceiling protocol in my FreeRtos application to prevent priority inversion, I would really appreciate a guide through the entire process
Solution:
priority inheritance offers good average case performance but still might trigger more often. Ceiling protocol gives a better worst case performance but can lead to little worse average case behavior tho.
Jump to solution
4 Replies
electro_coco
electro_coco6mo ago
use semaphores
Enthernet Code
Enthernet Code6mo ago
Start by identifying the tasks that are susceptible to priority inversion. These tasks should include the higher-priority task HPT, the lower-priority task LPT, and the medium-priority task MPT. Priority inversion occurs when LPT ties up a resource needed by HPT, preventing HPT from running
Solution
Marvee Amasi
Marvee Amasi6mo ago
priority inheritance offers good average case performance but still might trigger more often. Ceiling protocol gives a better worst case performance but can lead to little worse average case behavior tho.
Camila_99$$
Camila_99$$6mo ago
Hi! @Boss lady To prevent priority inversion in your FreeRTOS application use priority inheritance by creating mutexes with xSemaphoreCreateMutex(). Tasks using the mutex will temporarily inherit higher priority if needed. For priority ceiling, manually set the task priority to the highest level before accessing shared resources and restore it afterward. This ensures smooth task execution.
Want results from more Discord servers?
Add your server