Skip to main content
Graduate II
July 4, 2024
Solved

PTP(d) vs. PHY, master problems

  • July 4, 2024
  • 3 replies
  • 1526 views

Heyho,

any PTP specialists around here?

I'm currently working with a new board using the H733 with a KSZ8863RLL ethernet PHY, and I have a strange PTP synchronization problem:

If a board with a KSZ8863 is the PTP master, no slave can synchronize.
The slave's filtered "offset from master" is always increasing, whereas when sync is working this value is getting closer to 0.

As soon as the master is one of my other boards using a LAN8742 PHY (H735, H723, F767), all boards sync perfectly.

I have checked and compared the PTP messages from the master in Wireshark, and I can see no difference between the masters' messages.
The thing is that this is hard to debug on that level, as we're talking about timings < 100µs.

I have checked all clocks, settings, played with the filters and the servo, no chance.

What could be the difference between the PHYs which affects the PTP master output?

Thanks in advance.

    This topic has been closed for replies.
    Best answer by LCE

    Got it! :smiling_face_with_smiling_eyes:

    So the KSZ8863 takes a little longer to transmit data, compared to the LAN8742, about +15 µs.

    Combine this with a too low maximum addend adjust value in PTPd and it will never sync.

    So the solution was to use a higher maximum addend adjust value.

    So simple... and I've been through the complete PTPd. At least I know it much better than before now...

    3 replies

    LCEAuthor
    Graduate II
    July 8, 2024

    Anybody having at least a good guess, at least with some PTPd / lwIP or KSZ8863 experience?

    Super User
    July 8, 2024

    There should be some difference. Maybe, KZ adds some trailers to the packets that are invisible in wireshark but break the receiving side.

     

    LCEAuthor
    Graduate II
    July 9, 2024

    Thanks for the reply!

    Well, it shouldn't add any bytes or so in simple PHY state.

    The funny thing is, that the receiving part is probably not the problem, because a PTP slave with KSZ syncs perfectly to a PTP master with LAN8742.

    But when the PTP master is using the KSZ, then the slaves can't sync, so I assume this should be seen in Wireshark.

    LCEAuthorAnswer
    Graduate II
    July 18, 2024

    Got it! :smiling_face_with_smiling_eyes:

    So the KSZ8863 takes a little longer to transmit data, compared to the LAN8742, about +15 µs.

    Combine this with a too low maximum addend adjust value in PTPd and it will never sync.

    So the solution was to use a higher maximum addend adjust value.

    So simple... and I've been through the complete PTPd. At least I know it much better than before now...