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

Why does my application just hang?

I've done a few modifications to the default heart rate application in SDK 4.2.0, but now I can't see it advertising any more. Also, there is no longer any LED activity. Any suggestions on what might be wrong?

  • It sounds as if you may have introduced an error in some softdevice function parameter, causing the method to return an error. In all the BLE example applications in the SDK, these return codes are checked, and if the method doesn't succeed, an error handler, app_error_handler(), will be called. With SDK 4.1.0 and 4.2.0, the default behavior of this was changed, from hanging in an infinite loop, to just resetting. If you have an error somewhere in your startup, this reset will therefore cause an infinite reset loop.

    I'd therefore recommend you to try removing the reset, and uncommenting the ble_debug_assert_handler() function call. This will cause the application to hang in this method instead, and if you then use the debugger to stop the CPU, you should be able to see on which line number and file the error occurred, and what the exact error code returned was. These error codes are defined in nrf_error.h and friends, and should at least give you a pointer on what may be wrong.

    Feel free to post a new question if you don't understand the error returned.

Related