L4T 36.4.4 l4t_initrd_flash.sh fails in offline mode

I’m running l4t_initrd_flash.sh per Workflow 2 in tools/kernel_flash/README_initrd_flash.txt

./tools/kernel_flash/l4t_initrd_flash.sh --no-flash jetson-orin-nano-devkit-super-nvme nvme0n1p1

When a device is connected in recovery mode, this works fine. In offline mode with all the environment variables set, it fails. The process for getting the correct env variables was taken from Flashing Support — NVIDIA Jetson Linux Developer Guide

export BOARDID=3767
export BOARDSKU=0005
export FAB=300
export BOARDREV=T.1
export CHIP_SKU=00:00:00:D5
export RAMCODE_ID=00:00:00:02
export RAMCODE=2

./tools/kernel_flash/l4t_initrd_flash.sh --no-flash jetson-orin-nano-devkit-super-nvme nvme0n1p1
Please install the Secureboot package to use initrd flash for fused board
22:40:13.502 - Debug: UFW is not installed. NFS port should be open.
22:40:13.508 - Debug: Checking VPN connections...
22:40:13.522 - Debug: IPSec service is not running.
22:40:13.525 - Debug: VPN routes none in tun|tap|ppp|vpn|gpd.
22:40:13.529 - Debug: No VPN connection detected.
/usr/src/jetson/orin-nano/Linux_for_Tegra/tools/kernel_flash/l4t_initrd_flash_internal.sh --no-flash --no-flash jetson-orin-nano-devkit-super-nvme nvme0n1p1
************************************
*                                  *
*  Step 1: Generate flash packages *
*                                  *
************************************

...

[   6.0416 ] tegrahost_v2 --chip 0x23 0 --blocksize 512 --magicid MEMB --addsigheader_multi tegra234-p3767-0001-sdram-l4t_cpp_1.bct tegra234-p3767-0001-sdram-l4t_cpp_2.bct tegra234-p3767-0001-sdram-l4t_cpp_3.bct tegra234-p3767-0001-sdram-l4t_cpp_4.bct --ratchet_blob ratchet_blob.bin
[   6.0424 ] Binary 0 length is 58752
[   6.0428 ] Binary 0 align length is 58880
[   6.0438 ] Binary 1 length is 58752
[   6.0441 ] Binary 1 align length is 58880
[   6.0450 ] Binary 2 length is 58752
[   6.0452 ] Binary 2 align length is 58880
[   6.0461 ] Binary 3 length is 58752
[   6.0478 ] Binary 3 align length is 58880
[   6.0479 ] Buffer length is 235520
[   6.0479 ] adding BCH for tegra234-p3767-0001-sdram-l4t_cpp_1.bct
[   6.0479 ] new length is 243712
[   6.0479 ]
[   6.0495 ] tegrahost_v2 --chip 0x23 0 --align mem_coldboot_aligned.bct
[   6.0518 ] tegrahost_v2 --chip 0x23 0 --magicid MEMB --ratchet_blob ratchet_blob.bin --appendsigheader mem_coldboot_aligned.bct zerosbk
[   6.0525 ] Header already present for mem_coldboot_aligned.bct
[   6.0565 ] tegrasign_v3.py --key None --list mem_coldboot_aligned_sigheader.bct_list.xml --pubkeyhash pub_key.key --sha sha512
[   6.0567 ] Assuming zero filled SBK key
[   6.0606 ] Warning: pub_key.key is not found
[   6.0593 ] tegrahost_v2 --chip 0x23 0 --updatesigheader mem_coldboot_aligned_sigheader.bct.encrypt mem_coldboot_aligned_sigheader.bct.hash zerosbk
[   6.0614 ] Generating recovery mem-bct
[   6.0621 ] tegrabct_v2 --chip 0x23 0 --sdram tegra234-p3767-0001-sdram-l4t_cpp.dtb --wb0sdram tegra234-p3767-0001-wb0sdram-l4t_cpp.dtb --membct tegra234-p3767-0001-sdram-l4t_cpp_1.bct tegra234-p3767-0001-sdram-l4t_cpp_2.bct tegra234-p3767-0001-sdram-l4t_cpp_3.bct tegra234-p3767-0001-sdram-l4t_cpp_4.bct
[   6.0629 ]  packing sdram params with Wb0 file tegra234-p3767-0001-wb0sdram-l4t_cpp.dtb
[   6.2145 ] Packing sdram param for instance[0]
[   6.2148 ] Packing sdram param for instance[1]
[   6.2151 ] Packing sdram param for instance[2]
[   6.2154 ] Packing sdram param for instance[3]
[   6.2157 ] Packing sdram param for instance[4]
[   6.2160 ] Packing sdram param for instance[5]
[   6.2163 ] Packing sdram param for instance[6]
[   6.2165 ] Packing sdram param for instance[7]
[   6.2168 ] Packing sdram param for instance[8]
[   6.2171 ] Packing sdram param for instance[9]
[   6.2174 ] Packing sdram param for instance[10]
[   6.2177 ] Packing sdram param for instance[11]
[   6.2180 ] Packing sdram param for instance[12]
[   6.2183 ] Packing sdram param for instance[13]
[   6.2186 ] Packing sdram param for instance[14]
[   6.2189 ] Packing sdram param for instance[15]
Traceback (most recent call last):
  File "/usr/src/jetson/orin-nano/Linux_for_Tegra/bootloader/./tegraflash.py", line 1462, in <module>
[   6.3276 ] Generating mem_bct based on ramcode group number
[   6.3276 ] Got ramcode 00:00:00:02 from the command line
    tegraflash_run_commands()
  File "/usr/src/jetson/orin-nano/Linux_for_Tegra/bootloader/./tegraflash.py", line 1279, in tegraflash_run_commands
    interpreter.onecmd(command)
  File "/usr/lib/python3.12/cmd.py", line 217, in onecmd
    return func(arg)
           ^^^^^^^^^
  File "/usr/src/jetson/orin-nano/Linux_for_Tegra/bootloader/./tegraflash.py", line 771, in do_sign
    self.chip_inst.tegraflash_sign(exports)
  File "/usr/src/jetson/orin-nano/Linux_for_Tegra/bootloader/tegraflash_impl_t234.py", line 3083, in tegraflash_sign
    self.tegraflash_generate_bct()
  File "/usr/src/jetson/orin-nano/Linux_for_Tegra/bootloader/tegraflash_impl_t234.py", line 686, in tegraflash_generate_bct
    self.tegraflash_generate_mem_bct(is_recovery)
  File "/usr/src/jetson/orin-nano/Linux_for_Tegra/bootloader/tegraflash_impl_t234.py", line 2370, in tegraflash_generate_mem_bct
    ramcode = int(values['--ramcode']) >> 2
              ^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '00:00:00:02'
cp: cannot stat 'signed/*': No such file or directory
cp: cannot stat 'signed/flash.xml.tmp': No such file or directory
sed: can't read flash.xml.tmp: No such file or directory
Using bpmp-dtb concatenated with odmdata in blob for t23x
./tegraflash.py --bl uefi_jetson_minimal_with_dtb_sigheader.bin.encrypt --bct br_bct_BR.bct --bldtb tegra234-p3768-0000+p3767-0005-nv-super.dtb --applet rcm_2_encrypt.rcm --applet_softfuse rcm_1_encrypt.rcm --cmd "secureflash;reboot"  --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_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-TE950M-A1_prod_sigheader.bin.encrypt; bpmp_fw_dtb tegra234-bpmp-3767-0003-3768-super_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"    --bct_backup
saving flash command in flashcmd.txt
*** no-flash flag enabled. Exiting now... ***
User can run above saved command in factory environment without
providing pkc and sbk keys to flash a device
Example:
    $ cd bootloader
    $ sudo bash ./flashcmd.txt
Error: /usr/src/jetson/orin-nano/Linux_for_Tegra/bootloader/signed/flash.idx is not found
Error: failed to relocate images to /usr/src/jetson/orin-nano/Linux_for_Tegra/tools/kernel_flash/images
Cleaning up...

I’m attaching the two full logs in case they help…

fails: build-offline.log (41.6 KB)
works build-recovery.log (214.6 KB)

And forgot to mention… Host is Ubuntu-22.04 and I’m working with the Orin Nano 8gb Super official Devkit.

Hi,

Please try these commands instead

Thanks

That produced the same error. I think the issue is RAMCODE_ID.

The instructions say to use RAMCODE_ID=$( ./chkbdinfo -R chip_info.bin_bak) which produces 00:00:00:02 but the script fails when it tries to convert that to an int using the standard python int() function. The rest of the examples in the Developer Guide show RAMCODE_ID being a single digit number, not a hex string so I set RAMCODE_ID=2 and that worked.

So I think you probably need to fix the instructions related to setting the environment variables.

From the Developer Guide:

$ cd bootloader
$ BOARDID=$(./chkbdinfo -i cvm.bin)
$ BOARDSKU=$(./chkbdinfo -k cvm.bin)
$ FAB=$(./chkbdinfo -f cvm.bin)
$ BOARDREV=$(./chkbdinfo -r cvm.bin)
$ CHIP_SKU=$(./chkbdinfo -C chip_info.bin_bak)
$ RAMCODE_ID=$( ./chkbdinfo -R chip_info.bin_bak)
$ RAMCODE=$(echo "ibase=2; ${RAMCODE_ID//:/}" | bc)

Are all the variables actually needed? Most of the instructions where the variables are included on the command line just have the first 4.

Generally just the first 3 should be fine.

export BOARDID=3767
export BOARDSKU=0005
export FAB=300

RAMCODE is defined by hardware during runtime, so should not define it before flash.

Thanks @WayneWWW Yeah I just tried it with those 3 and it worked fine. tools/kernel_flash/README_initrd_flash.txt seems to have better info than the Developer Guide.

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