*** Please note that this reply is generated by LLM automatically ***
I’ll provide a comprehensive answer to your question.
Understanding the Time Scales
First, let’s clarify the time scales involved:
- TAI (International Atomic Time): a continuous time scale based on the Earth’s rotation and atomic clocks.
- UTC (Coordinated Universal Time): a time scale based on TAI, but with leap seconds inserted to account for the Earth’s slightly irregular rotation.
The difference between TAI and UTC is currently 37 seconds, which is the offset you’re referring to.
Jetson PTP Implementation
The Jetson Orin AGX developer board uses the Linux PTP (Precision Time Protocol) implementation, which is based on the IEEE 1588 standard. The PTP implementation on Jetson Orin AGX uses the devptp0 device as the PTP clock source.
PHC (PTP Hardware Clock) Time Scale
The PHC time scale on Jetson Orin AGX is based on TAI. However, the devptp0 device is configured to produce a time scale that is aligned with UTC. This means that the PHC time scale on Jetson Orin AGX is effectively already aligned with UTC, rather than TAI.
phc2sys Offset
The phc2sys command is used to synchronize the system time with the PHC time scale. The offset value specified in the phc2sys command is used to adjust the system time to match the PHC time scale.
In your test cases, you observed that using an offset of 0 (i.e., phc2sys s devptp0 c CLOCK_REALTIME w m O 0) produces a system time that matches UTC. This suggests that the devptp0 device is already producing a time scale that is aligned with UTC.
Jetson PTP Driver and BSP
The Jetson PTP driver and BSP (Board Support Package) handle the UTC-TAI offset differently than typical NICs on x86 platforms. On x86 platforms, the PTP driver typically produces a time scale based on TAI, and the phc2sys command is used to adjust the system time to match UTC.
In contrast, the Jetson PTP driver and BSP are configured to produce a time scale that is already aligned with UTC. This means that the phc2sys command does not need to adjust the system time to match UTC, and an offset of 0 can be used.
Recommended Practice
Based on your observations and the information provided, the recommended practice for synchronizing sensors to system time on Jetson Orin AGX is to use an offset of 0 (i.e., phc2sys s devptp0 c CLOCK_REALTIME w m O 0) when using the phc2sys command. This will ensure that the system time is aligned with UTC, which is the typical time scale used in most applications.
Comparison with Typical NICs on x86 Platforms
The Jetson PTP driver and BSP handle the UTC-TAI offset differently than typical NICs on x86 platforms. On x86 platforms, the PTP driver typically produces a time scale based on TAI, and the phc2sys command is used to adjust the system time to match UTC.
In contrast, the Jetson PTP driver and BSP are configured to produce a time scale that is already aligned with UTC. This means that the phc2sys command does not need to adjust the system time to match UTC, and an offset of 0 can be used.
Conclusion
In summary, the PHC time scale on Jetson Orin AGX is based on TAI, but the devptp0 device is configured to produce a time scale that is aligned with UTC. The phc2sys command should be used with an offset of 0 to synchronize the system time with the PHC time scale. This will ensure that the system time is aligned with UTC, which is the typical time scale used in most applications.
*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***