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

SoftDevice S113 interrupt priority levels: 0, 1 and 4 or 6?

Does SoftDevice S113 use interrupt priority level 4, or are the actual S113 interrupt priorities 0, 1 and 6?

As I understand it, this says S113 uses priority levels 0, 1 and 4:

https://infocenter.nordicsemi.com/topic/sds_s113/SDS/s1xx/processor_avail_interrupt_latency/exception_mgmt_sd.html

But SD_EVT_IRQHandler seems to use priority 6.

I see priority 6 returned from current_int_priority_get() inside my NRF_SDH_BLE_OBSERVER handler, with NRF_SDH_DISPATCH_MODEL 0. It also says 6 in nrf_soc.h and in 

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s113.api.v7.0.1%2Fgroup__nrf__soc__api.html

[Drill down through Defines to SD_EVT_IRQHandler]

  • Hello,

    Sorry for the late reply.

    I believe that the IRQ 4 is used by the softdevice when the event actually occurs. IRQ 6 is the priority in the event that has been forwarded to the application. 

    I am not sure whether it is possible to change this event priority. I would have to check this out. Is it causing any issues in your application?

    Best regards,

    Edvin

  • >> I am not sure whether it is possible to change this event priority.

    The reference I gave says "The priorities of the interrupts reserved by the SoftDevice cannot be changed."

    It was causing nothing to work when the application was avoiding priority 4 and using priority 6.

    Could you possibly look into this a little further?

  • andy4 said:
    The reference I gave says "The priorities of the interrupts reserved by the SoftDevice cannot be changed."

     

    #define SD_EVT_IRQHandler (SWI2_IRQHandler)

    SoftDevice Event IRQ handler. Used for both protocol events and SoC events. The default interrupt priority for this handler is set to 6.

    You can't change the softdevice priorities, but it may be possible to change the event handler's IRQ priority.

    To change the event handler's priority, you can use the following implementation:

    static void change_irq_priority(uint32_t IRQn_priority)
    {
        ret_code_t err_code;
    
        err_code = sd_nvic_SetPriority(SD_EVT_IRQn, IRQn_priority);
        APP_ERROR_CHECK(err_code);
        //NRF_LOG_INFO("priority changed with err_code 0x%02x", err_code);
    }

    Best regards,

    Edvin

Related