Issue with ptp hwtimestamp and how to get 1588 1PPS on i.MX6Q?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issue with ptp hwtimestamp and how to get 1588 1PPS on i.MX6Q?

283 Views
Alvin_cai
Contributor I

I am working on i.MX6Q board to get IEEE 1588 1PPS,and trying to sync the clock imx6q boards with hardware and software time stamping. The kernel version that I used is 4.9.15. (Write 4.1.15 err  begin)It seems the kernel supports 1588 feature and I try to get 1 pps single.

1.I set GPIO19 as event0_out, and have use the following way to pps_enable,but I also can't get the 1pps single.

https://community.nxp.com/t5/i-MX-Processors/How-to-get-IEEE-1588-1PPS-on-i-MX6Q/m-p/551121

2. Another question,I use the software timestamp by ptp4l, it works ok
[2023/1/4 10:45:24] root@MX6-LRM:~# ptp4l -i eth0 -P -m -S -s
[2023/1/4 10:45:24] ptp4l[428.296]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE
[2023/1/4 10:45:24] ptp4l[428.297]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
[2023/1/4 10:45:24] ptp4l[428.873]: port 1: new foreign master 000f32.fffe.313137-1
[2023/1/4 10:45:26] ptp4l[430.880]: selected best master clock 000f32.fffe.313137
[2023/1/4 10:45:26] ptp4l[430.880]: updating UTC offset to 37
[2023/1/4 10:45:26] ptp4l[430.880]: port 1: LISTENING to UNCALIBRATED on RS_SLAVE
[2023/1/4 10:45:27] ptp4l[431.891]: master offset 218068457718777103 s0 freq +0 path delay 49265
[2023/1/4 10:45:28] ptp4l[432.891]: master offset 218068457718770450 s0 freq +0 path delay 49105
[2023/1/4 10:45:29] ptp4l[433.891]: master offset 218068457718758223 s0 freq +0 path delay 49265
[2023/1/4 10:45:30] ptp4l[434.891]: master offset 218068457718748797 s0 freq +0 path delay 49105
[2023/1/4 10:45:31] ptp4l[435.891]: master offset 218068457718742463 s0 freq +0 path delay 48945
[2023/1/4 10:45:32] ptp4l[436.891]: master offset 218068457718798716 s0 freq +0 path delay 48879
[2023/1/4 10:45:33] ptp4l[437.891]: master offset 218068457718737675 s0 freq +0 path delay 48934
[2023/1/4 10:45:34] ptp4l[438.891]: master offset 218068457718710082 s0 freq +0 path delay 48873
[2023/1/4 10:45:35] ptp4l[439.892]: master offset 218068457718696643 s0 freq +0 path delay 48873
[2023/1/4 10:45:36] ptp4l[440.892]: master offset 218068457718689596 s0 freq +0 path delay 48853
[2023/1/4 10:45:37] ptp4l[441.892]: master offset 218068457718675823 s0 freq +0 path delay 48853
[2023/1/4 10:45:38] ptp4l[442.892]: master offset 218068457718665063 s0 freq +0 path delay 48853
[2023/1/4 10:45:39] ptp4l[443.892]: master offset 218068457718655078 s0 freq +0 path delay 48625
[2023/1/4 10:45:40] ptp4l[444.892]: master offset 218068457718645461 s0 freq +0 path delay 48709
[2023/1/4 10:45:41] ptp4l[445.892]: master offset 218068457718634490 s0 freq +0 path delay 48853
[2023/1/4 10:45:42] ptp4l[446.892]: master offset 218068457718624327 s0 freq +0 path delay 48909
[2023/1/4 10:45:43] ptp4l[447.893]: master offset 218068457718614754 s1 freq -10146 path delay 48909
[2023/1/4 10:45:44] ptp4l[448.893]: master offset -1936 s2 freq -10341 path delay 48909
[2023/1/4 10:45:44] ptp4l[448.893]: port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
[2023/1/4 10:45:45] ptp4l[449.893]: master offset -1757 s2 freq -10325 path delay 48909
[2023/1/4 10:45:46] ptp4l[450.893]: master offset 2169 s2 freq -9930 path delay 48921
[2023/1/4 10:45:47] ptp4l[451.893]: master offset -1096 s2 freq -10258 path delay 48921
[2023/1/4 10:45:48] ptp4l[452.893]: master offset -1766 s2 freq -10327 path delay 48776
[2023/1/4 10:45:49] ptp4l[453.893]: master offset -1667 s2 freq -10318 path delay 48776
[2023/1/4 10:45:50] ptp4l[454.893]: master offset 640 s2 freq -10087 path delay 48921
[2023/1/4 10:45:51] ptp4l[455.893]: master offset -1689 s2 freq -10322 path delay 48913
[2023/1/4 10:45:52] ptp4l[456.894]: master offset 893 s2 freq -10063 path delay 48913
[2023/1/4 10:45:53] ptp4l[457.894]: master offset -91 s2 freq -10161 path delay 48913
[2023/1/4 10:45:54] ptp4l[458.894]: master offset -2528 s2 freq -10407 path delay 48923

But with hardware time stamp, i'm not able to sync the clock

[2023/1/4 10:46:43] root@MX6-LRM:~# ptp4l -i eth0 -P -m -H -s
[2023/1/4 10:46:43] ptp4l[507.263]: selected /dev/ptp0 as PTP clock
[2023/1/4 10:46:43] ptp4l[507.266]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE
[2023/1/4 10:46:43] ptp4l[507.267]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
[2023/1/4 10:46:43] ptp4l[507.891]: port 1: new foreign master 000f32.fffe.313137-1
[2023/1/4 10:46:45] ptp4l[509.894]: selected best master clock 000f32.fffe.313137
[2023/1/4 10:46:45] ptp4l[509.894]: updating UTC offset to 37
[2023/1/4 10:46:45] ptp4l[509.894]: port 1: LISTENING to UNCALIBRATED on RS_SLAVE
[2023/1/4 10:46:46] ptp4l[510.905]: master offset 218067921569937310 s0 freq +0 path delay -35044
[2023/1/4 10:46:47] ptp4l[511.905]: master offset 218067920569935680 s0 freq +0 path delay -35294
[2023/1/4 10:46:48] ptp4l[512.905]: master offset 218067919569939790 s0 freq +0 path delay -35044
[2023/1/4 10:46:49] ptp4l[513.905]: master offset 218067918569932920 s0 freq +0 path delay -34614
[2023/1/4 10:46:50] ptp4l[514.905]: master offset 218067917569930178 s0 freq +0 path delay -34352
[2023/1/4 10:46:51] ptp4l[515.905]: master offset 218067916569934002 s0 freq +0 path delay -34656
[2023/1/4 10:46:52] ptp4l[516.905]: master offset 218067915569936026 s0 freq +0 path delay -34960
[2023/1/4 10:46:53] ptp4l[517.906]: master offset 218067914568933642 s0 freq +0 path delay -34656
[2023/1/4 10:46:54] ptp4l[518.906]: master offset 218067913568930802 s0 freq +0 path delay -34656
[2023/1/4 10:46:55] ptp4l[519.906]: master offset 218067912568934296 s0 freq +0 path delay -34630
[2023/1/4 10:46:56] ptp4l[520.906]: master offset 218067911568937214 s0 freq +0 path delay -34268
[2023/1/4 10:46:57] ptp4l[521.906]: master offset 218067910568930534 s0 freq +0 path delay -34268
[2023/1/4 10:46:58] ptp4l[522.906]: master offset 218067909568934774 s0 freq +0 path delay -34268
[2023/1/4 10:46:59] ptp4l[523.906]: master offset 218067908568939856 s0 freq +0 path delay -34630
[2023/1/4 10:47:00] ptp4l[524.906]: master offset 218067907568936480 s0 freq +0 path delay -34934
[2023/1/4 10:47:01] ptp4l[525.906]: master offset 218067906568939984 s0 freq +0 path delay -34438
[2023/1/4 10:47:02] ptp4l[526.907]: master offset 218067905567939944 s0 freq +0 path delay -34438
[2023/1/4 10:47:03] ptp4l[527.907]: master offset 218067904567930744 s0 freq +0 path delay -34438
[2023/1/4 10:47:04] ptp4l[528.907]: master offset 218067903567934044 s0 freq +0 path delay -34818
[2023/1/4 10:47:05] ptp4l[529.907]: master offset 218067902567936254 s0 freq +0 path delay -34348
[2023/1/4 10:47:06] ptp4l[530.907]: master offset 218067901567935132 s0 freq +0 path delay -34866
[2023/1/4 10:47:07] ptp4l[531.907]: master offset 218067900567934022 s0 freq +0 path delay -34556
[2023/1/4 10:47:08] ptp4l[532.907]: master offset 218067899567937782 s0 freq +0 path delay -34556

And I get the register ENET_ACVR(218_8404h),ENET_ATSTMP(218_8418h) value is always 0.
So how can I set and the PTP4l will run ok?
Thanks!

 

Labels (2)
0 Kudos
1 Reply

274 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

Yes, you can run the ptp4l with ENET_ATSPMP is zero, but you better try the latest bsp 5.15.71v where a lot of bugs has fixed since version 4.1.15:

https://www.nxp.com/design/software/embedded-software/i-mx-software/embedded-linux-for-i-mx-applicat...

 

Regards

0 Kudos