Failed to Setup Jetson Orin Nano GPIO Output in Jetpack 6.x

Template Testing Python Script

We used the template testing python script as follows.

import Jetson.GPIO as GPIO
import time

# Set up the GPIO mode to BOARD (using physical pin numbering)
GPIO.setmode(GPIO.BOARD)

# Define the pin number
pin = 7

# Set up GPIO9 as an output
GPIO.setup(pin, GPIO.OUT, initial=GPIO.LOW)

try:
    while True:
        GPIO.output(pin, GPIO.HIGH)
        print(f"GPIO PIN {pin} is on.")
        time.sleep(0.5)  # Wait for 500ms
        GPIO.output(pin, GPIO.LOW)
        print(f"GPIO PIN {pin} is off.")
        time.sleep(0.5)  # Wait for 500ms
except KeyboardInterrupt:
    print("Exiting gracefully")
    GPIO.cleanup()  # Cleanup all GPIOs

Environment

  • Jetpack 6.0 L4T 36.3.0 setup by SDK manager
  • Jetpack 6.1 L4T 36.4.0 setup by SDK manager

Software Checking

We’ve checked the status of the GPIO by sudo gpioinfo | grep PAC.06. The result is

line 144:     "PAC.06"       unused  output  active-high

When the template testing Python script shown above is running, the result of gpioinfo is

line 144:     "PAC.06" "Jetson-gpio" output active-high [used]

Also, we’ve checked the output of sudo cat /sys/kernel/debug/gpio | grep PAC.06 and the result is

gpio-492 (PAC.06              |Jetson-gpio         ) out hi
gpio-492 (PAC.06              |Jetson-gpio         ) out lo
...

and the output high and low voltage switch every 0.5 seconds, which matches the setting for the Python script.

Both the software-check methods are passed.

However, the result of the physical multimeter is still 0V.

Are there any possible problems I might not be aware of? Thanks.

1 Like

Hi otischung0321,

Are you using the devkit or custom board for Orin Nano?
How do you configure PAC.06 in pinmux spreadsheet?

Could you run the following command to check if it can be controlled?

# gpioset --mode=wait `gpiofind "PAC.06"`=1

Please also share the result of the following commant at this moment.

$ sudo busybox devmem 0x02448030

Hi KevinFFF,

Our board is the Jetson Orin Nano Developer Kit 8GB.

Below is the result of running sudo gpioinfo | grep PAC.06 while the command

gpioset --mode=wait `gpiofind "PAC.06"`=1

is active:

line 144:     "PAC.06" "gpioset" output active-high [used]

When PAC.06 is set using gpioset shown above, the output of sudo busybox devmem 0x02448030 is 0x0000005A. If it is not set, the result is 0x0000045A.

However, the physical multimeter still measures 0V.

My teammate mentioned that the GPIO works correctly with JetPack 5.x on the same model of the board. I haven’t downgraded to test it because we need CUDA 12 for AI model inference. I did not configure the pinmux spreadsheet.

I’m wondering if we now need to configure the pinmux spreadsheet or any other GPIO-related settings manually with JetPack 6, instead of relying on the default configuration provided by the SDK Manager. If that’s the case, could you confirm the steps I need to take, including those described in NVIDIA’s documentation?

It seems you hit similar issue as the following topic. (bit 10 has been set by gpiod)
Please apply the patch to check if it can help.
40hdr - SPI1 gpio padctl register bit[10] effect by gpiod tools in JP6 - #20 by KevinFFF

I would suggest using oscilloscope instead of multimeter to check the pin state.

Hi KevinFFF,

Where can I find the code to apply the patch? I’ve checked the source code in ~/nvidia/nvidia_sdk, which is the download path for the SDK Manager.

❯ sudo find . -name "pinctrl-tegra.h"
./nvidia_sdk/JetPack_6.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/rootfs/usr/src/linux-headers-5.15.148-tegra-ubuntu22.04_aarch64/3rdparty/canonical/linux-jammy/kernel-source/include/dt-bindings/pinctrl/pinctrl-tegra.h
./nvidia_sdk/JetPack_6.1_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/bootloader/pinctrl-tegra.h

I apologize if this is a silly question.

Please refer to Kernel Customization — NVIDIA Jetson Linux Developer Guide 1 documentation to download the kernel source and the source code should be included.

I am having the same issue, did this patch fix your problem?

I am trying to update the kernel as shown in your link, but when I try to clone from the linked repositories it says “Permission denied”. Maybe it will be simpler to just reflash my Nano?

Is NVIDIA Jetson Linux 36.4 (September 2024) the correct patch?

Yes, the patch should fix the GPIO control issue in JP6.

No, JP6.1(R36.4.0) does not have that patch included. It should be fixed in next release.

Will this patch work in JP6.1, or just JP6.0?

I am having trouble applying this patch by using these steps you mentioned: Kernel Customization — NVIDIA Jetson Linux Developer Guide 1 documentation

Specifically the following issues:

  1. It seems that my Jetson does not have the “source_sync.sh” script mentioned here. I cannot find the “Linux_for_Tegra” directory at all. I installed via the SD Card/Balena Etcher method.

  2. I installed the Toolchain as directed in the steps above, and moved forward with the manual sync, but when I try to build the kernel it says “compiler not recognized”

Am I making it harder than it should be?
Is there a package I can download to an SD card with Balena Etcher where this patch is already applied? Seems like a pretty important patch… Kind of ridiculous that the fix is for us to update and rebuild your kernel.

If not:

Have these steps changed in 6.1?
Is this missing a step where we create and install to the “Linux_for_Tegra” directory?
Am I building the “real-time kernel”?
Can you provide a step-by-step direction?

Okay, follow up, I was able to build and install the kernel with the patch applied, however, it did not fix my problem.

Maybe I should have clarified, my problem is that I am seeing the GPIO pin registered as HIGH in software, but the pin never goes high when checked with multimeter/oscillator.

I check in ‘sys/kernel/debug/gpio’ and it states gpio-492 (PAC.06 |Jetson-gpio ) out hi. According to the pinout sheets, gpio-492 aligns with pin 7 on the board, however it does not register any signal.

Is this problem a symptom of the aforementioned bug? It seems that I have the same symptoms as the original post? If so, why when I rebuild the kernel with the patch does it not fix it? I verified that the kernel I built was the one running.

If no reply, planning on reverting back to Jetpack 5.1.4 tomorrow.

I have the same problem, but when I’m trying to copy padvoltage.dtsi and pinmux.dtsi files to <l4t_top>/bootloader/generic/BCT/ directory it doesn´t work. I get the message that the file or directory does not exist.

We’re going to revert back to 5.1.4, obviously Jetpack 6.x is not production ready yet.

Hi KevinFFF,

I followed your instructions and successfully compiled and flashed the kernel image to the Jetson Orin Nano Developer Kit 8GB. I followed the kernel customization instructions up to the “build the DTBs” step. I did not sign or encrypt the kernel but flashed it directly. Additionally, I resolved the exFAT issue mentioned in the topic.

However, the GPIO is still not functioning properly, and the output of sudo busybox devmem 0x02448030 is consistently 0x0000005A. I used the default pinmux settings and did not generate customized settings using the spreadsheet. Are there any potential issues I might have overlooked?

Below are the files in our Linux_for_Tegra/bootloader/generic/BCT directory:

tegra234-br-bct_b-p3701-0000.dts                        tegra234-mb1-bct-prod-p3701-0002-p3711-0000.dts
tegra234-br-bct_b-p3701-0002+p3711-0000.dts             tegra234-mb1-bct-prod-p3701-0002-p3740-0002.dts
tegra234-br-bct_b-p3701-0002-p3740-0002.dts             tegra234-mb1-bct-prod-p3767-0000.dts
tegra234-br-bct_b-p3767-0000-l4t.dts                    tegra234-mb1-bct-ratchet-p3701-0000.dts
tegra234-br-bct-diag-boot.dts                           tegra234-mb1-bct-ratchet-p3701-0002-p3711-0000.dts
tegra234-br-bct-e2421-2425-slt.dts                      tegra234-mb1-bct-ratchet-p3767-0000.dts
tegra234-br-bct-p3701-0000.dts                          tegra234-mb1-bct-reset-p3701-0000.dts
tegra234-br-bct-p3701-0002+p3711-0000.dts               tegra234-mb1-bct-reset-p3701-0002-p3711-0000.dts
tegra234-br-bct-p3701-0002-p3740-0002.dts               tegra234-mb1-bct-reset-p3701-0002-p3740-0002.dts
tegra234-br-bct-p3767-0000-l4t.dts                      tegra234-mb1-bct-reset-p3767-0000.dts
tegra234-firewall-config-base.dtsi                      tegra234-mb1-bct-uphy-lanes-p3701-0000.dts
tegra234-mb1-bct-cprod-p3701-0000.dts                   tegra234-mb1-bct-uphy-lanes-p3701-0002-p3711-0000.dts
tegra234-mb1-bct-cprod-p3701-0002-p3711-0000.dts        tegra234-mb1-bct-uphy-lanes-p3767-0000.dts
tegra234-mb1-bct-cprod-p3701-0002-p3740-0002.dts        tegra234-mb2-bct-e2421-2425-slt.dts
tegra234-mb1-bct-cprod-p3767-0000.dts                   tegra234-mb2-bct-firewall-common.dts
tegra234-mb1-bct-device-p3701-0000.dts                  tegra234-mb2-bct-firewall-si-p3701-0002-p3711-0000.dts
tegra234-mb1-bct-device-p3701-0002-p3711-0000.dts       tegra234-mb2-bct-firewall-si-p3701-0002-p3740-0002.dts
tegra234-mb1-bct-device-p3701-0002-p3740-0002.dts       tegra234-mb2-bct-misc-p3701-0000.dts
tegra234-mb1-bct-device-p3767-0000.dts                  tegra234-mb2-bct-misc-p3701-0000-no-pva.dts
tegra234-mb1-bct-gpioint-p3701-0000.dts                 tegra234-mb2-bct-misc-p3701-0002-p3711-0000.dts
tegra234-mb1-bct-gpioint-p3701-0002-p3711-0000.dts      tegra234-mb2-bct-misc-p3701-0002-p3740-0002.dts
tegra234-mb1-bct-gpioint-p3701-0002-p3740-0002.dts      tegra234-mb2-bct-misc-p3701-0002-p3740-0002-no-pva.dts
tegra234-mb1-bct-gpioint-p3767-0000.dts                 tegra234-mb2-bct-misc-p3701-0008.dts
tegra234-mb1-bct-misc-p3701-0000.dts                    tegra234-mb2-bct-misc-p3767-0000.dts
tegra234-mb1-bct-misc-p3701-0002-p3711-0000.dts         tegra234-mb2-bct-scr-p3701-0000.dts
tegra234-mb1-bct-misc-p3701-0002-p3740-0002.dts         tegra234-mb2-bct-scr-p3767-0000.dts
tegra234-mb1-bct-misc-p3701-0008.dts                    tegra234-p3701-0000-as-p3767-0000-sdram-l4t.dts
tegra234-mb1-bct-misc-p3701-0008-flash.dts              tegra234-p3701-0000-as-p3767-0000-wb0sdram-l4t.dts
tegra234-mb1-bct-misc-p3701-0008-p3740-0002.dts         tegra234-p3701-0000-as-p3767-0004-sdram-l4t.dts
tegra234-mb1-bct-misc-p3767-0000.dts                    tegra234-p3701-0000-as-p3767-0004-wb0sdram-l4t.dts
tegra234-mb1-bct-padvoltage-p3701-0000-a04.dtsi         tegra234-p3701-0000-sdram-l4t.dts
tegra234-mb1-bct-padvoltage-p3701-0000.dtsi             tegra234-p3701-0000-wb0sdram-l4t.dts
tegra234-mb1-bct-padvoltage-p3701-0001-p3711-0000.dtsi  tegra234-p3701-0002-p3711-0000-ta970sa-sdram.dts
tegra234-mb1-bct-padvoltage-p3701-0002-p3740-0002.dtsi  tegra234-p3701-0002-p3711-0000-ta990sa-sdram.dts
tegra234-mb1-bct-padvoltage-p3767-dp-a03.dtsi           tegra234-p3701-0002-p3740-0002-ta970sa-sdram.dts
tegra234-mb1-bct-padvoltage-p3767-hdmi-a03.dtsi         tegra234-p3701-0002-p3740-0002-ta990sa-sdram.dts
tegra234-mb1-bct-pinmux-p3701-0000-a04.dtsi             tegra234-p3701-0005-as-p3767-0000-sdram-l4t.dts
tegra234-mb1-bct-pinmux-p3701-0000.dtsi                 tegra234-p3701-0005-as-p3767-0000-wb0sdram-l4t.dts
tegra234-mb1-bct-pinmux-p3701-0002-P3711-0000.dtsi      tegra234-p3701-0005-as-p3767-0004-sdram-l4t.dts
tegra234-mb1-bct-pinmux-p3701-0002-p3740-0002-b01.dtsi  tegra234-p3701-0005-as-p3767-0004-wb0sdram-l4t.dts
tegra234-mb1-bct-pinmux-p3701-0002-p3740-0002.dtsi      tegra234-p3701-0005-sdram-l4t.dts
tegra234-mb1-bct-pinmux-p3701-0008-p3740-0002-c01.dtsi  tegra234-p3701-0005-wb0sdram-l4t.dts
tegra234-mb1-bct-pinmux-p3767-dp-a03.dtsi               tegra234-p3701-0008-sdram-l4t.dts
tegra234-mb1-bct-pinmux-p3767-hdmi-a03.dtsi             tegra234-p3701-0008-wb0sdram-l4t.dts
tegra234-mb1-bct-pmic-p3701-0000.dts                    tegra234-p3767-0000-as-Nano-sdram-l4t.dts
tegra234-mb1-bct-pmic-p3701-0002-p3711-0000.dts         tegra234-p3767-0000-sdram-l4t.dts
tegra234-mb1-bct-pmic-p3701-0002-p3740-0002.dts         tegra234-p3767-0000-wb0sdram-l4t.dts
tegra234-mb1-bct-pmic-p3701-0005.dts                    tegra234-p3767-0001-sdram-l4t.dts
tegra234-mb1-bct-pmic-p3701-0008.dts                    tegra234-p3767-0001-wb0sdram-l4t.dts
tegra234-mb1-bct-pmic-p3701-0008-p3740-0002-c01.dts     tegra234-p3767-0004-sdram-l4t.dts
tegra234-mb1-bct-pmic-p3767-0000-a02.dts                tegra234-p3767-0004-wb0sdram-l4t.dts
tegra234-mb1-bct-prod-p3701-0000.dts

Thank you.

Both.

The bit 10 should not be 1 if you want to use it as GPIO,

This pin is configured as Input/Int PU by default.
Please configure it Output/Drive 1 as following in pinmux spreadsheet if you want to control it manually.
image

Hi KevinFFF,

The initial information I referred to was from the hardware specifications of the Jetson Orin Nano Dev. Kit. I then downloaded the Jetson Orin Nano Developer Kit Carrier Board Specification from the Jetson Download Center. However, there are discrepancies between the hardware specifications and the pinmux spreadsheet. For instance, the type of physical pin 7 (GPIO09) is listed as an output.
Additionally, the GPIOs on the 40-pin header—GPIO01, GPIO07, GPIO09, GPIO11, and GPIO13—are listed as bidirectional/output in the hardware specifications.

However, in the pinmux spreadsheet ver.1.01, released on Feb 24, 2023, it is listed as an input, as you mentioned.

Which source should I refer to in order to configure a pin on the 40-pin header as a controllable 3.3V output?

Thank you.

I successfully generated the three dtsi files and placed them in the respective folders.

Linux_for_Tegra/bootloader/dp-gpio-default.dtsi
Linux_for_Tegra/bootloader/generic/BCT/dp-padvoltage-default.dtsi
Linux_for_Tegra/bootloader/generic/BCT/dp-pinmux.dtsi

Untitled

dp-gpio-default.zip (1.4 KB)
dp-padvoltage-default.zip (1.2 KB)
dp-pinmux.zip (4.8 KB)

I then rebuilt and reflashed the kernel image, but it still doesn’t work properly.

It seems there are specific rules for the filenames of these dtsi files. What are the naming conventions for the Jetson Orin Nano Dev. Kit?

I apologize if this is a silly question.

Please just refer to the configuration in pinmux spreadsheet since the generated dtsi will be loaded during boot up.

Please reflash the whole board to apply the change since these device trees are loaded in MB1 rather than in kernel.
Do you also update the board config to declare for your new pinmux dsti?

Hi KevinFFF,

I found the correct filename and successfully controlled GPIO09 (physical pin 7).
Now, the output of sudo busybox devmem 0x02448030 is consistently 0x00000002.

I really appreciate your help!

2 Likes

Have you had any luck with this? I did the same as you and failed, just curious how this is going. Glad to find out its not just me that is hitting a brick wall with this.