I can not control GPIO3_PI.00 on AGX ORIN 32GB devkit [Jetpack 6.0 (rev. 2)]

Hello
First, I will explain my state.
My host PC is Ubuntu 22.04, and I flash my AGX ORIN 32GB devkit using SDK Manager.
SDK version is Jetpack 6.0 (rev. 2) and I flash it to NVMe SSD which is installed to board.

After all processes are finished, I try to control GPIO with VS CODE using the code below.

import Jetson.GPIO as GPIO
import time
GPIO_PIN = 40
GPIO.setmode(GPIO.BOARD)
GPIO.setup(GPIO_PIN, GPIO.OUT, initial=GPIO.HIGH)
print(“Press CTRL+C when you want the LED to stop blinking”)
while True:
time.sleep(2)
GPIO.output(GPIO_PIN, GPIO.HIGH)
print(“ON”)
time.sleep(2)
GPIO.output(GPIO_PIN, GPIO.LOW)
print(“OFF”)


I’ve experience that this code is work for several month ago.
(I think that time my Jetpack version is 5.x)
But now I can’t control GPIO with this code.

So, I try to figure how to solve this problem.
And I found in this forum that GPIO CONTROL on AGX ORIN with JETPACK 6.0 is not possible without changing(update) device tree.

Refer to [ Jetson AGX Orin Platform Adaptation and Bring-Up — NVIDIA Jetson Linux Developer Guide 1 documentation ]. I download pinmux spreadsheet and found the pin is set as input(not bidirectional).

So I changed to bidirectional and generate DT file. Finally I’ve got 3 files
[Orin-jetson_agx_orin-gpio-default.dtsi 4.9KB]
[Orin-jetson_agx_orin-padvoltage-default.dtsi 2.4KB]
[Orin-jetson_agx_orin-pinmux.dtsi** 65.7KB]

Now here is my question.
Based on pin-mux change document, I have to follow

Copy the pinmux.dtsi file to the <l4t_top>/bootloader/generic/BCT/ directory, and copy the gpio.dtsi file to the <l4t_top>/bootloader/ directory.

You do not need to copy the padvoltage.dtsi file.

But the person likes me who are not familiar with linux, can not follow any more.

In “<l4t_top>/bootloader/generic/BCT/” and <l4t_top>/bootloader/, there are lots of files with the name that I can’t understand.
what I mean is I cannot find which file do I have to replace with generated file.
And do I have to chang the generated files name to that original replaced file name?.

And also next step is

After copying the files, ensure that you point these files to the new board.conf file that you created for your board.

I don’t know what is board.conf. I can’t find file name with board.conf in linux for tegra folder.

Can anyone explain kindly for newby?

and even if I finish this process, how can I flash this to NVMe?
Any command for Terminal?
this command affects only for jetpack? not for Ubuntu image?

Finally, is there no way to change this in flashed Jetson after flash normal JETPACK?
This is not flexible at all. GPIO PINs(at least headered out 40 pins) can be used anytime during developing process.
But if I have to reflash it like this…it makes developing process to hard.

Anyway, I’m waiting for anyone who can help me.
Thank.

Hi easter1208,

Welcome to join Jetson platform.

You have to check the board config first.
For example, it should be jetson-agx-orin-devkit.conf for AGX Orin.
You can check what configs are included in this board config and you would find the following line in p3701.conf.common.

PINMUX_CONFIG="tegra234-mb1-bct-pinmux-p3701-0000-a04.dtsi";

You have to replace this dtsi, which should be under <Linux_for_Tegra>/bootloader/generic/BCT/.
Or you can just name your pinmux device tree as pinmux.dtsi and modify this line.

To install the BSP package into NVMe SSD, you can refer to the steps in <Linux_for_Tegra>/tools/kernel_flash/README_initrd_flash.txt.

Please check the flash log and you would know which layout file, board config, dtb…etc are used for your board.

You can also modify the pinmux register through devmem command but it would only valid before next reboot.

thanks for help.

I need further information.

first, I can find file “jetson-agx-orin-devkit.conf” under the path below.

./nvidia/nvidia_sdk/JetPack_6.0_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra/

and in this code I can find this line.

source “${LDK_DIR}/p3737-0000-p3701-0000.conf.common”;

in the file “${LDK_DIR}/p3737-0000-p3701-0000.conf.common”;

I can find

PINMUX_CONFIG=“tegra234-mb1-bct-pinmux-p3701-0000.dtsi”;
PMC_CONFIG=“tegra234-mb1-bct-padvoltage-p3701-0000.dtsi”;

the file tegra234-mb1-bct-pinmux-p3701-0000.dtsi is in the path below

./nvidia/nvidia_sdk/JetPack_6.0_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra/bootloader/generic/BCT

So I can understand

change
PINMUX_CONFIG=“tegra234-mb1-bct-pinmux-p3701-0000.dtsi”;
to →
PINMUX_CONFIG=“Orin-jetson_agx_orin-pinmux.dtsi”;
(After copy this file to the path)

But
[Jetson AGX Orin Platform Adaptation and Bring-Up — Jetson Linux<br/>Developer Guide 34.1 documentation] said that I need to copy one more file which named

Orin-jetson_agx_orin-gpio-default.dtsi

They said I need to copy this file to

./nvidia/nvidia_sdk/JetPack_6.0_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra/bootloader

I can copy this to folder, but I don’t know where to mention it like

PINMUX_CONFIG=“Orin-jetson_agx_orin-pinmux.dtsi”;

Step by step, Can I ask you about how to handle this ‘Orin-jetson_agx_orin-gpio-default.dtsi’ file?

Thanks for fast reply.

Correct!

The GPIO dtsi(Orin-jetson_agx_orin-gpio-default.dtsi) should be included in your PINMUX dtsi(Orin-jetson_agx_orin-pinmux.dtsi) already.
Please just put Orin-jetson_agx_orin-gpio-default.dtsi under <Linux_for_Tegra>/bootloader/ and it will be recognized.

Okay.
I’ve tried last day.
I tried several settings.

-1. Just use SDK manager.
I cannot control GPIO. I can import Jetson.GPIO without any problems, but GPIO is not controllable.

-2. After flash all components with SDK manager, re-flash with your erased command after copy those 2 files to right folder.

sudo ./tools/kernel_flash/l4t_initrd_flash.sh jetson-agx-orin-devkit-as-jao-32gb nvme0n1
(I just set GPIO pin to bidirectional and init PU and generate pinmux file.)

After flash process is finished, I even cannot import Jetson.GPIO.
Terminal said that such like “cannot recognize device name?”

-3. So I try to change PINMUX spreadsheet as like

HEADER 35 as ‘Output’ & ‘init PU’,
HEADER 38 as ‘Output’ & ‘Drive 0’,
HEADER 40 as ‘Output’ & ‘Dirve 1’

and generate files for test which setting is right setting.

Next, I copy this files to right place and try to setup through SDK manager.
(I’m not sure this will works)

In the file “${LDK_DIR}/p3737-0000-p3701-0000.conf.common”;
I change
PINMUX_CONFIG=“tegra234-mb1-bct-pinmux-p3701-0000.dtsi”;
to
PINMUX_CONFIG=“Orin-jetson_agx_orin-pinmux.dtsi”;

Change files and turn on SDK manager and install as normal.
(I think this installation maybe reflect changed files)

But in this case, SDK manager makes error in SDK components install step after flash Jetson OS.
with error like

Access to APT repository and ability to install Debian packages with it.: Apt repository check failure (1. sudo apt-get update && sudo apt-get check; 2. sudo dpkg --audit).

Anyway, I push skip and installation is finished. but nothing work properly.

Here is my next question.1

process
-0 Install whole components normally using SDK Manager.
-1 Generate pinmux files
-2 Copy to right folder
-3 Change "p3737-0000-p3701-0000.conf.common” files [PINMUX_CONFIG=“tegra234-mb1-bct-pinmux-p3701-0000.dtsi”;] to [PINMUX_CONFIG=“Orin-jetson_agx_orin-pinmux.dtsi”;]
-4 flash with command [sudo ./tools/kernel_flash/l4t_initrd_flash.sh jetson-agx-orin-devkit-as-jao-32gb nvme0n1]

The process above is right? and the command that i use in step 4 is right command?

Here is my next question.2

Now you are erase about the way to update this pinmux in installed AGX ORIN after normal install process using SDK Manager.
Can you tell me how can I do that?

This struggling situation makes me so sad.
I think this is really easy things for who already knows how to do it. But for me…I spend over 3 months only for figure it out just how to control GPIO!! :(

Please help me.
Thanks.

And 1 more.

Jetson AGX Orin Platform Adaptation and Bring-Up — NVIDIA Jetson Linux Developer Guide 1 documentation ]
said

Copy the pinmux.dtsi file to the <l4t_top>/bootloader/generic/BCT/ directory, and copy the gpio.dtsi file to the <l4t_top>/bootloader/ directory.

But I’ve check the file “pinmux.dtsi” in <l4t_top>/bootloader/generic/BCT/

include “./Orin-jetson_agx_orin-gpio-default.dtsi”

it means “Orin-jetson_agx_orin-gpio-default.dtsi” should be in ‘<l4t_top>/bootloader/generic/’ not <l4t_top>/bootloader/ directory. Isn’t it?

May I know why you use this as board config?’
Please use jetson-agx-orin-devkit instead.

It’s the similar thing just the naming…
pinmux.dtsi is exact your Orin-jetson_agx_orin-pinmux.dtsi
gpio.dtsi is exact your Orin-jetson_agx_orin-gpio-default.dtsi

Please use correct board config for your board. It should be jetson-agx-orin-devkit.conf.

You can also check the full flash log to check if your modification has been applied through checking which pinmux dtb in use.

Okay I will try a day again.
Before try it again, I wanna say this.
I think NVIDIA wanna hide how to use JETSON DEVKIT.

I understand that most of documents are very important for understanding whole Jetson system.
By the way, most of users are who don’t need to understand that kind of things at the first time.
But several years of experience from hear, Nvidia and supporters doesn’t accept that.
They force user to understand whole system before use something(Even that is small)

I’ve checked several question & answer about PIN MUX and GPIO problem of JP6.0.
That means, many people struggled for this problem. But answers from NVIDIA are always similar.
Just send some link of manual.
And same question and answer is happen again and again.

That means manual is not enough for many people who don’t know about system.

I think, at least someone who use official Devkit can get a example or manual with the child can understand level.
Just follow easy example for something and use the function. Understand of system is not important at start point.
After the things are work, then we can have space for understand how or why in minds.

I think Nvidia can make more easy manual.
NVIDIA don’t have so many Devkit and JP version.
So can make all code for all offical Devkit, JP and ect combination.

Anyway NVIDIA have to support person more kindly .

Thanks.

I will try your suggestion and ask you again!