Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

How is ESB_EVT_IRQHandler started?

Hi

How is the ESB_EVT_IRQHandler started? NVIC_SetPendingIRQ(ESB_EVT_IRQ) ​​is registered with on_radio_disabled(), but I don't know how to be started this handler in the nrf_esb.c code.
I know that using ppi_init() to connect events and tasks between RADIO and NRF_ESB_SYS_TIMER (actually TIMER2). However the vector for ESB_EVT_IRQHandler is SWI0_IRQHandler(SWI0_EGU0_IRQHandler), so I don't find out how to start the ESB_EVT_IRQHandler. please tell me how TIMER2 is involved in starting ESB_EVT_IRQHandler.

Thanks in advance

Yas

  • Hi Torbjørn

    Thank you for your continuous advice.
    I might be misunderstanding something fundamental regarding the mechanism in NVIC.

    I think I can count 6 places in nrf_esb.c (from nRF5 SDK v17.1.0) where NVIC_SetPendingIRQ(ESB_EVT_IRQ); is called from one of the on_radio_disabled_xx functions. 

    Sure, I know that 6 lines of the NVIC_SetPendingIRQ(ESB_EVT_IRQ) are placed in there.
    I am assuming this is just reserving the ESB_EVT_IRQ to wait for an interrupt because the name is "NVIC_SetPendingIRQ" and it is not "NVIC_ClearPendingIRQ" and not call the ESB_EVT_IRQHander directly, am I wrong?

    Best regards,

    Yas

  • Hi Yas

    Yas said:
    Sure, I know that 6 lines of the NVIC_SetPendingIRQ(ESB_EVT_IRQ) are placed in there.
    I am assuming this is just reserving the ESB_EVT_IRQ to wait for an interrupt because the name is "NVIC_SetPendingIRQ" and it is not "NVIC_ClearPendingIRQ" and not call the ESB_EVT_IRQHander directly, am I wrong?

    Setting the pending flag from software has the exact same effect as when a hardware peripheral triggers an interrupt. It will cause the ESB_EVT_IRQ handler to be called as soon as any higher priority interrupts have finished. 

    In other words these 6 lines will trigger the handler to be called, they are not just configuring the interrupt. 

    This is a software interrupt, which means there is no other way to fire the interrupt than to set the pending flag. 

    NVIC_ClearPendingIRQ is normally not used, since the interrupt handler will clear the pending flag automatically. 

    Best regards
    Torbjørn

  • Hi Torbjørn

    Thank you for your response.

    Setting the pending flag from software has the exact same effect as when a hardware peripheral triggers an interrupt. It will cause the ESB_EVT_IRQ handler to be called as soon as any higher priority interrupts have finished. 

    Thank to you, I'm cleared about that now.
    I can proceed forward. Thank you so much!

    Best regards

    Yas

  • Hi Yas

    Good to hear that things are clear. I will consider the case resolved then Slight smile

    Best regards
    Torbjørn

Related