MPSL_TIMESLOT_SIGNAL_RADIO - MPSL Radio Interrupt Expected Usage (driving ESB)

For reference I am using NCS v2.0 and VSCode with the NCS extension and coding in C++.

Hi, can you help clarify the expected behavior and usage of the MPSL_TIMESLOT_SIGNAL_RADIO signal?

I can see a few details from the MPSL API page (link

void MPSL_IRQ_RADIO_Handler(void)
RADIO interrupt handler.

Note: This handler should be placed in the interrupt vector table. The interrupt priority level should be priority 0.

...

MPSL_TIMESLOT_SIGNAL_RADIO
This signal indicates the RADIO interrupt. The signal will be executed in the same context as MPSL_IRQ_RADIO_Handler.

It isn't clear to me the meaning of how to use this information.

I have found the Nordic blog post  Updating to the MPSL Timeslot interface regarding MPSL and ESB. 

Looking at the source code, the MPSL_TIMESLOT_SIGNAL_RADIO event triggers calling RADIO_IRQHandler().

I can see in the nrf esb.c file there is such a function

ISR_DIRECT_DECLARE(RADIO_IRQHandler)
{
	radio_irq_handler();

	ISR_DIRECT_PM();

	return 1;
}

Question 1

So it seems that the Nordic example is what, receiving radio interrupts and routing them to the MPSL_TIMESLOT_SIGNAL_RADIO event?

Should I understand that if I'm driving another radio protocol, like ESB, that I have to forward radio event notifications to that protocol's radio ISR?

I have confirmed by implementing this that calling RADIO_IRQHandler() is necessary for the ESB example to work.

Question 2

Regarding the API page, for the MPSL_IRQ_RADIO_Handler(), when it says "This handler should be placed in the interrupt vector table", what does that mean?  Am I able to put the RADIO_IRQHandler() into an interrupt vector so I don't have to call it from the MPSL_TIMESLOT_SIGNAL_RADIO event myself?

Question 3

I can't seem to get access to the RADIO_IRQHandler() from my code without modifying the esb.h file to put an extern statement at the top.

extern void RADIO_IRQHandler();

I'm kind of baffled by that, I tried putting the exact same extern statement into the C++ file of my application and I get undefined reference to `RADIO_IRQHandler()' when compiling.  Unclear why or how I can work around that.  I don't want to edit the esb.h file.  Can you suggest what I do differently?

Thanks.

Parents
  • Hi,

    So it seems that the Nordic example is what, receiving radio interrupts and routing them to the MPSL_TIMESLOT_SIGNAL_RADIO event?

    Correct.

    Should I understand that if I'm driving another radio protocol, like ESB, that I have to forward radio event notifications to that protocol's radio ISR?

    Yes, you would need to handle this in the MPSL_TIMESLOT_SIGNAL_RADIO, but we are working on some new features so that you can fully uninitialize MPSL/SDC, and run ESB without using timeslots. This will hopefully be ready in some weeks/months. Here is one of the PR that will make this possible: https://github.com/nrfconnect/sdk-nrf/pull/8613

    Regarding the API page, for the MPSL_IRQ_RADIO_Handler(), when it says "This handler should be placed in the interrupt vector table", what does that mean? 

    The MPSL subsys does it for you in mpsl_init.c, it's not something you have to do in your code. https://github.com/nrfconnect/sdk-nrf/blob/v2.0.2/subsys/mpsl/init/mpsl_init.c#L188

    Am I able to put the RADIO_IRQHandler() into an interrupt vector so I don't have to call it from the MPSL_TIMESLOT_SIGNAL_RADIO event myself?

    This will be possible in the future, ref my answer previously. (MPSL will need to be uninitialized before you can register your own radio IRQ handler)

    I can't seem to get access to the RADIO_IRQHandler()

    Not sure what you are trying to do here, but the ESB RADIO_IRQHandler is here, and it calls the function radio_irq_handler().

Reply
  • Hi,

    So it seems that the Nordic example is what, receiving radio interrupts and routing them to the MPSL_TIMESLOT_SIGNAL_RADIO event?

    Correct.

    Should I understand that if I'm driving another radio protocol, like ESB, that I have to forward radio event notifications to that protocol's radio ISR?

    Yes, you would need to handle this in the MPSL_TIMESLOT_SIGNAL_RADIO, but we are working on some new features so that you can fully uninitialize MPSL/SDC, and run ESB without using timeslots. This will hopefully be ready in some weeks/months. Here is one of the PR that will make this possible: https://github.com/nrfconnect/sdk-nrf/pull/8613

    Regarding the API page, for the MPSL_IRQ_RADIO_Handler(), when it says "This handler should be placed in the interrupt vector table", what does that mean? 

    The MPSL subsys does it for you in mpsl_init.c, it's not something you have to do in your code. https://github.com/nrfconnect/sdk-nrf/blob/v2.0.2/subsys/mpsl/init/mpsl_init.c#L188

    Am I able to put the RADIO_IRQHandler() into an interrupt vector so I don't have to call it from the MPSL_TIMESLOT_SIGNAL_RADIO event myself?

    This will be possible in the future, ref my answer previously. (MPSL will need to be uninitialized before you can register your own radio IRQ handler)

    I can't seem to get access to the RADIO_IRQHandler()

    Not sure what you are trying to do here, but the ESB RADIO_IRQHandler is here, and it calls the function radio_irq_handler().

Children
Related