NVIDIA / jetson-gpio

A Python library that enables the use of Jetson's GPIOs
MIT License
936 stars 261 forks source link

jetson-gpio doesn't work on Jetpack 6.0 ??? #114

Open HappySamuel opened 2 months ago

HappySamuel commented 2 months ago

Recently, i upgrade my AGX Orin from Jetpack 5.0 to Jetpack 6.0, but jetson-gpio seems doesn't work anymore. Any idea why? and how to solve this issue?

According to my observation, setting the GPIO pins as input(s) will work, but setting as output(s) doesn't work.

anhmiuhv commented 2 months ago

How did you upgrade it?

HappySamuel commented 2 months ago

Hi @anhmiuhv

Flashing Jetpack 6.0 into AGX Orin

roshea6 commented 2 months ago

I seem to be getting the same issue on a Jetson Orin NX development kit flashed with Jetpack 6.0. I've used the library without issue before on a Jetson Xavier NX on Jetpack 5.

anhmiuhv commented 2 months ago

In Jetpack 6.0 we use the upstream kernel gpio driver instead of the downstream kernel driver in JP5. The upstream driver does not have the functionality to dynamically change the GPIO into gpio mode. Therefore, you will need to modify the pinmux in the BCT to configure the pin you want to use as GPIO and flash it onto the device.

This is the documentation on how to modify and create the BCT https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/HR/JetsonModuleAdaptationAndBringUp/JetsonAgxOrinSeries.html?highlight=pin%20direction#pinmux-changes

To use a pin as GPIO, ensure that E_IO_HV field is disabled in corresponding pinmux register of the GPIO pin. You can disable the 3.3V Tolerance Enable field in the pinmux spreadsheet. Also, make sure Pin Direction to Bidirectional so that userspace framework can operate GPIO in both input and output direction. After these configurations, reflash the board with the updated pinmux file

SamRodkey commented 1 month ago

In Jetpack 6.0 we use the upstream kernel gpio driver instead of the downstream kernel driver in JP5. The upstream driver does not have the functionality to dynamically change the GPIO into gpio mode. Therefore, you will need to modify the pinmux in the BCT to configure the pin you want to use as GPIO and flash it onto the device.

This statement makes it sound like GPIO functionality (and the Jetson-GPIO library) is broken for unmodified Jetson Orin Nano and other units which can use Jetpack 6 without performing these steps. Is this correct?

This is the documentation on how to modify and create the BCT https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/HR/JetsonModuleAdaptationAndBringUp/JetsonAgxOrinSeries.html?highlight=pin%20direction#pinmux-changes

Is the link here essentially the required steps to restore GPIO functionality when using Jetpack 6 for any NVIDIA Jetson series using Jetpack 6 other than a Jetson Orin AGX Developer Kit board?

The following statement is ambiguous to me:

If your board schematic differs from the schematic for the Jetson AGX Orin Developer Kit board, you must change the pinmux configuration applied by the software.

I'm not sure if this statement is saying any stock, unmodified board purchased by NVIDIA other than AGX Orin Developer Kits or AGX Orin developer kits which have a modified physical interface and therefore would have a different schematic...

To use a pin as GPIO, ensure that E_IO_HV field is disabled in corresponding pinmux register of the GPIO pin. You can disable the 3.3V Tolerance Enable field in the pinmux spreadsheet. Also, make sure Pin Direction to Bidirectional so that userspace framework can operate GPIO in both input and output direction. After these configurations, reflash the board with the updated pinmux file

Can you elaborate on this. What does the E_IO_HV field do? I only use a python wrapper of this library, I have no idea what this means....

SamRodkey commented 1 month ago

This is the documentation on how to modify and create the BCT https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/HR/JetsonModuleAdaptationAndBringUp/JetsonAgxOrinSeries.html?highlight=pin%20direction#pinmux-changes

I ran the spreadsheet and the macro per the instructions using Excel on a MacOS and it appears to have failed with no warnings or errors. The only output is a zero byte file in the parent directory where the directory path is included in the file name?

The macro is located inside /downloads/pinmux/ and it created a zero byte file called pinmux\orin-jetson orin nano-pinmux.dtsi. I think macro only works on a windows machine due to path separator differences between platforms?