Documentation/stm32f4: document the Ethernet PTP support. - #20206
Merged
Merged
Conversation
The STM32F4 page did not say anything about the Ethernet MAC. - Describe the time counter of the MAC and the options that enable the timestamping of received packets, the pulse-per-second output and the use of the counter as a high-resolution RTC. - Describe the /dev/ptp0 clock that the driver registers: the operations it offers, the numbering, and that the timestamps of the received packets are values of the MAC counter and not of CLOCK_REALTIME, so they have to be compared with /dev/ptp0. - Show how to start ptpd with them and a configuration that enables everything above. - Say that the driver does not timestamp transmitted packets. Signed-off-by: Daniel P. Carvalho <danieloak@gmail.com> Assisted-by: Claude:claude-sonnet-5
daniel-p-carvalho
requested review from
cederom and
raiden00pl
as code owners
September 20, 2026 16:51
simbit18
approved these changes
Sep 20, 2026
cederom
approved these changes
Sep 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The STM32F4 platform page has no section about the Ethernet MAC, so nothing tells a user how to use the PTP support that the legacy STM32 Ethernet driver has, and the driver got a
/dev/ptp0PTP hardware clock in #20180. This PR adds an "Ethernet" section toDocumentation/platforms/arm/stm32f4/index.rst. It changes documentation only.The section describes, checked against
arch/arm/src/common/stm32/stm32_eth_m3m4_v1.c,Kconfig.ethand the pin maps:SYSCLK, rate adjustable by up to +/- 50 %) and why a PTP daemon needs it.CONFIG_STM32_ETH_PTP,CONFIG_STM32_ETH_ENHANCEDDESC,CONFIG_STM32_ETH_TIMESTAMP_RX,CONFIG_STM32_ETH_PTP_GPIO(with the two possible pins on the STM32F40xxx and STM32F42xxx parts and theGPIO_ETH_PPS_OUTthat the board defines in itsboard.h) andCONFIG_STM32_ETH_PTP_RTC_HIRES./dev/ptp0clock: the numbering (the number of the Ethernet interface), the operations it offers (time, resolution, frequency, phase) and the one it does not (cross timestamp), with a link to the PTP clock driver page.CLOCK_REALTIME, so a program has to compare them with/dev/ptp0. It shows how to startptpdthat way (ptpd -H -p /dev/ptp0 -i eth0) and a configuration that enables everything.Transmit timestamps are not described here because they are not in
masteryet; the section will get them when they are.Impact
Documentation only, no code change. Only the page
platforms/arm/stm32f4changes.Testing
Built the documentation with Sphinx 6.2.1 and the packages of
Documentation/Pipfile, without-W: the build succeeds, the new section renders and the link to the PTP clock driver page resolves. None of the 19 warnings (duplicate C declarations in other pages) is from this file../tools/checkpatch.shpasses.The statements were checked by reading the driver and the pin maps. The configuration example and the
ptpdcommand line were not built or run as written here; the driver andptpdwere run on an STM32F4 board with a similar configuration.