How to map GPIO to the corresponding pin numbers on OrinNX?


The pinmux.xlsm file for Orin NX indicates that GPIO08 corresponds to GPIO3_PQ.02. However, in the modified GPIO example, SOC_GPIO08 is associated with GPIO3_PB.00. I’m a bit confused about how to establish the correspondence between them.

Please just refer to the pinmux spreadsheet as you are doing now to recognize the mapping of the pins.
GPIO08 is different from SOC_GPIO08, SOC_GPIO08 is the pin of SoC, GPIO08 is the pin of module.

You could also use the following command to print all GPIO number:

$ cat /sys/kernel/debug/gpio

Oh, I see! According to your hint, I think I suddenly understand. So the mapping relationship for GPIO8 is PQ.02. thanks Kevin。

I have another question. For example, if I want to add GPIO8 and its converted number is 450. After using “echo > 450 export”, the folder created under “/sys/class/gpio” is named “PQ.2”. However, I want the name to be “gpio450” instead. Is there any way to achieve such a file name?

Sorry, it’s the default behavior of linux and seems unavailable to change its name.

ok,I see!After rebooting, the generated PQ.02 is lost using the command “echo 356 > export”. How can I save it? Thank you!

The generated PQ.02 is a temporary node. You should export it again after reboot.

Yes, it’s a temporary node. I don’t want to re-import every time I boot up. Is there a way to save the import status? Do I need to modify the device tree? If I modify the device tree using the device tree file generated by pinmux, can I directly replace it in the system? Or do I need to re-flash it in the host?

You could refer to the Jetson-GPIO library for your use case.

ok thanks。

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.