Welcome to Jetson Orin NX Developer Kit repository
当製品の日本語版マニュアル資料は、こちらからご取得ください。
04.GPIO output
GPIO output
GPIO output1. GPIO pin diagram comparison table2. jetson orin super GPIO fix1. Modify the register with busybox (taking physical pin 31 as an example)2. Modify the device tree (taking physical pin 7 as an example)3. Program effect
1. GPIO pin diagram comparison table
GPIO.BOARD pin 31 corresponds to GPIO.BCM pin 6

2. jetson orin super GPIO fix
Note: After upgrading to jetson orin super, most of the GPIO ports changed from the original bidirectional (input + output) to input only. Now two solutions are provided to change GPIO into a bidirectional interface.
1. Modify the register with busybox (taking physical pin 31 as an example)
This solution is a temporary one: after the register configuration is modified, it becomes invalid on every reboot. If it needs to stay effective, refer to the second solution.
The document shown in the image can be found in the attached "Jetson GPIO" file; all these materials were downloaded from official sources.
After looking it up: physical pin 31 ---- corresponds to GPIO11 --- corresponds to SOC_GPIO33, the corresponding PADCTL_G3 address = PADCTL_A0 is 0x2430000, and SOC_GPIO33 corresponds to 0x2430070 (refer to the pictures below)



Pinmux register address:


The Offset is 0x70.
The Pinmux register address is 0x2430070
1.1 Install busybox
sudo apt install busybox
1.2 Set the gpio pin as output:
xxxxxxxxxxsudo busybox devmem 0x02430070 w 0x004
1.3 Test the output

xcd ~/jetson-gpio/samplesexport JETSON_MODEL_NAME=JETSON_ORIN_NXpython3 simple_out.py
After the setting is complete, refer to the BCM numbering, change the number in the test case to the corresponding value, then run the following test case, and you will see physical pin 31 switching back and forth between the high and low levels
2. Modify the device tree (taking physical pin 7 as an example)
Note: This solution requires some understanding of the device tree and is not recommended for beginners. After this solution succeeds, the configured gpio pin becomes a bidirectional pin, that is, input + output.
Physical pin 7 corresponds to GPIO 09, corresponds to SOC_GPIO59, and the corresponding device tree name is soc_gpio59_pac6

Copy the jetson-orin-gpio-patch-main file in the attached "Jetson GPIO" material into the Jetson Orin, open the pin7_as_gpio.dts file, and change the circled part to the GPIO pin you need to modify

Run the following commands under jetson-orin-gpio-patch
xxxxxxxxxxdtc -O dtb -o pin7_as_gpio.dtbo pin7_as_gpio.dts # The generated file name can be changed by yourself according to the different GPIO port namesudo cp pin7_as_gpio.dtbo /bootsudo /opt/nvidia/jetson-io/jetson-io.py





Start the test:
xxxxxxxxxxcd ~/jetson-gpio/samples
xxxxxxxxxxexport JETSON_MODEL_NAME=JETSON_ORIN_NX
xxxxxxxxxxpython3 simple_out.py
After the setting is complete, refer to the BCM numbering, change the number in the test case to the corresponding value, then run the following test case, and you will see physical pin 7 switching back and forth between the high and low levels
3. Program effect
Use a Dupont wire to bring out the GPIO.BOARD 31 pin and the GND pin, and a multimeter can be used to measure the voltage change of the pin:
Note: Do not connect the pins incorrectly or cause a short circuit, as a mistake may damage the mainboard hardware!
