I am now using Jetpack R36 (release) Revision 4.3 on Jetson AGX Orin Dev Kit.
I want to enable PPS signal input via GPIO port. I have verified that the PPS is supported in the kernel. Therefore I assume that I don’t need to build the kernel by myself.
zcat /proc/config.gz | grep -i PPS
CONFIG_PPS=y
# CONFIG_PPS_DEBUG is not set
# PPS clients support
CONFIG_PPS_CLIENT_KTIMER=y
CONFIG_PPS_CLIENT_LDISC=y
CONFIG_PPS_CLIENT_GPIO=y
# PPS generators support
Question 1: Maybe incorrect PIN name/numbering according to Pinmux Spreadsheet?
Basically I refered this post PPS input to GPIO on Jetpack 6.1 and the official ducumentation of Creating Device Tree Overlay. I planned to use PIN16 as well which is named GPIO08 according to Developer Guide. However, when refering to the Pinmux Spreadsheet, I found that PIN16 is named GPIO3_PBB.01, not PC.00 as claimed in the post PPS input to GPIO on Jetpack 6.1. Furthermore, PBB.01 can also be verified in the Jetson AGX Orin Developer Kit Carrier Board Specification
For anyone wondering how
16
comes from Pin16
on the 40 pin header, it took a bit of digging. Pin16
is calledGPIO8
, but is actuallygpio-357
orPC.00
on the pinmux sheet.
I am wondering whether I got something wrong or I used the incorrect version of Pinmux spreadsheet. Since this guy said in his post it works for him.
Question 2: How to create the gpio mapping for GPIO3_PBB.01?
Based on the post PPS input to GPIO on Jetpack 6.1, I guess I need to create a device tree overlay file named pps-overlay.dts
as follows.
/dts-v1/;
/plugin/;
/ {
compatible = "nvidia,p3737-0000+p3701-0005", "nvidia,p3701-0005","nvidia,tegra234";
overlay-name = "PPS Overlay";
jetson-header-name = "Jetson 40pin Header";
fragment@0 {
target-path = "/";
__overlay__ {
pps: pps-gpio {
status = "okay";
compatible = "pps-gpio";
gpios = <#1?? #2?? 0>;
assert-arising-edge;
};
};
};
};
And then the following commands should be executed.
dtc -O dtb -o pps-overlay.dtbo -@ pps-overlay.dts
sudo cp pps-overlay.dtbo /boot
sudo /opt/nvidia/jetson-io/config-by-hardware.py -n "PPS Overlay"
But after reading ALMOST ALL relevant posts in the forum, I still don’t know how to set them. I don’t want to cite all of them. From my understanding:
- For #1?? It could be &gpio, &tegra_main_gpio, &tegra_ano_gpio. Since after exectuing
sudo cat /sys/kernel/debug/gpio | grep PBB.01
, I gotgpio-325 (PBB.01 )
which implies this gpio pin lies ontegra234-gpio-aon
. - For #2?? After reading the source code, I have found something like:
#define TEGRA_GPIO_PORT_BB 27
#define TEGRA_GPIO_PORT_CC 28
#define TEGRA_GPIO_PORT_DD 29
#define TEGRA_GPIO_PORT_EE 30
#define TEGRA_GPIO_PORT_FF 31
#define TEGRA_GPIO(port, offset) \
((TEGRA_GPIO_PORT_##port * 8) + offset)
I guess I should use gpios = <&tegra_ano_gpio 325 0>
or gpios = <&gpio 217 0>
. 217 = 27(BB) * 8 + 1
. Both didn’t work after trying.
-
Question 2.1: Please clarify when to use &gpio, &tegra_main_gpio, &tegra_ano_gpio and how can I calculate/get the number for it.
I guess for &gpio the number is calculated as the formula and for tegra_ano_gpio the number should be the one outputed by the command sudo cat /sys/kernel/debug/gpio | grep PBB.01
)
IMPORTANT: Please quit pointing me to another very long forum topic. The documentation should really be fixed, it is really annoying. DEVELOPER DON’T NEED TO READ THE SOURCE CODE TO IMPLEMENT A SMALL FUNCTIONALITY. IT SHOULD BE WELL AND NICE DOCUMENTED.