if PendSV have lowest priority why it is set to 15 in RTOS

44 Views Asked by At
/* The lowest interrupt priority that can be used in a call to a "set priority"
function. */
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY   15
 
/* The highest interrupt priority that can be used by any interrupt service
routine that makes calls to interrupt safe FreeRTOS API functions.  DO NOT CALL
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5

I was expecting that if the PendSV have the lowest priority after int main() then it should be nearest value to 0

1

There are 1 best solutions below

0
Clifford On

Assuming this refers to FreeRTOS on Cortex-M, then you have I think confused FreeRTOS task priorities where zero is the lowest priority and Cortex-M NVIC priorities where zero is the higest priority

Note the warning at https://mcuoneclipse.com/2016/08/28/arm-cortex-m-interrupts-and-freertos-part-3/

enter image description here

The entire article is probably instructive and will answer any questions you have on FreeRTOS interrupts on Cortex-M