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.

LAUNCHXL-CC1352R1: Enabling Precision Time Protocol over BLE between two CC1352R1 MCUs

Part Number: LAUNCHXL-CC1352R1

I am a research student, currently working for a research project and writing a software for low-power and real-time wireless networks. I am very new to TI. I use two CC1352R1 MCUs, one is a BLE transmitter and the other is BLE receiver. I want to enable Precision Time Protocol (PTP) over BLE between two MCUs. I'm not very familiar with the PTP protocol but the goal is to to send the time-stamp from one device to another periodically when the connection is formed between two devices, secondly to have a clock accuracy with a precision of about 1 microsecond and also to figure out how often we have to send the time-stamp to maintain 1 microsecond accuracy.

Is there any example for the indicated MCU to achieve the goal of the task, or are there any other examples related to this task and can be able to be modified accordingly.

Any help on this would be greatly appreciated.

Thanks.

  • Muhammad Hamza Jawaid said:
    I want to enable Precision Time Protocol (PTP) over BLE between two MCUs.

    I haven't done it myself, but the conclusion of the Time Synchronization in Short Range Wireless Networks Master’s Thesis by Filip Gummesson and Kristoffer Hilmersson contains:

    In this thesis we have shown that deploying time synchronization in a WSN using BLE is possible, reaching low-ms accuracy

    I.e. suggests millisecond rather than microsecond accuracy.

  • Thanks Chester for your response. 

    I came across with this master thesis and came to know that precise time synchronization up to milliseconds is possible over BLE. The problem, however, is that they don't provide any code information. They used a Nordic device (nrf52) but did not mention which example they had used from the Nordic SDK. I'm looking forward to an example in the TI or Nordic SDK that greatly overlaps with what I needed to achieve the goal. Thanks.

  • Hi, 

    Unfortunately we don't have this implementation ready, but I would perhaps build upon a simpler data transfer mechanism and see if higher accuracy can be reached. I am a bit rusty on PTP, but I would start from the custom profile SimpleLink Academy example, which builds upon the project zero project and adds timer periodic services over BLE. 

    https://dev.ti.com/tirex/explore/node?node=AETVcTRqok2cbWCjbdtG5w__pTTHBmu__LATEST 

    If you intend to see the implementation of a simple protocol over BLE, check the Simple Serial socket example available at the Github

    https://github.com/ti-simplelink/ble_examples/tree/simplelink_cc13x2_26x2_sdk-4.10 

    Hope this helps,

    Rafael

  • Hi Rafael,

    Thank your for your response.

    What I understand from your answer is that I should pick the Simple Serial Socket example from GitHub and then modify it with the periodic service by the help of the Project Zero from the BLE Custom Profile example?

    One more question, Texas Instruments has released Revision E of pre-production silicon for the CC1352R1 device. However, my device is an earlier silicon release i.e. Revision C silicon, which is not compatible with the latest SDK i.e. v4.30.00.xx  and is only compatible with SDK v2.30.00.xx and earlier. Since both the examples (Simple Serial Socket and Custom Profile) are part of the latest SDK, that means they will not work on my device? Should I upgrade to the Revision E silicon device in order to get it working? 

    Thanks.

     

  • Muhammad Hamza Jawaid said:
    I'm looking forward to an example in the TI or Nordic SDK that greatly overlaps with what I needed to achieve the goal.

    Perhaps the Radio Timer (RAT) can be used. See Time synchronization over the air

  • Hi Chester,

    I found that your suggested method of "Time synchronization over the air" overlaps a lot with my goal. 

    I am currently using "Basic RX and TX Lab Exercise" which a Proprietary RF example for sending and receiving packets between two CC1352R1 devices, available from the link below:

    https://dev.ti.com/tirex/explore/content/simplelink_academy_cc13x2_26x2sdk_4_30_02_00/modules/prop_rf/prop_01_basic/prop_01_basic.html 

    Since I am new to TI and embedded programming, I have some confusion about using your suggested method in my assignment. Would you please help me incorporating your suggested method into my example? Should I just copy the snippets of code given in the user guide of your suggested method and paste them into the firmware of my example to synchronize the clocks of sender and receiver devices? If not then how can I incorporate this method into my exercise to synchronize the clocks?

    Thanks.

  • Hi,

    Muhammad Hamza Jawaid said:
    What I understand from your answer is that I should pick the Simple Serial Socket example from GitHub and then modify it with the periodic service by the help of the Project Zero from the BLE Custom Profile example?

    My original idea was to leverage the periodic clock service of the Custom Profile example to use as the BLE foundation to transfer the timestamp information - despite the clock being used to source the timestamp information is a TI-RTOS Clock element, it could be replaced with anything. Direct control/monitoring of the RAT peripheral would have to be carefully crafted to not disrupt the normal operation of the BLE stack.  

    My suggestion about the Serial Protocol was simply if anything specific could be reused to recreate the PTP protocol, but they are radically different and perhaps it will be of low value. 

    Muhammad Hamza Jawaid said:
    Should I upgrade to the Revision E silicon device in order to get it working? 

    If possible, I would preferably upgrade as the options for support are increased (not to count any bug fixes on the newer versions of the SDK).

    Unfortunately I don't have an implementation per se, but I would take a look at the Custom profile first (as well as the other SimpleLink Academy modules) so you can get familiar with the BLE stack and its intrinsics. 

    Hope this helps,

    Rafael