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

HardFault when calling any sd_ function from radio notification event handler

Hi,

I'm using S132 v2.0.0 and nrf52832. I've got a problem when I'm trying to call any softdevice function from radio notification event handler.

#define RADIO_NOTIFICATION_IRQ_PRIORITY      3
#define RADIO_NOTIFICATION_DISTANCE 	     NRF_RADIO_NOTIFICATION_DISTANCE_NONE

void radio_notification_init(void)
{
    err_code=ble_radio_notification_init(RADIO_NOTIFICATION_IRQ_PRIORITY,RADIO_NOTIFICATION_DISTANCE,radio_notification_evt_handler);
    APP_ERROR_CHECK(err_code);
    
    err_code = sd_radio_notification_cfg_set(NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE, RADIO_NOTIFICATION_DISTANCE);
    APP_ERROR_CHECK(err_code);
}

void radio_notification_evt_handler(bool radio_evt)
{
    m_addl_adv_manuf_data[INC_TEST_INDEX]++;

    uint32_t err_code = sd_ble_gap_adv_data_set(m_addl_adv_manuf_data, sizeof(m_addl_adv_manuf_data), NULL, 0);
    APP_ERROR_CHECK(err_code);
}

What can cause this behavior?

Parents Reply Children
Related