We are working on porting our device tree changes for the ARK Jetson PAB Carrier to Jetpack 6. We are stuck on controlling GPIO07, PG.06. This was all working in Jetpack 5 with the pinmux file set to output. Now with it set to output, it isn’t controllable.
I tried setting it to Bidirectional in the pinmux, but it doesn’t look like the excel is generating the correct config for the pin.
With jetson-gpio this works in Jetpack 5 but not 6.
import RPi.GPIO as GPIO
import time
Pin Definitions
vbus_det_pin = 32
def main():
# Pin Setup:
GPIO.setmode(GPIO.BOARD) # BCM pin-numbering scheme from Raspberry Pi
# set pin as an output pin with optional initial state of HIGH
GPIO.setup(vbus_det_pin, GPIO.OUT, initial=GPIO.HIGH)
value = GPIO.HIGH
print("Outputting {} to pin {}".format(value, vbus_det_pin))
GPIO.output(vbus_det_pin, value)
It looks like Jetson.GPIO is already built into Jetpack 5 and 6. In Jetapck 5 it shows the version is 2.1.6 but in Jetapck 6 it shows 2.1.7. But 2.1.7 is not shown in the github repo.
Yes its my own carrier board. Everything with this GPIO works in Jetpack 5. Flashed back to 35.5.0 on the same board with the same pinmux and it works.
I just verified locally on my Orin Nano DevKit, and I can make sure both PG.06 and PH.00 work with either gpiod or jetson-gpio.
Does setting it as bidirectional makes any difference?
Or maybe your multimeter is somehow problematic.
Okay I think I have it figured out but not ultimately solved. In Jetpack 5, the jetson-gpio python script would leave the pins configured and driven after exiting. But in Jetpack 6, when the python script exits, the pins revert to the default state.
How can we use the python script to leave a pin in a certain state after exiting?
Modes:¶ exit:
set values and exit immediately wait:
set values and wait for user to press ENTER time:
set values and sleep for a specified amount of time signal:
set values and wait for SIGINT or SIGTERM
Note: the state of a GPIO line controlled over the character device reverts to default when the last process referencing the file descriptor representing the device file exits. This means that it’s wrong to run gpioset, have it exit and expect the line to continue being driven high or low. It may happen if given pin is floating but it must be interpreted as undefined behavior.
we clean up the pin state when python code exit. We dont support different mode like this for the JetsonGPIO library. I dont think we have the functionality to set the drive mode like gpioset also.
I’m not concerned with gpioset necessarily. Just the jetson-gpio python library. Historically on the Pi and Jetson if you didn’t call cleanup, it would leave the pin in the state you set it to. This is going to break a lot of people’s setups when they move from Jetpack 5 to 6.
Okay so this comes back to the fundamental change over to libgpiod.
I changed my pinmux on this pin to output drive high by default. But even in the python script that only ever drives the pin high, when the script exits, it goes back to low.
Any interaction with the pin will cause it to reset to low.