GPIO07, PG.06 not working as expected in Jetpack 6
Issue Overview
Users are experiencing issues with GPIO07, PG.06 on the Nvidia Jetson Orin Nano Dev board after upgrading to Jetpack 6. The problem specifically affects custom carrier boards and involves the following symptoms:
- GPIO07, PG.06 is not controllable when set to output in the pinmux file.
- The pin works with gpioset but not with jetson-gpio in Python.
- When using jetson-gpio, the pin reverts to its default state after the Python script exits, unlike in Jetpack 5 where it would retain its set state.
- Any interaction with the pin causes it to reset to low, even when configured as output drive high by default in the pinmux.
This issue is causing compatibility problems for users migrating from Jetpack 5 to Jetpack 6, potentially breaking existing setups.
Possible Causes
-
Changes in GPIO handling between Jetpack 5 and Jetpack 6:
The fundamental change to libgpiod in Jetpack 6 may have altered the behavior of GPIO pins. -
Differences in Jetson.GPIO versions:
Jetpack 5 uses version 2.1.6, while Jetpack 6 uses 2.1.7, which may have introduced changes in pin behavior. -
Pinmux configuration issues:
The problem might be related to incorrect or incompatible pinmux settings in Jetpack 6. -
Python script cleanup behavior:
The Jetson.GPIO library in Jetpack 6 may be implementing a more aggressive cleanup process when scripts exit. -
Underlying hardware changes:
There could be hardware-level differences between Jetpack 5 and 6 that affect GPIO behavior.
Troubleshooting Steps, Solutions & Fixes
-
Verify GPIO functionality using gpioset:
sudo gpioset --mode=exit --drive=push-pull gpiochip0 41=1
If this works, it confirms that the GPIO is physically functional.
-
Check pin status after booting:
Use thegpioinfo
command to verify the initial state of the pins:gpioinfo | grep PG.06
-
Test with official Jetson.GPIO repository:
Install the GPIO library directly from NVIDIA’s official repository:sudo pip3 install git+https://github.com/NVIDIA/jetson-gpio.git
-
Modify Python scripts to handle cleanup:
Explicitly call GPIO.cleanup() at the end of your scripts to ensure proper pin state management:import Jetson.GPIO as GPIO try: # Your GPIO operations here finally: GPIO.cleanup()
-
Use alternative GPIO control methods:
If jetson-gpio is not working as expected, consider using the gpiod library for more direct control:sudo apt-get install gpiod
Then use Python bindings for gpiod in your scripts.
-
Adjust pinmux settings:
Review and update your pinmux configuration file. Try setting the pin to bidirectional instead of output:soc_gpio19_pg6 { nvidia,pins = "soc_gpio19_pg6"; nvidia,function = "rsvd1"; nvidia,pull = <TEGRA_PIN_PULL_NONE>; nvidia,tristate = <TEGRA_PIN_DISABLE>; nvidia,enable-input = <TEGRA_PIN_ENABLE>; nvidia,lpdr = <TEGRA_PIN_DISABLE>; };
-
Test on a Jetson DevKit:
If possible, test your GPIO configuration on an official Jetson DevKit to isolate whether the issue is specific to your custom carrier board. -
Consider using persistent GPIO settings:
For applications requiring persistent GPIO states, consider implementing a system service that sets GPIO states on boot or using udev rules to configure GPIOs. -
Report the issue to NVIDIA:
If the problem persists after trying these solutions, report the issue to NVIDIA’s developer forums or GitHub repository for further investigation and potential fixes in future updates. -
Temporary workaround for retaining pin states:
If you need to maintain pin states after script exit as a temporary measure, you could implement a small daemon that continuously sets the desired pin state in the background.