A working implementation of PRU-based PPS timestamping feeding Chrony via SHM, achieving steady-state clock offsets in the nanoseconds.
PRU-ICSS (edge capture) Linux (servo / policy)
┌──────────────────────────┐ ┌───────────────────────────────┐
│ GPS PPS → P8_16 → R31 │ │ pru_pps_shm (SCHED_FIFO:50) │
│ PRU0 polls rising edge ├───►│ IEP↔wall calibration │
│ IEP latch (200 MHz) │ │ NTP SHM unit 2 │
│ DRAM0: { seq, iep_lo } │ │ Chrony refclock → adjtimex │
└──────────────────────────┘ └───────────────────────────────┘
By entirely bypassing the Linux GPIO IRQ pathway and capturing the pulse edge using the 200 MHz PRU Industrial Ethernet Peripheral (IEP) hardware timer, this implementation eliminates traditional interrupt latency jitter.
- Daemon Precision: Typical wall-time residuals of 100–800 ns vs the true PPS edge.
- System Clock Offset: Once the Chrony servo converges,
chronyc trackingreports system time offsets in the low nanosecond domain (often under ±10 ns). - Jitter Profile: The estimated standard deviation converges to ~1 ns, an order-of-magnitude improvement over standard
pps-gpiowhich routinely shows 5–20 µs of offset dispersion.
Detailed tracking data and logs can be found in the Measurements & Validation document.
- Architecture & Overview: What is a PRU, why use it for PPS, and the system architecture
- Hardware Requirements: Supported hardware, GPS modules, and prerequisites
- Initial Setup & Overlays:
uEnv.txtconfiguration and device tree overlays - PRU Firmware: Compiling and installing the PRU microcontroller firmware
- Userspace Daemon & Chrony: Building the shared memory daemon and configuring Chrony
- Verification & Troubleshooting: Checking system behavior, remoteproc state, and common issues
- Timestamp Model: What exactly is captured, which edge, what defines t=0
- Clock Domains & Synchronization: IEP to wall correlation, memory mechanism, ordering guarantees
- Measurements & Validation: Expected performance, real-world tracking/statistics, and diagnostic guidance
- Firmware (
firmware/): PRU0 C source, resource table, INTC map, linker command - Daemon (
daemon/): Userspace SHM bridge and systemd service - Overlays (
overlays/): Device tree overlays for pinmux and rpmsg - Tools (
tools/): Log parsing and statistics helpers