Skip to main content
Graduate
August 7, 2025
Solved

STM32H7 PTP NETXDUO

  • August 7, 2025
  • 6 replies
  • 1318 views

Hello,

 

I would like to know if this PTP client example from Netxduo can be used on an STM32H723 MCU: 

https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/netx-duo/netx-duo-ptp-client/chapter1.md

 

Another MCU, the STM32N6 has this implementation here: https://github.com/STMicroelectronics/STM32CubeN6/tree/main/Projects/NUCLEO-N657X0-Q/Applications/NetXDuo/Nx_PTP_Client

 

I wanted to confirm if the STM32H723 does support that example because i am looking at https://github.com/STMicroelectronics/x-cube-azrtos-h7/tree/main/Projects and I cannot find any ...

 

Thank you.

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

    Hello @LCE,
    The STM32 ETH PTP setup can be found in the 
    MX_ETH_Init(...) function. Inside, you will find a PTP struct declaration used to configure the feature, followed by a call to ETH_PTP_SetConfig(...) to apply the configuration to the appropriate registers. For clock updates and addend changes, there are dedicated functions such as HAL_ETH_PTP_AddTimeOffset(...) and HAL_ETH_PTP_AddendUpdate(...).

    Best regards,

    6 replies

    Technical Moderator
    August 8, 2025

    Hello @FB__1, and welcome to ST Community,

    Currently, the only available PTP example is, as you mentioned, for the STM32N6. Regarding your question about STM32H723 support, I cannot confirm it will work immediately. However, since the STM32H723 does support PTP, with some adjustments, you should be able to adapt the example to run on that MCU. Additionally, I recommend searching the community for other threads on the same topic.

    Best regards,

     

    FB__1Author
    Graduate
    August 9, 2025

    As another option, will Zephyr RTOS on the STM32H723 work out of the box for the PTP example ?

    https://docs.zephyrproject.org/latest/boards/st/nucleo_h723zg/doc/index.html


    Thank you.

    Super User
    August 10, 2025
    Technical Moderator
    August 18, 2025

    Hello @FB__1 ,

    The adjustments typically involve porting hardware-specific configurations, such as clock settings for PTP, Ethernet peripheral pinout configuration, and adapting the NetXDuo middleware to the STM32H7. I recommend reviewing the STM32H7 reference manual along with the NetXDuo PTP guide for detailed information.

    Best regards,

    Graduate II
    August 18, 2025

    Interesting!

     

    @STackPointer64 , could you please show us where to find the following:

    - STM32 ETH PTP setup (including HW offload if used)

    - PTP register writing (clock update, addend change)

     

    @FB__1 

    - Do you use PTP via UDP or "pure" Ethernet? If Ethernet, does it use HW offload?

    - How is PTP sync quality?

    - How is sync quality if ethernet traffic goes up?

    Technical Moderator
    August 22, 2025

    Hello @LCE,
    The STM32 ETH PTP setup can be found in the 
    MX_ETH_Init(...) function. Inside, you will find a PTP struct declaration used to configure the feature, followed by a call to ETH_PTP_SetConfig(...) to apply the configuration to the appropriate registers. For clock updates and addend changes, there are dedicated functions such as HAL_ETH_PTP_AddTimeOffset(...) and HAL_ETH_PTP_AddendUpdate(...).

    Best regards,

    Graduate II
    August 25, 2025

    N6 ETH HAL driver:

     -@- The PTP offload feature is not supported in this driver.

     

    What a pity. :(

    The HW feature that was never used anywhere...

    BTW, as many users (F4, F7, H7) have been asking for PTP examples for years, it almost feels like a "low kick" (nicely said) that ST is sneaking it into N6.

    Super User
    August 25, 2025

    So have you checked zephyr or STLinux?

     

    Graduate II
    August 26, 2025

    Yes, some time ago.

    But since my own experiments with PTP offload (sync quality decreasing with ethernet traffic, compared to stable PTPd) I skipped it.

    Visitor II
    October 11, 2025

    I read the code of STM32N6,netxduo ptpclient.c and found the ptp implentmation is base on software clock.

    Not base on ethernet ptp registers.

    FB__1Author
    Graduate
    October 12, 2025

    I am satisfied with the NETXDUO PTP performance. I got very good precision below 1usec with the NETXDUO PTP client on the STM32N6 and ptp4l.

    I used :

    //PPS control register:
    TRGTMODSEL[1:0] = 00b -> Interrupt-only mode
    PPSEN0 = 1 to enable PPS channel 0