Jetson Orin NX (JetPack 6.2 / L4T 36.4.3) – Flashing fails after custom kernel build

Hi ,

I need help flashing my Jetson Orin NX after building a custom kernel. Flashing fails, and I’ve attached the flashing logs (logs.txt) for reference.

logs.txt (91.6 KB)

Platform Details

  • Board: Jetson Orin NX (Devkit)

  • JetPack: 6.2

  • L4T Version: 36.4.3

  • Root filesystem: NVMe-based storage

What I’m Trying to Do

I am cross-compiling the kernel, device tree, and NVIDIA out-of-tree modules on the host PC, installing them into Linux_for_Tegra, and then flashing the board to NVMe.

Host Setup & Dependencies

sudo apt install wget lbzip2 build-essential bc zip libgmp-dev \
libmpfr-dev libmpc-dev vim-common libncurses-dev \
bison flex libssl-dev libelf-dev

Source Download

cd ~/nvidia/nvidia_sdk/JetPack_6.2_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra
wget https://developer.nvidia.com/downloads/embedded/l4t/r36_release_v4.3/sources/public_sources.tbz2

Extract Kernel and NVIDIA Sources

tar -xjf public_sources.tbz2 Linux_for_Tegra/source/kernel_src.tbz2 --strip-components 2
tar -xjf public_sources.tbz2 Linux_for_Tegra/source/kernel_oot_modules_src.tbz2 --strip-components 2
tar -xjf public_sources.tbz2 Linux_for_Tegra/source/nvidia_kernel_display_driver_source.tbz2 --strip-components 2

Environment Variables

export DEVDIR=~/nvidia/nvidia_sdk/JetPack_6.2_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra
export CROSS_COMPILE=$HOME/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-
export INSTALL_MOD_PATH=$DEVDIR/rootfs/
export KERNEL_HEADERS=$DEVDIR/sources/kernel/kernel-jammy-src

Prepare Sources Directory

cd $DEVDIR
mkdir sources
tar -xjf kernel_src.tbz2 -C sources
tar -xjf kernel_oot_modules_src.tbz2 -C sources
tar -xjf nvidia_kernel_display_driver_source.tbz2 -C sources

Kernel Build Steps

cd $DEVDIR/sources/kernel/kernel-jammy-src
make menuconfig

cd $DEVDIR/sources
make -C kernel
sudo -E make install -C kernel
make dtbs
cp nvidia-oot/device-tree/platform/generic-dts/dtbs/* $DEVDIR/kernel/dtb/
make modules
sudo -E make modules_install

Flashing Command

cd $DEVDIR
sudo ./flash.sh jetson-orin-nano-devkit-nvme nvme0n1p1

Issue

The flashing process fails, and I’ve attached the complete flashing logs in logs.txt.

Request for Help

  1. Please examine my kernel build and flashing process and let me know if I missed or did something incorrectly.

  2. Based on the attached logs, please help identify why flashing fails.

  3. Since I am using NVMe-based storage, are there any additional steps or a different flashing procedure I should follow?

  4. Is there a recommended workflow for building and flashing a custom kernel on JetPack 6.2 for Orin NX with NVMe rootfs?

Any guidance would be greatly appreciated.

Thanks in advance.

*** Please note that this reply is generated by LLM automatically ***

Based on the provided context, I’ll provide a comprehensive answer to help you with flashing your custom kernel on the Jetson Orin NX.

Flashing Process

The flashing process involves several steps, including:

  1. Building the custom kernel, device tree, and NVIDIA out-of-tree modules on the host PC.
  2. Installing the built kernel, device tree, and modules into the root file system (e.g., /).
  3. Flashing the board using the flash.sh script.

Common Issues and Solutions

Based on the attached logs, I’ll highlight some common issues and potential solutions:

  1. Kernel version mismatch: Ensure that the kernel version you’re building matches the version of the flash.sh script. You can check the kernel version by running uname -r on the target device.
  2. Device tree mismatch: Verify that the device tree you’re building matches the device tree used by the flash.sh script. You can check the device tree by running dtc -I fs /proc/device-tree on the target device.
  3. NVIDIA out-of-tree modules: Ensure that the NVIDIA out-of-tree modules you’re building are compatible with the kernel version and device tree you’re using.
  4. Root file system: Verify that the root file system is properly installed and configured. You can check the root file system by running ls -l / on the target device.

Recommendations for Building and Flashing a Custom Kernel

To build and flash a custom kernel on JetPack 6.2 for Orin NX with NVMe rootfs, follow these recommendations:

  1. Use the correct kernel configuration: Use the jetson-orin-nano-devkit-super-nvme.conf configuration file as a starting point for your custom kernel configuration.
  2. Build the kernel and device tree: Build the kernel and device tree using the make command, and install them into the root file system.
  3. Build and install NVIDIA out-of-tree modules: Build and install the NVIDIA out-of-tree modules using the make command, and install them into the root file system.
  4. Flash the board: Flash the board using the flash.sh script, specifying the correct device name and configuration file.

Additional Tips

  1. Use the l4t_generate_soc_bup.sh script: Use the l4t_generate_soc_bup.sh script to generate the kernel and Bootloader payloads based on your custom kernel configuration.
  2. Use the l4t_sign_image.sh script: Use the l4t_sign_image.sh script to sign and generate the signature header at boot.
  3. Verify the flashing logs: Verify the flashing logs to ensure that the flashing process was successful and that there are no errors.

Comparison with Other Jetson Modules

The flashing process for the Jetson Orin NX is similar to other Jetson modules, such as the Jetson AGX Xavier and Jetson Nano. However, there are some differences in the configuration files and device trees used by each module.

In summary, to flash a custom kernel on the Jetson Orin NX, ensure that you’re using the correct kernel configuration, building and installing the kernel and device tree correctly, and flashing the board using the flash.sh script. Additionally, verify the flashing logs to ensure that the flashing process was successful.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

Hi,

Please try running sudo ./tools/l4t_update_initrd.sh before you flash the device, and follow the commands exactly as shown in the official guide.

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -p "-c ./bootloader/generic/cfg/flash_t234_qspi.xml" -c ./tools/kernel_flash/flash_l4t_t234_nvme.xml --showlogs --network usb0 jetson-orin-nano-devkit external

Thanks

Hi @DavidDDD ,

Thanks for the suggestion. I followed the recommended initrd flashing procedure, but I’m still hitting an error. Below are the details and logs.

Command Executed

sudo ./tools/kernel_flash/l4t_initrd_flash.sh \
  --external-device nvme0n1p1 \
  -p "-c ./bootloader/generic/cfg/flash_t234_qspi.xml" \
  -c ./tools/kernel_flash/flash_l4t_t234_nvme.xml \
  --showlogs \
  --network usb0 \
  jetson-orin-nano-devkit external

Then the flashed failed with logs mentioned in the logs_.txt

logs_.txt (298.0 KB)

As suggested in the logs, I have executed the generated flash command:

cd bootloader
sudo bash ./flashcmd.txt

The flashcmd.txt contains

./tegraflash.py --bl uefi_jetson_minimal_with_dtb_sigheader.bin.encrypt --bct br_bct_BR.bct --securedev  --bldtb tegra234-p3768-0000+p3767-0000-nv.dtb --applet rcm_2_encrypt.rcm --applet_softfuse rcm_1_encrypt.rcm --cmd "rcmboot"  --cfg secureflash.xml --chip 0x23 --mb1_bct mb1_bct_MB1_sigheader.bct.encrypt --mem_bct mem_rcm_sigheader.bct.encrypt --mb1_cold_boot_bct mb1_cold_boot_bct_MB1_sigheader.bct.encrypt --mb1_bin mb1_t234_prod_aligned_sigheader.bin.encrypt --psc_bl1_bin psc_bl1_t234_prod_aligned_sigheader.bin.encrypt --mem_bct_cold_boot mem_coldboot_sigheader.bct.encrypt  --bins "psc_fw pscfw_t234_prod_sigheader.bin.encrypt; mts_mce mce_flash_o10_cr_prod_sigheader.bin.encrypt; tsec_fw tsec_t234_sigheader.bin.encrypt; mb2_applet applet_t234_sigheader.bin.encrypt; mb2_bootloader mb2_t234_with_mb2_cold_boot_bct_MB2_sigheader.bin.encrypt; xusb_fw xusb_t234_prod_sigheader.bin.encrypt; pva_fw nvpva_020_sigheader.fw.encrypt; dce_fw display-t234-dce_sigheader.bin.encrypt; nvdec nvdec_t234_prod_sigheader.fw.encrypt; bpmp_fw bpmp_t234-TE980M-A1_prod_sigheader.bin.encrypt; bpmp_fw_dtb tegra234-bpmp-3767-0000-a02-3509-a02_with_odm_sigheader.dtb.encrypt; rce_fw camera-rtcpu-t234-rce_sigheader.img.encrypt; ape_fw adsp-fw_sigheader.bin.encrypt; spe_fw spe_t234_sigheader.bin.encrypt; tos tos-optee_t234_sigheader.img.encrypt; eks eks_t234_sigheader.img.encrypt; kernel boot.img; kernel_dtb tegra234-p3768-0000+p3767-0000-nv.dtb"    --bct_backup 

The Observed Flash Log

Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands
 

 Entering RCM boot

[   0.0218 ] mb1_t234_prod_aligned_sigheader.bin.encrypt filename is from --mb1_bin
[   0.0218 ] psc_bl1_t234_prod_aligned_sigheader.bin.encrypt filename is from --psc_bl1_bin
[   0.0218 ] rcm boot with presigned binaries
[   0.0222 ] tegrarcm_v2 --new_session --chip 0x23 0 --uid --download bct_br br_bct_BR.bct --download mb1 mb1_t234_prod_aligned_sigheader.bin.encrypt --download psc_bl1 psc_bl1_t234_prod_aligned_sigheader.bin.encrypt --download bct_mb1 mb1_bct_MB1_sigheader.bct.encrypt
[   0.0226 ] BR_CID: 0x80012344705E0280840000000B010240
[   0.2232 ] Sending bct_br
[   0.2235 ] Sending mb1
[   0.2265 ] Sending psc_bl1
[   0.2378 ] Sending bct_mb1
[   0.2442 ] Generating blob for T23x
[   0.2486 ] tegrahost_v2 --chip 0x23 0 --generateblob blob.xml blob.bin
[   0.2497 ] The number of images in blob is 19
[   0.2517 ] blobsize is 81012161
[   0.2521 ] Added binary blob_uefi_jetson_minimal_with_dtb_sigheader.bin.encrypt of size 2043968
[   0.3148 ] Added binary blob_pscfw_t234_prod_sigheader.bin.encrypt of size 310768
[   0.3151 ] Added binary blob_mce_flash_o10_cr_prod_sigheader.bin.encrypt of size 187120
[   0.3154 ] Added binary blob_tsec_t234_sigheader.bin.encrypt of size 176128
[   0.3156 ] Added binary blob_applet_t234_sigheader.bin.encrypt of size 279808
[   0.3159 ] Not supported type: mb2_applet
[   0.3160 ] Added binary blob_mb2_t234_with_mb2_cold_boot_bct_MB2_sigheader.bin.encrypt of size 440944
[   0.3163 ] Added binary blob_xusb_t234_prod_sigheader.bin.encrypt of size 164864
[   0.3166 ] Added binary blob_nvpva_020_sigheader.fw.encrypt of size 2164640
[   0.3168 ] Added binary blob_display-t234-dce_sigheader.bin.encrypt of size 12070576
[   0.3228 ] Added binary blob_nvdec_t234_prod_sigheader.fw.encrypt of size 294912
[   0.3254 ] Added binary blob_bpmp_t234-TE980M-A1_prod_sigheader.bin.encrypt of size 1027008
[   0.3261 ] Added binary blob_tegra234-bpmp-3767-0000-a02-3509-a02_with_odm_sigheader.dtb.encrypt of size 383296
[   0.3265 ] Added binary blob_camera-rtcpu-t234-rce_sigheader.img.encrypt of size 458096
[   0.3268 ] Added binary blob_adsp-fw_sigheader.bin.encrypt of size 415008
[   0.3271 ] Added binary blob_spe_t234_sigheader.bin.encrypt of size 270336
[   0.3273 ] Added binary blob_tos-optee_t234_sigheader.img.encrypt of size 1887312
[   0.3294 ] Added binary blob_eks_t234_sigheader.img.encrypt of size 9232
[   0.3300 ] Added binary blob_boot.img of size 58177536
[   0.3666 ] Added binary blob_tegra234-p3768-0000+p3767-0000-nv.dtb of size 249505
[   0.4323 ] tegrarcm_v2 --chip 0x23 0 --pollbl --download bct_mem mem_rcm_sigheader.bct.encrypt --download blob blob.bin
[   0.4326 ] BL: version 1.4.0.4-t234-54845784-e89ea9bc last_boot_error: 0
[   0.5042 ] Sending bct_mem
[   0.5044 ] Sending blob
[   4.5976 ] RCM-boot started

Then I have again executed the flash command:

Command Executed

sudo ./tools/kernel_flash/l4t_initrd_flash.sh \
  --external-device nvme0n1p1 \
  -p "-c ./bootloader/generic/cfg/flash_t234_qspi.xml" \
  -c ./tools/kernel_flash/flash_l4t_t234_nvme.xml \
  --showlogs \
  --network usb0 \
  jetson-orin-nano-devkit external

Then the flashed failed with logs mentioned in the logs_1.txt

logs_1.txt (289.5 KB)

Questions / Help Needed

  1. Based on the attached logs_1.txt, what is causing the flash to fail after RCM boot?

  2. Is this failure related to:

    • Secure Boot / fused board requirements?

    • NVMe flashing configuration?

    • Board config mismatch?

  3. Are there additional steps required for initrd flashing on a fused Orin NX device?

  4. Is my flashing flow correct, or is there a recommended alternative procedure I should follow?

Please let me know how to resolve this issue.
Thanks for your support.

Hi,

First, a quick question to confirm — are your Orin NX using the developer kit (dev kit) or custom board?

Thanks

Hi @DavidDDD ,

I am using the Jetson Orin NX Developer Kit (dev kit) (NVIDIA Orin NX T801-16GB)with NVMe as the root filesystem.

Please let me know if you need any additional board or hardware details.

Thanks.

Hi,

Please record the serial log during flashing for us to review further.

Thanks