Jetpack-6.1 gpio for pps signal : polling works, ppstool does not

Hello Nvidia experts,

Sorry if I am not the first one to have this problem, but other posts seem to refer to other hardware or older jetpacks.

I work with a custom board, where the PPS signal given by a GNSS (aka GPS) receiver is connected to PAC.00.

PAC.00 (spi5_sck_pac0) has been configured as input in the spreadsheet, and the generated dtsi files have been used to flash the board.

With the following script I see the input toggle

$ sudo gpiofind PAC.00
gpiochip0 138
$ unset previ
while true
do
        i=$(sudo gpioget gpiochip0 138)
        if [ $i != "$previ" ]
        then
                previ=$i
                echo $i $(date)
        fi
done
1 Fri Apr 25 04:55:22 PM UTC 2025
0 Fri Apr 25 04:55:22 PM UTC 2025
1 Fri Apr 25 04:55:23 PM UTC 2025
0 Fri Apr 25 04:55:23 PM UTC 2025
1 Fri Apr 25 04:55:24 PM UTC 2025
0 Fri Apr 25 04:55:24 PM UTC 2025
1 Fri Apr 25 04:55:25 PM UTC 2025
0 Fri Apr 25 04:55:25 PM UTC 2025
1 Fri Apr 25 04:55:26 PM UTC 2025
0 Fri Apr 25 04:55:26 PM UTC 2025
1 Fri Apr 25 04:55:27 PM UTC 2025
0 Fri Apr 25 04:55:27 PM UTC 2025
1 Fri Apr 25 04:55:28 PM UTC 2025
0 Fri Apr 25 04:55:28 PM UTC 2025

pps is configured in my dts file as follows :

        pps {
                gpios = <&gpio TEGRA234_MAIN_GPIO(AC, 0) GPIO_ACTIVE_LOW>;
                compatible = "pps-gpio";
                assert-falling-edge;
                status = "okay";
        };

and the pps-gpio driver is compiled as a module

When I insert the driver module

sudo insmod pps-gpio.ko

dmesg says

[  239.285861] irq: IRQ251: trimming hierarchy from :bus@0:pmc@c360000
[  239.286220] pps pps0: new PPS source pps.-1
[  239.286308] pps pps0: Registered IRQ 251 as PPS source

and my script polling the gpio complains

gpioget: error reading GPIO values: Device or resource busy

That proves that the dts entry describes exactly the gpio that I polled.

A /dev/pps0 file is now created, but running ppstool fails !!!

$ sudo ppstest /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
time_pps_fetch() error -1 (Connection timed out)
time_pps_fetch() error -1 (Connection timed out)
time_pps_fetch() error -1 (Connection timed out)
^C
$

When I remove the module, the script sees again the input toggling.

What have I missed to make ppstool/pps-gpio work ?

This is on a Orin NX with Jetpack-6.1(rev1)

Hi phdm,

From the results you shared, it seems you’ve configured PPS for PAC.00 correctly.

Please just use /dev/pps1 instead as following:

$ sudo ppstest /dev/pps1

You can also refer to How to set a GPIO as an interrupt pin and test if the interrupt function is working properly in Orin NX? - #14 by KevinFFF for the similar issue.

Hi KevinFFF,

I do not have /dev/pps1. When the pps-gpio.ko is not loaded, there is no /dev/pps*. When pps-gpio.ko is loaded, only /dev/pps0 is created, as can be seen here :

[  217.261990] irq: IRQ251: trimming hierarchy from :bus@0:pmc@c360000
[  217.262513] pps pps0: new PPS source pps.-1
[  217.262608] pps pps0: Registered IRQ 251 as PPS source

The only thing I see there is

Do I need to configure the PAC.00 pin, which is already configured as gpio input, as Input/Int PD in pinmux spreadsheet?

Which configuration register would that change ?

I don’t like needing to reflash my board. How can I do that using only DT configuration or devmem2 commands ?

Have you configured PAC.00 as following in pinmux spreadsheet?
image
If not, please give it a try.

You can also try running the following command

$ sudo busybox devmem 0x02448058 w 0x1057

Do you get any error in dmesg when you run this command?

It seems you don’t have interrupts and interrupt-parent specified in device tree.

I have done that to look at the differences in the generated dtsi files. I see of course a change in spi5_sck_pac0,

-                               nvidia,pull = <TEGRA_PIN_PULL_NONE>;
+                               nvidia,pull = <TEGRA_PIN_PULL_DOWN>;

but also another one in soc_gpio25_pp6

-                               nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
+                               nvidia,io-high-voltage = <TEGRA_PIN_ENABLE>;

Which devmem command can mimic that ?

No. Only

[  239.285861] irq: IRQ251: trimming hierarchy from :bus@0:pmc@c360000
[  239.286220] pps pps0: new PPS source pps.-1
[  239.286308] pps pps0: Registered IRQ 251 as PPS source

What should I add as interrupts and interrupt-parent ?

You can just take care of the configuration for PAC.06.
For pinmux address, please refer to Orin Technical Reference Manual for details.

Please try adding the following lines:

        pps {
                gpios = <&gpio TEGRA234_MAIN_GPIO(AC, 0) GPIO_ACTIVE_LOW>;
+               interrupts = <TEGRA234_MAIN_GPIO(AC, 0) IRQ_TYPE_EDGE_RISING>;
+               interrupt-parent = <&gpio>;
                compatible = "pps-gpio";
                assert-falling-edge;
                status = "okay";
        };