How to reduce flash time of l4t_initrd_flash.sh when flashing single partition?

Previously, I used

sudo ./flash.sh -r -k spe-fw jetson-agx-xavier-devkit mmcblk0p1

to update the spe-fw partition. This flashing process consumes ~ 1 minutes.

Now, I want to extend storage, so flash the kernel to external storage device. Then I use the following command to update spe-fw partition:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1 -c ./tools/kernel_flash/flash_l4t_nvme.xml -S 460GiB --showlogs -k spe-fw jetson-agx-xavier-devkit nvme0n1p1

However, this flashing process consumes ~ 12 minutes.
My question is how to reduce flash time of l4t_initrd_flash.sh when flashing single partition?

Hi Xu_Xu,

Are you using the devkit or custom board for AGX Xavier?
What’s the Jetpack version in use?

Do you want to extend the rootfs storage or flash spe-fw?

Hi,
I’m using the agx xavier devkit (r35.3.1). I need run some AI or robotic software (ROS2, docker, etc.). Because the internal emmc storage is low, I flash the Jetpach to a nvme (500G) by:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1 -c ./tools/kernel_flash/flash_l4t_nvme.xml -S 460GiB --showlogs --erase-all jetson-agx-xavier-devkit nvme0n1p1

Then, I have to use the SPE to accomplish some works. So I must usually modify the SPE codes and update the SPE-FW partition by:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1 -c ./tools/kernel_flash/flash_l4t_nvme.xml -S 460GiB --showlogs -k spe-fw jetson-agx-xavier-devkit nvme0n1p1

But this flashing process consumes too much time compared with

sudo ./flash.sh -r -k spe-fw jetson-agx-xavier-devkit mmcblk0p1

Therefore, I want to known how to reduce flash time of l4t_initrd_flash.sh when only flashing single partition?
Can I continue use the faster command sudo ./flash.sh -r -k spe-fw jetson-agx-xavier-devkit mmcblk0p1 to update the SPE-FW partition in this situation?

After you use the first command to flash the whole NVMe, could you try using the following command to flash spe-fw only?

sudo ./flash.sh -r -k spe-fw -c bootloader/t186ref/cfg/flash_t194_sdmmc.xml --no-systemimg jetson-agx-xavier-devkit nvme0n1p1

Thanks.

I run the command you support, get the following error:

[ 6.4713 ] Applet version 01.00.0000
[ 6.5426 ] Sending blob
[ 6.5428 ] […] 100%
[ 7.4604 ] tegrarcm_v2 --boot recovery
[ 7.4630 ] Applet version 01.00.0000
[ 8.5457 ] tegrarcm_v2 --isapplet
[ 9.4975 ] tegrarcm_v2 --ismb2
[ 9.5880 ] tegradevflash_v2 --iscpubl
[ 9.5901 ] Bootloader version 01.00.0000
[ 9.6218 ] Bootloader version 01.00.0000
[ 9.6231 ] Writing partition
[ 9.6270 ] tegradevflash_v2 --write spe-fw 1_spe_t194_sigheader.bin.encrypt
[ 9.6296 ] Bootloader version 01.00.0000
[ 9.6741 ] Writing partition spe-fw with 1_spe_t194_sigheader.bin.encrypt [ 126720 bytes ]
[ 9.6751 ] 000000000d0d090d: E> NV3P_SERVER: Failed to open partition spe-fw.
[ 9.6775 ]
[ 9.6775 ]
Error: Return value 13
Command tegradevflash_v2 --write spe-fw 1_spe_t194_sigheader.bin.encrypt
Failed to flash/read t186ref.

Could you share the full flash log when you are using the first command to flash the whole board?

Thanks.
It has been a long time since the full flash, but I found the relevant log file in the folder /Linux_for_Tegra/initrdlog (I am not 100% sure).
flash_2-1_0_20230426-222133.log (71.4 KB)

Could you try the following to update spe-fw instead?

$ sudo ./flash.sh -r -k spe-fw -c bootloader/t186ref/cfg/flash_t194_sdmmc.xml --no-systemimg jetson-agx-xavier-devkit mmcblk0p1

Thanks.
By the second command you support, I also get errors:

[   6.5632 ] [................................................] 100%
[   7.4824 ] tegrarcm_v2 --boot recovery
[   7.4860 ] Applet version 01.00.0000
[   8.5732 ] tegrarcm_v2 --isapplet
[   9.5218 ] tegrarcm_v2 --ismb2
[   9.6084 ] tegradevflash_v2 --iscpubl
[   9.6106 ] Bootloader version 01.00.0000
[   9.6418 ] Bootloader version 01.00.0000
[   9.6433 ] Writing partition
[   9.6476 ] tegradevflash_v2 --write spe-fw 1_spe_t194_sigheader.bin.encrypt
[   9.6495 ] Bootloader version 01.00.0000
[   9.6944 ] Writing partition spe-fw with 1_spe_t194_sigheader.bin.encrypt [ 126720 bytes ]
[   9.6955 ] 000000000d0d090d: E> NV3P_SERVER: Failed to open partition spe-fw.
[   9.6974 ] 
[   9.6975 ] 
Error: Return value 13
Command tegradevflash_v2 --write spe-fw 1_spe_t194_sigheader.bin.encrypt
Failed to flash/read t186ref.

We will update the code to reduce the flash individual partition in the next release.

For now, there’s a workaround for you use case.

Step 1. Create a second BSP folder to generate the new spe fw for initrd

Step 2. Manually replace the spe fw for initrd in original BSP folder. 
$ cp Linux_for_Tegra_2nd/tools/kernel_flash/images/internal/spe_t194_sigheader.bin.encrypt Linux_for_Tegra/tools/kernel_flash/images/internal/spe_t194_sigheader.bin.encrypt

Step 3. Use the following command to flash only the spe partiton, which would use existing environment 
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1 -c ./tools/kernel_flash/flash_l4t_nvme.xml --flash-only -k spe-fw jetson-agx-xavier-devkit nvme0n1p1

Thanks.

I think this update will be very useful. Because this will greatly improve the development efficiency of SPE-FW in this scenario.

Sorry, I have some confusion. How to generate the new spe-fw for initrd in the second BSP folder? By the following command you mentioned?

or

tools/kernel_flash/images/internal/spe_t194_sigheader.bin.encrypt will be generated when you use initrd command to flash the whole board as your previous comamnd as following.

Sorry, I still have some misunderstandings about the flashing plan you provided.
Based on my understanding, this command should be executed in the original BSP folder.

But, this also means that it will exist in that original folder (I have discovered its existence in that folder). Why do you still need to copy in Step2?

In addition, what folder should the modified spe-fw be placed in?

The main purpose for the 2nd BSP package is to get the spe_t194_sigheader.bin.encrypt.

You should put your updated spe_t194.bin to 2nd BSP package and use the full flash command to flash your board. The spe_t194_sigheader.bin.encrypt will be generated during the flash so that you could copy this file to the original BSP package.
At last, you could use initrd command to update only spe-fw with the command in Step3.

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