Jetson GPIO with Custom Carrier

Hi,

I was going through GPIO python libraries and came across Jetson GPIO. If I am using a custom carrier, i.e. not the NVIDIA Developer Kit, can I still utilize this library?

Going through the README, I came across this statement, which I was particularly interested inGPIO.TEGRA_SOC mode.

GPIO.setmode(GPIO.BOARD)
# or
GPIO.setmode(GPIO.BCM)
# or
GPIO.setmode(GPIO.CVM)
# or
GPIO.setmode(GPIO.TEGRA_SOC)

With this mode set you provide a string that corresponds to the GPIO you’re trying to configure as output or input, but what would that look like? If I run: sudo cat /sys/kernel/debug/gpio

Would either of the highlighted options work (in the scenario they’re configured as a regular GPIO in the pinmux). Would I be able to define the pin HIGH/LOW by using either “gpio-487” or “PAC.01” as a parameter.

I am using Orin AGX, and if this is not possible for custom carriers, can you potentially recommend another library?

Hello @msalazar,

We wouldn’t think of a reason for the GPIO library not to work with your custom carrier.
Just take into consideration the difference that there might be between your carrier board’s pinmux and the devkit carrier board, since although the SOM will inherently have the same pins regardless of the carrier it is in, the routing on the carrier will probably change.

best regards,
Andrew
Embedded Software Engineer at ProventusNova

Hi @proventusnova,

Thanks for the clarification. Just to follow up on my original question.

Using the TEGRA_SOC method, how should I define parameter that is passed into the GPIO.setup() method?

For example when enabled using GPIO.board() mode you can do the following

GPIO.setup(10, GPIO.in)

This would set pin number 10 as an input. But how would you do that for the other method:

GPIO.setup("gpio485", GPIO.in)

Where can I find my corresponding pins string name?

Thanks.

Hey @msalazar,

That is a great question.

Check this sample code out from the Jetson GPIO Repo:

In there they showcase different modes including TEGRA_SOC, that might give you a better understanding on how to achieve what you are looking for.

Please keep us posted and don’t hesitate to reach out if you need further support.

best regards,
Andrew
Embedded Software Engineer at ProventusNova

Hi msalazar,

What’s the Jetpack version in use?

Do you have the similar design for the 40-pins header on your custom carrier board as the devkit ?

Please refer to jetson-gpio/lib/python/Jetson/GPIO/gpio_pin_data.py at master · NVIDIA/jetson-gpio · GitHub for the pin available for Jetson.GPIO.
If your have the different design on custom carrier board, it may not work.

Hi Kevin,

The corresponding pin out does match. So I unfortunately can’t use GPIO.board.

I am using Jetpack 6.2 or r36.4.3

Actually, you can update gpio_pin_data.py to match your design for the custom carrier board.

Hi Kevin,

Can you provide of example how I would modify gpio_pin_data.py? The custom carrier uses an Orin AGX.


You can refer to Extending Jetson.GPIO to support gpio pins that are not on the 40 pin header - #3 by KevinFFF for the example what I shared the case for Orin NX.
Above modification is valid for the devkit.
Please note that you should refer to what the actual design of your custom carrier board.

You are using AGX Orin, please update in JETSON_ORIN_PIN_DEFS instead.

Hi Kevin,

thanks for that example. One last question, in your answer you provide this entry:

(92, 'PP.00', "tegra234-gpio", 41, 28, 'CAM0_MCLK', 'GP52_CLK1', None, None),

What do the integers 92, 41, 28 represent? Additionally, How do I get the signal name i.e. ‘CAM0_MCLK’
and ‘GP52_CLK1’, I am assuming those are capabilities of the PP.00 pin, depending on the pinmux, but where can I grab the corresponding signal name?

41 and 28 are just 2 used number in the table.

You can find CAM0_MCLK in Column B(Jetson SODIMM Signal Name) and GP52_CLK1 in Column E(SOC Ball Name) of pinmux spreadsheet.

92 is the GPIO line number, you can run the following command to check.

$ sudo gpioinfo|grep PP.00
        line  92:      "PP.00"       unused   input  active-high