Time Synchronization between Aurix and the SoC Using gPTP
The gPTP protocol must be used for time synchronization between the SoC and AURIX. gPTP is part of the Audio Video Bridging (AVB) Standard: IEEE 802.1AS: Timing and Synchronization for Time-Sensitive Applications (gPTP).
On the platform, gPTP over Ethernet is used for time synchronization. However, AURIX uses AUTOSAR Modules for the time synchronization.
For gPTP, the EthTSyn Module and the StbM Module are used. The Synchronized Time Base Manager (StbM) provides the Time base.
On Linux:
The gPTP Protocol is handled by an adapted version of the program linuxptp, also known as ptp4l and the program phc2sys to synchronize the system clock.
Master: ptpd-avb -CWKLb eq0
Slave: ptpd-avb -CgKLb eq0
On the platform, the supported configuration is:
AURIX serves as Global Time Master
The SoC serves as the Time Slave
To initiate a PTP synchronization between AURIX and the SoC
1. In the AURIX console, enter the date <time>.
Where <time> is in UNIX-style seconds.
To convert Hex time to Epoch, use Epoch-Unix Time stamp convertor available at:
For example:
date 0x77DA7A8F
2. Enable gPTP on AURIX:
3. On the SoC enter these commands:
On Linux:
For Single Slave (Either Xavier-A or Xavier-B)
timedatectl set-ntp 0
./phc2sys -s /dev/ptp0 -w -S 1.0 -O 0 &
./ptp4l -f ./gPTP_slave.cfg -p /dev/ptp0 -i eth0 -m -l 7
For Dual Slave (Both Xavier-A and Xavier-B together)
timedatectl set-ntp 0
./phc2sys -s /dev/ptp0 -w -S 1.0 -O 0 &
./ptp4l -f ./gPTP_slave.cfg -p /dev/ptp0 -i eth0 -m -l 7 -D
ptpd-avb -gCKLb eq0
4. Verify the date on the SoC to ensure that the AURIX and the SoC time are synchronized.