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

LinuxGPIO or SPI doesn't work on NVIDIA Orin Nx #1708

Open
ltidswell opened this issue Feb 25, 2024 · 10 comments
Open

LinuxGPIO or SPI doesn't work on NVIDIA Orin Nx #1708

ltidswell opened this issue Feb 25, 2024 · 10 comments
Labels
enhancement New feature or request

Comments

@ltidswell
Copy link

I am trying to program an Arduino Nano using AVRDUDE via the ICSP header on the Nano and the MOSI, MISO, and SCK pins on the 40 pin expansion header on the Orin Nx. I am using the Seeed Studio base board with the Orin Nx 16GB (https://www.seeedstudio.com/reComputer-J4012-p-5586.html) and have Jetpack 5.1.1 installed. Am using version 7.2 of AVRDUDE and followed these install instructions: https://github.com/avrdudes/avrdude/wiki/Building-AVRDUDE-for-Linux

Confirmed the Arduino & wires work by testing it on a Pi. Am trying to run:
sudo avrdude -v -p m328p -c linuxgpio

The naming convention for GPIO pins on the NVIDA Orin (also on the Xavier NX, possibly other NVIDIA devices too) is not gpioPINNUM like on other devices, the pins I am using and what they're called within /sys/class/gpio are:
389 --> PG.06 481 --> PZ.03 483 --> PZ.05 482 --> PZ.04
image

I modified linuxgpio.c to accept this naming convention and am managing to export the first pin but am now getting this error:
avrdude main() error: unable to open port gpiochip0 for programmer linuxgpio
I used gpioinfo to confirm the pins I am using are in gpiochip0.

I get a similar error trying to open the SPI port.

Any idea on how to fix this / is there support for using AVRDUDE on these devices?
Note: programming works via USB connection but in my application I can't use this.

@ltidswell ltidswell changed the title LinuxGPIO or SPI don't work on NVIDIA Orin Nx LinuxGPIO or SPI doesn't work on NVIDIA Orin Nx Feb 25, 2024
@mcuee mcuee added the enhancement New feature or request label Feb 25, 2024
@mcuee
Copy link
Collaborator

mcuee commented Feb 25, 2024

@SebKuzminsky

Just wondering if you can help here since you are the author of PR #1299.

@mcuee
Copy link
Collaborator

mcuee commented Feb 25, 2024

@s-wakaba

Just wondering if you can help here as well since you seem to be familiar with linuxspi.

@mcuee
Copy link
Collaborator

mcuee commented Apr 14, 2024

@ltidswell

Are you using sysfs and not libgpiod? If that is the case, please try libgpiod to see if that works.

Reference: please refer to this discussion, once the user switches to libgpiod, the problem got resolved.

@mcuee
Copy link
Collaborator

mcuee commented Apr 28, 2024

@ltidswell

Please help to use libgpiod and try latest git main. Thanks.

@stefanrueger
Copy link
Collaborator

@ltidswell Just checking where you are with this issue?

@ltidswell
Copy link
Author

@stefanrueger Found the issue to be the SPI pins don't output enough current (20uA) on the Nvidia SOMs. Selecting pins that output 20mA (I2C pins, datasheet: https://files.seeedstudio.com/products/NVIDIA/reComputer-J401x-datasheet.pdf) works using linuxGPIO but still had to manually convert to Nvidia GPIO names. Am attempting to use a non-inverting buffer on the SPI pins to see if that works. @mcuee will try git main when I get a chance but hoping using a buffer will fix the issue.

@stefanrueger
Copy link
Collaborator

Thanks for reporting back. This might help others with the same issue.

manually convert to Nvidia GPIO names

If you have an idea how git main could help please tell us in more detail. Better still submit a PR, eg, where the GPIO naming scheme is a -x command line parameter or a parameter in the avrdude.conf entry.

@mcuee
Copy link
Collaborator

mcuee commented Aug 9, 2024

@ltidswell

Any updates on this issue?

We may have to close the issue a few days later (say one week later) if we do not hear from you.

@ltidswell
Copy link
Author

@mcuee I fixed the issue by only using high current pins (#1708 (comment)). Am yet to try other solutions

@John-194
Copy link

@ltidswell
I am also trying to program Arduino via Jetson GPIO. Could you share how you modified linuxgpio.c to accept its naming convention?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants