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

  • 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).

  • Yeah.. sorry about the messy code display... I posted it to pastebin for easier viewing -> http://pastebin.com/sZSwxPR8

    If I understand you are saying that the sd_app_evt_wait() is not necessarily triggered by the BLE, and could just sit and wait while the BLE works unattended..yes? which is fine for now..

    Another point is that the LED used by the ADVERTISING_LED_PIN_NO never goes out.. not clear, but though it might be triggered by adv transmit, or other activity..

  • Upon more investigation, and some understanding since provided, it appears the BLE advertisement is functioning as expected.. The sd_app_evt_wait() is working properly, and apparently the ADV LED stays on continuously..

    All is well, and thanks to all who got involved, or intended to :)

  • Great, marking right answer and closing the question would help to others;)

Related