This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF_APP_PRIORITIES etc. removed in SDK 11?

The SDK 11 s13x migration document says:

The enumeration NRF_APP_PRIORITIES has been removed. Application developers must use the interrupt priority levels directly instead.

For s130 the interrupt priority levels available to the application are: 1 and 3.

Other types were also removed, leading to e.g. the radio notification build problems. I'm just curious if there was a reason for this change.

(Sadly, after I finished merging all the new code in I discovered that the new S130 is 12k bigger than the old S110. Looks like I'll have to stick with SDK 10 on my tiny 128k chip.)

Thanks!

Parents
  • Hi,

    I do not know the reason why NRF_APP_PRIORITIES was removed, but if you use the SDK you can now use the priorities from the app_irq_priority_t enumeration in <sdk folder>\components\libraries\util\app_util_platform.h:

    APP_IRQ_PRIORITY_HIGHEST
    APP_IRQ_PRIORITY_HIGH       // Replaces NRF_APP_PRIORITY_HIGH
    APP_IRQ_PRIORITY_MID
    APP_IRQ_PRIORITY_LOW        // Replaces NRF_APP_PRIORITY_LOW
    APP_IRQ_PRIORITY_LOWEST
    APP_IRQ_PRIORITY_THREAD     // Priority level of the MAIN context
    

    The actual values depend on whether or not you use a SoftDevice, and if the SoC is an nRF51 or an nRF52. If using the softdevice, the (distinct) levels for the application are:

    For nRF51:

    APP_IRQ_PRIORITY_HIGH
    APP_IRQ_PRIORITY_LOW
    APP_IRQ_PRIORITY_THREAD
    

    For nRF52:

    APP_IRQ_PRIORITY_HIGH
    APP_IRQ_PRIORITY_MID
    APP_IRQ_PRIORITY_LOW
    APP_IRQ_PRIORITY_LOWEST
    APP_IRQ_PRIORITY_THREAD
    

    PS: While looking at this I found that in SDK 11 the value for APP_IRQ_PRIORITY_HIGHEST is incorrectly set. If using a SoftDevice the value conflicts with the highest SoftDevice priority level. If not using a SoftDevice it does not add a priority level. To correct this you must change the #ifdef on line 60 in app_util_platform.h to an #ifndef.

    Regards, Terje

Reply
  • Hi,

    I do not know the reason why NRF_APP_PRIORITIES was removed, but if you use the SDK you can now use the priorities from the app_irq_priority_t enumeration in <sdk folder>\components\libraries\util\app_util_platform.h:

    APP_IRQ_PRIORITY_HIGHEST
    APP_IRQ_PRIORITY_HIGH       // Replaces NRF_APP_PRIORITY_HIGH
    APP_IRQ_PRIORITY_MID
    APP_IRQ_PRIORITY_LOW        // Replaces NRF_APP_PRIORITY_LOW
    APP_IRQ_PRIORITY_LOWEST
    APP_IRQ_PRIORITY_THREAD     // Priority level of the MAIN context
    

    The actual values depend on whether or not you use a SoftDevice, and if the SoC is an nRF51 or an nRF52. If using the softdevice, the (distinct) levels for the application are:

    For nRF51:

    APP_IRQ_PRIORITY_HIGH
    APP_IRQ_PRIORITY_LOW
    APP_IRQ_PRIORITY_THREAD
    

    For nRF52:

    APP_IRQ_PRIORITY_HIGH
    APP_IRQ_PRIORITY_MID
    APP_IRQ_PRIORITY_LOW
    APP_IRQ_PRIORITY_LOWEST
    APP_IRQ_PRIORITY_THREAD
    

    PS: While looking at this I found that in SDK 11 the value for APP_IRQ_PRIORITY_HIGHEST is incorrectly set. If using a SoftDevice the value conflicts with the highest SoftDevice priority level. If not using a SoftDevice it does not add a priority level. To correct this you must change the #ifdef on line 60 in app_util_platform.h to an #ifndef.

    Regards, Terje

Children
No Data
Related