An error occurred using the method of flashing with initrd

Hello there,

Last few months we are trying to enable flash to external SSD card with no luck. We really need your help to figure out the issues. We have the worst experience ever with your documentation.

Core board:xavier-nx 16G

I enter the following instructions

sudo  ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_nvme.xml -S 30GiB --showlogs jetson-xavier-nx-devkit-emmc nvme0n1p1

Result diagram

I found that my SSD card has been partitioned according to the partition table file

Hi,

Not sure if this is same issue or not. Please check if the workaround in this post can help

If this is not the same issue, please list out all the steps you have done.

Can you try to do the following:

  1. modify function tegraflash_get_ramcode() in file Linux_for_Tegra/bootloader/tegraflash_internal.py, to assign the variable ramcode = 2

  2. Run command:

sudo  ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_external.xml --erase-all --network usb0  --showlogs jetson-xavier-nx-devkit-emmc nvme0n1p1

Hi,
I’m very sorry to return to you now. Thank you very much for your help, but the problem has not been solved.
I’ll verify it according to your method: Here’s what I modified
2022-04-11_11-52

I execute the following command

sudo  ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_external.xml --erase-all --showlogs jetson-xavier-nx-devkit-emmc nvme0n1p1

The log of this execution is as follows

**********************************************
*                                            *
*  Step 1: Build the flashing environment    *
*                                            *
**********************************************
Create flash environment 0
~/sunxuehu/code/code/flashtool/Linux_for_Tegra/bootloader ~/sunxuehu/code/code/flashtool/Linux_for_Tegra
~/sunxuehu/code/code/flashtool/Linux_for_Tegra
Finish creating flash environment 0.
****************************************************
*                                                  *
*  Step 2: Boot the device with flash initrd image *
*                                                  *
****************************************************
~/sunxuehu/code/code/flashtool/Linux_for_Tegra/temp_initrdflash/bootloader0 ~/sunxuehu/code/code/flashtool/Linux_for_Tegra
./tegraflash.py --bl nvtboot_recovery_cpu_t194_sigheader.bin.encrypt --bct br_bct_BR.bct --securedev  --applet rcm_2_encrypt.rcm --applet_softfuse rcm_1_encrypt.rcm --cmd "rcmboot"  --cfg secureflash.xml --chip 0x19 --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 --mem_bct_cold_boot mem_coldboot_sigheader.bct.encrypt  --bins "mb2_bootloader nvtboot_recovery_t194_sigheader.bin.encrypt; mts_preboot preboot_c10_prod_cr_sigheader.bin.encrypt; mts_mce mce_c10_prod_cr_sigheader.bin.encrypt; mts_proper mts_c10_prod_cr_sigheader.bin.encrypt; bpmp_fw bpmp_t194_sigheader.bin.encrypt; bpmp_fw_dtb tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt; spe_fw spe_t194_sigheader.bin.encrypt; tlk tos-trusty_t194_sigheader.img.encrypt; eks eks_sigheader.img.encrypt; kernel boot0.img; kernel_dtb kernel_tegra194-p3668-all-p3509-0000.dtb; bootloader_dtb tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt"    --instance 1-2 --skipuid
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.0000 ] rcm boot with presigned binaries
[   0.0000 ] Boot Rom communication
[   0.0020 ] tegrarcm_v2 --instance 1-2 --chip 0x19 0 --rcm rcm_1_encrypt.rcm --rcm rcm_2_encrypt.rcm --skipuid
[   0.0026 ] Boot Rom communication completed
[   1.0294 ] 
[   2.0350 ] tegrarcm_v2 --instance 1-2 --isapplet
[   2.0371 ] Applet version 01.00.0000
[   2.0571 ] 
[   2.0571 ] Sending BCTs
[   2.0591 ] tegrarcm_v2 --instance 1-2 --download bct_bootrom br_bct_BR.bct --download bct_mb1 mb1_bct_MB1_sigheader.bct.encrypt --download bct_mem mem_rcm_sigheader.bct.encrypt
[   2.0596 ] Applet version 01.00.0000
[   2.0762 ] Sending bct_bootrom
[   2.0763 ] [................................................] 100%
[   2.0774 ] Sending bct_mb1
[   2.0825 ] [................................................] 100%
[   2.0865 ] Sending bct_mem
[   2.1363 ] [................................................] 100%
[   2.2104 ] 
[   2.2105 ] Generating blob
[   2.2163 ] tegrahost_v2 --chip 0x19 --generateblob blob.xml blob.bin
[   2.2183 ] number of images in blob are 13
[   2.2192 ] blobsize is 76725448
[   2.2195 ] Added binary blob_nvtboot_recovery_cpu_t194_sigheader.bin.encrypt of size 264064
[   2.2763 ] Added binary blob_nvtboot_recovery_t194_sigheader.bin.encrypt of size 181152
[   2.2767 ] Added binary blob_preboot_c10_prod_cr_sigheader.bin.encrypt of size 24016
[   2.2771 ] Added binary blob_mce_c10_prod_cr_sigheader.bin.encrypt of size 143200
[   2.2774 ] Added binary blob_mts_c10_prod_cr_sigheader.bin.encrypt of size 3430416
[   2.2782 ] Added binary blob_bpmp_t194_sigheader.bin.encrypt of size 856352
[   2.2789 ] Added binary blob_tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt of size 391408
[   2.2792 ] Added binary blob_spe_t194_sigheader.bin.encrypt of size 94960
[   2.2795 ] Added binary blob_tos-trusty_t194_sigheader.img.encrypt of size 410560
[   2.2798 ] Added binary blob_eks_sigheader.img.encrypt of size 5136
[   2.2800 ] Added binary blob_boot0.img of size 70510592
[   2.3103 ] Added binary blob_kernel_tegra194-p3668-all-p3509-0000.dtb of size 204640
[   2.3302 ] Added binary blob_tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt of size 208736
[   2.3664 ] 
[   2.3664 ] Sending bootloader and pre-requisite binaries
[   2.3684 ] tegrarcm_v2 --instance 1-2 --download blob blob.bin
[   2.3690 ] Applet version 01.00.0000
[   2.3867 ] Sending blob
[   2.3868 ] [................................................] 100%
[  13.1444 ] 
[  13.1483 ] tegrarcm_v2 --instance 1-2 --boot rcm
[  13.1504 ] Applet version 01.00.0000
[  13.1744 ] 
[  13.1745 ] RCM-boot started

~/sunxuehu/code/code/flashtool/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 device to expose ssh ......RTNETLINK answers: File exists
RTNETLINK answers: File exists
...RTNETLINK answers: File exists
RTNETLINK answers: File exists
Run command: if [ -f /qspi/l4t_flash_from_kernel.sh ]; then USER=root /qspi/l4t_flash_from_kernel.sh --no-reboot --qspi-only ; fi on root@fe80::1%enp0s20f0u2
4194304
[ 0]: l4t_flash_from_kernel: Starting to create gpt for emmc
Active index file is /home/guwen/sunxuehu/code/code/flashtool/Linux_for_Tegra/tools/kernel_flash/images/internal/flash.idx
Number of lines is 62
max_index=61
writing item=49, 1:3:primary_gpt, 512, 19968, gpt_primary_1_3.bin, 16896, fixed-<reserved>-0, cc310aa0163bc383023e41904c2cfa60640743bb
Writing primary_gpt partition with gpt_primary_1_3.bin
Offset is not aligned to K Bytes, no optimization is applied
dd if=/home/guwen/sunxuehu/code/code/flashtool/Linux_for_Tegra/tools/kernel_flash/images/internal/gpt_primary_1_3.bin of=/dev/sdb bs=1 skip=0  seek=512 count=16896
记录了16896+0 的读入
记录了16896+0 的写出
16896 bytes (17 kB, 16 KiB) copied, 0.0491309 s, 344 kB/s
Writing primary_gpt partition done
Writing secondary_gpt partition with gpt_secondary_1_3.bin
Offset is not aligned to K Bytes, no optimization is applied
dd if=/home/guwen/sunxuehu/code/code/flashtool/Linux_for_Tegra/tools/kernel_flash/images/internal/gpt_secondary_1_3.bin of=/dev/sdb bs=1 skip=0  seek=15757983232 count=16896
记录了16896+0 的读入
记录了16896+0 的写出
16896 bytes (17 kB, 16 KiB) copied, 0.076523 s, 221 kB/s
Writing secondary_gpt partition done
[ 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 /home/guwen/sunxuehu/code/code/flashtool/Linux_for_Tegra/tools/kernel_flash/images/external/flash.idx
Number of lines is 14
max_index=13
writing item=1, 9:0:primary_gpt, 512, 19968, gpt_primary_9_0.bin, 16896, fixed-<reserved>-0, 3513646af54759eb651ef0ab35dc3414f68c0858
Writing primary_gpt partition with gpt_primary_9_0.bin
Offset is not aligned to K Bytes, no optimization is applied
dd if=/home/guwen/sunxuehu/code/code/flashtool/Linux_for_Tegra/tools/kernel_flash/images/external/gpt_primary_9_0.bin of=/dev/sde bs=1 skip=0  seek=512 count=16896
记录了16896+0 的读入
记录了16896+0 的写出
16896 bytes (17 kB, 16 KiB) copied, 0.0478388 s, 353 kB/s
Writing primary_gpt partition done
Error: 备份 GPT 表损坏,但主表似乎是正确的,所以使用备份。
Warning: 并非所有可用于 /dev/sde 的空间都被用到了,您可以修正 GPT 以使用所有的空间 (额外的 32385215 个区块),还是说要继续使用目前的设置? 
Writing secondary_gpt partition with gpt_secondary_9_0.bin
Offset is not aligned to K Bytes, no optimization is applied
dd if=/home/guwen/sunxuehu/code/code/flashtool/Linux_for_Tegra/tools/kernel_flash/images/external/gpt_secondary_9_0.bin of=/dev/sde bs=1 skip=0  seek=495528943104 count=16896
记录了16896+0 的读入
记录了16896+0 的写出
16896 bytes (17 kB, 16 KiB) copied, 0.0354411 s, 477 kB/s
Writing secondary_gpt partition done
错误: 备份 GPT 分区表不如它应当的那样在磁盘末端。要通过移动过去(并且删除旧备份)的方式修复吗?
修正/Fix/忽略/Ignore? Fix                                                 
警告: 并非所有可用于 /dev/sde 的空间都被用到了,您可以修正 GPT 以使用所有的空间 (额外的 32385215 个区块),还是说要继续使用目前的设置? 
修正/Fix/忽略/Ignore? Fix                                                 
型号:ext0 0 (scsi)
磁盘 /dev/sde: 512GB
扇区大小 (逻辑/物理):512B/512B
分区表:gpt
磁盘标志:

编号  起始点  结束点  大小    文件系统  名称               标志
 1    20.5kB  15.0GB  15.0GB            APP                msftdata
 2    15.0GB  15.1GB  67.1MB            kernel             msftdata
 3    15.1GB  15.2GB  67.1MB            kernel_b           msftdata
 4    15.2GB  15.2GB  459kB             kernel-dtb         msftdata
 5    15.2GB  15.2GB  459kB             kernel-dtb_b       msftdata
 6    15.2GB  15.2GB  66.1MB            recovery           msftdata
 7    15.2GB  15.2GB  524kB             recovery-dtb       msftdata
 8    15.2GB  15.2GB  262kB             kernel-bootctrl    msftdata
 9    15.2GB  15.2GB  262kB             kernel-bootctrl_b  msftdata
10    15.2GB  15.5GB  315MB             RECROOTFS          msftdata
11    15.5GB  496GB   480GB             UDA                msftdata

[ 5]: l4t_flash_from_kernel: Expanding last partition to fill the storage device
[ 6]: l4t_flash_from_kernel: Successfully create gpt for external device
Run command: partprobe on root@fe80::1%enp0s20f0u2
[ 6]: l4t_flash_from_kernel: The device size indicated in the partition layout xml is smaller than the actual size. This utility will try to fix the GPT.
Error flashing non-qspi storage
Error flashing qspi

Cleaning up...

Hi,WayneWWW

What we encountered with them is not a problem. Here are all my steps and records

https://forums.developer.nvidia.com/t/an-error-occurred-using-the-method-of-flashing-with-initrd/210667/6?u=sunxuehu

Hi,lhoang

I also execute the following commands

sudo  ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_external.xml --erase-all --network usb0  --showlogs jetson-xavier-nx-devkit-emmc nvme0n1p1

After executing this command, I found that the machine could not start. The screen was restarting all the time, but nothing was displayed

The following is my execution log

**********************************************
*                                            *
*  Step 1: Build the flashing environment    *
*                                            *
**********************************************
Create flash environment 0
/home/sunxuehu/sunxuehu/code/code/flashtool/Linux_for_Tegra/bootloader /home/sunxuehu/sunxuehu/code/code/flashtool/Linux_for_Tegra
/home/sunxuehu/sunxuehu/code/code/flashtool/Linux_for_Tegra
Finish creating flash environment 0.
****************************************************
*                                                  *
*  Step 2: Boot the device with flash initrd image *
*                                                  *
****************************************************
/home/sunxuehu/sunxuehu/code/code/flashtool/Linux_for_Tegra/temp_initrdflash/bootloader0 /home/sunxuehu/sunxuehu/code/code/flashtool/Linux_for_Tegra
./tegraflash.py --bl nvtboot_recovery_cpu_t194_sigheader.bin.encrypt --bct br_bct_BR.bct --securedev  --applet rcm_2_encrypt.rcm --applet_softfuse rcm_1_encrypt.rcm --cmd "rcmboot"  --cfg secureflash.xml --chip 0x19 --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 --mem_bct_cold_boot mem_coldboot_sigheader.bct.encrypt  --bins "mb2_bootloader nvtboot_recovery_t194_sigheader.bin.encrypt; mts_preboot preboot_c10_prod_cr_sigheader.bin.encrypt; mts_mce mce_c10_prod_cr_sigheader.bin.encrypt; mts_proper mts_c10_prod_cr_sigheader.bin.encrypt; bpmp_fw bpmp_t194_sigheader.bin.encrypt; bpmp_fw_dtb tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt; spe_fw spe_t194_sigheader.bin.encrypt; tlk tos-trusty_t194_sigheader.img.encrypt; eks eks_sigheader.img.encrypt; kernel boot0.img; kernel_dtb kernel_tegra194-p3668-all-p3509-0000.dtb; bootloader_dtb tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt"    --instance 3-13 --skipuid
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.0000 ] rcm boot with presigned binaries
[   0.0000 ] Boot Rom communication
[   0.0022 ] tegrarcm_v2 --instance 3-13 --chip 0x19 0 --rcm rcm_1_encrypt.rcm --rcm rcm_2_encrypt.rcm --skipuid
[   0.0033 ] Boot Rom communication completed
[   1.0373 ] 
[   2.0420 ] tegrarcm_v2 --instance 3-13 --isapplet
[   2.0438 ] Applet version 01.00.0000
[   2.0744 ] 
[   2.0744 ] Sending BCTs
[   2.0766 ] tegrarcm_v2 --instance 3-13 --download bct_bootrom br_bct_BR.bct --download bct_mb1 mb1_bct_MB1_sigheader.bct.encrypt --download bct_mem mem_rcm_sigheader.bct.encrypt
[   2.0773 ] Applet version 01.00.0000
[   2.0942 ] Sending bct_bootrom
[   2.0942 ] [................................................] 100%
[   2.0957 ] Sending bct_mb1
[   2.1008 ] [................................................] 100%
[   2.1057 ] Sending bct_mem
[   2.1571 ] [................................................] 100%
[   2.2345 ] 
[   2.2345 ] Generating blob
[   2.2375 ] tegrahost_v2 --chip 0x19 --generateblob blob.xml blob.bin
[   2.2381 ] number of images in blob are 13
[   2.2383 ] blobsize is 76707016
[   2.2383 ] Added binary blob_nvtboot_recovery_cpu_t194_sigheader.bin.encrypt of size 264064
[   2.2598 ] Added binary blob_nvtboot_recovery_t194_sigheader.bin.encrypt of size 181152
[   2.2600 ] Added binary blob_preboot_c10_prod_cr_sigheader.bin.encrypt of size 24016
[   2.2603 ] Added binary blob_mce_c10_prod_cr_sigheader.bin.encrypt of size 143200
[   2.2608 ] Added binary blob_mts_c10_prod_cr_sigheader.bin.encrypt of size 3430416
[   2.2627 ] Added binary blob_bpmp_t194_sigheader.bin.encrypt of size 856352
[   2.2636 ] Added binary blob_tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt of size 391408
[   2.2640 ] Added binary blob_spe_t194_sigheader.bin.encrypt of size 94960
[   2.2641 ] Added binary blob_tos-trusty_t194_sigheader.img.encrypt of size 410560
[   2.2643 ] Added binary blob_eks_sigheader.img.encrypt of size 5136
[   2.2644 ] Added binary blob_boot0.img of size 70492160
[   2.3031 ] Added binary blob_kernel_tegra194-p3668-all-p3509-0000.dtb of size 204640
[   2.3180 ] Added binary blob_tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt of size 208736
[   2.3544 ] 
[   2.3545 ] Sending bootloader and pre-requisite binaries
[   2.3568 ] tegrarcm_v2 --instance 3-13 --download blob blob.bin
[   2.3575 ] Applet version 01.00.0000
[   2.3758 ] Sending blob
[   2.3758 ] [................................................] 100%
[  15.4506 ] 
[  15.4538 ] tegrarcm_v2 --instance 3-13 --boot rcm
[  15.4554 ] Applet version 01.00.0000
[  15.4804 ] 
[  15.4804 ] RCM-boot started

/home/sunxuehu/sunxuehu/code/code/flashtool/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 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
Cleaning up...

Initrd flash tool requires that you are able to create a ssh connection from the host to the target through the target.
The log shows that it ended here:

Waiting for device to expose ssh ...Run command: flash on fc00:1:1:0::2
Cleaning up...

That means the ssh timeout even though it can ping the device. Can you try to run this command after the flash command ended at Cleaning up :

ssh -v root@fc00:1:1:0::2

Otherwise, Initrd flash also support flashing through the ethernet cable, though you will need to know the ip address of the device:

sudo  ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_external.xml --erase-all --help --network eth0:<target-ip>/<subnet>:<host-ip>  --showlogs jetson-xavier nvme0n1p1

For examples:

sudo  ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_external.xml --erase-all --help --network eth0:192.168.0.3/24:192.168.0.2  --showlogs jetson-xavier nvme0n1p1

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