Jetson TX2/Nano PPS GPIO Configuration

Hi,

Jetson:TX2
JetPack:3.2.1
Kernel:4.4.38-tegra

We are considering using the Nano to provide PPS input to our system and given that we currently work with TX2’s would like to firstly test this by configuring one of the GPIOs on the J21 pinout on the devkit board.

I have been following
https://devtalk.nvidia.com/default/topic/1035352/jetson-tx2/pps-drivers-not-installing/
and have configured the device tree and enabled the PPS driver, however the GPIO is not configured correctly.

I have ensured the drivers are enabled in the kernel as follows

#
# PPS support
#
CONFIG_PPS=y
CONFIG_PPS_DEBUG=y

I have added the pps entry to the device tree, modifying tegra_quill_common.dtsi as folllows

pps {
		status = "okay";
		compatible = "pps-gpio";
		gpios = <&tegra_main_gpio TEGRA_MAIN_GPIO(I, 4) GPIO_ACTIVE_HIGH>;
	};

I can confirm that the driver loads and that the /dev/pps0 appears

dmesg | grep pps
[    0.437199] pps_core: LinuxPPS API ver. 1 registered
[    0.437227] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    8.196625] pps_core: source pps.-1 got cdev (252:0)
[    8.204894] pps pps0: new PPS source pps.-1
[    8.204926] pps pps0: Registered IRQ 200 as PPS source

Also, the gpio is reported to be configured for pps in the kernel.

sudo cat /sys/kernel/debug/gpio

GPIOs 320-511, platform/2200000.gpio, tegra-gpio: 
 ...
 ...  
 gpio-388 (                    |pps-gpio            ) in  hi 
 ...
 ...

However, when I probe the GPIO26 pin (sysfs GPIO388) this is still outputting 3.3v. I cannot modify this manually

su
echo 388 > /sys/class/gpio/export

reports

bash: echo: write error: Device or resource busy

Could someone recommend how to ensure the GPIO is configured correctly for PPS input please?.

Thanks

If you need would like to use sysfs to check the GPIO function you have to disable the pps-gpio first otherwise it will return “resource busy”.