Device Tree Overlay for GPIO in Jetpack 6

I, like many others, am having issues getting the Orin AGX on Jetpack 6 to work. I’ve gotten to the point where I have a device tree overlay and can see it as an option in the expansion header configuration screen of jetson-io.py. However, I cannot get it to mark the pin as used in any way.

Below is the relevant portion of the dts file. It should be setting the pin 18 on the 40 pin header to be gpio (I need it as input).

    fragment@0 {
        target = <&pinmux>;

        __overlay__ {
            pinctrl-names = "default";
            pinctrl-0 = <&jetson_io_pinmux>;

            jetson_io_pinmux: exp-header-pinmux {
                    hdr40-pin18 {
                        nvidia,pins = "soc_gpio21_ph0";
                        nvidia,tristate = <0x0>;
                        nvidia,enable-input = <0x1>;
                        nvidia,pull = <0x0>;
                    };
             };
        };

What am I missing? I’ve been going through the documentation and forum but can’t find anything helpful.

Hi xguay,

Are you using the devkit or custom board for AGX Orin?
What’s the exact Jetpack version in use?

What do you mean about “mark the pin as used”?
May I know what’s your use case?

Are you trying to use Jetson-IO tool to configure the pin to be used as GPIO?
(e.g. PIN18 of 40-pins header to be GPIO/Input !?)

Are you trying to use Jetson-IO tool to configure the pin to be used as GPIO?
(e.g. PIN18 of 40-pins header to be GPIO/Input !?)

Exactly that. I’m trying to write a compatible hardware configuration for the Orin AGX Developer kit.
Also note I applied this related patch: jetson-orin-gpio-patch/pinctrl-tegra-sfsel.patch at main · jetsonhacks/jetson-orin-gpio-patch · GitHub
And I can’t generate a dts file via the pinmux spreadsheet to compare against because the macros fail for me.

Please also share this information so that I can know your state.

It is not supported currently.
Jetson-IO tool can only help you to enable some functions on expansion header.
By default, the unused pins are configured as GPIO/Input.
You can simply check pinmux spreadsheet for them.

You can also refer to GPIO JP6.1 different behavior than JP5.1.2 - #3 by KevinFFF for the similar use case.

So, now knowing that the default state of the pin is what I was looking for I dug into the issue a bit more. I tried declaring the pin usage though another method. It seems the BCM style pin declaration is not what I thought it was. My understanding is that it was the pin number NOT the GPIO number on the Raspberry Pi header. Big difference. So pin 18 is GPIO 24 according to this pinout document
Thank you for your time.

Please check the following Figure from Jetson AGX Orin Developer Kit Carrier Board Specification

PIN18 of 40-pins expansion header is GPIO35.
And you can refer to the following image for details, it is also PH.00 which you may want to use in device tree.
image

That was my understanding. But as you can see in the code below that is NOT how it works. Following that I thought it must have meant the physical pin. That doesn’t throw an error, but it maps to the wrong pin. Only setting it as 24 (the gpio used for that pin on the raspberry pi) gives me correct output.

Python 3.10.12 (main, Feb  4 2025, 14:57:36) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Jetson.GPIO as GPIO
>>> import time
>>> 
>>> # For RPi style header
>>> pin_index_mode = GPIO.BCM
>>> channel = 35
>>> 
>>> GPIO.setmode(pin_index_mode)
>>> GPIO.setup(channel, GPIO.IN)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/Jetson/GPIO/gpio.py", line 333, in setup
    ch_infos = _channels_to_infos(channels, need_gpio=True)
  File "/usr/lib/python3/dist-packages/Jetson/GPIO/gpio.py", line 124, in _channels_to_infos
    return [_channel_to_info_lookup(c, need_gpio, need_pwm)
  File "/usr/lib/python3/dist-packages/Jetson/GPIO/gpio.py", line 124, in <listcomp>
    return [_channel_to_info_lookup(c, need_gpio, need_pwm)
  File "/usr/lib/python3/dist-packages/Jetson/GPIO/gpio.py", line 110, in _channel_to_info_lookup
    raise ValueError("Channel %s is invalid" % str(channel))
ValueError: Channel 35 is invalid
>>> sig_in = GPIO.input(channel)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/Jetson/GPIO/gpio.py", line 393, in input
    ch_info = _channel_to_info(channel, need_gpio=True)
  File "/usr/lib/python3/dist-packages/Jetson/GPIO/gpio.py", line 119, in _channel_to_info
    return _channel_to_info_lookup(channel, need_gpio, need_pwm)
  File "/usr/lib/python3/dist-packages/Jetson/GPIO/gpio.py", line 110, in _channel_to_info_lookup
    raise ValueError("Channel %s is invalid" % str(channel))
ValueError: Channel 35 is invalid
>>> print(f"Input on pin {channel}:\t{sig_in}")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'sig_in' is not defined
>>> 

Please refer to jetson-gpio/lib/python/Jetson/GPIO/gpio_pin_data.py at master · NVIDIA/jetson-gpio · GitHub that the BCM pin for PH.00 is 24 as following. (i.e. GPIO35 is just the name of this pin)

(43, 'PH.00', "tegra234-gpio", 18, 24, 'GPIO35', 'GP115', '32c0000.pwm', 0),

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.