I am following the code in the bottom half of this tutorial.
It’s a C++ script that should send a signal out of pin 7 that should be able to make an LED blink.
Sorry, the code is through a link, but it’s all there. I’m following the code and I installed the library for running gpio on C++ for a Jetson correctly.
The AGX Xavier white LED light works fine when it’s powered on. My only problem is with using the pins as gpio pins. I’m not getting anything from them no matter if I use C++ or Python gpio libraries.
How can I get the GPIO pins to work?
Can I test them somehow?
I just totally reinstalled Jetpack and everything on the machine. It doesn’t seem to work.
If you don’t know then I’m sure I don’t know. Something like this would work with an Arduino or Raspberry Pi with little effort.
Is there no sample script from Nvidia that can get the AGX Xavier to control an LED or a stepper motor? I’ve been going back and forth with the author of this library trying to get the Xavier’s pins to work. Nvidia makes this product and nobody knows how to use it.
Is there something other than gpio I can use software with to control motors and LEDs?
Just want to clarify, I am not sure why you ignored half of my comment.
I already shared the method that does not need any script to test the GPIO in previous comment. That method uses the sysfs to control the GPIO.
If you have any problem in running that, please let me know so that I can give you a more easy way to understand that.
I believe most of the “GPIO lib” python scripts are also based on this method. Thus, you can use this to test. If even that fails, then no lib in python would work and we may need some hardware guy to check what is going on. But I think this may not happen easily.
Please make sure you have pinmux setting correctly first. If you don’t understand what does “pinmux” mean here, please let me know.
I am sorry that this may not sound a easy way because I want to share a thorough solution which makes sure everything is ok.
Not every jetson project over the Github is maintained by us. Sometimes we do see some bugs. Thus, I prefer to using some basic system control method to test the function.
Is there a test I can do to find out if the device is broken? Only the 3.3V and 5V pins do what they are supposed to do.
Do I need a PN2222 transistor for any GPIO signal?
The pins I try to use as GPIO are labelled as ‘unsued’ at $ sudo /opt/nvidia/jetson-io/jetson-io.py
Because this link to a text document is confusing. It starts with "THIS ABI IS DEPRECATED, THE ABI DOCUMENTATION HAS BEEN MOVED TO
Documentation/ABI/obsolete/sysfs-gpio AND NEW USERSPACE CONSUMERS
ARE SUPPOSED TO USE THE CHARACTER DEVICE ABI. THIS OLD SYSFS ABI WILL
NOT BE DEVELOPED (NO NEW FEATURES), IT WILL JUST BE MAINTAINED.
Refer to the examples in tools/gpio/* for an introduction to the new
character device ABI. Also see the userspace header in
include/uapi/linux/gpio.h"
And this quote…
“Board documentation should in most cases cover what GPIOs are used for
what purposes. However, those numbers are not always stable; GPIOs on
a daughtercard might be different depending on the base board being used,
or other cards in the stack. In such cases, you may need to use the
gpiochip nodes (possibly in conjunction with schematics) to determine
the correct GPIO number to use for a given signal.”
Numbers are not always stable and I might need to use “gpiochip nodes”.
We’ve been going back and forth a few times and I don’t know how to get anything out of the pins on the Xavier. If I could just have some examples in C++ and Python, or the command line that make the device do the things people buy the device for I would appreciate it. Controlling LEDs, stepper motors, encoders. Arduinos and Raspberry Pis take a few minutes to get going with these things.
Can I do any tests to a pin that would show on an electrometer?
If there is some deeper layer of industrial robotics computing that I need to learn I would learn it.
Ok, forget about that document. Maybe too much details there make you confused.
Just follow the " Terminal Access to GPIO pins" in below website.
If you want to use “pin7” on jeton AGX, check the website I shared in previous comment.
There is a gpio “422” under the “sysfs” in the table. This “422” is what you need to use in the “export” of that “Terminal Access to GPIO pins” section.
The “gpio number will change” means this “422” is not always representing “pin7” when different platform comes to use. For example, “gpio422” is not pin 7 on jetson nano.
I have the pin numbers down. I know what the pins are supposed to be.
Things in this website don’t work on my AGX Xavier.
$ sudo cp /opt/nvidia/jetson-gpio/etc/99-gpio.rules /etc/udev/rules.d/ cp: cannot stat '/opt/nvidia/jetson-gpio/etc/99-gpio.rules': No such file or directory
You seem like you’re getting mad but I would just like a way to use the pins. You link to many things that are not from Nvidia. I don’t understand why Nvidia doesn’t have good documentation and troubleshooting for the pins. I’ve been trying to get something out of the pins every day this week and I can’t tell if the device is broken.
It’s not necessarily the customers fault for not understanding. I understand all I need to use Arduino and Raspberry Pi. I need something like that but with more memory. I thought that’s what I’d be getting with Nvidia.
I’m sorry, I don’t know what a ‘node’ is. I would like to learn. # cd /sys/class/gpio/gpio422 # dir active_low device direction edge power subsystem uevent value
SUCCESS!
I tried pin 37 and I’m able to use it to turn an LED off and on for the first time working with the Xavier all week.
No. I have only been able to toggle the pins labelled gpio that say ‘3.3V’ and not the ones that say ‘1.8/3.3V’ on this website with a pin diagram
Checking the pins with an electrometer they are toggling from 0V to 3.3V.
I think I mentioned before, I tried an electrometer on pins 7 and 11 and they always showed about 0.1V, whether they were toggled on or off. Pins 7 and 11 are among the ones labelled ‘1.8/3.3V’.
Can I change a mode or pinmux option, or something for these pins?
Eventually I’d like to hook up a robot to this device. I see PWM is only available on three pins. I’m still in the dark with what most of these pins are and how to use them. PWM is limited to three motors?
Did I mention the problem was simply the little two pin bridge was not over the correct pins? You made lots of comments “Maybe you’re confused” and showed me all these things that had nothing to do with the problem.
Maybe you should have found someone at the company who might have known why the gpio pins weren’t working. Somebody who knew about the bridge over pins 1 and 2 or pins 2 and 3.
back to your original question, may I confirm what’s your actual use-case, also, what pins you’re going to use?
had you download the pinmux spreadsheets, there shows the default pin configurations for reference.
furthermore, there’s Jetson-IO to Configuring Jetson Expansion Header, it’ll create the *.dtbo binary to overwrite the pin settings after system boot into linux kernel. so, please have pinmux change *.cfg file flashed if you would like to have pin configurations applied during bootloader stage.