Control a GPIO as an output redux

Like many others, I am simply trying to control a GPIO (pin 7 on the 40-pin header) as an output and see it change on the multimeter for now using python code.
‘’’
import Jetson.GPIO as GPIO
import time

Pin Definitions

output_pin = 7 # Board pin number

Pin Setup

GPIO.setmode(GPIO.BOARD)
GPIO.setup(output_pin, GPIO.OUT, initial=GPIO.LOW)

print(“Press CTRL+C to exit”)
try:
while True:
GPIO.output(output_pin, GPIO.HIGH)
time.sleep(5)
GPIO.output(output_pin, GPIO.LOW)
time.sleep(5)
except KeyboardInterrupt:
print(“Exiting program”)
finally:
GPIO.cleanup()

Looking at this post, Jetson Nano Orin Developer kit GPIO output - Jetson & Embedded Systems / Jetson Orin Nano - NVIDIA Developer Forums, I am trying to follow the steps and it says to download the PINMUX spread spreadsheet via the link, but searching for pinxum does not list a spreadsheet to download.

I also noted in posts apologies that due to errors in nvidia files that that the output does not work with python the way it is supposed to. Has this been fixed? if not why?

Given a controller one of the first tasks is always to “blink an LED”, which seems nearly impossible right now with Jetpack 6.0.

Frustrated…

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

To address your question about controlling a GPIO pin on the Jetson Orin Nano using Python, let’s break down the information and steps required to achieve this, considering the context provided.

  1. Understanding GPIO on Jetson Orin Nano:

    • The Jetson Orin Nano, like other Jetson devices, uses GPIO (General Purpose Input/Output) pins for various applications, including controlling external devices like LEDs.
    • GPIO pins can be configured as inputs or outputs, and their direction (input/output) can be controlled using specific commands or libraries.
  2. Python Library for GPIO Control:

    • You’re using the JetsonGPIO library, which is a Python wrapper for GPIO operations on Jetson devices. This library simplifies the process of setting up and controlling GPIO pins.
    • The code snippet you provided demonstrates how to set a pin as an output and toggle its state (high/low) using a loop, which is a common approach to blink an LED connected to the specified GPIO pin.
  3. Pin Configuration and PINMUX:

    • PINMUX (Pin Multiplexing) is a feature that allows a single pin to have multiple functions. The Jetson devices, including the Orin Nano, support PINMUX, which can be configured using the Jetson AGX Orin pinmux spreadsheet or through specific commands/tools like gpio debugfs.
    • The PINMUX spreadsheet is a resource provided by NVIDIA that helps in configuring the pin functions. However, you mentioned difficulty in finding the spreadsheet, which might be due to changes in NVIDIA’s documentation or website structure.
  4. Issues with GPIO Output:

    • There have been reports and discussions on forums about issues with GPIO output not working as expected with Python on Jetson devices, including the Orin Nano. These issues could stem from various sources, including software bugs, incorrect pin configuration, or hardware limitations.
    • NVIDIA periodically releases updates and patches for JetPack, which might address known issues. However, without specific details on the version of JetPack and the exact nature of the problem, it’s challenging to determine if these issues have been resolved.
  5. Steps to Troubleshoot and Possibly Resolve the Issue:

    • Verify Pin Configuration: Ensure that the pin you’re trying to use (pin 7 on the 40-pin header) is correctly configured as an output. You might need to consult the PINMUX spreadsheet or use gpio debugfs to verify and set the pin’s function.
    • Check JetPack Version: Make sure you’re running the latest version of JetPack. Updates often include fixes for known issues, which might resolve any problems you’re experiencing with GPIO control.
    • Use gpio debugfs: This tool can be useful for debugging GPIO issues. You can use it to manually set the direction and value of GPIO pins, which can help in isolating the problem.
    • Consult NVIDIA Forums and Documentation: The NVIDIA Developer Forums and official documentation are valuable resources. Look for threads related to your issue or check the documentation for any specific guidelines on using GPIO with the Jetson Orin Nano.
  6. Comparison with Other Jetson Devices:

    • While the specific issue you’re facing might be related to the Jetson Orin Nano, similar problems have been reported on other Jetson devices. The approach to resolving these issues, such as verifying pin configuration and using debug tools, is generally applicable across different Jetson models.
    • However, the exact steps and solutions might vary due to differences in hardware and software configurations between models like the Jetson Nano, Jetson Xavier, and Jetson Orin series.

In conclusion, controlling a GPIO pin on the Jetson Orin Nano involves understanding the device’s PINMUX configuration, using the appropriate Python library, and potentially troubleshooting issues related to software versions or hardware configurations. Given the dynamic nature of software development and the complexity of embedded systems, staying updated with the latest documentation, forums, and software releases from NVIDIA is crucial for overcoming challenges like the one you’re facing.

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

Hi mhebel,

Are you using the devkit or custom board for Orin Nano?

Have you verified with the latest Jetpack 6.2.1?

Please search the pinmux spreasheet in download center as following.


And refer to Jetson Orin NX and Nano Series — NVIDIA Jetson Linux Developer Guide 1 documentation to apply the change.
You should configure the pin as GPIO Output or Bi-directional if you want to control them.

Hi Kevin,
Little confused on jetpack version, I installed from SDK Manager about 2 weeks ago. Checking things, this is what I get:

dpkg-query --show nvidia-l4t-core
nvidia-l4t-core	36.4.4-20250616085344

When I run jtop, it shows no jetpack installed, though maybe it’s just a jtop version issue?

When I run

sudo apt-cache show nvidia-jetpack
[sudo] password for emac: 
Package: nvidia-jetpack
Source: nvidia-jetpack (6.2.1)
Version: 6.2.1+b38
Architecture: arm64
Maintainer: NVIDIA Corporation
Installed-Size: 194
Depends: nvidia-jetpack-runtime (= 6.2.1+b38), nvidia-jetpack-dev (= 6.2.1+b38)
Homepage: http://developer.nvidia.com/jetson
Priority: standard
Section: metapackages
Filename: pool/main/n/nvidia-jetpack/nvidia-jetpack_6.2.1+b38_arm64.deb
Size: 29300
SHA256: dd9cb893fbe7f80d2c2348b268f17c8140b18b9dbb674fa8d79facfaa2050c53
SHA1: dc630f213f9afcb6f67c65234df7ad5c019edb9c
MD5sum: 9c8dc61bdab2b816dcc7cd253bcf6482
Description: NVIDIA Jetpack Meta Package
Description-md5: ad1462289bdbc54909ae109d1d32c0a8

Package: nvidia-jetpack
Source: nvidia-jetpack (6.2)
Version: 6.2+b77
Architecture: arm64
Maintainer: NVIDIA Corporation
Installed-Size: 194
Depends: nvidia-jetpack-runtime (= 6.2+b77), nvidia-jetpack-dev (= 6.2+b77)
Homepage: http://developer.nvidia.com/jetson
Priority: standard
Section: metapackages
Filename: pool/main/n/nvidia-jetpack/nvidia-jetpack_6.2+b77_arm64.deb
Size: 29298
SHA256: 70553d4b5a802057f9436677ef8ce255db386fd3b5d24ff2c0a8ec0e485c59cd
SHA1: 9deab64d12eef0e788471e05856c84bf2a0cf6e6
MD5sum: 4db65dc36434fe1f84176843384aee23
Description: NVIDIA Jetpack Meta Package
Description-md5: ad1462289bdbc54909ae109d1d32c0a8

Package: nvidia-jetpack
Source: nvidia-jetpack (6.1)
Version: 6.1+b123
Architecture: arm64
Maintainer: NVIDIA Corporation
Installed-Size: 194
Depends: nvidia-jetpack-runtime (= 6.1+b123), nvidia-jetpack-dev (= 6.1+b123)
Homepage: http://developer.nvidia.com/jetson
Priority: standard
Section: metapackages
Filename: pool/main/n/nvidia-jetpack/nvidia-jetpack_6.1+b123_arm64.deb
Size: 29312
SHA256: b6475a6108aeabc5b16af7c102162b7c46c36361239fef6293535d05ee2c2929
SHA1: f0984a6272c8f3a70ae14cb2ca6716b8c1a09543
MD5sum: a167745e1d88a8d7597454c8003fa9a4
Description: NVIDIA Jetpack Meta Package
Description-md5: ad1462289bdbc54909ae109d1d32c0a8

ok, found the spreadsheet. Thanks, but there must be an easier way to set a GPIO as an output, and if it’s just a DT issue, why hasn’t it been corrected?

Thanks.

Sorry, I’m using the dev kit board.

Thanks for the assists here, I learned more about the device tree and how to make overlays to configure the gpio, mainly from this video - Fix GPIO on Jetson Orin Nano Super | Full Guide to Creating a Device Tree Overlay

From the spreadsheet method I got stuck where exactly to copy the generated DT files to.

Thing is, there’s plenty of examples using python to control the GPIO on the dev board, but none work unless the device tree modified first, which is never mentioned.

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