Priority for system timer (Systick)


I used FreeRTOS on cortex M4 with tickless mode. For timing RTOS I was used to using RTC insted of Systick (because of depth of sleep mode). In M4 I set priority for RTC timer using configLIBRARY_LOWEST_INTERRUPT_PRIORITY (HAL_NVIC_SetPriority(RTC_IRQn, configLIBRARY_LOWEST_INTERRUPT_PRIORITY, 0);)
OK, but now I want to use the same on cortex M0+, but there is no macro like configLIBRARY_LOWEST_INTERRUPT_PRIORITY or configLIBRARY_MAX_INTERRUPT_PRIORITY. How should I set the priority for system timer and other periphery?

I use STM32L0.
Thank you for help.


On the Cortex-M0+ there is no masking of different priority levels. Either all exceptions with configurable priority are enabled or disabled. Although the interrupts can nest, if PRIMASK is set to 1 (masked) then they will not nest or pre-empt each other so it is not important.

Thank you. So interrupt priority for system (RTOS) timer (in my case RTC, ussualy Systick) can be the same level as priority for EXTI from buttons?

Yes. I think that will be be fine. The reason for the way it is done on the Cortex-M4 is to stop any interrupts which access the API from corrupting API operations in other interrupts. This is not a problem in this port unless you enable interrupts whilst in an interrupt.