I can not seem to find what a priority value passed to task creation functions of FreeRTOS mean. If I remember correctly ThreadX uses smaller values for higher priorities i.e task with priority value 1 has higher priority value than task with priority value 2. But for FreeRTOS I cant seem to find whether if it is the same or if it is the opposite i.e higher value meaning higher priority.
I have tried googling but couldn't find anything. FreeRTOS API reference page for xTaskCreate only specifies that this is the priority value. Can some one please help resolve this confusion.
The FreeRTOS scheduler ensures that tasks in the Ready or Running state will always be given processor (CPU) time in preference to tasks of a lower priority that are also in the ready state. In other words, the task placed into the Running state is always the highest priority task that is able to run.
by using the vTaskPrioritySet() API function to change the priority of two tasks relative to each other.
Priority inversion is a bug that occurs when a high priority task is indirectly preempted by a low priority task. For example, the low priority task holds a mutex that the high priority task must wait for to continue executing.
xTaskCreate() can only be used to create a task that has unrestricted access to the entire microcontroller memory map. Systems that include MPU support can alternatively create an MPU constrained task using xTaskCreateRestricted().
Found answer to my question in FreeRTOS Quick start guide. The section on task priorities explains that lower priority numbers denote lower priority tasks and idle task has priority zero which is the lowest priority.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With