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

Radio notification event handler and sd_ble_gatts_hvx

Dear all,

I'm currently using nrf52840DK with SDK 17.00 and s140 softdevice. I'm trying to syncronize the dispatch of my data with connection interval (set to 7.5 ms). I have enabled the radio notification interrupt with ble_radio_notification_init(3, NRF_RADIO_NOTIFICATION_DISTANCE_800US, radio_evt_handler), where:

static void radio_evt_handler(bool radio_active){

   if (radio_active) {

     if (is_notificated){

       sd_ble_gatts_hvx();

      }

   }

}

The initialization is successfull (as the doc said I call the init function immediately after the softdevice enable), while the is_notificated is set to 1 when the CCCD is set to 1.

The problem is that the call to sd_ble_gatts_hvx stays stucked here (causing an Hardfault):

I read the documentation at Radio notification and I thought that the problem could be that I couldn't queue my 200B packet on time (tndist-tprep). I tried to change both PACKET_SIZE (down to 10B) and tndist (up to the maximum value of 5.5ms), but nothing change. My question now is: what could be the problem? I know that doing something like that is possible (Previous question), but up to now I have no idea how to solve it.

Anyone can help??

Thanks all,

Elia.

Related