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

Call to nrf_sdh_enable_request fails in SDK v16.0.0 (works in SDK v15.3.0)

I am porting our firmware from SDK v15.3.0 to 16.0.0. I believe I have most of the changes in place
as I am able to build the boot loader and get it to execute without any catastrophic errors.

However, when I try to port a basic advertisement project to this newer SDK, the call to 'nrf_sdh_enable_request()'
triggers a fault. The issue is triggered by this call inside that function:

    sdh_state_observer_notify(NRF_SDH_EVT_STATE_ENABLED);

It appears that handler eventually in the file 'nrf_drv_power.c' checks to see if the local module
(i.e. m_initialized) is set to TRUE/1.

For reasons that I cannot currently triage, the combination of using SDK v16.0.0 and the preprocessor symbol DEBUG_NRF
triggers this failure. This issue disappears if I DO NOT define DEBUG_NRF in the build.

RMV

  • Hi RMV, 

    Please be aware that most of our BLE examples don't use the nrf_drv_power library. You can find that in all of our example inside ble_peripheral folder, we don't use such library at all. 

    The reason you see a call to nrf_drv_power_on_sd_enable() was because you included the nrf_drv_power.c in your project. Inside the code this macro will be compiled: 

    NRF_SDH_STATE_OBSERVER(m_sd_observer, POWER_CONFIG_STATE_OBSERVER_PRIO) =
    {
    .handler = nrf_drv_power_sdh_state_evt_handler,
    .p_context = NULL
    };

    And because of that nrf_drv_power_sdh_state_evt_handler() will be called when the softdevice is enabled. 

    So if you remove nrf_drv_power.c from your code, it should work fine. 

  • This problem disappears (and I am now able to build my project) if I remove the file 'nrf_drv_power.c'.

    I will mark this as 'answered'.

Related