Test environment:
- Two Debix Model A board (named M1 and M2)
- Connect two boards via the network cable
1. Install linuxptp
sudo apt-get install linuxptp
2. Configure master (M1) time and run ptp4l
1) Check M1 Ethernet corresponding PTP

2) Print "PTP Hardware Clock: 1" in step 1 to get the corresponding /dev/ptp1 of ens33
3) Get the current system time

4) Disable network synchronization
timedatectl set-ntp false
5) Sync time to ptp and check ptp time
phc_ctl /dev/ptp1 set
phc_ctl /dev/ptp1 get
6) Run ptp4l to send ptp time out
ptp4l -i ens33 -m -H --step_threshold=1 -2 &
3. Configure slave (M2) to view the time after synchronization
1) Run ptp4l to get time
ptp4l -i ens33 -m -H --step_threshold=1 -s -2 &

2) Run phc2sys to synchronize the time to system
phc2sys -s ens33 -c CLOCK_REALTIME -w -m &
When the time and master's time are the same, PTP time synchronization test is successful.