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

Firmware main loop no longer executed when client app gets out of range

I'm working on a product that is somehow related to geolocation. As part of it, RSSI measurement is sent back at high frequency to the central. Currently based on nRF51822, using SD130 2.0.1

And low timing interval ensure I get a measurement at least every 100ms:

#define MIN_CONN_INTERVAL                MSEC_TO_UNITS(50, UNIT_1_25_MS)
#define MAX_CONN_INTERVAL                MSEC_TO_UNITS(80, UNIT_1_25_MS)

Upon connection, I run the following:

sd_ble_gap_rssi_start(p_ble_evt->evt.gap_evt.conn_handle, 1, 0);

Upon RSSI update, a notification is sent to the central with the measurement. This is basically the only thing that the firmware does.

I have an issue that arise when central gets too far from peripheral. For testing purposes I use nRF Connect, enable the notification, everything goes fine, but when being far enough, I can see the update rate slowing down (like no update for 1s), then no more update at all, while I still see the "disconnect" button. Then after a while, it switches back to "Connect", but trying to reconnect fails (and I can't see any advertisment anymore)

I've got some debug out in my main loop, and when I come back to my console, I see no more output. When I pause execution, I can keep stepping, the MCU is still running, but the code executed is outside of my code, it's somewhere inside the SD.

In another version of the firmware, I also have a timer that executes every few seconds and blinks LEDs. But when the peripheral "stops responding", the timer no longer gets executed (might be dued being in a loop in a higher priority interrupt?).

Any help would be greatly appreciated, I have a complete demonstration project available.

Parents Reply Children
No Data
Related