jclark / rpi-cm4-ptp-guide

Guide to using the hardware PTP support in the Raspberry Pi CM4
MIT License
69 stars 9 forks source link

CM4 P2P timestamping #34

Open gspreeth opened 1 week ago

gspreeth commented 1 week ago

Hi, I could successfully setup a ptp master on a CM4 pi and when using E2E pdelay mechanism (UDP) then it seems to work fine. low nanosecond jitter and stead pdelay values. when switching to P2P mode, then the pdelay values seem to jump around at the 60 to 80us mark as if it is being software timestamped. Therefore the sync is also inaccurate around those values. All settings and hardware timestamping etc seem fine, but it is as if the L2 packets are not timestamped right. any ideas?

jclark commented 1 week ago

What's the client? Do you have a switch between client and master, or are they connected back to back?

gspreeth commented 1 week ago

hi, I use another CM4 as the client back to back. I have also used other devices. all give the same results.

below is a plot of the pdelay values over time. as well as a PPS comparison between the CM4 master and a different slave. the sync seems to have the same offset as the pdelay value jitter. this just seems like the L2 pdelay responses from the master is not hardware timestamped so they are all over the place.

Screenshot from 2024-04-29 12-11-56

jclark commented 1 week ago

Hmm. I don't have any great ideas.

I would suggest trying some variations to see what works and what doesn't:

I am away from home at the moment. I will give it a try when I have a chance.

What kernel and ptp4l version are you using?

gspreeth commented 1 week ago

thaanks, I will play around a bit more but have tried a lot of settings. it really just seems like the difference between L2 and L4 pdelay timestamping. It seems in all guides and previous issues etc everyone only tries UDP..

Kernel should be latest: 6.6.28+rpt-rpi-v8 ptp4l i used 3.1.1 and also upgraded to 4.2 (with upgrade to 4 You need to use the ptp_minor_version 0 )