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

Bluetooth stack get stuck in connected state

Hi,

I have discovered a (rare) problem where the S132 stack get stuck in connected state when it is not actually connected anymore.

This behavior was first reported by a beta tester and it surprised me as I had never seen it before, he reported that it happened after a long non-stop connected session (like 5 days).

Yesterday I managed to reproduce the problem by mistake, I was developing the Android app and had made a mistake which caused the app to crash which in turn caused the SoC to get stuck in connected state and did not go back to advertising (I even turned off my phone completely to be sure the connection was not maintained by the Android OS).

The BLE_GAP_EVT_DISCONNECTED was never called, the LED indicating an ongoing connection was lit and the application code was running as nothing had happened.

I had implemented a workaround for this issue (as I do not know the cause) where I on BLE_GAP_EVT_CONNECTED start a timer that must be reset on a regular basis by the central by sending heartbeats, if no heartbeat is delivered within a certain amount of time, I perform a NVIC system reset. The timer is stopped on a BLE_GAP_EVT_DISCONNECTED. This approach that is similar to a watchdog worked in my case but I would still like to know if this is a bug in the S132 stack or what else could cause this problem.

The product does not have any physical I/O capabilities (not even an ON/OFF-switch) so it is important that it is not stuck for long periods of time.

Has anyone encountered a similar problem?

Info:

- SoC: nRF52832

- BT Stack: S132 v.6.1

- SDK v15.2.0

- Kernel: freeRTOS v10.0.0

Parents Reply Children
Related