Error: /mnt/internal/flash.idx is not found

I’ve been able to flash orin nano with encryption correctly. Afterwards, if I make a modification and try to re-flash, or simply flash again without any modification , I just re-use same folder, this error appears( and I am flashing the same orin nano I successfully flashed previously)

[ 99]: l4t_flash_from_kernel: Successfully flash the external device
Erased 67108864 bytes from address 0x00000000 in flash
[ 187]: l4t_flash_from_kernel: Error: /mnt/internal/flash.idx is not found
[ 187]: l4t_flash_from_kernel: /mnt/internal/flash.idx is not found. Skipping spi flashing
[ 187]: l4t_flash_from_kernel: Error flashing qspi

Here is the log:

[   6.8924 ] tegraparser_v2 --pt flash.xml.bin --generateflashindex /home/vmasip/nvidia/Linux_for_Tegra/bootloader/signed/flash.xml.tmp flash.idx
Using bpmp-dtb concatenated with odmdata in blob for t23x
./tegraflash.py --bl uefi_jetson_with_dtb_sigheader.bin.encrypt --bct br_bct_BR.bct --securedev  --bldtb tegra234-p3767-0003-p3768-0000-a0.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; 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; 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-3509-a02_with_odm_sigheader.dtb.encrypt; sce_fw camera-rtcpu-sce_sigheader.img.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-p3767-0003-p3768-0000-a0.dtb"    --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

Save initrd flashing command parameters to /home/vmasip/nvidia/Linux_for_Tegra/tools/kernel_flash/initrdflashparam.txt
/tmp/tmp.85YstF4EYB /home/vmasip/nvidia/Linux_for_Tegra
writing boot image config in bootimg.cfg
extracting kernel in zImage
extracting ramdisk in initrd.img
/tmp/tmp.85YstF4EYB/initrd /tmp/tmp.85YstF4EYB /home/vmasip/nvidia/Linux_for_Tegra
58213 bloques
grep: /home/vmasip/nvidia/Linux_for_Tegra/tools/kernel_flash/images/internal/flash.idx: No existe el archivo o el directorio
65197 bloques
/tmp/tmp.85YstF4EYB /home/vmasip/nvidia/Linux_for_Tegra
flashimg0=boot0.img
/home/vmasip/nvidia/Linux_for_Tegra
Success
Cleaning up...
Finish generating flash package.
Put device in recovery mode, run with option --flash-only to flash device.
(base) vmasip@eudald-Latitude-7480:~/nvidia/Linux_for_Tegra$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --network usb0 --showlogs --flash-only
/home/vmasip/nvidia/Linux_for_Tegra/tools/kernel_flash/l4t_initrd_flash_internal.sh --network usb0 --usb-instance 1-3 --device-instance 0 --flash-only --external-device nvme0n1p1 -c "./tools/kernel_flash/flash_l4t_t234_nvme_rootfs_enc.xml" --network usb0 jetson-orin-nano-devkit external
**********************************************
*                                            *
*  Step 1: Build the flashing environment    *
*                                            *
**********************************************
Create flash environment 0
/home/vmasip/nvidia/Linux_for_Tegra/bootloader /home/vmasip/nvidia/Linux_for_Tegra
/home/vmasip/nvidia/Linux_for_Tegra
Finish creating flash environment 0.
****************************************************
*                                                  *
*  Step 2: Boot the device with flash initrd image *
*                                                  *
****************************************************
/home/vmasip/nvidia/Linux_for_Tegra/temp_initrdflash/bootloader0 /home/vmasip/nvidia/Linux_for_Tegra
./tegraflash.py --bl uefi_jetson_with_dtb_sigheader.bin.encrypt --bct br_bct_BR.bct --securedev  --bldtb tegra234-p3767-0003-p3768-0000-a0.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; 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; 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-3509-a02_with_odm_sigheader.dtb.encrypt; sce_fw camera-rtcpu-sce_sigheader.img.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 boot0.img; kernel_dtb tegra234-p3767-0003-p3768-0000-a0.dtb"    --bct_backup  --instance 1-3
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.0411 ] rcm boot with presigned binaries
[   0.0421 ] tegrarcm_v2 --instance 1-3 --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.0430 ] BR_CID: 0x80012344705DF1885000000004FE0180
[   0.0512 ] Sending bct_br
[   0.0579 ] Sending mb1
[   0.0584 ] Sending psc_bl1
[   0.0690 ] Sending bct_mb1
[   0.0749 ] Generating blob for T23x
[   0.0770 ] tegrahost_v2 --chip 0x23 0 --generateblob blob.xml blob.bin
[   0.0780 ] The number of images in blob is 18
[   0.0785 ] blobsize is 66328694
[   0.0786 ] Added binary blob_uefi_jetson_with_dtb_sigheader.bin.encrypt of size 3186752
[   0.1107 ] Added binary blob_pscfw_t234_prod_sigheader.bin.encrypt of size 375168
[   0.1115 ] Added binary blob_mce_flash_o10_cr_prod_sigheader.bin.encrypt of size 190592
[   0.1121 ] Added binary blob_applet_t234_sigheader.bin.encrypt of size 277312
[   0.1125 ] Not supported type: mb2_applet
[   0.1127 ] Added binary blob_mb2_t234_with_mb2_cold_boot_bct_MB2_sigheader.bin.encrypt of size 437008
[   0.1131 ] Added binary blob_xusb_t234_prod_sigheader.bin.encrypt of size 164864
[   0.1134 ] Added binary blob_display-t234-dce_sigheader.bin.encrypt of size 9097216
[   0.1195 ] Added binary blob_nvdec_t234_prod_sigheader.fw.encrypt of size 294912
[   0.1224 ] Added binary blob_bpmp_t234-TE950M-A1_prod_sigheader.bin.encrypt of size 1027008
[   0.1232 ] Added binary blob_tegra234-bpmp-3767-0003-3509-a02_with_odm_sigheader.dtb.encrypt of size 199936
[   0.1237 ] Added binary blob_camera-rtcpu-sce_sigheader.img.encrypt of size 166304
[   0.1240 ] Added binary blob_camera-rtcpu-t234-rce_sigheader.img.encrypt of size 540000
[   0.1248 ] Added binary blob_adsp-fw_sigheader.bin.encrypt of size 400960
[   0.1254 ] Added binary blob_spe_t234_sigheader.bin.encrypt of size 270336
[   0.1259 ] Added binary blob_tos-optee_t234_sigheader.img.encrypt of size 1288096
[   0.1264 ] Added binary blob_eks_t234_sigheader.img.encrypt of size 9232
[   0.1269 ] Added binary blob_boot0.img of size 48054272
[   0.1594 ] Added binary blob_tegra234-p3767-0003-p3768-0000-a0.dtb of size 347622
[   0.2140 ] tegrarcm_v2 --instance 1-3 --chip 0x23 0 --pollbl --download bct_mem mem_rcm_sigheader.bct.encrypt --download blob blob.bin
[   0.2150 ] BL: version 1.4.0.1-t234-54845784-08e631ca last_boot_error: 0
[   0.3201 ] Sending bct_mem
[   0.3534 ] Sending blob
[   3.7443 ] RCM-boot started

/home/vmasip/nvidia/Linux_for_Tegra
***************************************
*                                     *
*  Step 3: Start the flashing process *
*                                     *
***************************************
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for device to expose ssh ......RTNETLINK answers: File exists
RTNETLINK answers: File exists
Waiting for device to expose ssh ...Run command: flash on fc00:1:1:0::2
SSH ready
blockdev: cannot open /dev/mmcblk0boot0: No such file or directory
[ 0]: l4t_flash_from_kernel: Serial Number: 1425123205974
[ 0]: l4t_flash_from_kernel: Starting to create gpt for external device
Active index file is /mnt/external/flash.idx
Number of lines is 19
max_index=18
writing item=1, 9:0:primary_gpt, 512, 19968, gpt_primary_9_0.bin, 16896, fixed-<reserved>-0, e89e446511a0fcb7384b1272d7239adea8b1de47
Writing primary_gpt partition with gpt_primary_9_0.bin
Offset is not aligned to K Bytes, no optimization is applied
dd if=/mnt/external/gpt_primary_9_0.bin of=/dev/nvme0n1 bs=1 skip=0  seek=512 count=16896
16896+0 records in
16896+0 records out
16896 bytes (17 kB, 16 KiB) copied, 0.0289823 s, 583 kB/s
Writing primary_gpt partition done
Writing secondary_gpt partition with gpt_secondary_9_0.bin
Offset is not aligned to K Bytes, no optimization is applied
dd if=/mnt/external/gpt_secondary_9_0.bin of=/dev/nvme0n1 bs=1 skip=0  seek=512110173696 count=16896
16896+0 records in
16896+0 records out
16896 bytes (17 kB, 16 KiB) copied, 0.027614 s, 612 kB/s
Writing secondary_gpt partition done
[ 14]: l4t_flash_from_kernel: Successfully create gpt for external device
[ 14]: l4t_flash_from_kernel: Starting to flash to external device
Active index file is /mnt/external/flash.idx
Number of lines is 19
max_index=18
[ 14]: l4t_flash_from_kernel: Starting to flash to qspi
QSPI storage size: 67108864 bytes.
writing item=0, 9:0:master_boot_record, 0, 512, mbr_9_0.bin, 512, fixed-<reserved>-0, 694898d1c345bdb31b377790ed7fc0b0db184bf7
writing item=1, 9:0:primary_gpt, 512, 19968, gpt_primary_9_0.bin, 16896, fixed-<reserved>-0, e89e446511a0fcb7384b1272d7239adea8b1de47
writing item=2, 9:0:A_kernel, 20480, 134217728, boot.img, 47200256, fixed-<reserved>-3, f4a91beb187775c840db8474430ae7b3f4619641
Writing A_kernel partition with boot.img
Get size of partition through connection.
47200256 bytes from /mnt/external/boot.img to /dev/nvme0n1: 1KB block=46094 remainder=0
dd if=/mnt/external/boot.img of=/dev/nvme0n1 bs=1K skip=0  seek=20 count=46094
46094+0 records in
46094+0 records out
47200256 bytes (47 MB, 45 MiB) copied, 0.669597 s, 70.5 MB/s
Writing A_kernel partition done
writing item=3, 9:0:A_kernel-dtb, 134238208, 786432, kernel_tegra234-p3767-0003-p3768-0000-a0.dtb, 347622, fixed-<reserved>-4, eeb8c123f309f381622d1099b705c9947fd712c3
Writing A_kernel-dtb partition with kernel_tegra234-p3767-0003-p3768-0000-a0.dtb
Get size of partition through connection.
347622 bytes from /mnt/external/kernel_tegra234-p3767-0003-p3768-0000-a0.dtb to /dev/nvme0n1: 1KB block=339 remainder=486
dd if=/mnt/external/kernel_tegra234-p3767-0003-p3768-0000-a0.dtb of=/dev/nvme0n1 bs=1K skip=0  seek=131092 count=339
339+0 records in
339+0 records out
347136 bytes (347 kB, 339 KiB) copied, 0.00671731 s, 51.7 MB/s
dd if=/mnt/external/kernel_tegra234-p3767-0003-p3768-0000-a0.dtb of=/dev/nvme0n1 bs=1 skip=347136  seek=134585344 count=486
486+0 records in
486+0 records out
486 bytes copied, 0.00132429 s, 367 kB/s
Writing A_kernel-dtb partition done
writing item=4, 9:0:A_reserved_on_user, 135024640, 33161216, , , fixed-<reserved>-5, 
[ 15]: l4t_flash_from_kernel: Warning: skip writing A_reserved_on_user partition as no image is specified
writing item=5, 9:0:B_kernel, 168185856, 134217728, boot.img, 47200256, fixed-<reserved>-6, f4a91beb187775c840db8474430ae7b3f4619641
Writing B_kernel partition with boot.img
Get size of partition through connection.
47200256 bytes from /mnt/external/boot.img to /dev/nvme0n1: 1KB block=46094 remainder=0
dd if=/mnt/external/boot.img of=/dev/nvme0n1 bs=1K skip=0  seek=164244 count=46094
46094+0 records in
46094+0 records out
47200256 bytes (47 MB, 45 MiB) copied, 0.402297 s, 117 MB/s
Writing B_kernel partition done
writing item=6, 9:0:B_kernel-dtb, 302403584, 786432, kernel_tegra234-p3767-0003-p3768-0000-a0.dtb, 347622, fixed-<reserved>-7, eeb8c123f309f381622d1099b705c9947fd712c3
Writing B_kernel-dtb partition with kernel_tegra234-p3767-0003-p3768-0000-a0.dtb
Get size of partition through connection.
347622 bytes from /mnt/external/kernel_tegra234-p3767-0003-p3768-0000-a0.dtb to /dev/nvme0n1: 1KB block=339 remainder=486
dd if=/mnt/external/kernel_tegra234-p3767-0003-p3768-0000-a0.dtb of=/dev/nvme0n1 bs=1K skip=0  seek=295316 count=339
339+0 records in
339+0 records out
347136 bytes (347 kB, 339 KiB) copied, 0.00359648 s, 96.5 MB/s
dd if=/mnt/external/kernel_tegra234-p3767-0003-p3768-0000-a0.dtb of=/dev/nvme0n1 bs=1 skip=347136  seek=302750720 count=486
486+0 records in
486+0 records out
486 bytes copied, 0.0010167 s, 478 kB/s
Writing B_kernel-dtb partition done
writing item=7, 9:0:B_reserved_on_user, 303190016, 33161216, , , fixed-<reserved>-8, 
[ 15]: l4t_flash_from_kernel: Warning: skip writing B_reserved_on_user partition as no image is specified
writing item=8, 9:0:recovery, 336351232, 83886080, recovery.img, 50782208, fixed-<reserved>-9, 7338cacaee0c088dc1fcd50c0448b452d1d751c2
Writing recovery partition with recovery.img
Get size of partition through connection.
50782208 bytes from /mnt/external/recovery.img to /dev/nvme0n1: 1KB block=49592 remainder=0
dd if=/mnt/external/recovery.img of=/dev/nvme0n1 bs=1K skip=0  seek=328468 count=49592
49592+0 records in
49592+0 records out
50782208 bytes (51 MB, 48 MiB) copied, 0.700957 s, 72.4 MB/s
Writing recovery partition done
writing item=9, 9:0:recovery-dtb, 420237312, 524288, tegra234-p3767-0003-p3768-0000-a0.dtb.rec, 347622, fixed-<reserved>-10, eeb8c123f309f381622d1099b705c9947fd712c3
Writing recovery-dtb partition with tegra234-p3767-0003-p3768-0000-a0.dtb.rec
Get size of partition through connection.
347622 bytes from /mnt/external/tegra234-p3767-0003-p3768-0000-a0.dtb.rec to /dev/nvme0n1: 1KB block=339 remainder=486
dd if=/mnt/external/tegra234-p3767-0003-p3768-0000-a0.dtb.rec of=/dev/nvme0n1 bs=1K skip=0  seek=410388 count=339
339+0 records in
339+0 records out
347136 bytes (347 kB, 339 KiB) copied, 0.0078097 s, 44.4 MB/s
dd if=/mnt/external/tegra234-p3767-0003-p3768-0000-a0.dtb.rec of=/dev/nvme0n1 bs=1 skip=347136  seek=420584448 count=486
486+0 records in
486+0 records out
486 bytes copied, 0.00144522 s, 336 kB/s
Writing recovery-dtb partition done
writing item=10, 9:0:esp, 420761600, 67108864, esp.img, 67108864, fixed-<reserved>-11, ba5fea5ca747be8459f45b4621b5d60ba4b6de1b
Writing esp partition with esp.img
Get size of partition through connection.
67108864 bytes from /mnt/external/esp.img to /dev/nvme0n1: 1KB block=65536 remainder=0
dd if=/mnt/external/esp.img of=/dev/nvme0n1 bs=1K skip=0  seek=410900 count=65536
65536+0 records in
65536+0 records out
67108864 bytes (67 MB, 64 MiB) copied, 1.00052 s, 67.1 MB/s
Writing esp partition done
writing item=11, 9:0:recovery_alt, 487870464, 83886080, , , fixed-<reserved>-12, 
[ 17]: l4t_flash_from_kernel: Warning: skip writing recovery_alt partition as no image is specified
writing item=12, 9:0:recovery-dtb_alt, 571756544, 524288, , , fixed-<reserved>-13, 
[ 17]: l4t_flash_from_kernel: Warning: skip writing recovery-dtb_alt partition as no image is specified
writing item=13, 9:0:esp_alt, 572280832, 67108864, , , fixed-<reserved>-14, 
[ 17]: l4t_flash_from_kernel: Warning: skip writing esp_alt partition as no image is specified
writing item=14, 9:0:UDA, 639401984, 419430400, , , fixed-<reserved>-15, 
blkdiscard /dev/nvme0n1p15
/mnt/simg2img /mnt/external/user_data_encrypted.img_ext /dev/nvme0n1p15
writing item=15, 9:0:reserved, 1058832384, 502792192, , , fixed-<reserved>-16, 
[ 18]: l4t_flash_from_kernel: Warning: skip writing reserved partition as no image is specified
writing item=16, 9:0:APP, 1561624576, 419430400, , , fixed-<reserved>-1, 
Formatting APP partition /dev/nvme0n1p1 ...
mke2fs 1.45.5 (07-Jan-2020)
Discarding device blocks: done                            
Creating filesystem with 102400 4k blocks and 102400 inodes
Filesystem UUID: 29d36718-cbdb-41ed-bdc1-72dc2eeefc4f
Superblock backups stored on blocks: 
	32768, 98304

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

Formatting APP parition done
Formatting APP partition /dev/nvme0n1p1 ...
tar -xpf /mnt/external/system_boot.img  --checkpoint=10000 --warning=no-timestamp --numeric-owner --xattrs --xattrs-include=*  -C  /tmp/ci-pwAADhB1sX
writing item=17, 9:0:APP_ENC, 1981054976, 58636369920, , , fixed-<reserved>-2, 
blkdiscard /dev/nvme0n1p2
/mnt/simg2img /mnt/external/system_root_encrypted.img_ext /dev/nvme0n1p2
writing item=18, 9:0:secondary_gpt, 512110173696, 16896, gpt_secondary_9_0.bin, 16896, fixed-<reserved>-0, 21032cfc0dc4488554a95a1f5d494b77afa6fd49
[ 99]: l4t_flash_from_kernel: Successfully flash the external device
Erased 67108864 bytes from address 0x00000000 in flash
[ 187]: l4t_flash_from_kernel: Error: /mnt/internal/flash.idx is not found
[ 187]: l4t_flash_from_kernel: /mnt/internal/flash.idx is not found. Skipping spi flashing
[ 187]: l4t_flash_from_kernel: Error flashing qspi
Flash failure
Cleaning up...

This is my flashing script:


cd $L4T_FOLDER
sudo ./tools/kernel_flash/l4t_initrd_flash_internal.sh --no-flash --network usb0      --showlogs -p -c bootloader/t186ref/cfg/flash_t234_qspi.xml      jetson-orin-nano-devkit internal
sudo ./flash.sh --no-flash -k A_eks jetson-orin-nano-devkit internal
sudo cp bootloader/eks_t234_sigheader.img.encrypt ./tools/kernel_flash/images/internal/.
sudo ROOTFS_ENC=1 ./tools/kernel_flash/l4t_initrd_flash.sh --showlogs --no-flash --external-device nvme0n1p1 -i ./sym2_t234.key -c ./tools/kernel_flash/flash_l4t_t234_nvme_rootfs_enc.xml --external-only --append --network usb0 jetson-orin-nano-devkit external
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --network usb0 --showlogs --flash-only

Hi masip85,

Are you using the devkit or custom board for Orin Nano?
What’s your Jetpack version in use?

Could you remove above 2 lines in your flashing script to verify?

I’ve did it. But it didn’t work. Same error. Then I came back to the previous version (with those 2 lines again) with fresh-new folder never flashed, but this time it didn’t work. Not even in other nano. I am using nvidia dev kits. And, should I have a log debbuging trough a usb to ttl into pins 3,4,7 ? With minicom -D /dev/ttyUSB0 -8 -b 115200 , I get nothing.

So, I moved back to sdkmanager. It flashed at the third attempt. Yes , errors like fails to read rcm_state. Then, I moved back to encryption and again, same error:

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

Formatting APP parition done
Formatting APP partition /dev/nvme0n1p1 ...
tar -xpf /mnt/external/system_boot.img  --checkpoint=10000 --warning=no-timestamp --numeric-owner --xattrs --xattrs-include=*  -C  /tmp/ci-9a4p6Afg0G
writing item=17, 9:0:APP_ENC, 1981054976, 58636369920, , , fixed-<reserved>-2, 
blkdiscard /dev/nvme0n1p2
/mnt/simg2img /mnt/external/system_root_encrypted.img_ext /dev/nvme0n1p2
writing item=18, 9:0:secondary_gpt, 512110173696, 16896, gpt_secondary_9_0.bin, 16896, fixed-<reserved>-0, 7286059980368f47ce5e78a57cd4384d033c34b0
[ 87]: l4t_flash_from_kernel: Successfully flash the external device
Erased 67108864 bytes from address 0x00000000 in flash
[ 190]: l4t_flash_from_kernel: Error: /mnt/internal/flash.idx is not found
[ 190]: l4t_flash_from_kernel: /mnt/internal/flash.idx is not found. Skipping spi flashing
[ 190]: l4t_flash_from_kernel: Error flashing qspi
Flash failure
Cleaning up...

Please refer to Jetson Nano & NX Style - Serial Debug Console - JetsonHacks to capture serial console log.

Please share the full flash log as file here for further check.

I did, but nothing show up. You can see the wiring, just RXD TXD and GROUND (checked orin nano twice). Waveshare ttl to usb. 3.3V configured.

Now, while I am flashing with nvidia_sdk manager, nothing shows up at minicom console. You can see the command I execute at the image I’ve attached.

I’ve also tried:
picocom -b 115200 /dev/ttyUSB0 --logfile my_log.txt

I get nothing. And jetson has been successfully flashed well with nvidia_sdk_manager.

What is happening?

Ok. I’ve changed the ttl device wire, and at a first moment, I came with nothing at the debugging port, but after a while, it’s giving me info. I am attaching you the log:

minicom.log (353.9 KB)

[ 2069.471211] NFS: state manager: check lease failed on NFSv4 server fc00:1:1:0::1 with error 13

Is this the error?

I repeat context: It’s happening with two different orin nano. This orin nano failed flashed of the attachments, has been successfully flashed with sdk manager 2 hours ago. So, I guess, it’s not a disk issue.

I would also need to check the full flash log.

It seems you can boot up the board successfully.
Is your issue about the “flash failed” or “the error message relating to NFS”?

I am using this code for flashing:

cd $L4T_FOLDER
sudo ./tools/kernel_flash/l4t_initrd_flash_internal.sh --no-flash --network usb0      --showlogs -p -c bootloader/t186ref/cfg/flash_t234_qspi.xml      jetson-orin-nano-devkit internal > flashLog1.txt
sudo ./flash.sh --no-flash -k A_eks jetson-orin-nano-devkit internal > flashLog2.txt
sudo cp bootloader/eks_t234_sigheader.img.encrypt ./tools/kernel_flash/images/internal/.
sudo ROOTFS_ENC=1 ./tools/kernel_flash/l4t_initrd_flash.sh --showlogs --no-flash --external-device nvme0n1p1 -i ./sym2_t234.key -c ./tools/kernel_flash/flash_l4t_t234_nvme_rootfs_enc.xml --external-only --append --network usb0 jetson-orin-nano-devkit external > flashLog3.txt
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --network usb0 --showlogs --flash-only > flashLog4.txt

but as I have said before, I’ve tried without this with the same outcome:

sudo ./flash.sh --no-flash -k A_eks jetson-orin-nano-devkit internal
sudo cp bootloader/eks_t234_sigheader.img.encrypt ./tools/kernel_flash/images/internal/.

These are the logs(without removing those lines):
flashLog1.txt (134.1 KB)
flashLog2.txt (21.6 KB)
flashLog3.txt (144.5 KB)
flashLog4.txt (6.9 KB)

When this happens, the jetson doesn’t boot after restart. in normal boot mode. Nothing happens. Not even moving the fan.

I thought the NFS error obtained from the serial port, was the cause of flash failed. Maybe it’s not (if that is the case that is not my problem). So, at the end, the problem is that I cannot flash the jetson.

pd. I’ve tested latest 36.3 version. Same result

Hello,

Do you know what is happening? Are you able to reproduce this issue?

Error: Could not stat device /dev/mmcblk0 - No such file or directory.

There’s no internal eMMC for Orin Nano.

Could you remove these 2 lines and follow you steps to flash the board again?

For this command, please use the following command instead

$ sudo ./tools/kernel_flash/l4t_initrd_flash_internal.sh --no-flash --network usb0  --showlogs -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" jetson-orin-nano-devkit internal > flashLog1.txt

Hello

Ok,so now i am trying this code with 6.0 version. First command didn’t work:

sudo ./tools/kernel_flash/l4t_initrd_flash_internal.sh --no-flash --network usb0      --showlogs -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml"      jetson-orin-nano-devkit internal > flashLog1.txt

so I moved to this:

cd $L4T_FOLDER
if [ "$JP" = "35.5.0" ]; then
    sudo ./tools/kernel_flash/l4t_initrd_flash_internal.sh --no-flash --network usb0      --showlogs -p -c bootloader/t186ref/cfg/flash_t234_qspi.xml      jetson-orin-nano-devkit internal > flashLog1.txt
else
    sudo ./tools/kernel_flash/l4t_initrd_flash.sh --network usb0 \
            --showlogs -p "-c bootloader/generic/cfg/flash_t234_qspi.xml" \
            --no-flash jetson-orin-nano-devkit internal > flashLog1.txt
fi

#    sudo ./flash.sh --no-flash -k A_eks jetson-orin-nano-devkit internal > flashLog2.txt
#    sudo cp bootloader/eks_t234_sigheader.img.encrypt ./tools/kernel_flash/images/internal/.
    sudo ROOTFS_ENC=1 ./tools/kernel_flash/l4t_initrd_flash.sh --showlogs --no-flash --external-device nvme0n1p1 -i ./sym2_t234.key -c ./tools/kernel_flash/flash_l4t_t234_nvme_rootfs_enc.xml --external-only --append --network usb0 jetson-orin-nano-devkit external > flashLog3.txt
    sudo ./tools/kernel_flash/l4t_initrd_flash.sh --network usb0 --showlogs --flash-only > flashLog4.txt

as i said, this time I am with JP=36.6.0
This time, it flashed successfully.!!! Here the logs:
flashLog4.txt (56.2 KB)
flashLog3.txt (153.2 KB)
flashLog1.txt (202.4 KB)

But I’ve got an error when booting jetson I would send you minicom messages, BUT, nothing shows up. It’s something I am starting to think doesn’t work well too. I’ve followed guides. (connected rx tx and gnd. 3.3V mode. connect to pc and use minicom or picocom (sudo picocom -b 115200 /dev/ttyUSB0)but nothing shows up (I’ve tried 2 different uart converters). Sometimes I think is a jetson issue, but could be related to minicom and laptop. ). So, I send you a picture of the error.

How did I prepare encryption key? Like this:

# Ruta del archivo a reemplazar
file_path="${L4T_FOLDER}/source/${PUBLIC}/optee/samples/hwkey-agent/host/tool/gen_ekb/example.sh"

# Contenido que será escrito en el archivo
new_content1='#!/bin/bash

# [T234 example]
# Fill your OEM_K1 fuse key value
echo "2d4a614e645267556b58703273357638792f423f4428472b4b6250655368566d" > oem_k1.key

# This is the fixed vector for deriving EKB root key from fuse.
# It is expected user to replace the FV below with a user specific
# FV, and code the exact same user specific FV into OP-TEE.
echo "bad66eb4484983684b992fe54a648bb8" > fv_ekb_t234

# Generate user-defined symmetric key files
# For each key, uncomment the random generate key and comment out the next line for production
# openssl rand -rand /dev/urandom -hex 32 > sym_t234.key    # kernel/kernel-dtb encryption key
echo "0000000000000000000000000000000000000000000000000000000000000000" > sym_t234.key
# openssl rand -rand /dev/urandom -hex 16 > sym2_t234.key   # disk encryption key
echo "96be0bdc974cd136109006d8f9277fa2" > sym2_t234.key
# openssl rand -rand /dev/urandom -hex 16 > auth_t234.key   # uefi variables authentication key
echo "d9f7b49e3b6264985f1326f541bb43c9" > auth_t234.key

python3 gen_ekb.py -chip t234 -oem_k1_key oem_k1.key \
        -fv fv_ekb_t234 \
        -in_sym_key sym_t234.key \
        -in_sym_key2 sym2_t234.key \
        -in_auth_key auth_t234.key \
        -out eks_t234.img
'

# Contenido que será escrito en el archivo
new_content2='#!/bin/bash

# [T234 example]
# Fill your OEM_K1 fuse key value
echo "0000000000000000000000000000000000000000000000000000000000000000" > oem_k1.key

# Generate user-defined symmetric key files
# A random generate key is recommended for production, and a specified key is recommended for testing
# For each key, there are reference examples for generating random key and specifying keys.
# openssl rand -rand /dev/urandom -hex 32 > sym_t234.key    # kernel/kernel-dtb encryption key
echo "0000000000000000000000000000000000000000000000000000000000000000" > sym_t234.key
# openssl rand -rand /dev/urandom -hex 16 > sym2_t234.key   # disk encryption key
echo "96be0bdc974cd136109006d8f9277fa2" > sym2_t234.key
# openssl rand -rand /dev/urandom -hex 16 > auth_t234.key   # uefi variables authentication key
echo "00000000000000000000000000000000" > auth_t234.key

python3 gen_ekb.py -chip t234 -oem_k1_key oem_k1.key \
        -in_sym_key sym_t234.key \
        -in_sym_key2 sym2_t234.key \
        -in_auth_key auth_t234.key \
        -out eks_t234.img


'
# Reemplazar el contenido del archivo

if [ "$JP" = "35.5.0" ]; then
    echo "$new_content1" | sudo tee "$file_path"
else
    echo "$new_content2" | sudo tee "$file_path"
fi

# Ejecutar example.sh y compiar .img y .key a l4tfolder
cd ${L4T_FOLDER}/source/${PUBLIC}/optee/samples/hwkey-agent/host/tool/gen_ekb/ && bash example.sh && cd -

cp ${L4T_FOLDER}/source/${PUBLIC}/optee/samples/hwkey-agent/host/tool/gen_ekb/eks_t234.img ${L4T_FOLDER}/bootloader/eks_t234.img
cp ${L4T_FOLDER}/source/${PUBLIC}/optee/samples/hwkey-agent/host/tool/gen_ekb/sym2_t234.key ${L4T_FOLDER}/


I’ve doubled checked that .img and .key are copied correctly.

Then I modify NUM_SECTORS at ./tools/kernel_flash/flash_l4t_t234_nvme_rootfs_enc.xmlto 1000215216 ffor my 512GB disk.

This encryption code used to work. But now I am stunned with this new error.

no key available with this passphrase

It seems you hit kernel panic with nvme0n1p2 unlock failed and you should update eks image.

#    sudo ./flash.sh --no-flash -k A_eks jetson-orin-nano-devkit internal > flashLog2.txt
#    sudo cp bootloader/eks_t234_sigheader.img.encrypt ./tools/kernel_flash/images/internal/.

Please add these 2 lines back but use jetson-agx-orin-devkit instead of jetson-orin-nano-devkit in the first command.

If you are using JP6, you could just remove the sections for JP5.
It seems your auth_t234.key is all zero currently.

Hello

Well , as you can see in my previous code, I’ve got new_content1 and new_content2 according to JP version. Both are original versions of jetpack optee sources (modifying just sym2 key). I guess auth2 should be all zeros if original versions are all zeros. But when the original source is not all zeros, I should keep with the original values. (In a case like mine, where uefi is not modified).

So do I keep this two lines for JP6? Remember JP6 , uses “newcontent2” with all zeros at auth_t234.

And I can remove these two lines for JP5 where auth_t234 is not all zeros. Isn’t it?

I’ll make it a try with the modification you suggest.

I’ve tried re-adding these 2 lines with the nano->agx modification you’ve proposed. But new error:

Error: Invalid target board - A_eks.

If I change it to jetson-orin-nano-devkit again it works. Log:
flashLog2.txt (26.9 KB)

Befoce cp command, origin and target folder:

Then I execute cp command.

Next steps, you can see execution and terminal output here:

vmasip@vmasip-Latitude-7480:/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra$    sudo ROOTFS_ENC=1 ./tools/kernel_flash/l4t_initrd_flash.sh --showlogs --no-flash --external-device nvme0n1p1 -i ./sym2_t234.key -c ./tools/kernel_flash/flash_l4t_t234_nvme_rootfs_enc.xml --external-only --append --network usb0 jetson-orin-nano-devkit external > flashLog3.txt
53899 bloques
install: el objetivo '' no es un directorio: No existe el archivo o el directorio
72020 bloques
53899 bloques

gzip: /media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/kernel/Image: not in gzip format
77459 bloques
77459 bloques
95581 bloques
20+0 registros leídos
20+0 registros escritos
20 bytes copied, 0,000296593 s, 67,4 kB/s
ln: fallo al crear el enlace simbólico './boot': El archivo ya existe
ln: fallo al crear el enlace simbólico './kernel_tegra234-p3768-0000+p3767-0005-nv.dtb': El archivo ya existe
131072+0 registros leídos
131072+0 registros escritos
67108864 bytes (67 MB, 64 MiB) copied, 0,64483 s, 104 MB/s
/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/bootloader/L4TConfiguration_updated.dts: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/bootloader/L4TConfiguration.dtbo: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/bootloader/user_data_encrypted.img_ext.raw : 14.07%   (419430400 => 59010029 bytes, /media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/tools/kernel_flash/images/external/user_data_encrypted.img_ext.zst) 
/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/bootloader/system_root_encrypted.img_ext.raw : 13.51%   (58636369920 => 7924211957 bytes, /media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/tools/kernel_flash/images/external/system_root_encrypted.img_ext.zst) 
53899 bloques

gzip: /media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/kernel/Image: not in gzip format
77459 bloques
20+0 registros leídos
20+0 registros escritos
20 bytes copied, 0,00045456 s, 44,0 kB/s
131072+0 registros leídos
131072+0 registros escritos
67108864 bytes (67 MB, 64 MiB) copied, 0,497453 s, 135 MB/s
/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/bootloader/L4TConfiguration_updated.dts: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/bootloader/L4TConfiguration.dtbo: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/bootloader/L4TConfiguration_updated.dts: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/bootloader/L4TConfiguration.dtbo: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
77459 bloques
129883 bloques
vmasip@vmasip-Latitude-7480:/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra$     sudo ./tools/kernel_flash/l4t_initrd_flash.sh --network usb0 --showlogs --flash-only > flashLog4.txt


Again flash3 and 4 logs:
flashLog4.txt (56.5 KB)
flashLog3.txt (153.2 KB)

But again No key available with this passphrase ,failed to unlock and kernel panic.

Okay, it seems working with using jetson-orin-nano-devkit as board config.
and your flash log seems finished successfully.

Could you also update eks image in slot B with the following command?

$ sudo ./flash.sh --no-flash -k B_eks jetson-orin-nano-devkit internal

Why do you say it has finished successfully if that message is not shown at flashLog4.txt, but says specifically “Flash Failure”?

Anyway, I’ve tried your B_eks modification:

flashLog2.txt (26.9 KB)

With this output at terminal outside log:

131072+0 registros leídos
131072+0 registros escritos
67108864 bytes (67 MB, 64 MiB) copied, 0,509036 s, 132 MB/s
/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/bootloader/L4TConfiguration_updated.dts: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/bootloader/L4TConfiguration.dtbo: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property

FlashLog3:
flashLog3.txt (153.2 KB)

Output outside flashlog3:

vmasip@vmasip-Latitude-7480:/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra$ sudo ROOTFS_ENC=1 ./tools/kernel_flash/l4t_initrd_flash.sh --showlogs --no-flash --external-device nvme0n1p1 -i ./sym2_t234.key -c ./tools/kernel_flash/flash_l4t_t234_nvme_rootfs_enc.xml --external-only --append --network usb0 jetson-orin-nano-devkit external > flashLog3.txt
çç
53899 bloques
install: el objetivo '' no es un directorio: No existe el archivo o el directorio
72020 bloques
53899 bloques

gzip: /media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/kernel/Image: not in gzip format
77459 bloques
77459 bloques
95581 bloques
20+0 registros leídos
20+0 registros escritos
20 bytes copied, 0,000989971 s, 20,2 kB/s
ln: fallo al crear el enlace simbólico './boot': El archivo ya existe
ln: fallo al crear el enlace simbólico './kernel_tegra234-p3768-0000+p3767-0005-nv.dtb': El archivo ya existe
131072+0 registros leídos
131072+0 registros escritos
67108864 bytes (67 MB, 64 MiB) copied, 0,476265 s, 141 MB/s
/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/bootloader/L4TConfiguration_updated.dts: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/bootloader/L4TConfiguration.dtbo: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/bootloader/user_data_encrypted.img_ext.raw : 14.07%   (419430400 => 59010029 bytes, /media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/tools/kernel_flash/images/external/user_data_encrypted.img_ext.zst) 
/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/bootloader/system_root_encrypted.img_ext.raw : 13.74%   (58636369920 => 8056293970 bytes, /media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/tools/kernel_flash/images/external/system_root_encrypted.img_ext.zst) 
53899 bloques

gzip: /media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/kernel/Image: not in gzip format
77459 bloques
20+0 registros leídos
20+0 registros escritos
20 bytes copied, 0,000305641 s, 65,4 kB/s
131072+0 registros leídos
131072+0 registros escritos
67108864 bytes (67 MB, 64 MiB) copied, 0,482805 s, 139 MB/s
/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/bootloader/L4TConfiguration_updated.dts: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/bootloader/L4TConfiguration.dtbo: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/bootloader/L4TConfiguration_updated.dts: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
/media/vmasip/jetson_sources/flash_manual/Linux_for_Tegra/bootloader/L4TConfiguration.dtbo: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
77459 bloques
129883 bloques

NOW, we’ve got a different error when flashing:
flashLog4.txt (8.5 KB)

I extract this from log4:

for target to boot-up...
Waiting for device to expose ssh ......Waiting for device to expose ssh ...Run command: flash on fc00:1:1:0::2
SSH ready
blockdev: cannot open /dev/mmcblk0boot0: No such file or directory
[ 0]: l4t_flash_from_kernel: Serial Number: 1421223018445
[ 0]: l4t_flash_from_kernel: Starting to create gpt for emmc
Active index file is /mnt/internal/flash.idx
Number of lines is 61
max_index=60
[ 2]: l4t_flash_from_kernel: Successfully create gpt for emmc
[ 2]: l4t_flash_from_kernel: Starting to create gpt for external device
Active index file is /mnt/external/flash.idx
Number of lines is 19
max_index=18
writing item=1, 9:0:primary_gpt, 512, 19968, gpt_primary_9_0.bin, 16896, fixed-<reserved>-0, e2353a269da65c68db7d44df881fd6c95f98433f
Writing primary_gpt partition with gpt_primary_9_0.bin
Offset is not aligned to K Bytes, no optimization is applied
dd if=/mnt/external/gpt_primary_9_0.bin of=/dev/nvme0n1 bs=1 skip=0  seek=512 count=16896
16896+0 records in
16896+0 records out
16896 bytes (17 kB, 16 KiB) copied, 0.0307092 s, 550 kB/s
Writing primary_gpt partition done
**Error: Invalid argument during seek for read on /dev/nvme0n1**
**[ 6]: l4t_flash_from_kernel: Error: partprobe failed. This indicates that:**
** -   the xml indicates the gpt is larger than the device storage**
** -   the xml might be invalid**
** -   the device might have a problem.**
 Please make correction.
Flash failure
Either the device cannot mount the NFS server on the host or a flash command has failed. Debug log saved to /tmp/tmp.elte2ERvPv. You can access the target's terminal through "sshpass -p root ssh root@fc00:1:1:0::2" 
Cleaning up...

It’s an strange error, I followed the same steps, same commands I pasted previously. And modified .xml NUM_SECTORS with same value, 1000215216 for a 512GB nvme. I paste again my “encryption commands”

The only modification i have done is B_EKS. But is this really caused by B_EKS?

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

Sorry that what I mean should be creating the signed eks image successfully rather than flash.

Could you share the result of sudo fdisk -l on your board to check the actual size of your SSD?