[LinuxPPS] Some debug
Rodolfo Giometti
giometti at enneenne.com
Thu Sep 18 23:13:19 CEST 2008
On Thu, Sep 18, 2008 at 09:08:53AM -0700, Luca Bertagnolio wrote:
> Here is some debug info I have just gathered.
>
> The modules are automatically loaded upon machine startup:
>
> tix ~ # lsmod
> Module Size Used by
> pps_ldisc 2592 0
> pps_core 7644 1 pps_ldisc
>
> Loading ppsldisc:
>
> tix ~ # /usr/local/sbin/ppsldisc /dev/ttyS1 &
>
> source serial1 got cdev (253:0)
> new PPS source serial1 at ID 0
> PPS source #0 "/dev/ttyS1" added
> PPS event on source 0 at 1221752734.126042132
> capture assert seq #1 for source 0
> [STDev] PPS assert at 53257 on source #0
Here you are receiving the PPS signal.
Also you are using old code! Please use __latest__ LinuxPPS release,
no debugging for old code.
> PPS event on source 0 at 1221752734.326095768
> capture clear seq #1 for source 0
> [snip]
>
> Running ppstest:
>
> tix ~ # ppstest /dev/pps0
>
> PPS_GETCAP: source 0
> PPS_GETPARAMS: source 0
> PPS_SETPARAMS: source 0
> time format unspecified (33)
> PPS_FETCH: source 0
> timeout 3.000000000
> PPS event on source 0 at 1221752925.181384265
> capture assert seq #192 for source 0
> [STDev] PPS assert at 101021 on source #0
Still receiving...
> PPS_FETCH: source 0
> timeout 3.000000000
> [snip]
>
> Starting ntpd, first issues:
>
> tix ~ # /etc/init.d/ntpd start
>
> PPS_GETCAP: source 0
> PPS_SETPARAMS: source 0
> PPS_GETCAP: source 0
> PPS_SETPARAMS: source 0
> PPS_FETCH: source 0
> timeout 0.000000000
> PPS_FETCH: source 0
Whatch out, no more PPS signals! Why? Maybe someone disabled the IRQs
on your serial port?
> [snip]
> Whoops! And even after stopping ntpd things remain the same:
>
> tix ~ # /etc/init.d/ntpd stop
>
> PPS_FETCH: source 0
> timeout 0.000000000
> PPS_FETCH: source 0
> [snip]
Still not receiving...
> So clearly starting ntpd messes up PPS API somewhere.
>
> Killing ppsldisc and restarting it cures the problem, though. And funnily enough, now ntpd seems to be working fine!
>
> PPS event on source 0 at 1221753829.351403521
> capture assert seq #85 for source 0
> [STDev] PPS assert at 327086 on source #0
Now you got again the PPS signal.
> Any info on what might cause the issue with ntpd and ppsldisc? What more can I debug, and how?
Something (evil) disables the IRQs and/or PPS signals after stopping
NTPD.
Please, do the same test using the __latest__ LinuxPPS patch
release. Also you may wish enabling the CONFIG_PPS_IRQ_EVENTS kernel
option for better performance. :)
Ciao,
Rodolfo
--
GNU/Linux Solutions e-mail: giometti at enneenne.com
Linux Device Driver giometti at linux.it
Embedded Systems phone: +39 349 2432127
UNIX programming skype: rodolfo.giometti
More information about the LinuxPPS
mailing list