acassis opened a new pull request, #4050:
URL: https://github.com/apache/nuttx-apps/pull/4050
## Summary
gnsspps synchronizes a NuttX board to GNSS time with the PPS output of a
GNSS receiver, so that boards with their own receiver share the same time scale
without a network.
It reads the PPS time stamps as external time stamp (EXTTS) events from a
PTP clock (/dev/ptpX, for example CONFIG_PTP_PPS) and steers the clock with
clock_adjtime():
* Acquire: the frequency error is measured from two pulses, then the phase
is removed with one step.
* Locked: a PI servo (Kp 0.7, Ki 0.3 by default, as linuxptp) runs on every
pulse, with outlier rejection and re-acquisition.
* Holdover: the last frequency is kept when the PPS is lost.
* The whole seconds come from the NMEA RMC or ZDA sentences of the receiver,
confirmed by two sentences before a step.
* Optionally (-r) CLOCK_REALTIME follows the PTP clock.
The RMS and maximum phase error and the frequency are printed every 16
pulses.
## Impact
Users could use a low cost GNSS with PPS to sync two or more boards.
## Testing
```
nsh> uname -a
NuttX 0.0.0 b2fb8a7c Nov 13 2026 19:37:12 arm stm32f4discovery
nsh> ls /dev
/dev:
console
null
ptp0
ttyS0
ttyS1
zero
nsh> gnsspps -s /dev/ttyS1 -n 100
gnsspps: /dev/ptp0 channel 0, NMEA from /dev/ttyS1
gnsspps: locked, offset -296857179 ns stepped, freq -71155 ppb
gnsspps: stepping +27383908 s to NMEA time
gnsspps: rms 183 ns max 474 ns freq -71033 ppb
gnsspps: rms 190 ns max 461 ns freq -70690 ppb
gnsspps: rms 81 ns max 153 ns freq -71205 ppb
gnsspps: rms 200 ns max 508 ns freq -71048 ppb
gnsspps: rms 186 ns max 459 ns freq -70798 ppb
gnsspps: rms 80 ns max 115 ns freq -71256 ppb
nsh>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]