Skip to content

Documentation/stm32f4: document the Ethernet PTP support. - #20206

Merged
acassis merged 1 commit into
apache:masterfrom
daniel-p-carvalho:docs/stm32-eth-ptp
Sep 20, 2026
Merged

acassis merged 1 commit into
apache:masterfrom
daniel-p-carvalho:docs/stm32-eth-ptp

Conversation

@daniel-p-carvalho

Copy link
Copy Markdown
Contributor

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/ptp0 PTP hardware clock in #20180. This PR adds an "Ethernet" section to Documentation/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.eth and the pin maps:

  • The time counter of the MAC (32-bit seconds and 31-bit sub-second parts, clocked from SYSCLK, rate adjustable by up to +/- 50 %) and why a PTP daemon needs it.
  • The options 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 the GPIO_ETH_PPS_OUT that the board defines in its board.h) and CONFIG_STM32_ETH_PTP_RTC_HIRES.
  • The /dev/ptp0 clock: 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.
  • That the timestamps of received packets are values of the MAC counter and not of CLOCK_REALTIME, so a program has to compare them with /dev/ptp0. It shows how to start ptpd that way (ptpd -H -p /dev/ptp0 -i eth0) and a configuration that enables everything.
  • That the driver stamps received packets only.

Transmit timestamps are not described here because they are not in master yet; the section will get them when they are.

Impact

Documentation only, no code change. Only the page platforms/arm/stm32f4 changes.

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.sh passes.

The statements were checked by reading the driver and the pin maps. The configuration example and the ptpd command line were not built or run as written here; the driver and ptpd were run on an STM32F4 board with a similar configuration.

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
@github-actions github-actions Bot added Area: Documentation Improvements or additions to documentation Size: S The size of the change in this PR is small labels Sep 20, 2026
@acassis
acassis merged commit d6d06c7 into apache:master Sep 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Documentation Improvements or additions to documentation Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants