MPSL assert 112, 2235 after starting DTM TX test using custom rpmsg endpoint

I have made a second rpmsg endpoint to hci_rpmsg sample and integrated direct test mode sample functionality behind that second endpoint. Application has dedicated test mode to prevent starting normal Bluetooth using HCI when DTM is needed. After starting DTM TX test MPSL assert 112, 2235 happens and network core halts. Radio transmission is still on.
From DTM sample it seems that only initialisation needed is calling dtm_init function and that is done.
I'm using nRF Connect SDK 1.7.0 with nRF5340.

Parents
  • Seems that mpsl_lib_init always inits RADIO_IRQn at startup and that handler should not be executed in case of running DTM. DTM registers it own interrupt handler, but it is not replacing mpsl version. Is there some some elegant way to disable or replace already registered IRQ handler?

    Hack like this to mpsl interrupt handler does the job, but is not quite elegant:

    bool mpsl_init_dtm_is_on = false;
    
    ISR_DIRECT_DECLARE(mpsl_radio_isr_wrapper)
    {
    	if (!mpsl_init_dtm_is_on) {
    		MPSL_IRQ_RADIO_Handler();
    
    		ISR_DIRECT_PM();
    
    		/* We may need to reschedule in case a radio timeslot callback
    		* accesses zephyr primitives.
    		*/
    		return 1;
    	}
    	extern int dtm_radio_wrapper(void);
    	return dtm_radio_wrapper();
    }

Reply
  • Seems that mpsl_lib_init always inits RADIO_IRQn at startup and that handler should not be executed in case of running DTM. DTM registers it own interrupt handler, but it is not replacing mpsl version. Is there some some elegant way to disable or replace already registered IRQ handler?

    Hack like this to mpsl interrupt handler does the job, but is not quite elegant:

    bool mpsl_init_dtm_is_on = false;
    
    ISR_DIRECT_DECLARE(mpsl_radio_isr_wrapper)
    {
    	if (!mpsl_init_dtm_is_on) {
    		MPSL_IRQ_RADIO_Handler();
    
    		ISR_DIRECT_PM();
    
    		/* We may need to reschedule in case a radio timeslot callback
    		* accesses zephyr primitives.
    		*/
    		return 1;
    	}
    	extern int dtm_radio_wrapper(void);
    	return dtm_radio_wrapper();
    }

Children
Related