# Cortex-M0+: how to choose correct interrupt priorities?

**URL:** <https://forums.freertos.org/t/cortex-m0-how-to-choose-correct-interrupt-priorities/13677>\
**Category:** Kernel\
**Created:** [October 13, 2021, 7:00pm UTC](https://forums.freertos.org/t/cortex-m0-how-to-choose-correct-interrupt-priorities/13677 "2021-10-13T19:00:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joergg2012](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@joergg2012](https://forums.freertos.org/u/joergg2012)\
**Post date:** [October 13, 2021, 7:00pm UTC](https://forums.freertos.org/t/cortex-m0-how-to-choose-correct-interrupt-priorities/13677/1 "2021-10-13T19:00:03Z")

</div>

My project uses a STM32L073 controller, which is a Cortex-M0+ core with 4 possible interrupt priorities.

The Cortex-M0 port has no setting for configMAX\_SYSCALL\_INTERRUPT\_PRIORITY because of the not existing BASEPRI register.  
Usage of FreeRTOS-critical-sections lead (amongst others) to the CMSIS intrinsic functions \_\_disable\_irq() respective \_\_enable\_irq().  
Function \_\_disable\_irq() sets bit 0 at the PRIMASK register which “Prevents the activation of all exceptions with configurable priority”.

So I would expect that it’s allowed to use FreeRTOS …FromISR() functions at any interrupt-service-routine with priority from 0…3.  
If a critical-section (e.g. inside the scheduler) is active, no other interrupt can preempt it.

Is this correct?

To create my basic project code I use STs CubeMX V6.2.0 software which irritates me by allowing only the lowest interrupt-priority 3 for interrupts that use FreeRTOS functions.  
But why should only interrupts with identical priority as the scheduler be allowed to call …FromISR() functions?

Can anyone clear up my confusion?

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [October 13, 2021, 7:45pm UTC](https://forums.freertos.org/t/cortex-m0-how-to-choose-correct-interrupt-priorities/13677/2 "2021-10-13T19:45:21Z")

</div>

In the M0 port critical sections are implemented with a global interrupt disable - so an interrupt cannot occur if you are within a critical section. Additionally, interrupts don’t nest, so there is no need for critical sections inside the interrupts themselves. Hence there is no configMAX\_SYSCALL\_INTERRUPT\_PRIORITY and you can use whichever interrupt priority is best for your application’s requirements - without restriction.
