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

Abrupt offset when using wireless timer synchronization

Hello,

Our project:

At the moment we are developing an application with a nRF52840DK as central and a nRF52DK as peripheral. The code on both boards is based on the ble_app_uart_c and the ble_app_uart example of wireless timer sync demo.

It is available here: GitHub - nordic-auko/nRF5-ble-timesync-demo: nRF52 clock synchronization demo code ; There is also a blog post regarding this: Wireless timer synchronization among nRF5 devices - Bluetooth low energy - Short-range guides - Nordic DevZone (nordicsemi.com)

On the peripheral we are using the saadc with a sample rate of 1ms. The samples get timestamped and sent to the central via NUS. On the central we receive these timestamped samples. We also read out a GPIO as a digital input on the central. We are using wireless timer synchronization to sychronize the saadc samples with the readings of the GPIO.

Our problem:

When we start the wireless timer synchronization it works completly fine at first. But about 1100 to 1380 seconds after we started the wireless timer sync we get an abrupt offset of about 3ms. This offset exists for exactly 10 seconds. After these 10 seconds the wireless timer sync continues with perfect operation and the offset is gone. 

We already figured out that is definetly an abrupt 3ms offset and no slow timer drift (So we verified that the wireless timer sync basically works).

It also seems like that the master-timer on the central (which sends the sync beacons) is correct. So the problem/offset would be on the peripheral (which receives the sync beacons) with its slave timer.

We already spent a lot of time trying to debug this and trying to find the cause for this. But without success.

Our questions:

1. Do you have any suggestions what could cause this weird abrupt offset for exactly 10 seconds?

2. Do you have any tips how to solve this issue?

3. How can we debug this problem properly?

--------------------------------------------------------------

Any kind of feedback is always appreciated. Thank you very much in advance. It looks like that success of this project depends on your help.

Best regards,

Michael

Related