Writing partition APP with system.img *** Error: Flashing the device failed. ] 031%

Hi,

I am trying to do mass flashing, here are the steps I followed:

  • Install all the necessary softwares on first xavier nx production module

  • Went to Jetson Xavier NX flashing directory

    cd ~/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra
    
  • Connected first xavier nx device with all necessary software installed, and put it into RCM mode.

    sudo ./nvmassflashgen.sh jetson-xavier-nx-devkit-emmc mmcblk0p1
    
  • Untar the generated file

    tar xvjf mfi_jetson-xavier-nx-devkit-emmc.tbz2
    
  • Went to extracted file directory

    cd mfi_jetson-xavier-nx-devkit-emmc
    
  • Disconnected first xavier nx production module

  • Connected second xavier nx production module and put it into RCM mode

    sudo ./nvmflash.sh --showlogs
    

Here is the log output:


*** Boot Rom communication
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegrarcm_v2 --instance 1-9.1 --chip 0x19 0 --rcm rcm_list_signed.xml 
BR_CID: 0x88021911646cf5c924000000130501c0
RCM version 0X190001
Boot Rom communication completed
*** Boot Rom communication succeeded.

*** Checking applet
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegrarcm_v2 --instance 1-9.1 --isapplet
Applet version 01.00.0000
*** Checking applet succeeded.

*** Sending BCTs
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegrarcm_v2 --instance 1-9.1 --download bct_bootrom br_bct_BR.bct --download bct_mb1 mb1_bct_MB1_sigheader.bct.encrypt --download bct_mem mem_rcm_sigheader.bct.encrypt
Applet version 01.00.0000
Sending bct_bootrom
[................................................] 100%
Sending bct_mb1
[................................................] 100%
Sending bct_mem
[................................................] 100%
*** Sending BCTs succeeded.

*** Sending bootloader and pre-requisite binaries
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegrarcm_v2 --instance 1-9.1 --download blob blob.bin
Applet version 01.00.0000
Sending blob
[................................................] 100%
*** Sending bootloader and pre-requisite binaries succeeded.

*** Booting Recovery
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegrarcm_v2 --instance 1-9.1 --boot recovery
Applet version 01.00.0000
*** Booting Recovery succeeded.

*** Checking applet
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegrarcm_v2 --instance 1-9.1 --isapplet

*** Checking CPU bootloader
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegradevflash_v2 --instance 1-9.1 --iscpubl
Bootloader version 01.00.0000
Bootloader version 01.00.0000
*** Checking CPU bootloader succeeded.
ls: cannot access 'mbr_*': No such file or directory
ls: cannot access 'gpt_*': No such file or directory

*** Retrieving storage infomation
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegradevflash_v2 --instance 1-9.1 --oem platformdetails storage storage_info.bin
Bootloader version 01.00.0000
Saved platform info in storage_info.bin
*** Retrieving storage infomation succeeded.

*** Generating GPT
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegraparser_v2 --storageinfo storage_info.bin --generategpt --pt flash.xml.bin
*** Generating GPT succeeded.

*** Flashing the device
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegradevflash_v2 --instance 1-9.1 --pt flash.xml.bin --create
Bootloader version 01.00.0000
Erasing spi: 0 ......... [Done]
Writing partition secondary_gpt with gpt_secondary_3_0.bin
[................................................] 100%

Erasing sdmmc_user: 3 ......... [Done]
Writing partition master_boot_record with mbr_1_3.bin
[................................................] 100%
Writing partition primary_gpt with gpt_primary_1_3.bin
[................................................] 100%
Writing partition secondary_gpt with gpt_secondary_1_3.bin
[................................................] 100%

Writing partition mb1 with mb1_t194_prod_sigheader.bin.encrypt
[................................................] 100%
Writing partition mb1_b with mb1_t194_prod_sigheader.bin.encrypt
[................................................] 100%
Writing partition spe-fw with spe_t194_sigheader.bin.encrypt
[................................................] 100%
Writing partition spe-fw_b with spe_t194_sigheader.bin.encrypt
[................................................] 100%
Writing partition mb2 with nvtboot_t194_sigheader.bin.encrypt
[................................................] 100%
Writing partition mb2_b with nvtboot_t194_sigheader.bin.encrypt
[................................................] 100%
Writing partition mts-preboot with preboot_c10_prod_cr_sigheader.bin.encrypt
[................................................] 100%
Writing partition mts-preboot_b with preboot_c10_prod_cr_sigheader.bin.encrypt
[................................................] 100%
Writing partition mts-mce with mce_c10_prod_cr_sigheader.bin.encrypt
[................................................] 100%
Writing partition mts-mce_b with mce_c10_prod_cr_sigheader.bin.encrypt
[................................................] 100%
Writing partition mts-proper with mts_c10_prod_cr_sigheader.bin.encrypt
[................................................] 100%
Writing partition mts-proper_b with mts_c10_prod_cr_sigheader.bin.encrypt
[................................................] 100%
Writing partition sc7 with warmboot_t194_prod_sigheader.bin.encrypt
[................................................] 100%
Writing partition sc7_b with warmboot_t194_prod_sigheader.bin.encrypt
[................................................] 100%
Writing partition SMD with slot_metadata.bin
[................................................] 100%
Writing partition SMD_b with slot_metadata.bin
[................................................] 100%
Writing partition xusb-fw with xusb_sil_rel_fw
[................................................] 100%
Writing partition xusb-fw_b with xusb_sil_rel_fw
[................................................] 100%
Writing partition cpu-bootloader with cboot_t194_sigheader.bin.encrypt
[................................................] 100%
Writing partition cpu-bootloader_b with cboot_t194_sigheader.bin.encrypt
[................................................] 100%
Writing partition bootloader-dtb with tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt
[................................................] 100%
Writing partition bootloader-dtb_b with tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt
[................................................] 100%
Writing partition BMP with bmp.blob
[................................................] 100%
Writing partition BMP_b with bmp.blob
[................................................] 100%
Writing partition secure-os with tos-trusty_t194_sigheader.img.encrypt
[................................................] 100%
Writing partition secure-os_b with tos-trusty_t194_sigheader.img.encrypt
[................................................] 100%
Writing partition eks with eks_sigheader.img.encrypt
[................................................] 100%
Writing partition eks_b with eks_sigheader.img.encrypt
[................................................] 100%
Writing partition adsp-fw with adsp-fw_sigheader.bin.encrypt
[................................................] 100%
Writing partition adsp-fw_b with adsp-fw_sigheader.bin.encrypt
[................................................] 100%
Writing partition rce-fw with camera-rtcpu-rce_sigheader.img.encrypt
[................................................] 100%
Writing partition rce-fw_b with camera-rtcpu-rce_sigheader.img.encrypt
[................................................] 100%
Writing partition bpmp-fw with bpmp_t194_sigheader.bin.encrypt
[................................................] 100%
Writing partition bpmp-fw_b with bpmp_t194_sigheader.bin.encrypt
[................................................] 100%
Writing partition bpmp-fw-dtb with tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt
[................................................] 100%
Writing partition bpmp-fw-dtb_b with tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt
[................................................] 100%
Writing partition VER with qspi_bootblob_ver.txt
[................................................] 100%
Writing partition VER_b with qspi_bootblob_ver.txt
[................................................] 100%
Writing partition master_boot_record with mbr_1_3.bin
[................................................] 100%
Writing partition APP with system.img
*** Error: Flashing the device failed.           ] 031%

Please give some pointers on what could be wrong.

Thanks

hello NitinRai,

are you having customization to replace the default system.img?
it yes, the size might be differ, you may probably need to use the “-S size” option to specify the partition size.
please check Flash Script Usage and doing so with flash.sh to have verification.
thanks

@JerryChang
I am creating a massflash blob from one of our Xavier NX production module which has custom softwares installed.

are you having customization to replace the default system.img

I found the system.img at two places:

  1. ~/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/bootloader/system.img
  2. ~/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/system.img

Please confirm which one you are referring to.
As per the README_Massflash.txt the system.img created inside mfi_jetson-xavier-nx-devkit-emmc dir should just work without replacing any files manually.

it yes, the size might be differ, you may probably need to use the “ -S size ” option to specify the partition size.

At which step do I need to use this -S size option and what should be the value of size?

hello NitinRai,

/bootloader/system.img: this is the default system image generated by flash commands,
/mfi_jetson-xavier-nx-devkit-emmc/system.img : this is generated by nvmassflashgen.sh script.

could you please have an offline approach to execute nvmassflashgen?
for example,
BOARDID=3668 BOARDSKU=0000 FAB=100 FUSELEVEL=fuselevel_production ./nvmassflashgen.sh jetson-xavier-nx-devkit mmcblk0p1

BTW, suggest you should also check Massflash and JetPack 4.4 issue - #8 by DaneLLL as see-also.
thanks

I need to have custom softwares installed on all the devices which will be flashed, If i follow offline method how do i make sure it has those customizations done ?

hello NitinRai,

please check Topic 173555 for the steps to modify the files in system.img, then flash to board again. thanks

Thanks for the reference links, I have seen those topics before creating a new one. I have a system.img file with me I don’t want to modify it.

Where do I use this flag -S size neither nvmassflashgen.sh accepts this nor nvmflash.sh

My query is:

  • I flashed a jetson nx then installed some libraries and softwares
  • I created a mass flash blob image using online method (because I wan’t to flash more device which contains same softwares as the first one)
  • I suppose the blob I created contains all the changes I made in the first nx
  • Once I have this customized blob, I want to flash more Jetson NX devices having same customization that I did in the first one

All the topics I visited has discussion about flash.sh script which only allow to flash one device at once.
I hope you understand what I am trying to do

hello NitinRai,

this is not correct.

it’ll generate a new system.img from your local host machine when you execute nvmassflashgen.sh.
however,
you may include -r switch to skip building and reuse existing system.img.
for example, $ sudo ./nvmassflashgen.sh -r jetson-xavier-nx mmcblk0p1
you should have a cloned image to replace with the default image, then deployment it to other platforms.

BTW,
mostly flash options works for the nvmassflashgen.sh, (since I only check several options.)
you may use the flag -S size into command line for generating mass-flash image tarball, thanks

Hey @JerryChang Thanks for the valuable information. I am able to massflash with custom system.img

I followed all the steps as mentioned in the previous replies to generate mfi_jetson-xavier-nx-devkit-emmc directory and then create a clone of the device using command :

sudo ./flash.sh -r -k APP -G backup.img jetson-xavier-nx-devkit-emmc mmcblk0p1

After which I replaced the system.img with the backup.img in the ``mfi_jetson-xavier-nx-devkit-emmc` directory using command:

cp backup.img mfi_jetson-xavier-nx-devkit-emmc/system.img

and finally connected two Xavier NX put them into RCM and ran sudo ./nvmflash.sh --showlogs It worked out without any errors and flashe both of the two devices in parallel.

1 Like

@NitinRai
Thank you for sharing your success!
You may also like to use Jetpack 4.5.1 instead of Jetpack 4.4.1

@JerryChang non production nx devkit version is not supported by nvmassflash script? is it?
The readme only lists these

                                 BOARDID  BOARDSKU  FAB  BOARDREV
     --------------------------------+--------+---------+----+---------
     jetson-xavier-nx-devkit-emmc     3668     0001      100  N/A
     jetson-nano-devkit-emmc          3448     0002      200  N/A
     jetson-agx-xavier-devkit (16GB)  2888     0001      400  H.0
     jetson-agx-xavier-devkit (32GB)  2888     0004      400  K.0
     jetson-agx-xavier-devkit-8gb     2888     0006      400  B.0
     jetson-tx2-devkit                3310     1000      B02  N/A
     jetson-tx2-devkit-tx2i           3489     0000      300  A.0
     jetson-tx2-devkit-4gb            3489     0888      300  F.0
     jetson-tx1-devkit                2180     0000      400  N/A

hello Andrey1984,

yes, massflash only support with eMMC modules.
however,
there’s tool to support that if you’re working Jetson Xavier NX with external storage, (i.e. NVMe)

please check below for more details.
$OUT/JetPack-4.5.1/Linux_for_Tegra/tools/kernel_flash/README.txt