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

Timer synchronous using Precision Time Protocol

Dear all,

I want to implement precision clock synchronisation between two Nordic NRF52840DK devices, I have seen the example using the Timeslot API with the Nordic SDK,but I want to implement

this with Precision Time Protocol,that is I need to retrieve timestamp or counter value at the point that a packet is actually sent or received at physical layer.

According to this post,It seems there are APIs in "Zephyr Bluetooth LE Controller" can do this.

But in my case,I use the LLPM example in nrf connect SDK,and this example only support SoftDevice controller.

Is there any similar APIs in SoftDevice Controller can achieve this? many thanks!!

Best regards.

   

Parents Reply Children
  • Thanks for your kindly reply! The example you post is what I am referring to,In our use case,we want to calculate the packet latency from sender's application to receivers's application, so we retrieve time_stamp1 (t1) at app of sender and t2 at app of receiver. To get t2-t1 as transmission latency,the timer(or clock) at each side should be synchronized or in other word we need to know the offset of two timers.

    As a beginner, modifying the example using the Timeslot API for NCS is quite difficult for me,is there any sample code for NCS can approach this,I really need this,thanks a lot !!!!

    Best regards,

    hao

  • Just to clarify I assume you are only implementing something similar to PTP since PTP is developed for Ethernet networks?

    What API are you planning to use to send your packets?

    Depending on what you're using your best bet might be to make a timestamp with something like k_uptime_ticks right before you send your packet.

    -Einar

  • Actually,I think taking the time slot example is more reasonable,I think I will put more attention on this approach.By the way, Although the the example use the nRF5 SDK but the the controller is softdevice controller which is same as the NCS example I use.

    What part or what's the API should I replace? Could you please point this out to me?

    Best regards,

    hao

        

  • Hi

    I would recommend looking over the code in this MPSL timeslot sample to see how the timeslot API in NCS is used.

    -Einar

Related