GPIO 492 is saying inavalid argument for orin nano with cutom carrier board

Hell team,
we are able to boot with custom carrier board, the device and OS is up and running, we see that gpio sysfs is deprecated now, with another gpiod
lib (gpiodetct, gpioinfo) commands we are not able to make the particular pin as output and write value as high,

for example: PAC.06(line144 in gpiochip0), can you please help on how we can make high that pin, we calculated with offset value its comes gpio number 492,

we have attached the gpiod logs for reference,
please help on how we can make this gpio 492 as high.
gpiod_logs.txt (11.1 KB)

PAC.06 is by default an input pin.
Please modify the pinmux spreadsheet to make it an output pin:
https://docs.nvidia.com/jetson/archives/r36.2/DeveloperGuide/HR/JetsonModuleAdaptationAndBringUp/JetsonOrinNxNanoSeries.html#generating-the-pinmux-dtsi-files

Moreover, the command itself is also wrong.
It’s line 144, then you should directly use 144. No more offset calculation now.

sudo gpioset --mode=wait 0 492=1

Hi Dave, thank you for reply,

so do we have to use 492 or 144? as per this command

sudo cat /sys/kernel/debug/gpio

PAC.06 is GPIO 492, so we were using that number

gpio_debuglogs.txt (6.7 KB)

and i tried that command too:

Onanouser@localhost:~$ sudo gpioset --mode=wait 0 492=1
gpioset: error setting the GPIO line values: Invalid argument

Onanouser@localhost:~$ sudo gpioset --mode=wait 0 144=1

**Onanouser@localhost:~$ sudo gpioget 0 144 **
0
Onanouser@localhost:~$

gpio - 492 or line 144 is not set to high!!!

Oh YES, it’s 144.
So

sudo gpioset --mode=wait 0 144=1

after changing the pinmux setting.

You have to measure the pin with a multimeter.
The effect of gpioset disappears as soon as the program ends, so running gpioget afterwards is meaningless.

Or you don’t know what I’m talking about here?

yeah we can make the default input to output via that pinmux changes, but gpioset command wont set as output if we write high?

YES.
Doing anything on an input pin with gpioset is meaningless.

Hello Dave,
Which sheet we have to modify among those 4 sheets inside?

Jetson_Orin_NX_Series_+DP A03

Jetson_Orin_NX_Series_+DP A01

Jetson_Orin_NX_Series_+HDMI A03
Jetson_Orin_NX_Series_+HDMI A01

Usually it’s A03, and also depends on whether you are using HDMI or DP.

Hello DaveYY,
continue query for the same gpio issue,

  1. WE had some changes in pinmux file and able generate below three files as mentioned in this doc Jetson Orin NX and Nano Series — NVIDIA Jetson Linux Developer Guide 1 documentation

Orin-tegra234-mb1-bct-gpio-default.dtsi
Orin-tegra234-mb1-bct-padvoltage-default.dtsi
Orin-tegra234-mb1-bct-pinmux.dtsi

  1. done changes in jetson-orin-nano-devkit.conf also for modifying the file names Jetson Orin NX and Nano Series — NVIDIA Jetson Linux Developer Guide 1 documentation

  2. now for 3rd step do we need to do something extra or just flash command will take those changes and load image in device? using this comand Sd card:
    =========
    sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device mmcblk0p1
    -c tools/kernel_flash/flash_l4t_external.xml -p “-c bootloader/generic/cfg/flash_t234_qspi.xml”
    –showlogs --network usb0 jetson-orin-nano-devkit internal

NO.
Actually you don’t need to re-flash the whole rootfs, as the change is only done in QSPI bootloader.
You can just run

sudo ./flash.sh --no-systemimg -c bootloader/generic/cfg/flash_t234_qspi.xml jetson-orin-nano-devkit internal

It should be much faster than re-flashing everything including rootfs.

thank you DaveYYY,

One more thing, while flashing with whole rootfs command, we are getting this error

'/home/admin1/projects/orin_nano/Linux_for_Tegra/tools/kernel_flash/l4t_flash_from_kernel.sh' -> '/home/admin1/projects/orin_nano/Linux_for_Tegra/tools/kernel_flash/images/l4t_flash_from_kernel.sh'
Success
******************************************
*                                        *
*  Step 2: Generate rcm boot commandline *
*                                        *
******************************************
ROOTFS_AB= ROOTFS_ENC= /home/admin1/projects/orin_nano/Linux_for_Tegra/flash.sh  --no-flash --rcm-boot jetson-orin-nano-devkit mmcblk0p1
###############################################################################
# L4T BSP Information:
# R36 , REVISION: 2.0
# User release: 0.0
###############################################################################
ECID is 
Board ID() version() sku() revision()
Chip SKU(00:00:00:D3) ramcode() fuselevel(fuselevel_production) board_FAB()
emc_opt_disable_fuse:(0)
**Error: Unrecognized module SKU** 
Cleaning up...

and after flashing i can see that by ‘uname -a’ the kernel image is still the old one its Nov 30th 2023.

FYI: we have compiled kernel separately and installed in rootfs following this doc Kernel Customization — NVIDIA Jetson Linux Developer Guide 1 documentation

That means your board is not detected to be in force recovery mode.

when device is in reset mode it should be detect like this for lsusb right?

Bus 002 Device 088: ID 0955:7523 NVIDIA Corp.

YES. Supposedly.

Hello DaveYYY, are we missing any steps here? because when i try to flash, we are getting this below errors

[   1.6486 ] mb2_bct_file = mb2_cold_boot_bct_MB2.bct
[   1.6573 ] DCE binary: display-t234-dce.bin
[   1.6574 ] Kernel DTB used: tegra234-p3768-0000+p3767-0005-nv_with_odm_overlay.dtb.updated
[   1.6575 ] Concatenating kernel-dtb to dce-fw binary
[   1.6575 ] dce_bin = display-t234-dce.bin
[   1.6575 ] kernel_dtb = tegra234-p3768-0000+p3767-0005-nv_with_odm_overlay.dtb.updated
[   1.6575 ] dce_with_dtb = display-t234-dce_with_tegra234-p3768-0000+p3767-0005-nv_with_odm_overlay.dtb.bin
[   1.6746 ] Update display-t234-dce_with_tegra234-p3768-0000+p3767-0005-nv_with_odm_overlay.dtb.bin to dce_fw partitions
[   1.6793 ] Parsing partition layout
[   1.6812 ] tegraparser_v2 --pt flash.xml.tmp
[   1.6837 ] Creating list of images to be signed
[   1.6855 ] Generating ratchet blob
[   1.6856 ] Pre-processing config: tegra234-mb1-bct-reset-p3767-0000.dts
[   1.6951 ] Pre-processing config: tegra234-mb1-bct-device-p3767-0000.dts
[   1.7046 ] Pre-processing config: tegra234-mb1-bct-cprod-p3767-0000.dts
[   1.7144 ] Pre-processing config: tegra234-mb1-bct-gpioint-p3767-0000.dts
[   1.7247 ] Pre-processing config: tegra234-mb1-bct-misc-p3767-0000.dts
[   1.7391 ] Pre-processing config: **Orin-tegra234-mb1-bct-pinmux.dtsi**
Error: Return value 1
Command cpp -nostdinc -x assembler-with-cpp -D IN_DTS_CONTEXT -I .. -I ../generic/BCT **Orin-tegra234-mb1-bct-pinmux.dtsi** Orin-tegra234-mb1-bct-pinmux_cpp.dts
**Error**: /home/admin1/projects/orin_nano/Linux_for_Tegra/bootloader/signed/flash.idx is not found
**Error**: failed to relocate images to /home/admin1/projects/orin_nano/Linux_for_Tegra/tools/kernel_flash/images
Cleaning up...

even for this qspi bootloader flash command also,

[ 1.8019 ] kernel_dtb = tegra234-p3768-0000+p3767-0005-nv_with_odm_overlay.dtb.updated
[ 1.8020 ] dce_with_dtb = display-t234-dce_with_tegra234-p3768-0000+p3767-0005-nv_with_odm_overlay.dtb.bin
[ 1.8143 ] Update display-t234-dce_with_tegra234-p3768-0000+p3767-0005-nv_with_odm_overlay.dtb.bin to dce_fw partitions
[ 1.8195 ] Parsing partition layout
[ 1.8215 ] tegraparser_v2 --pt flash.xml.tmp
[ 1.8250 ] Creating list of images to be signed
[ 1.8269 ] Generating ratchet blob
[ 1.8270 ] Pre-processing config: tegra234-mb1-bct-reset-p3767-0000.dts
[ 1.8372 ] Pre-processing config: tegra234-mb1-bct-device-p3767-0000.dts
[ 1.8475 ] Pre-processing config: tegra234-mb1-bct-cprod-p3767-0000.dts
[ 1.8588 ] Pre-processing config: tegra234-mb1-bct-gpioint-p3767-0000.dts
[ 1.8706 ] Pre-processing config: tegra234-mb1-bct-misc-p3767-0000.dts
[ 1.8876 ] Pre-processing config: Orin-tegra234-mb1-bct-pinmux.dtsi
Error: Return value 1
Command cpp -nostdinc -x assembler-with-cpp -D IN_DTS_CONTEXT -I … -I …/generic/BCT Orin-tegra234-mb1-bct-pinmux.dtsi Orin-tegra234-mb1-bct-pinmux_cpp.dts
Failed flashing generic.
admin1@Oven:~/projects/orin

Can you try changing only one GPIO pin at a time?
See which change causes the error.

yeah, but we are still in flashing stage, i am getting errors for flashing itself. both flash commands are throughing same errors.

or please let us know,
do we have to follow any naming conventions for pinmux, gpio and padvoltage .dtsi files?

and pinmux file which is used for generating .dtsi files is Jetson_Orin_NX_series_and_Orin_Nano_series_Pinmux_Config_Template.xlsm , is it the right file.?

There’s no such limit.

YES.