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!

Hello. Kevin.
I’ve tried command with

sudo ./tools/kernel_flash/l4t_initrd_flash.sh jetson-agx-orin-devkit nvme0n1

and I got error from Terminal

Step 1: Generate flash packages *
Create folder to store images to flash
Generate image for internal storage devices
Generate images to be flashed
ADDITIONAL_DTB_OVERLAY=“” /home/jhai/nvidia/nvidia_sdk/JetPack_6.0_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra/flash.sh --no-flash --sign jetson-agx-orin-devkit nvme0n1
################################################################################
L4T BSP Information:
R36 , REVISION: 3.0
User release: 0.0
###############################################################################
ECID is
Board ID() version() sku() revision()
Chip SKU(00:00:00:D0) ramcode() fuselevel(fuselevel_production) board_FAB()
Error: Unrecognized module SKU
Error: failed to generate images
Cleaning up…

What should I do in this case?

Okay.
I failed to flash with generated PINMUX files
(it is too hard to find the way by my self).

So, I choose more familiar way.
Directly access to registor.

Here is my temporary solution.(I know this will reset after every reboot)

Jetson AGX Orin Platform Adaptation and Bring-Up — Jetson Linux<br/>Developer Guide 34.1 documentation

-1. Find [Verilog Ball Name] in PIN MUX config spreadsheet.
-2. Open Technical Reference Manual
-3. Search full name of PIN using [Verilog Ball Name] keyword found in step.1
-4. Save [complete pin name] and [offset]. This [complete pin name] includes [Pad Control Groupe]
-4-1. At this point, description shows bit fields of register that tell you which bit do we have to touch.
-5. Using [Pad Control Groupe] keyword, find [Control Registers Base Address Block]
-5. Search [Address Start] of [Control Registers Base Address Block] using keyword [Control Registers Base Address Block]
(You can find in “System Address Map” section.)
-6. On Jetson device, install busybox useing command [$sudo apt-get install busybox]
-7. Through command [$sudo busybox devmem ] where is [Address Start] + [offset].
-8 Check the value and if the value is not what you want, than, change the value using [$sudo busybox devmem w ]
-9. Can check change value using command we use in step 7.

Here is example

For example, If I Wanna use “40-pin header Pin 40 GPIO/Audio” as GPIO output.
-1. in PIN MUX config spreadsheet, [Verilog Ball Name] is [SOC_GPIO42]
-2. -
-3, Search
-4. I can find [offset] is [0x90] and [complete pin name] of [SOC_GPIO42] in page 6194, it is [PADCTL_G4_SOC_GPIO42_0].
And [Pad Control Groupe] is [G4] and [Control Registers Base Address Block] of [G4] is [PADCTL_A4]
(you can find in “Pad Control Grouping” section)
-5. [Address Start] of [PADCTL_A4] is [0x02434000]
-6. -
-7. $sudo busybox devmem 0x02434090
(where 0x02434090 is [Address Start : 0x02434000] + [offset : 0x90]
-8. $sudo busybox devmem 0x02434090 w 0x400
(Set SFIO bit to 0 for GPIO, Set DISABLE bit to 0 for OUTPUT, Set TRISTATE bit to 0 for PASSTHROUGH)
-9. You can check changed value with [$sudo busybox devmem 0x02434090].

This is how to use pin as GPIO for temporary. This will reset after reboot.
Make this command to script and run for everytimes after boot to set again.

I know this method is really annoying. But i’m sure that this is very helpful for someone who are not friendly with linux and someone who just wanna test GPIO.

And Kevin, if you can help me to learn flash with generated PINMUX files.
Please help me.
That will be a great help to my future development knowledge.
Thanks

Sorry that our documents confuse you to understand how it works, but please notice that embedded system is not as easy for everyone since you need to have background for that like how it boots up from booloader, kernel, rootfs.
Please forgive us that we can not give step-by-step with commands for everyone since they may have their custom requirement and use case.

Let’s back to your question.
I’ve tried to instruct you how to put the pinmux and gpio dtsi to the correct path of your BSP package in my response on 13/Aug.

It seems the board information can not be recognized. Did you modify the content in the EEPROM of your module before?

Please try to remove the NVMe SSD and run the following command to flash the internal eMMC of your devkit.

$ cd <Linux_for_Tegra>/
$ sudo ./flash.sh jetson-agx-orin-devkit internal

First. I did not modify the content in the EEPROM of my module before.
But anyway, I will try as soon as possible. Thx.

As a pro microcontroller(such as TI C2000, AVR, STM controller) engineer, embedded system like Jetson is little hard for understand.
I think it looks similar but there is big difference between two.

Thx a lot, I understand that you try hard to give solution for people in this forum.
I would like to express my sincere gratitude to you.

I will ask you when I try this.(Now, as my project is approaching its deadline, I feel like my methods are good enough for me :( )

1 Like

That is definitely. The module you mentioned are all MCU rather than SoM like Jetson. They have big difference from SW architecture and with different ability.

Okay thanks, please let us know if your have further question and you could simply open a new topic to discuss in details.

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