The Raspberry Pi Compute Module 4 (CM4) and Compute Module 5 (CM5) have hardware support for the Precision Time Protocol (PTP). This repository was a guide to how to use this to provide an accurate source of time within your local network. Based on my experience with the approach in this repository, I developed SatPulse, which provides a much better solution. This guide accordingly now links mainly to pages on the SatPulse web site.
Although the CM4/CM5 do not have an Ethernet jack, they do have an Ethernet PHY, meaning that Ethernet functionality requires only wiring up a jack. The PHY is the Broadcom BCM54210PE, which has support for PTP. Linux kernel support for this was added in 2022, as discussed in raspberrypi/linux#4151. This support has now been merged into the mainline Linux kernel.
The PTP support involves the Ethernet PHY having its own clock, called the PTP hardware clock (PHC), and being able to use this clock to timestamp incoming and outgoing network packets. This enables the CM4/CM5 to make use of PTP, but it is not by itself particularly exciting: similar functionality is available on many NICs. The exciting part is that the CM4/CM5 provides a pin that allows the PHC to be synchronized with an external pulse per second (PPS) signal. When this pin is connected to the PPS output of a GPS receiver, the CM4/CM5 can provide a highly accurate source of time for PTP within a local area network. (As far as I know, the only other inexpensive, easy way to get this functionality is using an Intel i210-T1 PCIe card.) The CM4/CM5 can also generate a PPS signal from the PHC on this pin: this makes it possible to measure the accuracy of the PHC.
There's a useful introductory blog from Jeff Geerling and also a video.
- parts needed to create a CM4/CM5-based computer
- GPS hardware: modules, boards/cards, enclosed receivers, GNSSDOs, antennas
- inexpensive network switches with PTP support
SatPulse has a setup guide. Key stages are:
- install and configure the operating system
- install SatPulse
- verify the serial connection to the GPS
- configure and run satpulsed
- configure the GPS receiver
- set up precision timing with a PHC, which covers ptp4l and chrony
This guide described setting up a time server using LinuxPTP's ts2phc program, but I now recommend using SatPulse instead.
- how to verify the GPS serial and PPS connections using only standard Linux commands
- how to configure chrony to use PPS input and hardware timestamping
- how to set up a combined PTP/NTP client on a CM4/CM5
- how to use the PTP client on Windows 10/11 with a CM4/CM5-based PTP server
- how to measure time synchronization
This shows the results from using a TAPR TICC in interval mode with two CM4 PTP slaves
- both slaves synchronized to a CM4 master using a u-blox RCB-F9T connected to a roof-mounted, dual-frequency antenna
- E2E, UDP IPv4 multicast (i.e. linuxptp default)
- all three machines connected to a FS IES3110-series switch (configured as transparent, one-step)
- TICC 10Mhz reference is a BG7TBL
Fedora has great docs for PTP, although some details are different for Raspberry Pi OS, which is Debian-based.

