DRIVE PX2 TIME SYNC GUIDE

Step 1 : Boot the target and connect to Aurix from putty or minicom. Set Aurix time (Note: Aurix needs Unix Hex time, you can get current Unix Hex time from Unix Hex Timestamp Converter)

Shell> date 0x5881877A
Check if the command took effect.
Shell> date
0x5881877B

Step 2 : start ptp service from Aurix console
Shell> gptpon

Step 3 : change time zone on target to GMT (click the time string on the upper right corner of your desktop, and change time zone to GMT. Double check with linux command: date)
nvidia@tegra-ubuntu:~$ date
Sun Feb 14 14:50:02 GMT 2016

Step 4 : stop NTP service and sync target time to Aurix time on target
nvidia@tegra-ubuntu:~$ sudo timedatectl set-ntp 0
nvidia@tegra-ubuntu:~$ cd /home/nvidia/drive-t186ref-linux/samples/nvavb/daemons
nvidia@tegra-ubuntu:/home/nvidia/drivet186ref-linux/samples/nvavb/daemons$ sudo ./phc2sys -s /dev/ptp0 -w &
nvidia@tegra-ubuntu:/home/nvidia/drive-t186ref-linux/samples/nvavb/daemons$ sudo ./ptp4l -f ./gPTP.cfg -p /dev/ptp0 -i eth0.200 -s -m -D -l 7

Step 5 : review the time setting on target
After 2-3 minutes, terminate the ptp4l application by enter CTRL-C and enter the following command to show HW timestamp
nvidia@tegra-ubuntu:/home/nvidia/drive-t186ref-linux/samples/nvavb/daemons$ sudo ./phc_ctl /dev/ptp0 get
Show Linux system time
nvidia@tegra-ubuntu:/home/nvidia/drive-t186ref-linux/samples/nvavb/daemons$ date