Xavier PTP using system clock as master and PTP clock as client

Hi all,

I’m not sure if this is a Xavier problem or not, so sorry If I’m posing in the wrong place.

I have my system clock being synchronised by chrony so I know it is very accurate and I want to be able to sync the PHC (/dev/ptp0) to the system clock so that other things on the PTP network can all use the Xavier time as a grandmaster clock.

I don’t seem to be having too much luck with this and was wondering if maybe there are some kernel modules that need to be enabled or something else?

I do have the following enabled:
gunzip < /proc/config.gz | grep PTP

  CONFIG_NET_PTP_CLASSIFY=y
  CONFIG_NF_CONNTRACK_PPTP=m
  CONFIG_NF_NAT_PPTP=m

  # PTP clock support
  CONFIG_PTP_1588_CLOCK=y
  CONFIG_USB_F_PTP=y
  CONFIG_USB_CONFIGFS_F_PTP=y
  CONFIG_TEGRA_PTP_NOTIFIER=y

gunzip < /proc/config.gz | grep CONFIG_NETWORK_PHY_TIMESTAMPING

CONFIG_NETWORK_PHY_TIMESTAMPING=y

So It looks like the phc2sys program is working as expected, it initially has an offset but quickly corrects it.

$ sudo phc2sys -c /dev/ptp0 -s CLOCK_REALTIME -O 1 -m
phc2sys[2179.690]: sys offset -1241234161 s0 freq -62499998 delay  12121
phc2sys[2180.691]: sys offset -1178623024 s1 freq  +39033 delay  10421
phc2sys[2181.693]: sys offset     -6387 s2 freq  +32646 delay   9599
phc2sys[2182.693]: sys offset      -271 s2 freq  +36846 delay   9599
phc2sys[2183.693]: sys offset      1464 s2 freq  +38500 delay  11423
phc2sys[2184.694]: sys offset      1741 s2 freq  +39216 delay  11391

However the ptp4l program starts up and then never seems to receive a SYNC with a timestamp.

I created a ptp4l.conf file according to this link:

[global] 
priority1 127
[eth0]

And then ran:

sudo ptp4l -f /etc/ptp4l.conf -m
[sudo] password for agx1: 
ptp4l[88.463]: selected /dev/ptp0 as PTP clock
ptp4l[88.465]: port 1: INITIALIZING to LISTENING on INITIALIZE
ptp4l[88.465]: port 0: INITIALIZING to LISTENING on INITIALIZE
ptp4l[88.465]: port 1: link up
ptp4l[89.022]: port 1: new foreign master c4ffbc.fffe.ab8ea5-1
ptp4l[89.022]: port 1: new foreign master 00044b.fffe.e58912-1
ptp4l[93.022]: selected best master clock c4ffbc.fffe.ab8ea5
ptp4l[93.022]: assuming the grand master role
ptp4l[93.022]: port 1: LISTENING to GRAND_MASTER on RS_GRAND_MASTER
ptp4l[93.022]: selected best master clock c4ffbc.fffe.ab8ea5
ptp4l[93.022]: assuming the grand master role
ptp4l[352.093]: timed out while polling for tx timestamp
ptp4l[352.094]: increasing tx_timestamp_timeout may correct this issue, but it is likely caused by a driver bug
ptp4l[352.094]: port 1: send sync failed
ptp4l[352.094]: port 1: GRAND_MASTER to FAULTY on FAULT_DETECTED (FT_UNSPECIFIED)
ptp4l[368.096]: port 1: FAULTY to LISTENING on FAULT_CLEARED
ptp4l[371.020]: port 1: received SYNC without timestamp
ptp4l[372.017]: port 1: received SYNC without timestamp
ptp4l[373.017]: port 1: received SYNC without timestamp
ptp4l[374.017]: port 1: received SYNC without timestamp
ptp4l[374.390]: port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
ptp4l[374.390]: selected best master clock 00044b.fffe.cc2a7e
ptp4l[374.391]: assuming the grand master role
ptp4l[375.017]: port 1: received SYNC without timestamp
ptp4l[376.017]: port 1: received SYNC without timestamp

The “received SYNC without timestamp” continues on until infinity.

It looks like there shouldn’t be any issues with the Xavier as this post seemed to have no troubled getting the Xavier to work as a client, I can only assume its the same to work as a master.

This topic didn’t seem to solve the PTP issue:

Any help would be very appreciated, thanks!

once Xavier assumes the grandmaster role it will be possible to run ptp4l from another Xavier so that it will listen & synchronize to the grand master clock;
I did not use chrony in the tested scenario though
Hardware timestamping capabilities should also be listed there

ethtool -T eth0 

we are using at client:

/usr/local/sbin/ptp4l -i eno1 -p /dev/ptp0 -s -m
/usr/local/sbin/phc2sys -a -r -m

at server [ jetson nx]

/usr/local/sbin/ptp4l -i eth0 -m -H -A 
/usr/local/sbin/phc2sys -m -s CLOCK_REALTIME -c eth0 -w

so it takes time through NTP through GPS pps/nmea inputs, then distributes it over linux network
There are issues with windows network ptp compliance though
ref thread
https://forums.developer.nvidia.com/t/time-sensitive-networking-tsn-on-nx/