Connecting GPS with PPS to Xavier

Hi all,

I’m trying to timesync Xavier with a GPS timeserver using chrony and gpsd. I connect my gps to the UART port of the Xavier and use CTS pin to also connect pps to Xavier. But when I run gpsd, I get the error: kernel PPS unavailable.

I found that for TX2 there was a kernel patch that fixed this problem, but couldn’t find anything for Xavier since it is new.

Any ideas how to enable PPS in Xavier kernel?

P.S. I’m running Ubuntu 18.04 on my Xavier

What kernel patch? Could you share it?

This is what I found: meta-beagleboard/0003-pps-gpio-add-device-tree-binding-and-support.patch at master · beagleboard/meta-beagleboard · GitHub

This kernel driver can be still found in k4.9 source. However, they are in different base with your patch. Also, this driver is not enabled by default.

Since this is 3rdparty driver, I cannot share much help here. Could you firstly enable it in kernel?

Can you please tell me how to enable it in kernel?

And what pin should I use for PPS? I am currently using Clear to Send on UART (PIN 36). But base on working pins used on TX1 and TX2 I don’t think this is the right pin to use!

My understanding is that I should use a free GPIO that’s connected to a hardware interrupt. The working pins that we previously used for connecting PPS for TX1 is: GPIO8_ALS_PROX_INT and GPIO9_MOTION_INT for TX2

Any suggestion for Xavier?

You’ll find information in the Documentation download for the particular release you use. That information shows cross compile on a PC host. Install steps depend on the particular release, the Documentation mentions this part.

In your case you might want to adapt this topic and build just the relevant module:

https://devtalk.nvidia.com/default/topic/1012382/jetson-tx2/usb-wifi-adapter-s-/post/5290682/#5290682

You’ll find the Xavier “uname -r” is probably “4.9.108-tegra”, meaning a 4.9.108 version with “-tegra” as CONFIG_LOCALVERSION (see that URL). Useful when adding a new driver as a module. Your L4T release (see “head -n 1 /etc/nv_tegra_release”) will probably be R31.1 if you’ve flashed, or R31.0.1 if you have not (and I recommend not using old versions).

The Documentation will mention a PINMUX spreadsheet…use that for assigning GPIO pin functions. A driver won’t be able to take advantage of a GPIO for your purpose unless it is assigned to be what you want it to be…which PINMUX accomplishes.

Didn’t you enable “CONFIG_PPS_CLIENT_GPIO” on TX2/TX1? I think even TX2 and TX1 don’t enable it by default…?

As for the UART, I think you could only use the GPIO expansion connector which should be K53,K54,L51,H54. (UART1 TX,RX,RTS,CTS).

I had enable “CONFIG_PPS_CLIENT_GPIO”, and add GPIO9_CAN1_GPIO0 as pps input to the dtb, but it still now work
there is no pps device in /sys/class/pps/ . Could you give me some help?

Because procedures for installing various features have changed over time the first thing you should do is verify that the changes you made were actually installed. To verify “CONFIG_PPS_CLIENT_GPIO” examine the output from this:

gunzip < /proc/config.gz | grep CONFIG_PPS_CLIENT_GPIO

To verify any device tree changes made their way in you can reverse compile the device tree on the running system and compare to your changes. This will produce a copy of what the system is actually running for device tree:

dtc -I fs -O dts -o extracted.dts /proc/device-tree

The content you see in “/sys” is a direct result of various drivers and is not real file content. If the driver is missing, or if something tells the driver to not load, then no content will exist in “/sys”. So what we now know is that one or more of the following is true:

  • The driver does not exist. One example is that the driver is in module format, but the module is not in the correct location. What is your "uname -r"? If you used module format, is the module somewhere in "/lib/modules/$(uname -r)/"?
  • The driver parameters (possibly device tree parameters) are in error or are missing and the driver cannot create the file in "/sys".
  • The hardware is not visible to the driver, and thus would not know to load. One example of this might be hardware needing external power but the power is not on at the time of driver load. Another example might be that the driver is the wrong version for that hardware.

Can you verify the CONFIG attribute shows up in “/proc/config.gz”? Can you verify any device tree changes show as present after reverse compiling the running system’s tree?

@m.mousaei what is the state of it?
@all any known solution for GPS timesync at Xaver?
I am approaching related issue. Theoretically at the moment, as I do not have any gps to test with.
reference thread : [url]https://devtalk.nvidia.com/default/topic/1047944/jetson-agx-xavier/implementation-of-precise-time-synchronization-between-two-xaviers-over-wlan/?offset=2#5318093[/url]

@gassmimohamed974

[url]https://devtalk.nvidia.com/default/topic/1042270/announcements/welcome-to-the-new-agx-ndash-autonomous-machines-forum-/post/5318238/?offset=15#5318303[/url]

void

I am to connect GPS with PPS to Xavier,
I have to wire somehow input-output interface of the devices, right?
Could you extend if an adapter/connector needs to be procured? Garmin GPS 18 LVC.
Can the GPS be wired directly to the GPIO interface without additional adapters? If the answer is “NO” - what adapters I need to procure? Otherwise how to identify pins to connect?
Moreover, as I understand, there will be a need to identify pins “K53,K54,L51,H54” and wire the GPS to it, Right?
Any advise how to identify exactly these pins?
External Media
[source of the image - jetsonhacks]
UPD: these pins are 8,10,11,36 of J30
So far it seems to me that data in and data out will need t obe connected to GPIO [ to what pins? ], and additionally separate 5v will need to be settled for some wires.
Thanks,
Andrei
Reference: Synchronizing ntpd to a Garmin GPS 18 LVC via gpsd


GPS_18x_Tech_Specs.pdf (832 KB)
GPS18_Series_SpSht.pdf (1.18 MB)

Can someone explain how to connect GNSS_PPS through the GPIO?

Is it enabled on the Xavier? and what about TX2 is is enabled now after the updated Jetpack release?

Could you, guys, extend how to connect GPS PPS, please?
External Media
I Understand that I connect 5v and ground to a separate usb wires, but to where do I wire the tx, rx and pps wires at the Xavier GPIO?

How to enable “CONFIG_PPS_CLIENT_GPIO” ?

gunzip < /proc/config.gz | grep CONFIG_PPS_CLIENT_GPIO
# CONFIG_PPS_CLIENT_GPIO is not set
nvidia@jetson-number:~$ zcat /proc/config.gz | grep -i pps
# PPS support
CONFIG_PPS=y
# CONFIG_PPS_DEBUG is not set
# PPS clients support
# CONFIG_PPS_CLIENT_KTIMER is not set
# CONFIG_PPS_CLIENT_LDISC is not set
# CONFIG_PPS_CLIENT_GPIO is not set
# PPS generators support

linked thread:
https://devtalk.nvidia.com/default/topic/1051338/jetson-agx-xavier/how-to-locate-pins-uart5_tx-j58-uart5_rx-h58-/post/5336037/?offset=15#5336048