Using GPIO pins on Orin Nano

I am running a Jetson Orin Nano but it is proving unbelievaby difficult to do something as simple as set a free GPIO pin to output. Pi 7 on the 40 pin connector is set by the system to input, I have been trying for weeks to change that to input. I have followed every instruction I have been offered, none have worked. I have installed Jetson.GPIO library , made a gpio groub and made myself a member but still get this warning of I try and use the library in a script:

usr/local/lib/python3.10/dist-packages/Jetson.GPIO-2.1.12-py3.10.egg/Jetson/GPIO/gpio_cdev.py:361: UserWarning:
[WARNING] User requested output for channel “7”, but it is set to input in pinmux. For more information on resolving this, please see
Jetson Orin NX and Nano Series — NVIDIA Jetson Linux Developer Guide 1 documentation

I have tried to followed the advice linked to above but cannot get that to work.

I would be eternally grateful if someone could show me, in simple terms, how to set a GPIO pin on the Jetson Orin Nano.

By the way, the configuration page at sudo /opt/nvidia/jetson-io/jetson-io.py opens for a split second and then closes.

*** Please note that this reply is generated by LLM automatically ***

To set a GPIO pin on the Jetson Orin Nano, you need to configure the pinmux settings. The Jetson Orin Nano has a complex pinmux configuration, and the default settings may not allow you to use a GPIO pin as an output.

First, you need to understand that the Jetson Orin Nano has a 40-pin GPIO expansion header, and each pin has a specific function. You can find the pinout diagram in the Jetson Orin NX and Nano Series Product Design Guide.

To set a GPIO pin as an output, you need to follow these steps:

  1. Check the pinmux settings: Before you start, check the current pinmux settings using the jetson-io tool. You can run the command sudo /opt/nvidia/jetson-io/jetson-io.py to open the configuration page. However, as you mentioned, the page closes immediately. You can try running the command with the --show option to display the current pinmux settings: sudo /opt/nvidia/jetson-io/jetson-io.py --show.
  2. Identify the pin: Identify the pin you want to use as a GPIO output. In your case, you want to use pin 7 on the 40-pin connector.
  3. Check the pinmux configuration: Check the pinmux configuration for the pin you want to use. You can find the pinmux configuration in the Jetson Orin NX and Nano Series Product Design Guide, Chapter 14. Unused Interface Terminations. Look for the pin you want to use and check if it is configured as a GPIO output.
  4. Configure the pinmux settings: If the pin is not configured as a GPIO output, you need to configure the pinmux settings. You can use the jetson-io tool to configure the pinmux settings. Run the command sudo /opt/nvidia/jetson-io/jetson-io.py --configure to open the configuration page. Select the pin you want to use and configure it as a GPIO output.
  5. Save the changes: Save the changes to the pinmux settings. You can do this by running the command sudo /opt/nvidia/jetson-io/jetson-io.py --save.
  6. Reboot the system: Reboot the system to apply the changes.
  7. Use the GPIO library: Once the system has rebooted, you can use the GPIO library to set the GPIO pin as an output. You can use the JetsonGPIO library you installed earlier.

Here is an example code snippet that sets GPIO pin 7 as an output:

import Jetson.GPIO as GPIO

# Set the GPIO mode to BCM
GPIO.setmode(GPIO.BCM)

# Set the GPIO pin as an output
GPIO.setup(7, GPIO.OUT)

# Set the GPIO pin high
GPIO.output(7, GPIO.HIGH)

Note that you need to use the BCM mode to access the GPIO pins on the Jetson Orin Nano.

Comparison with other Jetson modules:

  • The Jetson Orin NX has a similar pinmux configuration to the Jetson Orin Nano. However, the Jetson Orin NX has more GPIO pins available.
  • The Jetson AGX Orin has a different pinmux configuration than the Jetson Orin Nano and Jetson Orin NX. You need to consult the Jetson AGX Orin documentation to configure the GPIO pins.

In summary, to set a GPIO pin on the Jetson Orin Nano, you need to configure the pinmux settings using the jetson-io tool, and then use the GPIO library to set the GPIO pin as an output.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

Hi stephen.joung,

Are you using the devkit or custom board for Orin Nano?
What’s the Jetpack version in use?

Do you want to use PIN7 of 40pin header (i.e. PAC.06) as Output and control it?
If so, please configure its pinmux as GPIO/Output/Drive 0 first.

I am using the Jetson Orin Nano 8GB Developement Board running JP 6.1

I would suggest verifying with the latest JP6.2.2(r36.5).

Please also try this.

I am using JP6.1 for a reason. JP6.2 is still missing important components such as a PyTorch wheel and is therefore not yet usable for my projects. I am using busybox devmem to set the pins aIneed as an interim measure.

Okay, please use pinmux spreadsheet to configure the pinmux for the GPIO to work as an output pin.

I do not have access to a Windows computer to configure the pinmux spreadsheet as the macros do not work in LibreOffice.

Sorry that the macro in pinmux spreadsheet only supports on Windows currently.
Please get a Windows host for this task.