rpi3 clock drift

Ross Alexander rwa at athabascau.ca
Wed Nov 27 17:59:35 UTC 2019


On Wed, 27 Nov 2019, IanLepore wrote:

> Date: Tue, 26 Nov 2019 15:48:54 -0700
> From: Ian Lepore <ian at freebsd.org>
> To: James Shuriff <james at opentech.cc>, Bakul Shah
>       <bakul at bitblocks.com>
> Cc: "freebsd-arm at freebsd.org" <freebsd-arm at freebsd.org>
> Subject: Re: rpi3 clock drift
> Message-ID:
>       <486c0bc46deeefb8338f50fe6dfdf7951786e56c.camel at freebsd.org>
> Content-Type: text/plain; charset="UTF-8"
>
> On Tue, 2019-11-26 at 22:34 +0000, James Shuriff wrote:
>> kern.timecounter.tc.ARM MPCore Timecounter.frequency: 54000000
>
> 54 MHz seems like a very strange frequency for a clock in an arm
> system.  Of course, everything about an RPi seems to be strange and
> non-standard.
>
> Can someone else with an rpi3 (which keeps good time) confirm that
> that's the usual number?
>
> -- Ian

Mine does reasonably well; it's disciplined to a local stratum-0 (a
pi2 with a GPS hat supplying PPS).  The timecounter values are

     rpi3:/var/db/ntp # sysctl kern.timecounter

     kern.timecounter.fast_gettime: 1
     kern.timecounter.tick: 1
     kern.timecounter.choice: ARM MPCore Timecounter(1000) dummy(-1000000)
     kern.timecounter.hardware: ARM MPCore Timecounter
     kern.timecounter.alloweddeviation: 5
     kern.timecounter.timehands_count: 2
     kern.timecounter.stepwarnings: 0
     kern.timecounter.tc.ARM MPCore Timecounter.quality: 1000
     kern.timecounter.tc.ARM MPCore Timecounter.frequency: 19200000
     kern.timecounter.tc.ARM MPCore Timecounter.counter: 1547324379
     kern.timecounter.tc.ARM MPCore Timecounter.mask: 4294967295

and the ntpq info looks like

     rpi3:/var/db/ntp # ntpq

     ntpq> lpee
         remote           refid      st t when poll reach   delay   offset  jitter
     ==============================================================================
     *debian2.bogons  .PPS.            1 u   39  512  377    0.759    5.328   3.179

     ntpq> rl &1
     associd=63559 status=961a conf, reach, sel_sys.peer, 1 event, sys_peer,
     srcadr=debian2.bogons, srcport=123, dstadr=192.168.2.6, dstport=123,
     leap=00, stratum=1, precision=-19, rootdelay=0.000, rootdisp=1.099,
     refid=PPS, reftime=e18933b7.00541adb  Wed, Nov 27 2019 10:41:11.001,
     rec=e18933be.acaf7c6a  Wed, Nov 27 2019 10:41:18.674, reach=377,
     unreach=0, hmode=3, pmode=4, hpoll=9, ppoll=9, headway=17, flash=00 ok,
     keyid=0, offset=5.328, delay=0.759, dispersion=14.153, jitter=3.179,
     xleave=5.695,
     filtdelay=     0.87    0.76    0.78    0.77    0.79    0.79    0.71    0.80,
     filtoffset=    6.01    5.33    4.48    3.45    2.52    1.53    0.75    0.56,
     filtdisp=      0.00    7.95   16.10   23.85   31.71   39.74   47.61   55.62

     ntpq> rl
     associd=0 status=0618 leap_none, sync_ntp, 1 event, no_sys_peer,
     version="ntpd 4.2.8p12-a (1)", processor="arm64",
     system="FreeBSD/13.0-CURRENT", leap=00, stratum=2, precision=-21,
     rootdelay=0.759, rootdisp=23.748, refid=192.168.2.3,
     reftime=e18931ac.ad6bd044  Wed, Nov 27 2019 10:32:28.677,
     clock=e18933ef.81828f21  Wed, Nov 27 2019 10:42:07.505, peer=63559, tc=9,
     mintc=3, offset=5.327665, frequency=-7.309, sys_jitter=0.000000,
     clk_jitter=1.121, clk_wander=0.013, tai=37, leapsec=201701010000,
     expire=201912280000

     ntpq> quit

This box is drifting a bit right now because I've got a 'make -j 3
buildworld' running; the cheapo little resonators that the Pi folks
use instead of crystals drift madly with thermal stress.  I can see
the house furnace cutting in and out by graphing the loopstats file
:).  While idle it's usually good to less than half a millisecond.

regards,
Ross

============================================================================
Ross Alexander, (780) 675-6823 desk / (780) 689-0749 cell, rwa at athabascau.ca
                         54.71593 N 113.30835 W

     Order is simply a thin, perilous condition
     we try to impose on the basic reality of chaos.

        -- William Gaddis, _J R_
--
This communication is intended for the use of the recipient to whom it is addressed, and may contain confidential, personal, and or privileged information. Please contact us immediately if you are not the intended recipient of this communication, and do not copy, distribute, or take action relying on it. Any communications received in error, or subsequent reply, should be deleted or destroyed.
---


More information about the freebsd-arm mailing list