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

Issue with nrf_sdh_enable_request() after adding DEBUG_NRF to project configuration

Hi

I've been working on a project over the past few months, and per a new requirement I was asked to add a debug configuration, as thus far I have worked with only a release configuration

I have a few asserts in code that I wanted to check, so alongside DEBUG I've also added DEBUG_NRF to my project, and this causes an issue where my project stops working by reaching the error while loop inside app_error_save_and_stop()

following the code in debug mode, I found what appears to be the function call that causes the error

while initializing the BLE module, I call ble_stack_init() which begins by calling nrf_sdh_enable_request()

at the end of this function is the following call: sdh_state_observer_notify(NRF_SDH_EVT_STATE_ENABLED);

for some reason I can't explain, it seems that the third iteration inside the loop fails when calling handler(evt, p_observer->p_context) inside this function, but only in this case

and as sdh_state_observer_notify() is called 3 times within nrf_sdh_enable_request() and there previous two seem to work correctly, I really have no idea what could cause this issue

The project works fine without DEBUG_NRF, it is a FreeRTOS project based on the ble_app_hrs_freertos example, though it has changed significantly

Please let me know what further information I can provide that might help determine the source of the problem, and I'll provide it as soon as I can

Thanks

Aviv

Parents
  • I've done some further testing:

    I've disabled all of my API calls in main(), so that only log_init() and clock_init() happen before initializing the BLE module, and yet the code still has the same error in the same function call

    I did open the ble_app_hrs_freertos example from the SDK and tried running it in debug configuration, and in that example these functions worked (it failed afterwards, but I would suspect this due to the fact I'm running on a PCB rather than the nRF52840 DK)

    these tests lead me to believe that this has something to do with the project configurations, specifically in sdk_config.h, so I've attached it below. hopefully this will provide some clues regarding the possible issues

    0028.sdk_config.h

Reply
  • I've done some further testing:

    I've disabled all of my API calls in main(), so that only log_init() and clock_init() happen before initializing the BLE module, and yet the code still has the same error in the same function call

    I did open the ble_app_hrs_freertos example from the SDK and tried running it in debug configuration, and in that example these functions worked (it failed afterwards, but I would suspect this due to the fact I'm running on a PCB rather than the nRF52840 DK)

    these tests lead me to believe that this has something to do with the project configurations, specifically in sdk_config.h, so I've attached it below. hopefully this will provide some clues regarding the possible issues

    0028.sdk_config.h

Children
No Data
Related