2025-10-29 4:32 AM
Hi,
I am implementing PTP slave on bare metal H743II with firmware 1.12.1 and LwIP 2.1.2.
Timestamps for transmitted PTP datagrams can be received by implemented a callback function HAL_ETH_TxPtpCallback(). The callback is called from stm32h7xx_hal_eth.c:HAL_ETH_ReleaseTxPacket(). There was no call to HAL_ETH_ReleaseTxPacket(), so I added a call to it after calling udp_sendto().
The callback function was never called because HAL_ETH_ReleaseTxPacket() never found a packet in use with timestamp in the descriptor. I copied the timestamp handling from HAL_ETH_ReleaseTxPacket() to HAL_ETH_Transmit(). That seems to work, but is a workaround that probably conflicts with the design.
Any suggestion for a better solution is appreciated.
Solved! Go to Solution.
2025-10-29 5:03 AM
All info for H723 .. H735 family:
For TX timestamps, you have to set a flag in a TX descriptor (DESC2 |= ETH_DMATXNDESCRF_TTSE).
Then check at TX interrupt for last segment sent and if a timestamp is available (DESC3 & ETH_DMATXNDESCWBF_TTSS).
I don't know if HAL is doing that for you, I built my own ETH driver.
2025-10-29 5:03 AM
All info for H723 .. H735 family:
For TX timestamps, you have to set a flag in a TX descriptor (DESC2 |= ETH_DMATXNDESCRF_TTSE).
Then check at TX interrupt for last segment sent and if a timestamp is available (DESC3 & ETH_DMATXNDESCWBF_TTSS).
I don't know if HAL is doing that for you, I built my own ETH driver.