Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF5 SDK FreeRTOS interrupt priorities

I'm referring to nRF5 SDK 17.0.2. In 'external/freertos/config/FreeRTOSConfig.h', the value 'configLIBRARY_LOWEST_INTERRUPT_PRIORITY' is set to 0xf, but the nRF51/52 only implements 3 priority bits or 8 priority levels. So should the lowest priority not be 0x7?

This value is next assigned to 'configKERNEL_INTERRUPT_PRIORITY' as well, which is later used to set the NVIC priorities for either the systick or the RTC interrupts. In either case, 'NVIC_SetPriority(..)' is called with a value of 0xf. After looking at the CMSIS source code, it seems that the function will just truncate that to 0x7, so what's the point of the 0xf here?

Thanks

Kai

  • it seems that the function will just truncate that to 0x7, so what's the point of the 0xf here?

    I guess it is a harmless way to keep it compatible to potential future revisions of the chip which might have 4 priority bits implemented. It would have been a bug if the other extra written bits were used for something else, which it is not in this case.

Related