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

Device not advertising after disconnect

Hi,

I am facing a frustrating problem which came up all over sudden: I am using the nordic uart serice/nRF52/SDK13 and after a couple of connects/disconnects of my peripheral I can not see it anymore, neither from my mobile application nor from any of the Nordic provided applications (nRF Connect, nRF Uart v2.0).

I do receive the "BLE_GAP_EVT_DISCONNECTED" event, but 1 out of 10 times I am not able to see my device anymore. Restarting of the device and everything is fine again.

Now I tried to manually stop advertising and restart it again when i receive the BLE_GAP_EVT_DISCONNECTED event, but that does not seem to help.

Any idea what could do the trick?

Many thanks, Josef

Parents
  • It might be caused by any error/hard fault and its wrong handling in your code. The usual (and sometimes the only;) way is to run it in debug mode with UART or SEGGER RTT print-outs at such level that you can easily trace what your code is doing without disturbing the timing and APP/SD flow. With high probability you will then see some bad return (error) code from some sd_xxx function call or deadlock inside your own code...

    Normally Nordic BLE Stack (SD) doesn't start advertising after GAP Peripheral link is terminated, it's always application which requests to start it through sd_ble_gap API. If you haven't been doing it before and you've anyway seen you board to start advertising after disconnection then you most probably use some thick library/module from SDK which does it for you (and then if not using correctly or if there is a bug it explains the failures you see).

  • Hi, thanks for the suggestions. I managed to isolate the issue to a particular function of the code which deactivates a portion of my custom PCB (SPI connected ADC) by disabling a load switch and reactivates it when it is needed. If I leave the external ADC constantly powered, the issue does not appear. Since these parts of the code (Advertising and ADC reading over SPI) are in no way related, i imagine that the remaining charge after disabling the load switch has some kind of influence on the nRF pins... I will keep looking...

  • Thanks!  I have the same problem but different, but at least I have isolated the problem to my C code on the nRF, not the Java code in my APP.

Reply Children
No Data
Related