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

All LEDs light up upon ble error

Hello,

I am using the nRF52 along with SDK 9.0.2. I have used both the ble_app_uart code and the twi_master_slave code to send data from a sensor over bluetooth to the nRF Toolbox UART app on Android. I can flash the code, connect to the nRF52, and read data over bluetooth just fine, but only with using an nrf_delay_ms.

If I use a delay less than about 50ms, the app disconnects from the nRF52 bluetooth, and all the LEDs light up. This is important, because I can't use too big of a delay, or my sampling rate will be too low and the quality of the data suffers.

Is it a common error for all LEDs to light up? Could the need for the delay be a hardware limitation on how quickly the nordic can send transmissions over bluetooth?

Thanks.

  • If all the LEDs are lighting up then you are in the error handler because one of your calls returned a non-zero error code and APP_ERR_CHECK() calls the error handler and all the LEDs light up to tell you this fact so you can go and debug. Get the debugger out, put a breakpoint in the error handler, or wait until all the LEDs light up and hit 'break' and look at the stack trace to see where you are and what call failed and what the error code was which caused it.

    If you're using some hard-coded delay then you're most likely already doing something wrong, hard-coded fixed delays are almost always a hack which hides a real issue.

  • You can also have a look at this recent blogpost on debugging for more about the error handler and debugging. It is well worth a read-through.

Related