This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5706: HSR/PTP timeout

Part Number: AM5706
Other Parts Discussed in Thread: AM5718

Tool/software: Linux

We are not able to make PTP working with HSR PRU FW.

SDK: Linux RT SDK 5.02

PHY: dp83822

Here are the steps:

1. Configure  HSR using this script (eth1 and eth2 are used):

ETH1="${1:-eth1}"
ETH2="${2:-eth2}"
IP="${3:-192.168.33.187}"

ifconfig ${ETH1} 0.0.0.0 down
ifconfig ${ETH2} 0.0.0.0 down
ifconfig ${ETH1} hw ether ${MAC}
ifconfig ${ETH2} hw ether ${MAC}
ethtool -K ${ETH1} hsr-rx-offload on
ethtool -K ${ETH2} hsr-rx-offload on
ifconfig ${ETH1} up
ifconfig ${ETH2} up
ip link add name hsr0 type hsr slave1 ${ETH1} slave2 ${ETH2} supervision 45 version 1
ethtool -C ${ETH1} rx-usecs 200
ethtool -C ${ETH2} rx-usecs 200
ethtool -C ${ETH1} adaptive-rx on
ethtool -C ${ETH2} adaptive-rx on
ifconfig hsr0 ${IP}

Observation: Able to perform HSR ping tests with other HSR devices (IDK, PC with redbox).

2. Connect a PTP master clock source using a redbox into the HSR ring. This PTP master clock is successfully used to sync our HW using GMAC and PRUETH interfaces.

3. Run PTP daemon using the command:

root@am57xx-evm:~# ptp4l -2 -P -f oc-hsr0.cfg -s -m
ptp4l[148.290]: selected /dev/ptp1 as PTP clock
ptp4l[148.350]: port 1 (eth1): INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[148.353]: port 0 (/var/run/ptp4l): INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[155.648]: port 1: announce timeout
ptp4l[155.651]: selected best master clock 0e7e20.fffe.41037c
ptp4l[162.039]: port 1: announce timeout
ptp4l[162.041]: selected best master clock 0e7e20.fffe.41037c
ptp4l[169.285]: port 1: announce timeout
ptp4l[169.287]: selected best master clock 0e7e20.fffe.41037c
ptp4l[176.997]: port 1: announce timeout
ptp4l[176.999]: selected best master clock 0e7e20.fffe.41037c
ptp4l[184.934]: port 1: announce timeout
ptp4l[184.936]: selected best master clock 0e7e20.fffe.41037c
ptp4l[191.462]: port 1: announce timeout
ptp4l[191.464]: selected best master clock 0e7e20.fffe.41037c
ptp4l[199.121]: port 1: announce timeout
ptp4l[199.122]: selected best master clock 0e7e20.fffe.41037c

root@am57xx-evm:~# cat oc-hsr0.cfg
[global]
tx_timestamp_timeout 10
logMinPdelayReqInterval -3
logSyncInterval -3
twoStepFlag 1
summary_interval 0
[eth1]
egressLatency 726
ingressLatency 186

Observation: Repeated "port 1: announce timeout" messages logged by PTP daemon.

  • Tried same test on AM5718 IDK. Same observation that PTP does not work on HSR interface.

    - Used eth2 and eth3 in case of AM5718 IDK
    - contents of oc-hsr0.cfg:
    smc8series@ubuntu:~$ ssh root@10.3.33.133
    root@am57xx-evm:~# cat oc-hsr0.cfg
    [global]
    tx_timestamp_timeout 10
    logMinPdelayReqInterval -3
    logSyncInterval -3
    twoStepFlag 1
    summary_interval 0
    [eth2]
    egressLatency 726
    ingressLatency 186
  • Hello Paritosh,

    Our HSR/PRP expert is out of office at the moment, so support will be limited until then.

    Here are two parts of the TI documentation which may be helpful: Industrial Protocols > HSR_PRP and Industrial Protocols > PTP

    Please take a look at both of them, since there may be non-overlapping PTP information in the two parts.

    Regards,

    Nick

  • With a CFG file below, PTP seems to be working with HSR, as seen from offset in ptp4l log and testptp tool. But, there are confusing errors reported by the ptp4l:


    root@am57xx-evm:~# cat hsr-oc-eth1-eth2.cfg
    [global]
    sanity_freq_limit 0
    step_threshold 0.00002
    tx_timestamp_timeout 20

    domainNumber 0
    priority1 128
    priority2 128
    slaveOnly 1

    twoStepFlag 1
    summary_interval 0
    doubly_attached_clock 1

    [hsr0]
    redundancy 1
    delay_mechanism P2P
    network_transport L2

    [eth1]
    redundancy 1
    redundancy_master_interface hsr0
    redundancy_slave_number 1

    logAnnounceInterval 0
    logSyncInterval 0
    logMinPdelayReqInterval 0
    announceReceiptTimeout 3
    syncReceiptTimeout 2

    delay_mechanism P2P
    network_transport L2
    egressLatency 726
    ingressLatency 186
    fault_reset_interval 0

    [eth2]
    redundancy 1
    redundancy_master_interface hsr0
    redundancy_slave_number 2

    logAnnounceInterval 0
    logSyncInterval 0
    logMinPdelayReqInterval 0
    announceReceiptTimeout 3
    syncReceiptTimeout 2

    delay_mechanism P2P
    network_transport L2
    egressLatency 726
    ingressLatency 186
    fault_reset_interval 0



    ptp4l log:

    ptp4l[1086.912]: receive msg ERROR: in_ports=0x00
    ptp4l[1086.913]: Msg 2: no red port found
    ptp4l[1086.913]: hsr0: No red dispatch port
    ptp4l[1086.913]: receive msg ERROR: in_ports=0x00
    ptp4l[1086.913]: Msg 2: no red port found
    ptp4l[1086.913]: hsr0: No red dispatch port
    ptp4l[1086.938]: master offset 11 s2 freq -727 path delay 109
    ptp4l[1086.938]: master offset 16 s2 freq -718 path delay 109
    ptp4l[1087.912]: receive msg ERROR: in_ports=0x00
    ptp4l[1087.913]: Msg 2: no red port found
    ptp4l[1087.913]: hsr0: No red dispatch port
    ptp4l[1087.913]: receive msg ERROR: in_ports=0x00
    ptp4l[1087.913]: Msg 2: no red port found
    ptp4l[1087.913]: hsr0: No red dispatch port
    ptp4l[1087.938]: master offset -46 s2 freq -776 path delay 109
    ptp4l[1087.938]: master offset -41 s2 freq -784 path delay 109

    What is causing these errors ? Is there a config error ?
  • Hello Paritosh,

    FYI, the HSR/PRP expert will be back next week.

    Regards,
    Nick
  • Paritosh,

    Is your last test on the IDK or on your custom board? Could you please provide the ptp4l command that you are using to start the daemon?

    Thanks.
  • The last test and observations are same on our custom board and IDK both:

    Here is the ptp4l command:

    ptp4l -2 -P -f hsr-oc-eth1-eth2.cfg -s -m
  • Paritosh,

    We've made several improvements to HSR/PTP in our latest release, v5.03. We would recommend that you switch to that release and you should find that this test works in that release. In fact, we've added specific documentation for it here:

    software-dl.ti.com/.../Industrial_Protocols_PTP.html

    Please give that release a try and let us know if you have any problems with it.

    Thank you.