Hello forum! I have a Jetson Xavier with lastest JetPack, but I can’t control GPIO. Example (Blinking LEDs on NVIDIA Jetson Xavier, Jetson TX2, and Raspberry Pi in 4K - YouTube) shows a dir /sys/class/gpio/gpio393 to contol GPIO. But I have no such similar. How can I do this?
hello briskiydmitry,
may I know which pin you would like to control?
some information as below for your reference.
- you should check the module pin names in Jetson AGX Xavier Pinmux.
- please refer to Xavier’s GPIO definitions,
$TOP/kernel_src/kernel/nvidia/include/dt-bindings/gpio/tegra194-gpio.h - please also refer to Tegra Linux Driver Package TX2 Adaptation Guide → [GPIO Changes] for the GPIO mapping formulas.
- another discussion thread, Topic 1001584 about GPIO you could refer to.
Thx. These materials helped me a lot. It would be great to get an example of control on с / с ++. I found a ready solution in python, what if it could be useful to someone (Jetson.GPIO · PyPI) .
Hi briskiydmitry,
For an example of control on с, please see:
The discussion thread you mention just describes problems, but no solutions. I in particular can’t drive a pin, although everything seems ok. I can export the pin, change direction to output and write a value, but the output never changes - it is always the same -
This is clearly some goof-up, otherwise exporting the pin will always fail.
So the question is has anyone(perhaps you) got it to work and how? And why are there some many posts on GPIO but no solution to correct it.
Here’s an example for driving GPIO from user level C/C++:
Note that the specific GPIO port names/addresses are taken from the Jetson Nano; you’d have to update the code to match the address map of the Xavier.