This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2642R: Adding timestamp to packets

Part Number: CC2642R


Hi,

I'm trying to reach a +/- 100ms synchronization between two CC2642 using a multi_role based example without connections/pairing - just by broadcast and scanning. For discussion sake, lets say I'm trying to set it so that every 5 minutes one CC2642 broadcasts and the other one broadcasts 100ms after the first.

So far I've used a third CC2642 that sends pings every second. Right before I call the GapAdv_enable() command I call Seconds_getTime() and load the result into the ping data. Each of the other 2 CC2642 scans for this packet once per minute and uses Seconds_setTime() with the value from the ping packet.

The result was in the range of +/- 750ms between them. Sometimes they were broadcasting on top of each other and at most at about 750ms apart and it varied between each broadcast interval. I can only assume that using Seconds_getTime()/Seconds_setTime() is not sufficient.

I've read this article about achieving synchronization with proprietary PHY and it includes options to append a timestamp to the packets with a command to the RF core. I believe this would greatly reduce the lag I get over using the RTC functions. Can I use this setup while using the BLE5 stack, or will messing with RF configurations disrupt something in the program? If it's possible, would you mind adding a short guide as to what to change.

I'm using SDK version 6.10.0.29.

Thanks,

Eyal

  • Hey Eyal,

    I've read this article about achieving synchronization with proprietary PHY and it includes options to append a timestamp to the packets with a command to the RF core. I believe this would greatly reduce the lag I get over using the RTC functions. Can I use this setup while using the BLE5 stack, or will messing with RF configurations disrupt something in the program? If it's possible, would you mind adding a short guide as to what to change.

    Radio operations are handled inside the link layer of the BLE5-stack. As such, this code is not modifiable since it is provided as a library.

    Synchronization will have to be done at the application layer, and this is difficult. The reason is because the BLE5-stack manages the execution of scanning/advertising events. So, there is a delay between calling GapAdv_enable() and the first advertisement going out. You'll have to measure this delay and try to synchronize the call to GapAdv_enable() on both ends. Perhaps you can use multiple advertisement sets and append the timestamp info into the first advertisement payload and use that information to synchronize the start of the second. Again, these calls will just synchronize things at the application layer. It may get you close, but if the stack is performing another task at the same time as your call to GapAdv_enable (for example, scanning), then you will have difficulty synchronizing these events consistently.