that’s wrong GPIO number for Xavier NX series.
there’s offsets during kernel init stage, please check $ dmesg | grep "registered GPIOs" for the allocated GPIOs.
you should also see tegra194-gpio.h for the port index and calculation formula for reference.
thanks
they’re different modules,
please check GPIO header files for the port index and calculation formula.
for example,
Jetson TX1 and Nano series, tegra-gpio.h
Jetson TX2 series, tegra186-gpio.h
Jetson AGX Xavier and Xavier NX series, tegra194-gpio.h
OK, offset probably means the actual pin number of the physical GPIO header.
But how do I find out the port. That’s absolutely not clear to me.
I’ve been able to find this:
which says that pin 33 should be gpio393. After subtracting the base which in my case seems to be 288 (dmesg output you mentioned) and subtracting the pin offset (33) I get 72. Divided by 8 I get 9 which maps to port J (looking again at the header file). But how would I find out the port if I didn’t know the final result in the end?
In my case the aforementioned picture is actually all I need, but maybe just for future generations… :-)
let’s taking pin-33 for example, it’s GPIO13, GPIO3_PN.01,
btw, it’s pinmux spreadsheets to include the detail signal name and the pin muxing. please searching for GPIO13 to find its GPIO signal.
for this GPIO3_PN.01,
you should consider GPIO3_P for mapping to its port index, whereas the port index is N; offset is 1.
then, checking the header file, tegra194-gpio.h.