-
Notifications
You must be signed in to change notification settings - Fork 61
Description
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:
- start ptp4l :
ptp4l -m -i eth0 -f automotive-master_domain0.cfg --step_threshold=1 &
PS: The content of "automotive-master_domain0.cfg" file is:
[global]
# Options carried over from gPTP.
gmCapable 1
priority1 248
priority2 248
logSyncInterval -3
syncReceiptTimeout 3
neighborPropDelayThresh 800
min_neighbor_prop_delay -20000000
assume_two_step 1
path_trace_enabled 1
follow_up_info 1
transportSpecific 0x1
ptp_dst_mac 01:80:C2:00:00:0E
network_transport L2
delay_mechanism P2P
domainNumber 0
#
# Automotive Profile specific options
#
BMCA noop
masterOnly 1
- To set the system clocks (CLOCK_REALTIME and CLOCK_TAI), configure the UTC-TAI offset in the system:
pmc -u -b 0 -t 1 "SET 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"
- To check if the setting is successful:
pmc -u -b 0 -t 1 "GET GRANDMASTER_SETTINGS_NP"
the output is:
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
It seems good. That is the setting I want.
- 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.)
The message package captured by tcpdump is in the attachment file:
logAfterPhc2sys.zip
I also ran the 'check_clocks' 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:
- disable NTP:
timedatectl set-ntp false
and then restart ptp4l - 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:
- Can you suggest why the PMC setting doesn't work on the actual message sent from ptp4l?
- Is there any other thing that can affect the PMC setting I need to avoid?
- Can you let me know how to solve the problem? (correct PMC setting, but WRONG flags on message)
Kind Regards,
Jim