2024-07-15 03:28 PM - edited 2024-07-15 03:34 PM
Hi,
I noticed there is no Stm32H7 Ethernet PTP example available anywhere. The ST support for PTP is very poor. I wanted to make an example and get it out for review to bring more visibility to the issues with PTP and see if I could solve some issues which are bugging this implementation.
Link: https://github.com/chris1seto/Stm32H723NucleoPtpExample
ST, could you please comment on the issues covered in this example? For any others, if you have solutions to any of these problems, could you fork/PR to add fixes or just post here so I can include fixes?
Issues are detailed in the readme, but I copy and pasted them below:
"
"
2024-07-16 07:48 AM
I believe I have found an issue with the tail pointer management in the HAL, which affects this project, where I set the tail pointer to zero during descriptor processing because it wasn't working with the original tail pointer management code and it wasn't clear to me what purpose the tail pointer served. Now I think I understand why the tail pointer is necessary.
See:
https://github.com/STMicroelectronics/stm32h7xx_hal_driver/issues/65
https://github.com/STMicroelectronics/stm32h7xx_hal_driver/issues/65
ST has confirmed that the tail pointer is an *absolute address* (NOT an offset, as indicated by the ref manual): https://community.st.com/t5/stm32-mcus-products/stm32h723-ethernet-dma-tail-pointer/m-p/698263/highlight/true#M255294
2024-07-16 08:22 AM
Hello @chris1seto ,
I would like to thank you for your continuous and constructive feedback.
the issues that you raised on GitHub will be treated and it seems that your description of the issue seems to be convenient for me.
just want to know now if the issue that you are raising in this thread are currently under investigation in
Ethernet PTP timestamp retrieval is entirely wrong · Issue #63 · STMicroelectronics/stm32h7xx_hal_driver (github.com)
and
Ethernet tail pointer setup is incorrect, and tail pointer management does not work with timestamping enabled · Issue #65 · STMicroelectronics/stm32h7xx_hal_driver (github.com)
which are related to the first two points in this thread.
regarding:
-The clock state oscillates between PTP_UNCALIBRATED and PTP_SLAVE I don't get how this is Happening, and I think it would be difficult to reproduce.
-Optimization: RX descriptor use could be less intensive if the Eth mac only timestamped PTP packets
to try and test this first of all do you confirm that the current example published on GitHub is working to try and reproduce the issue on it? and to wrap this out you need to optimize the timestamping functionality to only timestamp PTP packets.
Regards
2024-07-16 08:35 AM
Hi @STea , thanks for the response.
For the issue about the clock oscillating between uncalibrated and slave, don't worry about that. I'll figure that one out. My custom Stm32H723 board *isn't* doing this, so there is some setup which does work correctly.
The other issue though, about *only* timestamping PTP packets rather than relying on TSENALL, I'd like your help with. I can't seem to get a combination of settings here which work and don't cause the FBE bit to be set. I don't even understand why there'd be a bus error occurring in the first place, since, the timestamping storing and retrieval does work with my patch. There's very little documentation which describes how this works, so I'm at somewhat of a dead end.
Could you modify the example so that rather than TSENALL, the Eth mac is configured to only timestamp PTP packets which would be relevant to a PTP slave?
Thank you,
2024-08-20 08:06 AM
@STea It's been over a month, any updates? I still need help on these issues.
2024-08-21 02:07 AM
Hello @chris1seto ,
Sorry for the delayed response. I confirm the behavior you are describing.
this issue is tracked internally (Ticket number 189048 for internal usage only)
I will try to update you on this issue as soon as possible.
Regards
2024-09-10 02:50 PM
@STea Any updates on this? This issue is actively blocking my progress on a commercial project. We're at the almost 2 month point after I wrote the example to demonstrate this issue.
2024-09-16 02:12 AM
Hello @chris1seto ,
We are still actively investigating this issue internally. I'll update you as soon as possible sorry again for the delay. hope this will be answered soon.
Regards