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

SDK 14 nrf_sdh_evts_poll called before nrf_sdh_ble_enable

I am in the process of porting my ANT + BLE app from SDK13.0 to sdk14.0

My basic set up process is

nrf_drv_clock_init();
nrf_drv_clock_hfclk_request(NULL);
while (!nrf_drv_clock_hfclk_is_running())
{}

nrf_sdh_enable_request();
nrf_sdh_ant_enable();
uint32_t ram_start = 0;
nrf_sdh_ble_app_ram_start_get(&ram_start);
//DO BLE CFG
nrf_sdh_ble_enable(&ram_start);

This is simplified from my actual code, its just to show the basic set up.

I am finding that SD_EVT_IRQHandler is firing before I get to nrf_sdh_ble_enable(). This means that nrf_sdh_ble_evts_poll is called before ble is enabled and so, sd_ble_evt_get() returns BLE_ERROR_NOT_ENABLED.

  • Am I doing my setup in the right order?
  • Is there something I can use to prevent nrf_sdh_ble_evts_poll being called before nrf_sdh_ble_enable. Something like add a NRF_SDH_REQUEST_OBSERVER observer?
  • Or, is this simply a bug in the SDK and nrf_sdh_ble_evts_poll needs its code wrapped in a if(ble_enabled) statement?

Looking at the code, I imagine this problem would also be seen with the ant code if I initialised the BLE first then ANT

Parents Reply Children
No Data
Related