Welcome to Jetson Orin NANO Developer Kit repository
04.GPIO output
GPIO Output Function
GPIO Output Function1. GPIO Pin Diagram Comparison Table2. Jetson Orin Super GPIO Repair1. Busybox Modifies Registers (Taking Physical Pin 31 as an Example)2. Change the Device Tree (Taking the Change of Physical Pin 7 as an Example)3. Program Effect
1. GPIO Pin Diagram Comparison Table
GPIO.BOARD pin 12 corresponds to GPIO.BCM pin 18:

2. Jetson Orin Super GPIO Repair
Note: After upgrading to Jetson Orin Super, most GPIO ports have changed from bidirectional (input + output) to input only. Two solutions are now provided to change GPIO into a bidirectional interface.
1. Busybox Modifies Registers (Taking Physical Pin 31 as an Example)
This solution is temporary: after the register configuration is modified, it becomes invalid on every reboot. If it needs to remain in effect permanently, refer to the second solution.
The documents appearing in the pictures can be found in the attachment - jetson gpio; they were all found and downloaded from the official website.
According to the query: physical pin 31 ---- corresponds to GPIO11--- corresponds to SOC_GPIO33, the corresponding PADCTL_G3 address = PADCTL_A0 is 0x2430000, and the corresponding address for SOC_GPIO33 is 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 output

xcd ~/jetson-gpio/samplesexport JETSON_MODEL_NAME=JETSON_ORIN_NANOpython3 simple_out.py
After the setting is complete, refer to the BCM numbering, change the numbering in the test case to the corresponding value, and then run the test case below; you will then find physical pin 31 switching back and forth between high and low levels
2. Change the Device Tree (Taking the Change of Physical Pin 7 as an Example)
Note: This solution requires a certain 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 软件资料\资料文档\jetson-gpio into Jetson Orin, open the pin7_as_gpio.dts file, and change the circled part to the GPIO pin you need to change

Run the following commands separately under jetson-orin-gpio-patch
xxxxxxxxxxdtc -O dtb -o pin7_as_gpio.dtbo pin7_as_gpio.dts #The generated file name can be changed according to different GPIO port namessudo 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_NANO
xxxxxxxxxxpython3 simple_out.py
After the setting is complete, refer to the BCM numbering, change the numbering in the test case to the corresponding value, and then run the test case below; you will then find physical pin 7 switching back and forth between high and low levels
3. Program Effect
Use a DuPont wire to lead out the GPIO.BOARD 6 and GND pins; a multimeter can be used to measure the pin voltage change:
Note: Do not connect the pins incorrectly or cause a pin short circuit; a mistake may damage the mainboard hardware!
