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

ble radio notification issue on NRF52840

I'm using a NRF52840 with S140 softdevice. I advertise some data and I want to be notified when advertising start. I followed this thread and I use the customs ble_radio_notification c and h files given by Ole Bauck. When I'm running the code the initialisation doesn't work and return the err_code 8. When I run it with the debugger it crash when sd_radio_notification_cfg_set() is called. And I have this message : SOFTDEVICE: ASSERTION FAILED.

Here is my code :

err_code = ble_radio_notification_init(3, NRF_RADIO_NOTIFICATION_DISTANCE_800US, on_send);

void on_send(bool radio_active){
    NRF_LOG_INFO("on send");
}

I already read a lot of threads about radio notification and I never see a similar problem. Maybe the problem come from an other thing but I just started to develop on NRF and I don't know where to search anymore.

  • Hi,

    I think the SD assert is caused by the high interrupt priority, suggest to use the default interrupt priority (7) which is set by the softdevice:

    void RADIO_NOTIFICATION_IRQHandler()
    {    
        NRF_LOG_INFO("on send");
    }
    
    /* Must be called after ble_stack_init() and before adv. start*/
    static void radio_notification_init()
    {
        uint32_t  err_code;
    
        err_code = sd_nvic_ClearPendingIRQ(RADIO_NOTIFICATION_IRQn);
        APP_ERROR_CHECK(err_code);
    
        err_code = sd_nvic_EnableIRQ(RADIO_NOTIFICATION_IRQn);
        APP_ERROR_CHECK(err_code);
    
        err_code = sd_radio_notification_cfg_set(NRF_RADIO_NOTIFICATION_TYPE_INT_ON_ACTIVE, 
                                                 NRF_RADIO_NOTIFICATION_DISTANCE_800US);
        APP_ERROR_CHECK(err_code);
    }

     

Related