PROCESSOR-SDK-AM64X: AM64x PTP related question

Part Number: PROCESSOR-SDK-AM64X

Tool/software:

Hi,
A question arose when I was trying out the TSN PTP feature on TI AM64x EVM.
On the grandmaster:
phc2sys -a -rr --transportSpecific=1 &
ptp4l -P -2 -H -i eth1 -f /root/ptp/gPTP.cfg --step_threshold=1 -m -q -p /dev/ptp0

On the slave:
phc2sys -a -r --transportSpecific=1 &
ptp4l -P -2 -H -i eth0 -s -f /root/ptp/gPTP.cfg --step_threshold=1 -m -q -p /dev/ptp0
ptp4l[235.449]: selected /dev/ptp0 as PTP clock
ptp4l[235.490]: port 1 (eth0): INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[235.490]: port 0 (/var/run/ptp4l): INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[235.490]: port 0 (/var/run/ptp4lro): INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[238.840]: selected local clock 641c10.fffe.24678f as best master
ptp4l[239.178]: port 1 (eth0): new foreign master 70ff76.fffe.1fe2de-1
ptp4l[241.178]: selected best master clock 70ff76.fffe.1fe2de
ptp4l[241.178]: port 1 (eth0): LISTENING to UNCALIBRATED on RS_SLAVE
ptp4l[241.820]: port 1 (eth0): UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
ptp4l[242.445]: rms 877146033535543168 max 1754292067071086848 freq  +3697 +/- 1944 delay    35 +/-   0
ptp4l[243.446]: rms  779 max 1127 freq  +6797 +/- 883 delay    34 +/-   0
ptp4l[244.446]: rms 1088 max 1144 freq  +8516 +/- 295 delay    34 +/-   0
ptp4l[245.447]: rms  685 max  999 freq  +8875 +/- 130 delay    34 +/-   0
ptp4l[246.447]: rms  137 max  222 freq  +8148 +/- 180 delay    34 +/-   0
ptp4l[247.448]: rms  390 max  432 freq  +7461 +/- 182 delay    34 +/-   0
ptp4l[248.448]: rms  365 max  442 freq  +7078 +/-  31 delay    34 +/-   0
ptp4l[249.449]: rms  139 max  236 freq  +7160 +/-  69 delay    34 +/-   0
ptp4l[250.449]: rms   67 max  111 freq  +7196 +/-  68 delay    34 +/-   0
ptp4l[251.450]: rms  444 max  539 freq  +7995 +/- 323 delay    34 +/-   0
ptp4l[252.450]: rms  580 max  744 freq  +8773 +/- 122 delay    34 +/-   0
ptp4l[253.451]: rms  266 max  365 freq  +7848 +/- 242 delay    34 +/-   0
ptp4l[254.453]: rms  170 max  235 freq  +7718 +/- 108 delay    35 +/-   0
ptp4l[255.453]: rms  126 max  219 freq  +7842 +/- 177 delay    35 +/-   0
ptp4l[256.453]: rms  227 max  255 freq  +8293 +/-  67 delay    35 +/-   0
ptp4l[257.454]: rms  497 max  762 freq  +8901 +/- 409 delay    35 +/-   0
ptp4l[258.454]: rms  418 max  763 freq  +9271 +/- 261 delay    35 +/-   0
ptp4l[259.454]: rms  383 max  475 freq  +8247 +/- 250 delay    36 +/-   0
ptp4l[260.455]: rms  640 max  765 freq  +7331 +/- 227 delay    35 +/-   0
ptp4l[261.455]: rms  260 max  403 freq  +7383 +/-  61 delay    35 +/-   0
ptp4l[262.456]: rms  117 max  183 freq  +7405 +/-  69 delay    35 +/-   0
ptp4l[263.456]: rms  186 max  264 freq  +7147 +/-  50 delay    35 +/-   0
ptp4l[264.457]: rms  389 max  494 freq  +7932 +/- 327 delay    35 +/-   0
ptp4l[265.457]: rms  185 max  416 freq  +7954 +/- 151 delay    35 +/-   0
ptp4l[266.458]: rms  314 max  446 freq  +8382 +/- 161 delay    35 +/-   0
ptp4l[267.458]: rms  148 max  246 freq  +8174 +/- 203 delay    35 +/-   0
ptp4l[268.459]: rms  179 max  357 freq  +7949 +/- 218 delay    35 +/-   0
ptp4l[269.460]: rms  468 max  594 freq  +7174 +/- 265 delay    35 +/-   0
ptp4l[270.462]: rms  249 max  381 freq  +7101 +/- 126 delay    34 +/-   0
ptp4l[271.462]: rms  244 max  301 freq  +7764 +/- 124 delay    34 +/-   0
ptp4l[272.463]: rms  182 max  316 freq  +7698 +/- 233 delay    34 +/-   0
ptp4l[273.463]: rms  193 max  270 freq  +7259 +/-  79 delay    35 +/-   0
ptp4l[274.464]: rms  204 max  314 freq  +7091 +/- 162 delay    35 +/-   0
ptp4l[275.464]: rms  300 max  339 freq  +6654 +/-  50 delay    35 +/-   0
ptp4l[276.465]: rms  151 max  235 freq  +6691 +/- 125 delay    35 +/-   0
ptp4l[277.465]: rms   97 max  185 freq  +6700 +/- 112 delay    35 +/-   0
ptp4l[278.466]: rms  111 max  164 freq  +6537 +/-  42 delay    34 +/-   0
ptp4l[279.466]: rms  129 max  194 freq  +6849 +/-  97 delay    34 +/-   0
ptp4l[280.466]: rms  118 max  250 freq  +6749 +/- 165 delay    35 +/-   0
ptp4l[281.467]: rms  414 max  457 freq  +7531 +/- 187 delay    35 +/-   0
ptp4l[282.468]: rms  294 max  432 freq  +7747 +/-  59 delay    35 +/-   0
ptp4l[283.468]: rms  213 max  383 freq  +7342 +/- 287 delay    35 +/-   0
ptp4l[284.469]: rms  340 max  397 freq  +6726 +/-  58 delay    36 +/-   0

Qustion:
Does the rms offset between grandmaster and slave look reasonable? If not, how can we fix it?

  • Hello Matt, 

    1. What Linux SDK version are you using?

    2. Are both your grandmaster and follower device a TI AM64x EVM?

    3. What are the contents of your gPTP.cfg file?

    Does the rms offset between grandmaster and slave look reasonable? If not, how can we fix it?

    From tests I've ran in the past the rms offset should typically be in the double-digit ns level. So, we need to figure out what are the differences between your test setup and mine.

    -Daolin

  • Hi Daolin,

    For #1, #2:

    Yes, both the PTP grandmaster and slave are running on TI AM64x EVM, with the default SDK on SD card.

    root@am64xx-evm:~/# uname -a
    Linux am64xx-evm 6.6.58-ti-01497-ga7758da17c28-dirty #1 SMP PREEMPT Wed Nov 27 13:23:15 UTC 2024 aarch64 GNU/Linux

    For #3: The gPTP.cfg was taken from https://github.com/richardcochran/linuxptp/blob/master/configs/gPTP.cfg (as suggested by some TI instruction):

    root@am64xx-evm:~/# cat gPTP.cfg
    #
    # 802.1AS example configuration containing those attributes which
    # differ from the defaults.  See the file, default.cfg, for the
    # complete list of available options.
    #
    [global]
    gmCapable               1
    priority1               248
    priority2               248
    logAnnounceInterval     0
    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

    # Add these lines for the TI PHY:
    ingressLatency 88
    egressLatency  288

  • Hi Matt, 

    root@am64xx-evm:~/# uname -a
    Linux am64xx-evm 6.6.58-ti-01497-ga7758da17c28-dirty #1 SMP PREEMPT Wed Nov 27 13:23:15 UTC 2024 aarch64 GNU/Linux

    Any particular reason for using non-RT Linux vs RT Linux? (I noticed you're not using PREEMPT_RT)

    priority1               248

    Can you try configuring "priority1" in your gPTP.cfg to be "100" for the grandmaster and "240" for the follower?

    -Daolin

  • Hi Daolin,

    I used non-RT Linux because that is on the TI AM64x EVM SD card and the instructions I found online do not seem to mention to use RT Linux for TSN features.

    Here is the output on the slave side after changing the gPTP.cfg as you suggested:

    ptp4l[378.503]: selected /dev/ptp0 as PTP clock
    ptp4l[378.554]: port 1 (eth0): INITIALIZING to LISTENING on INIT_COMPLETE
    ptp4l[378.554]: port 0 (/var/run/ptp4l): INITIALIZING to LISTENING on INIT_COMPLETE
    ptp4l[378.554]: port 0 (/var/run/ptp4lro): INITIALIZING to LISTENING on INIT_COMPLETE
    ptp4l[381.879]: port 1 (eth0): new foreign master 70ff76.fffe.1fe2de-1
    ptp4l[381.907]: selected local clock 641c10.fffe.24678f as best master
    ptp4l[383.879]: selected best master clock 70ff76.fffe.1fe2de
    ptp4l[383.879]: port 1 (eth0): LISTENING to UNCALIBRATED on RS_SLAVE
    ptp4l[384.846]: port 1 (eth0): UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
    ptp4l[385.473]: rms 38884 max 77824 freq  +4611 +/- 2133 delay    33 +/-   0
    ptp4l[386.473]: rms 1090 max 1413 freq  +7261 +/- 796 delay    33 +/-   0
    ptp4l[387.474]: rms 1099 max 1424 freq  +8580 +/- 132 delay    33 +/-   0
    ptp4l[388.474]: rms  512 max  641 freq  +8553 +/- 164 delay    33 +/-   0
    ptp4l[389.475]: rms  291 max  445 freq  +7674 +/- 272 delay    33 +/-   0
    ptp4l[390.475]: rms  239 max  371 freq  +7523 +/- 244 delay    33 +/-   0
    ptp4l[391.476]: rms  263 max  384 freq  +7934 +/- 319 delay    33 +/-   0
    ptp4l[392.476]: rms  357 max  463 freq  +8484 +/- 190 delay    33 +/-   0
    ptp4l[393.477]: rms  256 max  416 freq  +8657 +/- 119 delay    33 +/-   0
    ptp4l[394.478]: rms  230 max  474 freq  +8724 +/- 251 delay    33 +/-   0
    ptp4l[395.478]: rms  481 max  619 freq  +9525 +/- 100 delay    33 +/-   0
    ptp4l[396.479]: rms  116 max  228 freq  +9204 +/- 140 delay    33 +/-   0
    ptp4l[397.479]: rms  145 max  263 freq  +9365 +/- 132 delay    33 +/-   0
    ptp4l[398.480]: rms  205 max  332 freq  +9215 +/- 289 delay    33 +/-   0
    ptp4l[399.481]: rms  173 max  295 freq  +9264 +/- 242 delay    33 +/-   0
    ptp4l[400.481]: rms  223 max  277 freq  +9673 +/- 100 delay    33 +/-   0
    ptp4l[401.482]: rms  372 max  479 freq +10142 +/- 239 delay    33 +/-   0
    ptp4l[402.482]: rms  195 max  393 freq +10199 +/- 112 delay    34 +/-   0
    ptp4l[403.483]: rms  377 max  488 freq  +9382 +/- 253 delay    34 +/-   0
    ptp4l[404.483]: rms  348 max  454 freq  +9008 +/-  89 delay    34 +/-   0
    ptp4l[405.484]: rms  327 max  386 freq  +8710 +/- 138 delay    34 +/-   0
    ptp4l[406.484]: rms  245 max  384 freq  +9111 +/- 337 delay    34 +/-   0
    ptp4l[407.485]: rms  155 max  282 freq  +9257 +/- 172 delay    34 +/-   0
    ptp4l[408.485]: rms  402 max  541 freq  +9914 +/- 171 delay    34 +/-   0
    ptp4l[409.486]: rms  437 max  611 freq  +8859 +/- 355 delay    33 +/-   0
    ptp4l[410.486]: rms  339 max  488 freq  +8603 +/- 276 delay    33 +/-   0
    ptp4l[411.487]: rms  231 max  384 freq  +9075 +/- 278 delay    34 +/-   0
    ptp4l[412.487]: rms  125 max  168 freq  +9110 +/- 145 delay    33 +/-   0
    ptp4l[413.488]: rms  538 max  702 freq  +8104 +/- 361 delay    33 +/-   

    Any comments?

    Thank you for your help!

  • HI Daolin,

    Just checking the status of this, do you have any insights on why the rms offsets are not double digits and how to improve?

    Thank you! 

  • Hi Matt, 

    Apologies for the delay in response.

    For #1, #2:

    Yes, both the PTP grandmaster and slave are running on TI AM64x EVM, with the default SDK on SD card.

    root@am64xx-evm:~/# uname -a
    Linux am64xx-evm 6.6.58-ti-01497-ga7758da17c28-dirty #1 SMP PREEMPT Wed Nov 27 13:23:15 UTC 2024 aarch64 GNU/Linux

    Are you able to replicate the same PTP offset on SDK 11.1 (which should be kernel version 6.12.x)? 

    It might be worth checking if the RT-Linux version will also produce the same rms offsets, just as a sanity check or comparison with non-RT.

    Just to clarify, you are using CPSW Ethernet (and not ICSSG Ethernet) to test PTP?

    Here is what I found when testing on AM64x EVM1 eth0 <----> eth0 AM64x EVM2, where eth0 is CPSW Ethernet and using RT-Linux SDK 11.1. With this configuration, I see the expected 2-digit offset values.

    EVM1- Grandmaster

    root@am64xx-evm:~# cat gPTP.cfg 
    # 802.1AS example configuration containing those attributes which
    # differ from the defaults. See the file, default.cfg, for the
    # complete list of available options.
    #
    [global]
    gmCapable 1
    priority1 100
    priority2 248
    logAnnounceInterval 0
    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
    ingressLatency 96
    egressLatency 288
    root@am64xx-evm:~# ptp4l -P -2 -H -i eth0 -f gPTP.cfg --step_threshold=1 -m -q -p /dev/ptp0     
    ptp4l[1261.577]: selected /dev/ptp0 as PTP clock
    ptp4l[1261.605]: port 1 (eth0): INITIALIZING to LISTENING on INIT_COMPLETE
    ptp4l[1261.605]: port 0 (/var/run/ptp4l): INITIALIZING to LISTENING on INIT_COMPLETE
    ptp4l[1261.606]: port 0 (/var/run/ptp4lro): INITIALIZING to LISTENING on INIT_COMPLETE
    ptp4l[1265.107]: port 1 (eth0): new foreign master 1c6349.fffe.1ad7bc-1
    ptp4l[1265.594]: port 1 (eth0): LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
    ptp4l[1265.595]: selected local clock 3408e1.fffe.80a7ad as best master
    ptp4l[1265.595]: port 1 (eth0): assuming the grand master role
    ptp4l[1267.108]: selected best master clock 1c6349.fffe.1ad7bc
    ptp4l[1267.108]: port 1 (eth0): assuming the grand master role
    ^Croot@am64xx-evm:~# uname -a
    Linux am64xx-evm 6.12.35-g563c0d3bd742 #6 SMP PREEMPT_RT Thu Aug 14 15:16:24 CDT 2025 aarch64 GNU/Lx
    root@am64xx-evm:~#

    EVM2- Follower

    root@am64xx-evm:~# cat gPTP.cfg 
    # 802.1AS example configuration containing those attributes which
    # differ from the defaults. See the file, default.cfg, for the
    # complete list of available options.
    #
    [global]
    gmCapable 1
    priority1 240
    priority2 248
    logAnnounceInterval 0
    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
    ingressLatency 96
    egressLatency 288
    
    root@am64xx-evm:~# ptp4l -P -2 -H -i eth0 -f gPTP.cfg --step_threshold=1 -m -q -p /dev/ptp0     
    ptp4l[1257.220]: selected /dev/ptp0 as PTP clock
    ptp4l[1257.251]: port 1 (eth0): INITIALIZING to LISTENING on INIT_COMPLETE
    ptp4l[1257.252]: port 0 (/var/run/ptp4l): INITIALIZING to LISTENING on INIT_COMPLETE
    ptp4l[1257.252]: port 0 (/var/run/ptp4lro): INITIALIZING to LISTENING on INIT_COMPLETE
    ptp4l[1261.220]: port 1 (eth0): LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
    ptp4l[1261.221]: selected local clock 1c6349.fffe.1ad7bc as best master
    ptp4l[1261.221]: port 1 (eth0): assuming the grand master role
    ptp4l[1262.710]: port 1 (eth0): new foreign master 3408e1.fffe.80a7ad-1
    ptp4l[1263.335]: port 1 (eth0): received SYNC without timestamp
    ptp4l[1264.210]: port 1 (eth0): received SYNC without timestamp
    ptp4l[1264.711]: selected best master clock 3408e1.fffe.80a7ad
    ptp4l[1264.711]: port 1 (eth0): MASTER to UNCALIBRATED on RS_SLAVE
    ptp4l[1265.461]: port 1 (eth0): UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
    ptp4l[1266.212]: rms 15114 max 19954 freq +16779 +/- 10396 delay  27 +/-  0
    ptp4l[1267.212]: rms 2787 max 4269 freq +7682 +/- 3785 delay  27 +/-  0
    ptp4l[1267.462]: port 1 (eth0): received SYNC without timestamp
    ptp4l[1268.338]: rms 4737 max 5028 freq  -948 +/- 1247 delay  27 +/-  0
    ptp4l[1269.339]: rms 2929 max 3924 freq -2476 +/- 139 delay  27 +/-  0
    ptp4l[1270.339]: rms 913 max 1527 freq -1504 +/- 352 delay  27 +/-  0
    ptp4l[1271.340]: rms 181 max 281 freq  -487 +/- 215 delay  27 +/-  0
    ptp4l[1272.340]: rms 282 max 303 freq  -19 +/- 66 delay  26 +/-  0
    ptp4l[1273.341]: rms 170 max 231 freq  +60 +/-  9 delay  26 +/-  0
    ptp4l[1274.342]: rms  53 max  90 freq   +2 +/- 24 delay  27 +/-  0
    ptp4l[1274.721]: port 1 (eth0): received PDELAY_REQ without timestamp
    ptp4l[1275.342]: rms  38 max  56 freq  -104 +/- 32 delay  27 +/-  0
    ptp4l[1276.343]: rms  21 max  37 freq  -116 +/- 10 delay  27 +/-  0
    ptp4l[1277.343]: rms  8 max  13 freq  -88 +/-  8 delay  27 +/-  0
    ptp4l[1278.344]: rms  11 max  14 freq  -72 +/-  5 delay  27 +/-  0
    ptp4l[1279.345]: rms  4 max  7 freq  -76 +/-  4 delay  27 +/-  0
    ptp4l[1280.345]: rms  5 max  9 freq  -85 +/-  5 delay  27 +/-  0
    ^Croot@am64xx-evm:~# uname -a
    Linux am64xx-evm 6.12.35-g563c0d3bd742 #6 SMP PREEMPT_RT Thu Aug 14 15:16:24 CDT 2025 aarch64 GNU/Lx
    root@am64xx-evm:~# 

    -Daolin

  • Hi Daolin,

    Thank you for the response. 
    I believe I tested PTP with CPSW Ethernet. I roughly followed this TI webinar presentation to set up EVM1 as a switch (without cut-through), then testing PTP with EVM1 eth1 <--> EVM2 eth0
    e2e.ti.com/.../TI-Sitara-Linux-TSN-webinar.pdf
    Please explain if you think I might be using the ICSSG Ethernet.

    I am willing to try SDK 11.1 with both non-RT kernel and RT kernel.
    Can you please point out how do I obtain both images for the SD card?

    Thank you for your help!

  • Hi Matt, 

    Apologies again for the delay in response as I was/am out of office this week.

    I am willing to try SDK 11.1 with both non-RT kernel and RT kernel.
    Can you please point out how do I obtain both images for the SD card?

    You can find the SDK 11.1 RT wic image here: https://www.ti.com/tool/de-de/download/PROCESSOR-SDK-LINUX-RT-AM64X 

    For SDK 11.1 non-RT wic image: https://www.ti.com/tool/de-de/download/PROCESSOR-SDK-LINUX-AM64X 

    I believe I tested PTP with CPSW Ethernet. I roughly followed this TI webinar presentation to set up EVM1 as a switch (without cut-through), then testing PTP with EVM1 eth1 <--> EVM2 eth0
    e2e.ti.com/.../TI-Sitara-Linux-TSN-webinar.pdf
    Please explain if you think I might be using the ICSSG Ethernet.

    The webinar assumes that you are using the TI provided wic image. Based on that and assuming you made no changes to device tree or device tree overlay, both eth0 and eth1 by default are using CPSW Ethernet. 

    -Daolin

  • Thank you, Daolin!

    I will try PTP on SDK 11.1 and let you know the results. It may take a while. Thank you.