Skip to first unread message

JM

unread,
Aug 4, 2014, 5:44:16 PM8/4/14
to beagl...@googlegroups.com
I am setting up an NTP server using a BBB and an NMEA-compatible GPS device. I have wired up the GPS serial port to UART5 and the GPS 1 PPS output to both a GPIO pin and UART5_CTS.  I have successfully configured everything to use kernel-level events for the 1 PPS via the GPIO pin, but not via the CTS pin.  GPSD can see that the CTS line is toggling, but since the kernel is not detecting these events, GPSD falls back to a less accurate measurement.

Question:  What are the necessary settings to make UART5_CTS generate kernel PPS events?

Thanks in advance for any assistance.




RCN kernel Linux bb-sdcard 3.8.13-bone59 #1 SMP Sat Jul 5 02:59:43 UTC 2014 armv7l armv7l armv7l GNU/Linux
NTPD version 4.2.7p454
GPSD version 3.10


Relevant DTS sections:
     fragment@40 {
        target = <&am33xx_pinmux>;
        __overlay__ {
            pinctrl_pps: pinctrl_pps_pins {
                pinctrl-single,pins = <
                    0x0C8 0x27  // P8.36  uart3_cts   INPUT  PULLDN  MODE7 
                >;
            };
        };
    };

    fragment@41 {
        target = <&am33xx_pinmux>;
        __overlay__ {
            pinctrl_uart5: pinctrl_uart5_pins {
                pinctrl-single,pins = <
                    0x0D8 0x36  // P8.31  uart5_cts   INPUT  PULLUP  MODE6 
                  //0x0DC 0x16  // P8.32  uart5_rts  OUTPUT  PULLUP  MODE6 
                    0x0C0 0x04  // P8.37  uart5_txd  OUTPUT  PULLDN  MODE4 
                    0x0C4 0x24  // P8.38  uart5_rxd   INPUT  PULLDN  MODE4 
                >;
            };
        };
    };

    fragment@42 {
       target = <&ocp>;
        __overlay__ {
            #address-cells = <1>;
            #size-cells = <1>;                            
            pps {
                compatible = "pps-gpio";
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_pps>;
                status = "okay";
                gpios = <&gpio3 16 0>;  // Linux GPIO enumeration is +1 from chip number
                assert-rising-edge;
            };
        };
    };

    fragment@43 {
        target = <&uart6>;      //Linux enumeration is +1 from chip number 
        __overlay__ {
            status = "okay";
        };
    };

    fragment@44 {
        target = <&ocp>;
        __overlay__ {
            uart5_helper {
                compatible = "bone-pinmux-helper";
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_uart5>;
                status = "okay";
            };
        };
    };



Syslog messages showing PPS registration:
Aug  4 20:42:37 bb-sdcard kernel: [    0.141178] pps_core: LinuxPPS API ver. 1 registered
Aug  4 20:42:37 bb-sdcard kernel: [    0.141187] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giom...@linux.it>
Aug  4 20:42:37 bb-sdcard kernel: [    2.043004] pps_ldisc: PPS line discipline registered
Aug  4 20:42:49 bb-sdcard kernel: [   22.804952] pps pps0: new PPS source pps.15.-1
Aug  4 20:42:49 bb-sdcard kernel: [   22.805089] pps pps0: Registered IRQ 208 as PPS source
Aug  4 20:42:51 bb-sdcard kernel: [   23.984672] pps pps1: new PPS source OMAP-SERIAL5
Aug  4 20:42:51 bb-sdcard kernel: [   23.984766] pps pps1: source "/dev/ttyO5" added


Actual PPS devices, note pps0 generating kernel events and pps1 not:
root@bb-sdcard# ll /sys/class/pps/*
lrwxrwxrwx 1 root root 0 Aug  4 20:42 /sys/class/pps/pps0 -> ../../devices/virtual/pps/pps0/
lrwxrwxrwx 1 root root 0 Aug  4 20:42 /sys/class/pps/pps1 -> ../../devices/virtual/pps/pps1/
root@bb-sdcard# cat /sys/class/pps/pps0/assert
1407188062.999944873#3094
root@bb-sdcard# cat /sys/class/pps/pps1/assert
0.000000000#0



Syslog messages showing GPSD using less accurate PPS measurement instead of KPPS:
Aug  4 20:42:13 bb-sdcard gpsd[1363]: gpsd:PROG: KPPS assert 0.000000000, sequence: 0 - clear  0.000000000, sequence: 0
Aug  4 20:42:13 bb-sdcard gpsd[1363]: gpsd:PROG: KPPS data: using clear
Aug  4 20:42:13 bb-sdcard gpsd[1363]: gpsd:PROG: KPPS cycle:       0 uSec, duration:       0 uSec @ 0.000000000
Aug  4 20:42:13 bb-sdcard gpsd[1363]: gpsd:RAW: PPS pps-detect on /dev/ttyO5 changed to 1
Aug  4 20:42:13 bb-sdcard gpsd[1363]: gpsd:PROG: PPS cycle: 1000050 uSec, duration:  199995 uSec @ 1407184933.203313318
Aug  4 20:42:13 bb-sdcard gpsd[1363]: gpsd:RAW: PPS edge rejected 1Hz trailing edge
Aug  4 20:42:14 bb-sdcard gpsd[1363]: gpsd:PROG: KPPS assert 0.000000000, sequence: 0 - clear  0.000000000, sequence: 0
Aug  4 20:42:14 bb-sdcard gpsd[1363]: gpsd:PROG: KPPS data: using clear
Aug  4 20:42:14 bb-sdcard gpsd[1363]: gpsd:PROG: KPPS cycle:       0 uSec, duration:       0 uSec @ 0.000000000
Aug  4 20:42:14 bb-sdcard gpsd[1363]: gpsd:RAW: PPS pps-detect on /dev/ttyO5 changed to 0
Aug  4 20:42:14 bb-sdcard gpsd[1363]: gpsd:PROG: PPS cycle:  999973 uSec, duration:  799977 uSec @ 1407184934.003291184
Aug  4 20:42:14 bb-sdcard gpsd[1363]: gpsd:RAW: PPS edge accepted 1Hz leading edge
Aug  4 20:42:14 bb-sdcard gpsd[1363]: gpsd:RAW: PPS ntpshm_put 1407184934.000000000 @ 1407184934.003291184
Aug  4 20:42:14 bb-sdcard gpsd[1363]: gpsd:INFO: PPS hooks called with accepted 1407184934.003291184 offset -0.003291184
Aug  4 20:42:14 bb-sdcard gpsd[1363]: gpsd:PROG: PPS edge accepted 1407184934.003291184 offset -0.003291184


NTP syncing to GPIO PPS (127.127.22.0), not GPSD/CTS PPS (127.127.28.1):
root@bb-sdcard# ntpq -crv -pn
associd=0 status=011d leap_none, sync_pps, 1 event, kern,
version="ntpd 4.2....@1.2483 Thu Jul 31 18:42:54 UTC 2014 (2)",
processor="armv7l", system="Linux/3.8.13-bone59", leap=00, stratum=1,
precision=-19, rootdelay=0.000, rootdisp=1.165, refid=PPS,
reftime=d78a7b8f.133c7be8  Mon, Aug  4 2014 21:37:19.075,
clock=d78a7b9a.98131c27  Mon, Aug  4 2014 21:37:30.594, peer=21917, tc=4,
mintc=3, offset=-0.005, frequency=-27.669, sys_jitter=0.007313,
clk_jitter=0.000, clk_wander=0.001
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 127.127.28.0    .GPS.            0 l   11   16  377    0.000   -1.311   0.111
 127.127.28.1    .PPS.            0 l   11   16  377    0.000   -0.095   0.007
o127.127.22.0    .PPS.            0 l   11   16  377    0.000   -0.005   0.007
*172.16.15.100   .GPS.            1 u   37   64  377    7.644   -0.045   0.420
-50.7.0.66       128.138.141.172  2 u   30   64  377   35.170   -6.805   5.060
+204.235.61.9    128.10.19.24     2 u   34   64  377   44.352   -1.701   1.732
+206.217.199.65  204.9.54.119     2 u   32   64  177   35.892   -2.374   3.846
-96.226.242.15   204.9.54.119     2 u    9   64   77   14.801    2.163   1.655






Reply all
Reply to author
Forward
0 new messages