JetPack6.2 GPIO problem

This command can set the GPIO pin to high, but not to low. Why?

gpioset gpiofind "PG.05"=1

This command can successfully set PG.05 to high.

gpioset gpiofind "PG.05"=0

But it cannot be set to use this command at low.

There is still one more question. Previously, when using the gpio of the sys system, one could read files in the program to operate the gpio. So now, how can one operate the gpio in the program

Hi Seven0,

Have you configured the pinmux of PG.05 to Output before use?

Please add --mode=wait in the command as following.

# gpioset --mode=wait `gpiofind "PG.05"`=0

What program are you using? python or C?

Could someone please clarify if it’s possible to reconfigure a GPIO from input to output without modifying the Pinmux configuration?

In my case, everything is using default settings — I haven’t changed anything manually. According to the Pinmux configuration, about one third of the GPIO_XX ports are set as output, and the rest as input.

Take for example:

GPIO_11 (216) gpiochip0 106 PQ.06 Input

Is it possible to change its behavior at runtime?

In my past experience with Jetson TX2, I was able to simply write “out” to the “direction” file under gpiofs.

However, I couldn’t find how to achieve this using tools like gpioset, gpioinfo, or gpiofind.

I’m using Orin NX, but I assume GPIOs work similarly across Jetson platforms, which is why I’m asking here.

Here’s my release info:

$ head /etc/nv_tegra_release
# R36 (release), REVISION: 4.3, GCID: 38968081, BOARD: generic, EABI: aarch64, DATE: Wed Jan  8 01:49:37 UTC 2025

Thank your reply.
This is my operation. You can see that I set “0”, but the gpioinfo display still shows a high output, and the measured level is indeed high.


My program is developed using C.

Do you mean that you’ve added --mode=wait in gpioset command but it still keep in high state?
I would expect you run gpioset in first terminal and run gpioinfo in another terminal to check its state. Or you can also get a scope to confirm that.

There should be gpiod (GPIO character device API) available for C program.

Hi AntonW,

Please note that pinmux/gpio dtsi are loaded in early boot stage(MB1).
If you don’t want to reflash the board to configure the pinmux.
You can also configure them in kernel device tree, there’s tegra-pinctrl driver would configure the pinmux during boot up.
Please refer to GPIO JP6.1 different behavior than JP5.1.2 - #5 by KevinFFF for the example.

Actually, gpioget command will configure the pin as input and gpioset will configure it as output. You can simply verify them locally.

Hello everyone!

Not quite. I can’t reproduce this locally. I do see that the GPIO mode (direction) changes after using gpioset, but I don’t see any effect — the LED doesn’t light up.

Here’s how I tested. My steps:

  1. The GPIO outputs on our (custom) board are wired very simply. The lines go through a ULN2003 to control LEDs. GPIO_00 (pin 87) is connected to GND via a jumper.

  2. I chose the following three GPIOs to demonstrate the issue. Here they are in a table:

GPIO_00   87   gpiochip0   131   PZ.01   <-- used as input - OK
GPIO_03   126  gpiochip1   12    PCC.00  <-- for output - OK
GPIO_11   216  gpiochip0   106   PQ.06   <-- problem is here
  1. Then I check their status using:
gpioinfo | grep -E "PQ.06|PCC.00|PZ.01"

Output:

line 106:      "PQ.06"       unused   input  active-high  
line 131:      "PZ.01"       unused   input  active-high  
line  12:      "PCC.00"      unused  output  active-high
  1. GPIO_00 (87, PZ.01) works correctly as an input. When I connect the jumper, I can read 0 with gpioget, and without the jumper I read 1.

  2. GPIO_03 (126, PCC.00) is configured as output (by default), and I can change its state using:

gpioset -m wait $(gpiofind "PCC.00")=1

The LED turns on as expected.

  1. But the same doesn’t work for:
gpioset -m wait $(gpiofind "PQ.06")=1
  1. After all these experiments, the GPIO direction/mode has changed:
gpioinfo | grep -E "PQ.06|PCC.00|PZ.01"

Now I see:

line 106:      "PQ.06"       unused  output  active-high  
line 131:      "PZ.01"       unused   input  active-high  
line  12:      "PCC.00"      unused  output  active-high

so PQ.06 gets reconfigured as output, but nothing happens (the LED doesn’t light up).

  1. Here’s the test script I used. I included all four combinations just in case (paranoia):
#!/bin/sh

set -x

TARGET=$(gpiofind "PQ.06")
# TARGET=$(gpiofind "PCC.00")

echo $TARGET

while true; do
    gpioset -m time --sec 1 $TARGET=0
    sleep 1
    gpioset -m time --sec 1 $TARGET=1
    sleep 1
    gpioset --active-low -m time --sec 1 $TARGET=1
    sleep 1
    gpioset --active-low -m time --sec 1 $TARGET=0
    sleep 1
done
  1. The issue is not limited to GPIO_11 (216, PQ.06) — I have other GPIOs connected to LEDs as well, and they also don’t work.

Have you configured the pinmux for PQ.06 as GPIO/Output before control it?

Have you applied the patch from 40hdr - SPI1 gpio padctl register bit[10] effect by gpiod tools in JP6 - #20 by KevinFFF to check if it could help for your case?

No, I haven’t changed the pinmux — that’s exactly my main question. I installed everything via SDK Manager in the “next-next-next” mode.

  1. I want to be able to change the direction dynamically. If I now set it to Output in the pinmux, will I still be able to use this pin as Input?

  2. This used to work for me on the TX2 — I changed the direction simply by writing “in” or “out” to a special file in /sys/class/gpio.

  3. What is the Bidirectional mode? I downloaded and compared the pinmux for the TX2, and it also has Input/Output explicitly set, but still works in both directions.

I’m not sure I can apply a patch (at least not right now — I’m not confident I have enough experience to rebuild anything). On the contrary, I wanted to leave everything as default as possible so that future transitions to new JetPack versions remain smooth.

You have to configure it in pinmux spreadsheet before use.

You can configure it as Bi-directional instead.

TX2 is from different platform and come with different software release. Let’s focus on the state for AGX Orin with JP6.2.

It means that the pin can work as either Input or Output.