This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ble_sdk_app_beacon hangs on sd_app_evt_wait()

Trying to run the SDK advertising beacon example: SDK 6.0, S110 7.3.0, device = nRF51822-QFAA(build code: CA/C0) 256kB Flash (rfDuino package) Compiled using gcc-arm-embedded 6.3.1 in FreeBSD, firmware loaded using Bus Blaster v3 in OpenOCD (0.90).

The example compiles and loads fine, but hangs on the sd_app_evt_wait() call. if I comment out the call to sd_app_evt_wait(), the loop runs fine. However, the BLE stack does not appear to run.. no advertisement is transmitted, and no events are generated to trigger the evt_wait.

The only significant change we made to the code was the clock designation in ble_stack_init(): SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, false);

main.c code included here on pastebin: http://pastebin.com/sZSwxPR8

Parents
  • Could you repost your main.c (or whatever file name content you pasted content to your question) to be able to compare it with SDK example you've used as source? Normally you indeed call sd_app_evt_wait() function in the main program loop to save energy, it should hang but your app is then called by Soft Device through event handler you provide during initialization. But for advertisement itself even that is not needed, you just set adv. a scan rsp data, other parameters and start it. Soft Device will do the rest and your app will basically spend 100% in sleep (SYSTEM ON sleep mode).

Reply
  • Could you repost your main.c (or whatever file name content you pasted content to your question) to be able to compare it with SDK example you've used as source? Normally you indeed call sd_app_evt_wait() function in the main program loop to save energy, it should hang but your app is then called by Soft Device through event handler you provide during initialization. But for advertisement itself even that is not needed, you just set adv. a scan rsp data, other parameters and start it. Soft Device will do the rest and your app will basically spend 100% in sleep (SYSTEM ON sleep mode).

Children
No Data
Related