I was trying ptp4l on my NXP i.MX boards. Then, I tried PMC settings on my ptp4l (using the steps on the following page https://tsn.readthedocs.io/avb.html )
What I have done to set up the time sync and PMC previously:
It seems good. That is the setting I want.
4. **start phc2sys**
`phc2sys -c eth0 -s CLOCK_REALTIME --step_threshold=1 --transportSpecific=1 -w &`
After that, I checked the message captured from eth0. The message sent on ethernet was **WRONG**. The flags such as ptpTimescale are false which is different to the PMC settings. (The following picture is the message read by Wireshark.)
![Screenshot from 2024-07-30 14-38-31](https://github.com/user-attachments/assets/af88a94a-dafd-4018-a020-06b54fcd1888)
![Screenshot from 2024-07-30 14-38-25](https://github.com/user-attachments/assets/9d661f17-dd48-491d-b761-51df2d679bd3)
The message package captured by tcpdump is in the attachment file:
[logAfterPhc2sys.zip](https://github.com/user-attachments/files/16423213/logAfterPhc2sys.zip)
I also ran the '[check_clocks](https://tsn.readthedocs.io/_downloads/f329e8dec804247b1dbb5835bd949e6f/check_clocks.c)' to check the time sync. The output was:
> phc-tai delta is greater than 50 usec !
> TAI offset set in kernel is not correct !
> Please verify ptp4l and phc config and restart them if necessary to synchronize the clocks !
**What I have tried to solve the problem:**
1. disable NTP: `timedatectl set-ntp false` and then restart ptp4l
2. make sure there is only one ptp4l, one phc2sys running: `ps -A | grep ptp4l` (there is only 1 ptp4l、 phc2sys)
However, those don't solve the problem.
**My questions:**
1. Can you suggest why the PMC setting doesn't work on the actual message sent from ptp4l?
2. Is there any other thing that can affect the PMC setting I need to avoid?
3. Can you let me know how to solve the problem? (correct PMC setting, but WRONG flags on message)
Kind Regards,
Jim
Hi,
I was trying ptp4l on my NXP i.MX boards. Then, I tried PMC settings on my ptp4l (using the steps on the following page https://tsn.readthedocs.io/avb.html )
What I have done to set up the time sync and PMC previously:
ptp4l -m -i eth0 -f automotive-master_domain0.cfg --step_threshold=1 &
PS: The content of "automotive-master_domain0.cfg" file is:
clockAccuracy 0xfe offsetScaledLogVariance 0xffff \
currentUtcOffset 37 leap61 0 leap59 0 currentUtcOffsetValid 1 \
ptpTimescale 1 timeTraceable 1 frequencyTraceable 0 \
timeSource 0xa0"
sending: GET GRANDMASTER_SETTINGS_NP 484952.fffe.411081-0 seq 0 RESPONSE MANAGEMENT GRANDMASTER_SETTINGS_NP clockClass 248 clockAccuracy 0xfe offsetScaledLogVariance 0xffff currentUtcOffset 37 leap61 0 leap59 0 currentUtcOffsetValid 1 ptpTimescale 1 timeTraceable 1 frequencyTraceable 0 timeSource 0xa0