Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jetapck 6 with libgpiod broken #110

Open
AlexKlimaj opened this issue May 15, 2024 · 5 comments
Open

Jetapck 6 with libgpiod broken #110

AlexKlimaj opened this issue May 15, 2024 · 5 comments

Comments

@AlexKlimaj
Copy link

Coming from everything working in Jetpack 5, I am unable to get pin 32 working in Jetpack 6. Pin 33 works, Pin 32 doesn't. It does work through gpioset but not through jetson-gpio.

https://forums.developer.nvidia.com/t/gpio07-pg-06-not-working-in-jetpack-6/293013

@AlexKlimaj
Copy link
Author

Okay it is actually working but the pin state reverts to default when the script exits. In Jetpack 5 the pin stays in the state its in when the script exits. In Jetpack 6, the pin reverts back to the default pinmux state.

@anhmiuhv
Copy link
Collaborator

anhmiuhv commented May 17, 2024

This is what I found for gpioset.

https://manpages.debian.org/testing/gpiod/gpioset.1.en.html

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.

@anhmiuhv
Copy link
Collaborator

anhmiuhv commented May 17, 2024

we clean up the pin state when python code exit. We dont support different mode like this for the library. I dont think we have the functionality to set the drive mode like gpioset also.

@AlexKlimaj
Copy link
Author

I'm not concerned with the behavior of gpioset but this python library. If you don't call cleanup, it should leave the pin in the state you set it to.

@AlexKlimaj
Copy link
Author

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.

@AlexKlimaj AlexKlimaj changed the title Jetapck 6 Orin Nano/NX Pin 32 Not Working Jetapck 6 with libgpiod broken May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants