How do I backup and clone Orin

Hi,all

I’m using jetson Orin 32GB with JetPack 5.0.2 , R35.1

I want to copy this Orin onto a new Orin

I refer to the following sources:/Linux_for_Tegra/tools/backup_restore/README_backup_restore.txt

but,

chenweiqian@chenweiqian-virtual-machine:~/udi_nvidia/nvidia/r35.1/Linux_for_Tegra$ lsusb
Bus 001 Device 024: ID 0955:7223 NVIDIA Corp. APX
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 004: ID 0e0f:0008 VMware, Inc. VMware Virtual USB Mouse
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
chenweiqian@chenweiqian-virtual-machine:~/udi_nvidia/nvidia/r35.1/Linux_for_Tegra$ sudo ./tools/backup_restore/l4t_backup_restore.sh -b jetson-agx-orin-devkit
[sudo] password for chenweiqian: 
/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/tools/kernel_flash/l4t_initrd_flash_internal.sh --no-flash --initrd --showlogs jetson-agx-orin-devkit mmcblk0p1
Please install the Secureboot package to use initrd flash for fused board
******************************************
*                                        *
*  Step 1: Generate rcm boot commandline *
*                                        *
******************************************
/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/flash.sh  --no-flash --rcm-boot jetson-agx-orin-devkit mmcblk0p1
###############################################################################
# L4T BSP Information:
# R35 , REVISION: 1.0
###############################################################################
copying emc_fuse_dev_params(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-br-bct-diag-boot.dts)... done.
copying device_config(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-device-p3701-0000.dts)... done.
copying misc_config(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-misc-p3701-0000.dts)... done.
./tegraflash.py --chip 0x23 --applet "/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/mb1_t234_prod.bin" --skipuid --cfg readinfo_t234_min_prod.xml --dev_params tegra234-br-bct-diag-boot.dts --device_config tegra234-mb1-bct-device-p3701-0000.dts --misc_config tegra234-mb1-bct-misc-p3701-0000.dts --bins "mb2_applet applet_t234.bin" --cmd "dump eeprom cvm cvm.bin; dump custinfo custinfo_out.bin; reboot recovery" 
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands
 
[   0.0835 ] tegrarcm_v2 --chip 0x23 0 --ismb2applet
[   0.0846 ] File rcm_state open failed
[   0.0846 ] ERROR: failed to read rcm_state
[   0.0846 ] 
[   0.0854 ] tegrasign_v3.py --key None --getmode mode.txt
[   0.0856 ] Assuming zero filled SBK key
[   0.0851 ] Pre-processing config: tegra234-mb1-bct-device-p3701-0000.dts
[   0.0930 ] Pre-processing config: tegra234-mb1-bct-misc-p3701-0000.dts
[   0.1026 ] Parsing partition layout
[   0.1037 ] tegraparser_v2 --pt readinfo_t234_min_prod.xml.tmp
[   0.1054 ] Parsing partition layout
[   0.1064 ] tegraparser_v2 --pt readinfo_t234_min_prod.xml.tmp
[   0.1079 ] Creating list of images to be signed
[   0.1090 ] tegrahost_v2 --chip 0x23 0 --partitionlayout readinfo_t234_min_prod.xml.bin --list images_list.xml zerosbk
[   0.1101 ] MB1: Nvheader already present is mb1_t234_prod_aligned.bin
[   0.1115 ] Header already present for mb1_t234_prod_aligned_sigheader.bin
[   0.1121 ] MB1: Nvheader already present is mb1_t234_prod_aligned.bin
[   0.1171 ] Header already present for mb1_t234_prod_aligned_sigheader.bin
[   0.1176 ] MB1: Nvheader already present is psc_bl1_t234_prod_aligned.bin
[   0.1215 ] Header already present for psc_bl1_t234_prod_aligned_sigheader.bin
[   0.1220 ] adding BCH for mb2_t234_aligned.bin
[   0.1243 ] MB1: Nvheader already present is psc_bl1_t234_prod_aligned.bin
[   0.1341 ] Header already present for psc_bl1_t234_prod_aligned_sigheader.bin
[   0.1344 ] adding BCH for mb2_t234_aligned.bin
[   0.1471 ] Generating signatures
[   0.1479 ] tegrasign_v3.py --key None --list images_list.xml --pubkeyhash pub_key.key --sha sha512
[   0.1481 ] Assuming zero filled SBK key
[   0.1690 ] Warning: pub_key.key is not found
[   0.1686 ] Parsing dev params for multi chains
[   0.1753 ] Generating br-bct
[   0.1763 ] Updating dev and MSS params in BR BCT
[   0.1764 ] tegrabct_v2 --dev_param tegra234-br-bct-diag-boot_cpp.dtb --brbct br_bct.cfg --chip 0x23 0
[   0.1775 ] Updating bl info
[   0.1785 ] tegrabct_v2 --brbct br_bct_BR.bct --chip 0x23 0 --updateblinfo readinfo_t234_min_prod.xml.bin --updatesig images_list_signed.xml
[   0.1792 ] WARNING: boot chain is not completed. set to 0
[   0.1802 ] Get Signed section of bct
[   0.1811 ] tegrabct_v2 --brbct br_bct_BR.bct --chip 0x23 0 --listbct bct_list.xml
[   0.1820 ] Signing BCT
[   0.1828 ] tegrasign_v3.py --key None --list bct_list.xml --pubkeyhash pub_key.key --sha sha512
[   0.1829 ] Assuming zero filled SBK key
[   0.1853 ] Sha saved in br_bct_BR.sha
[   0.1856 ] Warning: pub_key.key is not found
[   0.1849 ] Updating BCT with signature
[   0.1856 ] tegrabct_v2 --brbct br_bct_BR.bct --chip 0x23 0 --updatesig bct_list_signed.xml
[   0.1863 ] Offset :4608 Len :3584
[   0.1869 ] Generating SHA2 Hash
[   0.1877 ] tegrasign_v3.py --key None --list bct_list.xml --sha sha512
[   0.1878 ] Assuming zero filled SBK key
[   0.1879 ] Assuming zero filled SBK key
[   0.1903 ] Sha saved in br_bct_BR.sha
[   0.1898 ] Updating BCT with SHA2 Hash
[   0.1906 ] tegrabct_v2 --brbct br_bct_BR.bct --chip 0x23 0 --updatesha bct_list_signed.xml
[   0.1913 ] Offset :4608 Len :3584
[   0.1915 ] Offset :68 Len :8124
[   0.1918 ] Generating coldboot mb1-bct
[   0.1926 ] tegrabct_v2 --chip 0x23 0 --mb1bct mb1_cold_boot_bct.cfg --misc tegra234-mb1-bct-misc-p3701-0000_cpp.dtb --device tegra234-mb1-bct-device-p3701-0000_cpp.dtb
[   0.1933 ] MB1-BCT version: 0.9

[   0.1943 ] Parsing config file :tegra234-mb1-bct-device-p3701-0000_cpp.dtb 
[   0.1944 ] Added Platform Config 9 data with size :- 80
[   0.1944 ] 
[   0.1944 ] Updating mb1-bct with firmware information
[   0.1952 ] tegrabct_v2 --chip 0x23 0 --mb1bct mb1_cold_boot_bct_MB1.bct --updatefwinfo readinfo_t234_min_prod.xml.bin
[   0.1973 ] tegrahost_v2 --chip 0x23 0 --align mb1_cold_boot_bct_MB1_aligned.bct
[   0.1988 ] tegrahost_v2 --chip 0x23 0 --magicid MBCT --appendsigheader mb1_cold_boot_bct_MB1_aligned.bct zerosbk
[   0.1996 ] adding BCH for mb1_cold_boot_bct_MB1_aligned.bct
[   0.2009 ] tegrasign_v3.py --key None --list mb1_cold_boot_bct_MB1_aligned_sigheader.bct_list.xml --pubkeyhash pub_key.key --sha sha512
[   0.2010 ] Assuming zero filled SBK key
[   0.2029 ] Warning: pub_key.key is not found
[   0.2036 ] tegrahost_v2 --chip 0x23 0 --updatesigheader mb1_cold_boot_bct_MB1_aligned_sigheader.bct.encrypt mb1_cold_boot_bct_MB1_aligned_sigheader.bct.hash zerosbk
[   0.2051 ] Generating recovery mb1-bct
[   0.2058 ] tegrabct_v2 --chip 0x23 0 --mb1bct mb1_bct.cfg --misc tegra234-mb1-bct-misc-p3701-0000_cpp.dtb --device tegra234-mb1-bct-device-p3701-0000_cpp.dtb
[   0.2067 ] MB1-BCT version: 0.9

[   0.2076 ] Parsing config file :tegra234-mb1-bct-device-p3701-0000_cpp.dtb 
[   0.2080 ] Added Platform Config 9 data with size :- 80
[   0.2080 ] 
[   0.2080 ] Updating mb1-bct with firmware information
[   0.2091 ] tegrabct_v2 --chip 0x23 0 --mb1bct mb1_bct_MB1.bct --recov --updatefwinfo readinfo_t234_min_prod.xml.bin
[   0.2118 ] tegrahost_v2 --chip 0x23 0 --align mb1_bct_MB1_aligned.bct
[   0.2133 ] tegrahost_v2 --chip 0x23 0 --magicid MBCT --appendsigheader mb1_bct_MB1_aligned.bct zerosbk
[   0.2199 ] adding BCH for mb1_bct_MB1_aligned.bct
[   0.2212 ] tegrasign_v3.py --key None --list mb1_bct_MB1_aligned_sigheader.bct_list.xml --pubkeyhash pub_key.key --sha sha512
[   0.2214 ] Assuming zero filled SBK key
[   0.2228 ] Warning: pub_key.key is not found
[   0.2230 ] tegrahost_v2 --chip 0x23 0 --updatesigheader mb1_bct_MB1_aligned_sigheader.bct.encrypt mb1_bct_MB1_aligned_sigheader.bct.hash zerosbk
[   0.2242 ] Error: Skip generating mem_bct because sdram_config is not defined
[   0.2242 ] Error: Skip generating mem_bct because sdram_config is not defined
[   0.2242 ] Copying signatures
[   0.2250 ] tegrahost_v2 --chip 0x23 0 --partitionlayout readinfo_t234_min_prod.xml.bin --updatesig images_list_signed.xml
[   0.2297 ] mb1_t234_prod_aligned_sigheader.bin.encrypt filename is from images_list
[   0.2299 ] psc_bl1_t234_prod_aligned_sigheader.bin.encrypt filename is from images_list
[   0.2299 ] Boot Rom communication
[   0.2307 ] tegrarcm_v2 --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.2318 ] BR_CID: 0x80012344705DD34C3400000003000240
[   0.2349 ] Sending bct_br
[   0.2350 ] Sending mb1
[   0.2371 ] Sending psc_bl1
[   0.2660 ] Sending bct_mb1
[   0.2828 ] Boot Rom communication completed
[   0.2841 ] tegrahost_v2 --chip 0x23 0 --align applet_t234_aligned.bin
[   0.2856 ] tegrahost_v2 --chip 0x23 0 --magicid MB2A --appendsigheader applet_t234_aligned.bin zerosbk
[   0.2864 ] adding BCH for applet_t234_aligned.bin
[   0.2940 ] tegrasign_v3.py --key None --list applet_t234_aligned_sigheader.bin_list.xml --pubkeyhash pub_key.key --sha sha512
[   0.2941 ] Assuming zero filled SBK key
[   0.2960 ] Warning: pub_key.key is not found
[   0.2965 ] tegrahost_v2 --chip 0x23 0 --updatesigheader applet_t234_aligned_sigheader.bin.encrypt applet_t234_aligned_sigheader.bin.hash zerosbk
[   0.2988 ] Sending mb2_applet...

[   0.2996 ] tegrarcm_v2 --chip 0x23 0 --pollbl --download applet applet_t234_sigheader.bin.encrypt
[   0.3105 ] BL: version 0.23.0.0-t234-54845784-92215740 last_boot_error: 0
[   0.4729 ] Sending applet
[   0.6172 ] completed
[   0.6222 ] tegrarcm_v2 --chip 0x23 0 --ismb2applet
[   0.6264 ] MB2 Applet version 01.00.0000
[   0.8728 ] tegrarcm_v2 --chip 0x23 0 --ismb2applet
[   0.8768 ] MB2 Applet version 01.00.0000
[   0.9435 ] Retrieving board information
[   0.9452 ] tegrarcm_v2 --chip 0x23 0 --oem platformdetails chip chip_info.bin
[   0.9471 ] MB2 Applet version 01.00.0000
[   1.0065 ] Saved platform info in chip_info.bin
[   1.0413 ] Chip minor revision: 1
[   1.0414 ] Bootrom revision: 0x7
[   1.0415 ] Ram code: 0x0
[   1.0416 ] Chip sku: 0xd2
[   1.0417 ] Chip Sample: prod
[   1.1078 ] Retrieving EEPROM data
[   1.1079 ] tegrarcm_v2 --oem platformdetails eeprom cvm /home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/cvm.bin --chip 0x23 0
[   1.1088 ] MB2 Applet version 01.00.0000
[   1.1624 ] Saved platform info in /home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/cvm.bin
[   1.2627 ] tegrarcm_v2 --chip 0x23 0 --ismb2applet
[   1.2665 ] MB2 Applet version 01.00.0000
[   1.3283 ] tegrarcm_v2 --chip 0x23 0 --ismb2applet
[   1.3290 ] MB2 Applet version 01.00.0000
[   1.4651 ] Dumping customer Info
[   1.4702 ] tegrarcm_v2 --chip 0x23 0 --oem dump bct tmp.bct
[   1.4742 ] MB2 Applet version 01.00.0000
[   1.5375 ] Saved bct in tmp.bct
[   1.6035 ] tegrabct_v2 --brbct tmp.bct --chip 0x23 0 --custinfo /home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/custinfo_out.bin
[   1.6044 ] C[   1.6048 ] ustomer data saved in /home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/custinfo_out.bin successfully
[   1.6048 ] Rebooting to recovery mode
[   1.6056 ] tegrarcm_v2 --chip 0x23 0 --ismb2
[   1.6648 ] tegrarcm_v2 --chip 0x23 0 --ismb2applet
[   1.6655 ] MB2 Applet version 01.00.0000
[   1.7257 ] Booting to recovery mode
[   1.7267 ] tegrarcm_v2 --chip 0x23 0 --reboot recovery
[   1.7275 ] MB2 Applet version 01.00.0000
Board ID(3701) version(500) sku(0004) revision(F.0)
Copy /home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/kernel/dtb/tegra234-p3701-0004-p3737-0000.dtb to /home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/kernel/dtb/tegra234-p3701-0004-p3737-0000.dtb.rec
copying bctfile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-p3701-0000-p3737-0000-TE990M-sdram.dts)... done.
copying device_config(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-device-p3701-0000.dts)... done.
copying misc_config(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-misc-p3701-0000.dts)... done.
copying pinmux_config(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-pinmux-p3701-0000-a04.dtsi)... done.
copying gpioint_config(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-gpioint-p3701-0000.dts)... done.
copying pmic_config(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-pmic-p3701-0000.dts)... done.
copying pmc_config(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-padvoltage-p3701-0000-a04.dtsi)... done.
copying deviceprod_config(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-cprod-p3701-0000.dts)... done.
copying prod_config(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-prod-p3701-0000.dts)... done.
copying scr_config(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb2-bct-scr-p3701-0000.dts)... done.
copying wb0sdram(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-p3701-0000-p3737-0000-TE990M-wb0sdram.dts)... done.
copying bootrom_config(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-reset-p3701-0000.dts)... done.
copying dev_params(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-br-bct-p3701-0000.dts)... done.
copying dev_params_b(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-br-bct_b-p3701-0000.dts)... done.
copying mb2bct_cfg(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb2-bct-misc-p3701-0000.dts)... done.
Existing pscfwfile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/pscfw_t234_prod.bin) reused.
Existing pscbl1file(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/psc_bl1_t234_prod.bin) reused.
Existing mtsmcefile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/mce_flash_o10_cr_prod.bin) reused.
Existing mb2applet(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/applet_t234.bin) reused.
Existing bootloader(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/mb2_t234.bin) reused.
copying initrd(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/l4t_initrd.img)... done.
Making Boot image... done.
bl is uefi
Not signing of boot.img
Making recovery ramdisk for recovery image...
Re-generating recovery ramdisk for recovery image...
/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/ramdisk_tmp /home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader /home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra
36144 blocks

gzip: /home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/kernel/Image: not in gzip format
_BASE_KERNEL_VERSION=5.10.105-tegra
53066 blocks
Making Recovery image...
copying recdtbfile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/kernel/dtb/tegra234-p3701-0004-p3737-0000.dtb.rec)... done.
20+0 records in
20+0 records out
20 bytes copied, 0.000139992 s, 143 kB/s
/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/flash.sh: line 2617: python: command not found
Existing sosfile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/mb1_t234_prod.bin) reused.
Existing tegraboot(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/mb2_t234.bin) reused.
Existing cpu_bootloader(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/mb2_t234.bin) reused.
Existing mb2blfile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/mb2_t234.bin) reused.
Existing xusbfile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/xusb_t234_prod.bin) reused.
Existing dcefile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/display-t234-dce.bin) reused.
Existing nvdecfile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/nvdec_t234_prod.fw) reused.
Existing psc_rf(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/psc_rf_t234_prod.bin) reused.
Existing mb2_rf(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/mb2rf_t234.bin) reused.
Existing mb1file(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/mb1_t234_prod.bin) reused.
Existing bpffile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/bpmp_t234-TE990M-A1_prod.bin) reused.
copying bpfdtbfile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/tegra234-bpmp-3701-0004-3737-0000.dtb)... done.
Existing scefile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/camera-rtcpu-sce.img) reused.
Existing camerafw(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/camera-rtcpu-t234-rce.img) reused.
Existing apefile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/adsp-fw.bin) reused.
Existing spefile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/spe_t234.bin) reused.
Existing wb0boot(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/sc7_t234_prod.bin) reused.
Existing tosfile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/tos-optee_t234.img) reused.
Existing eksfile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/eks.img) reused.
copying dtbfile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/kernel/dtb/tegra234-p3701-0004-p3737-0000.dtb)... done.
Copying nv_boot_control.conf to rootfs
Not signing of kernel-dtb
Skip generating system.img
Existing tbcfile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/uefi_jetson.bin) reused.
131072+0 records in
131072+0 records out
67108864 bytes (67 MB, 64 MiB) copied, 0.242551 s, 277 MB/s
	Sync'ing esp.img ... done.
copying tbcdtbfile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/kernel/dtb/tegra234-p3701-0000-p3737-0000.dtb)... done.
copying cfgfile(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/t186ref/cfg/flash_t234_qspi_sdmmc.xml) to flash.xml... done.
Existing flashapp(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/tegraflash.py) reused.
Existing overlay_dtb(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/L4TConfiguration.dtbo) reused.
Existing overlay_dtb(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/tegra234-p3737-overlay-pcie.dtbo) reused.
Existing overlay_dtb(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/tegra234-p3737-audio-codec-rt5658-40pin.dtbo) reused.
Existing overlay_dtb(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/tegra234-p3737-a03-overlay.dtbo) reused.
Existing overlay_dtb(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/tegra234-p3737-a04-overlay.dtbo) reused.
Existing overlay_dtb(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/L4TRootfsInfo.dtbo) reused.
Existing overlay_dtb(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/tegra234-p3737-camera-dual-imx274-overlay.dtbo) reused.
Existing overlay_dtb(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/tegra234-p3737-camera-e3331-overlay.dtbo) reused.
Existing overlay_dtb(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/tegra234-p3737-camera-e3333-overlay.dtbo) reused.
Existing overlay_dtb(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/tegra234-p3737-camera-imx185-overlay.dtbo) reused.
Existing overlay_dtb(/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/tegra234-p3737-camera-imx390-overlay.dtbo) reused.
./tegraflash.py  --bl uefi_jetson_with_dtb.bin  --odmdata gbe-uphy-config-22,hsstp-lane-map-3,nvhs-uphy-config-0,hsio-uphy-config-0,gbe0-enable-10g  --overlay_dtb L4TConfiguration.dtbo,tegra234-p3737-overlay-pcie.dtbo,tegra234-p3737-audio-codec-rt5658-40pin.dtbo,tegra234-p3737-a03-overlay.dtbo,tegra234-p3737-a04-overlay.dtbo,L4TRootfsInfo.dtbo,tegra234-p3737-camera-dual-imx274-overlay.dtbo,tegra234-p3737-camera-e3331-overlay.dtbo,tegra234-p3737-camera-e3333-overlay.dtbo,tegra234-p3737-camera-imx185-overlay.dtbo,tegra234-p3737-camera-imx390-overlay.dtbo  --bldtb tegra234-p3701-0000-p3737-0000.dtb --applet mb1_t234_prod.bin --cmd "rcmboot"  --cfg flash.xml --chip 0x23 --concat_cpubl_bldtb --cpubl uefi_jetson.bin --device_config tegra234-mb1-bct-device-p3701-0000.dts --misc_config tegra234-mb1-bct-misc-p3701-0000.dts --pinmux_config tegra234-mb1-bct-pinmux-p3701-0000-a04.dtsi --gpioint_config tegra234-mb1-bct-gpioint-p3701-0000.dts --pmic_config tegra234-mb1-bct-pmic-p3701-0000.dts --pmc_config tegra234-mb1-bct-padvoltage-p3701-0000-a04.dtsi --deviceprod_config tegra234-mb1-bct-cprod-p3701-0000.dts --prod_config tegra234-mb1-bct-prod-p3701-0000.dts --scr_config tegra234-mb2-bct-scr-p3701-0000.dts --wb0sdram_config tegra234-p3701-0000-p3737-0000-TE990M-wb0sdram.dts --br_cmd_config tegra234-mb1-bct-reset-p3701-0000.dts --dev_params tegra234-br-bct-p3701-0000.dts,tegra234-br-bct_b-p3701-0000.dts --mb2bct_cfg tegra234-mb2-bct-misc-p3701-0000.dts  --bins "psc_fw pscfw_t234_prod.bin; mts_mce mce_flash_o10_cr_prod.bin; mb2_applet applet_t234.bin; mb2_bootloader mb2_t234.bin; xusb_fw xusb_t234_prod.bin; dce_fw display-t234-dce.bin; nvdec nvdec_t234_prod.fw; bpmp_fw bpmp_t234-TE990M-A1_prod.bin; bpmp_fw_dtb tegra234-bpmp-3701-0004-3737-0000.dtb; sce_fw camera-rtcpu-sce.img; rce_fw camera-rtcpu-t234-rce.img; ape_fw adsp-fw.bin; spe_fw spe_t234.bin; tos tos-optee_t234.img; eks eks.img; kernel boot.img; kernel_dtb tegra234-p3701-0004-p3737-0000.dtb"  --sdram_config tegra234-p3701-0000-p3737-0000-TE990M-sdram.dts  --cust_info custinfo_out.bin  --secondary_gpt_backup  --bct_backup  --boot_chain A 
saving flash command in /home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/flashcmd.txt
saving Windows flash command to /home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader/flash_win.bat
*** no-flash flag enabled. Exiting now... *** 
Save initrd flashing command parameters to /home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/tools/kernel_flash/initrdflashparam.txt
/tmp/tmp.f7W6OyZROB /home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra
writing boot image config in bootimg.cfg
extracting kernel in zImage
extracting ramdisk in initrd.img
/tmp/tmp.f7W6OyZROB/initrd /tmp/tmp.f7W6OyZROB /home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra
53066 blocks
61583 blocks
/tmp/tmp.f7W6OyZROB /home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra
flashimg0=boot0.img
/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra
Success
Cleaning up...
Finish generating flash package.
/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/tools/kernel_flash/l4t_initrd_flash_internal.sh --initrd --usb-instance 1-1 --device-instance 0 --flash-only --initrd jetson-agx-orin-devkit mmcblk0p1
**********************************************
*                                            *
*  Step 1: Build the flashing environment    *
*                                            *
**********************************************
Create flash environment 0
/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader /home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra
/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra
Finish creating flash environment 0.
****************************************************
*                                                  *
*  Step 2: Boot the device with flash initrd image *
*                                                  *
****************************************************
/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/temp_initrdflash/bootloader0 /home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra
./tegraflash.py  --bl uefi_jetson_with_dtb.bin  --odmdata gbe-uphy-config-22,hsstp-lane-map-3,nvhs-uphy-config-0,hsio-uphy-config-0,gbe0-enable-10g  --overlay_dtb L4TConfiguration.dtbo,tegra234-p3737-overlay-pcie.dtbo,tegra234-p3737-audio-codec-rt5658-40pin.dtbo,tegra234-p3737-a03-overlay.dtbo,tegra234-p3737-a04-overlay.dtbo,L4TRootfsInfo.dtbo,tegra234-p3737-camera-dual-imx274-overlay.dtbo,tegra234-p3737-camera-e3331-overlay.dtbo,tegra234-p3737-camera-e3333-overlay.dtbo,tegra234-p3737-camera-imx185-overlay.dtbo,tegra234-p3737-camera-imx390-overlay.dtbo  --bldtb tegra234-p3701-0000-p3737-0000.dtb --applet mb1_t234_prod.bin --cmd "rcmboot"  --cfg flash.xml --chip 0x23 --concat_cpubl_bldtb --cpubl uefi_jetson.bin --device_config tegra234-mb1-bct-device-p3701-0000.dts --misc_config tegra234-mb1-bct-misc-p3701-0000.dts --pinmux_config tegra234-mb1-bct-pinmux-p3701-0000-a04.dtsi --gpioint_config tegra234-mb1-bct-gpioint-p3701-0000.dts --pmic_config tegra234-mb1-bct-pmic-p3701-0000.dts --pmc_config tegra234-mb1-bct-padvoltage-p3701-0000-a04.dtsi --deviceprod_config tegra234-mb1-bct-cprod-p3701-0000.dts --prod_config tegra234-mb1-bct-prod-p3701-0000.dts --scr_config tegra234-mb2-bct-scr-p3701-0000.dts --wb0sdram_config tegra234-p3701-0000-p3737-0000-TE990M-wb0sdram.dts --br_cmd_config tegra234-mb1-bct-reset-p3701-0000.dts --dev_params tegra234-br-bct-p3701-0000.dts,tegra234-br-bct_b-p3701-0000.dts --mb2bct_cfg tegra234-mb2-bct-misc-p3701-0000.dts  --bins "psc_fw pscfw_t234_prod.bin; mts_mce mce_flash_o10_cr_prod.bin; mb2_applet applet_t234.bin; mb2_bootloader mb2_t234.bin; xusb_fw xusb_t234_prod.bin; dce_fw display-t234-dce.bin; nvdec nvdec_t234_prod.fw; bpmp_fw bpmp_t234-TE990M-A1_prod.bin; bpmp_fw_dtb tegra234-bpmp-3701-0004-3737-0000.dtb; sce_fw camera-rtcpu-sce.img; rce_fw camera-rtcpu-t234-rce.img; ape_fw adsp-fw.bin; spe_fw spe_t234.bin; tos tos-optee_t234.img; eks eks.img; kernel boot0.img; kernel_dtb tegra234-p3701-0004-p3737-0000.dtb"  --sdram_config tegra234-p3701-0000-p3737-0000-TE990M-sdram.dts  --cust_info custinfo_out.bin  --secondary_gpt_backup  --bct_backup  --boot_chain A  --instance 1-1
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.7927 ] tegrasign_v3.py --key None --getmode mode.txt
[   0.7929 ] Assuming zero filled SBK key
[   0.7616 ] Pre-processing config: tegra234-mb1-bct-reset-p3701-0000.dts
Traceback (most recent call last):
  File "./tegraflash.py", line 1369, in <module>
    tegraflash_run_commands()
  File "./tegraflash.py", line 1210, in tegraflash_run_commands
    interpreter.onecmd(command)
  File "/usr/lib/python3.8/cmd.py", line 217, in onecmd
    return func(arg)
  File "./tegraflash.py", line 379, in do_rcmboot
    self.chip_inst.tegraflash_rcmboot(exports)
  File "/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/temp_initrdflash/bootloader0/tegraflash_impl_t234.py", line 1307, in tegraflash_rcmboot
    self.tegraflash_preprocess_configs()
  File "/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/temp_initrdflash/bootloader0/tegraflash_impl_t234.py", line 354, in tegraflash_preprocess_configs
    values[config] = self.run_dtc_tool(
  File "/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/temp_initrdflash/bootloader0/tegraflash_impl_t234.py", line 3294, in run_dtc_tool
    run_command(command, False)
  File "/home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/temp_initrdflash/bootloader0/tegraflash_internal.py", line 274, in run_command
    process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=use_shell, env=cmd_environ)
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'dtc'
Cleaning up...

How can I solve this problem?

Thanks!

Hi chenweiqian,

Are you using the devkit or custom board for AGX Orin?

Have you also tried the following instruction to clone from current Orin to new Orin?
Flashing Support — To clone a Jetson device and flash

FileNotFoundError: [Errno 2] No such file or directory: 'dtc'

It seems something missing in your BSP package.
Could you help to check if Linux_for_Tegra/kernel/dtc exists?

Hi,KevinFFF
Yes,I am using the custom board for AGX Orin

1、I tried the following:
https://forums.developer.nvidia.com/t/failed-to-sparse-the-raw-to-img-due-to-the-size-of-system-img-raw-is-not-mulple-of-4096/215526/25?u=chenweiqian
Since no patches were applied at first, this approach was abandoned

2、Linux_for_Tegra/kernel/dtc, this file it exists

chenweiqian@chenweiqian-virtual-machine:~/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/kernel$ ls -l
total 199984
drwxrwxrwx 2 root root    12288 6月   6 10:57 dtb
-rwxrwxrwx 1 root root   856213 8月  11  2022 dtc
-rw-rw-rw- 1 root root 33595904 6月   6 10:57 Image
-rw-rw-rw- 1 root root 12798888 8月  11  2022 Image.gz
-rw-rw-rw- 1 root root   941781 8月  11  2022 kernel_display_supplements.tbz2
-rw-rw-rw- 1 root root 25119839 8月  11  2022 kernel_headers.tbz2
-rw-rw-rw- 1 root root 20021691 8月  11  2022 kernel_supplements.tbz2
-rw-rw-rw- 1 root root    18385 8月  11  2022 LICENSE
-rw-rw-rw- 1 root root    17992 8月  11  2022 LICENSE.dtc
-rw-rw-rw- 1 root root     1091 8月  11  2022 LICENSE.nvethernetrm
-rwxrwxrwx 1 root root     3450 8月  11  2022 nv-enable-hard-coded-kernel-boot-display-mode.sh
-rw-rw-rw- 1 root root  1028546 8月  11  2022 nvidia-l4t-display-kernel_5.10.104-tegra-35.1.0-20220810203728_arm64.deb
-rw-rw-rw- 1 root root 93039070 8月  11  2022 nvidia-l4t-kernel_5.10.104-tegra-35.1.0-20220810203728_arm64.deb
-rw-rw-rw- 1 root root   343268 8月  11  2022 nvidia-l4t-kernel-dtbs_5.10.104-tegra-35.1.0-20220810203728_arm64.deb
-rw-rw-rw- 1 root root 17051718 8月  11  2022 nvidia-l4t-kernel-headers_5.10.104-tegra-35.1.0-20220810203728_arm64.deb
drwxrwxrwx 3 root root     4096 8月  11  2022 pinmux

Looking forward to your reply,thank you!

How’s the result if you apply the patch with this approach?

Could you also help to run the following command under Linux_for_Tegra/?

$sudo find -name dtc

1、 It prompt “size of system.img.raw is not mulple of 4096.”, the system.img is 0kb.

The size of system.img.raw is 62091112960(is not mulple of 4096).

I have deployed a lot of APPs on this Orin and it took me a lot of time and it would be a big loss if I had to reflash Orin again to apply this patch

2、

chenweiqian@chenweiqian-virtual-machine:~/udi_nvidia/nvidia/r35.1/Linux_for_Tegra$ sudo find -name dtc
[sudo] password for chenweiqian: 
./rootfs/usr/bin/dtc
./rootfs/usr/src/linux-headers-5.10.104-tegra-ubuntu20.04_aarch64/kernel-5.10/include/config/tegra/dtc
./rootfs/usr/src/linux-headers-5.10.104-tegra-ubuntu20.04_aarch64/kernel-5.10/scripts/dtc
./rootfs/usr/src/linux-headers-5.10.104-tegra-ubuntu20.04_aarch64/kernel-5.10/scripts/dtc/dtc
./kernel/dtc

Thank you!

Could you help to share the result of the following command on your board?

$sudo blockdev --getsize64 /dev/mmcblk0p1

Have you modified APP partition’s allocation_attribute to 0x808 from you original AGX Orin?

Hi,KevinFFF

1,The result of the command:

root@tegra-ubuntu:/home/unity# blockdev --getsize64 /dev/mmcblk0p1
62091112960

2, No,I haven’t modified it.

Looking forward to your reply,thank you!

Could you help to modify the following in Linux_for_Tegra/flash.sh and clone again?

   echo -e -n "\tConverting RAW image to Sparse image... ";
   mv -f ${target_partfile} ${target_partfile}.raw;
-  ./mksparse --fillpattern=0 ${target_partfile}.raw ${target_partfilile};
+  ./mksparse -b 512 --fillpattern=0 ${target_partfile}.raw ${target_partfilile};

Clone:

$sudo ./flash.sh -r -k APP -G clone.img jetson-agx-orin-devkit mmcblk0p1

If it can clone successfully, please share the size of clone.img.raw.

3 Likes

Great! I finished the work of cloning with your help.

Here’s how I did it:

0、I modified it earlier:https://forums.developer.nvidia.com/t/failed-to-sparse-the-raw-to-img-due-to-the-size-of-system-img-raw-is-not-mulple-of-4096/215526/25

diff --git a/rfs/usr/lib/nvidia/resizefs/nvresizefs.sh b/rfs/usr/lib/nvidia/resizefs/nvresizefs.sh
index 37d3ad3..cd36266 100755
--- a/rfs/usr/lib/nvidia/resizefs/nvresizefs.sh
+++ b/rfs/usr/lib/nvidia/resizefs/nvresizefs.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
+# Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -103,13 +103,19 @@
 		done
 		support_resizefs="${is_last}"
 	fi
+
+	if [ "${is_last}" == "true" ]; then
+		get_app_size
+		max_available_app_size
+		size="+${max_app_size}M"
+	fi
 }
 
 function get_app_size()
 {
 	# shellcheck disable=SC2086
 	partition_size="$(cat /sys/block/${block_dev}/${root_dev}/size)"
-	echo "$((partition_size/2/1024))"
+	cur_app_size="$((partition_size/2/1024))"
 }
 
 function max_available_app_size()
@@ -123,7 +129,7 @@
 				grep "last usable sector" | \
 				awk '{print $10}')"
 
-	echo "$(((last_usable_sector - app_start_sector + 1)/2/1024))"
+	max_app_size="$(((last_usable_sector - app_start_sector + 1)/2/1024))"
 }
 
 function parse_args()
@@ -143,7 +149,7 @@
 				echo "ERROR: ${script_name} doesn't support this platform."
 				exit 1
 			fi
-			get_app_size
+			echo "${cur_app_size}"
 			exit 0
 			;;
 		-m | --max)
@@ -151,7 +157,7 @@
 				echo "ERROR: ${script_name} doesn't support this platform."
 				exit 1
 			fi
-			max_available_app_size
+			echo "${max_app_size}"
 			exit 0
 			;;
 		-s | --size)
@@ -170,6 +176,8 @@
 script_name="$(basename "${0}")"
 support_resizefs="false"
 size="0"
+cur_app_size="0"
+max_app_size="0"
 root_dev=""
 block_dev=""

1、modify the following in Linux_for_Tegra/flash.sh and clone again

echo -e -n "\tConverting RAW image to Sparse image... ";
   mv -f ${target_partfile} ${target_partfile}.raw;
-  ./mksparse --fillpattern=0 ${target_partfile}.raw ${target_partfilile};
+  ./mksparse -b 512 --fillpattern=0 ${target_partfile}.raw ${target_partfilile};

2、Clone:

$sudo ./flash.sh -r -k APP -G clone.img jetson-agx-orin-devkit mmcblk0p1

There’s an error, but it’s not a big deal:

[   8.2651 ] tegradevflash_v2 --read APP /home/chenweiqian/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/clone.img
[   8.2661 ] Bootloader version 01.00.0000
[   8.3270 ] [................................................] 100%
*** The [APP] has been read successfully. ***
	Converting RAW image to Sparse image... 
Usage: ./mksparse [options] <source file> <target file>
where
  <options> are:
    -b|--blocksize<=r/w block size> ---------- default = 4096 
    -f|--fillpattern[=numeric byte pattern] -- default = 0 
    -V|--Verbose[=verbose level] ------------- default = Quiet 
  <source file> is:
    raw image input file name. 
  <target file> is:
    sparse image output file name. 

3、check the size of clone.img.raw

chenweiqian@chenweiqian-virtual-machine:~/udi_nvidia/nvidia/r35.1/Linux_for_Tegra$ ls -l ./clone.img.raw 
-rw-r--r-- 1 root root 62091112960 6月  13 12:51 ./clone.img.raw

4、Manually generate.img from.raw files

chenweiqian@chenweiqian-virtual-machine:~/udi_nvidia/nvidia/r35.1/Linux_for_Tegra$ cd bootloader/
chenweiqian@chenweiqian-virtual-machine:~/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader$ sudo ./mksparse -b 512 --fillpattern=0 ../clone.img.raw clone.img

5、check the size of clone.img.raw

chenweiqian@chenweiqian-virtual-machine:~/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader$ ls -l clone.img 
-rwxr-xr-x 1 root root 27950983312 6月  13 13:58 clone.img

6、Back up your original files

chenweiqian@chenweiqian-virtual-machine:~/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader$ mv system.img system.img-bak

7、Replacing system.img

chenweiqian@chenweiqian-virtual-machine:~/udi_nvidia/nvidia/r35.1/Linux_for_Tegra/bootloader$ mv clone.img system.img

8、There is an error when flushing directly:Error: Return value 3

chenweiqian@chenweiqian-virtual-machine:~/udi_nvidia/nvidia/r35.1/Linux_for_Tegra$ sudo ./flash.sh -r jetson-agx-orin-devkit mmcblk0p1

[ 466.5250 ] Writing partition esp with esp.img [ 67108864 bytes ]
[ 466.5569 ] [................................................] 100%
[ 475.6980 ] Writing partition APP with system.img [ 27950983312 bytes ]
Error: Return value 3                                         ] 000%
Command tegradevflash_v2 --pt flash.xml.bin --create
Failed flashing t186ref.

9、Patch the program:

modify allocation_attribute of APP from 0x8 to 0x808:https://forums.developer.nvidia.com/t/failure-to-flash-orin-with-cloned-system-img/236555/8

Linux_for_Tegra/bootloader/t186ref/cfg/flash_t234_qspi_sdmmc.xml

<partition name="APP" id="1" type="data">
    <allocation_policy> sequential </allocation_policy>
    <filesystem_type> basic </filesystem_type>
    <size> APPSIZE </size>
    <file_system_attribute> 0 </file_system_attribute>
-   <allocation_attribute> 0x8 </allocation_attribute>
+   <allocation_attribute> 0x808 </allocation_attribute>

10、And flash again with -r parameter

chenweiqian@chenweiqian-virtual-machine:~/udi_nvidia/nvidia/r35.1/Linux_for_Tegra$ sudo ./flash.sh -r jetson-agx-orin-devkit mmcblk0p1

11、Success!

[ 467.3835 ] Writing partition esp with esp.img [ 67108864 bytes ]
[ 467.4133 ] [................................................] 100%
[ 476.3526 ] Writing partition APP with system.img [ 27950983312 bytes ]
[ 476.3875 ] [................................................] 100%
[ 5087.8283 ] tegradevflash_v2 --write secondary_gpt_backup gpt_secondary_3_0.bin
[ 5087.8349 ] Bootloader version 01.00.0000
[ 5087.9229 ] Writing partition secondary_gpt_backup with gpt_secondary_3_0.bin [ 16896 bytes ]
[ 5087.9234 ] [................................................] 100%
[ 5088.2436 ] tegradevflash_v2 --write BCT br_bct_BR.bct
[ 5088.2453 ] Bootloader version 01.00.0000
[ 5088.3058 ] Writing partition BCT with br_bct_BR.bct [ 8192 bytes ]
[ 5088.3061 ] [................................................] 100%
[ 5094.9535 ] tegradevflash_v2 --write BCT-boot-chain_backup bct_backup.img
[ 5094.9547 ] Bootloader version 01.00.0000
[ 5095.0134 ] Writing partition BCT-boot-chain_backup with bct_backup.img [ 32768 bytes ]
[ 5095.0137 ] [................................................] 100%
[ 5095.5793 ] tegradevflash_v2 --write A_MB1_BCT mb1_cold_boot_bct_MB1_sigheader.bct.encrypt
[ 5095.5983 ] Bootloader version 01.00.0000
[ 5095.6527 ] Writing partition A_MB1_BCT with mb1_cold_boot_bct_MB1_sigheader.bct.encrypt [ 17344 bytes ]
[ 5095.6532 ] [................................................] 100%
[ 5095.9604 ] tegradevflash_v2 --write B_MB1_BCT mb1_cold_boot_bct_MB1_sigheader.bct.encrypt
[ 5095.9616 ] Bootloader version 01.00.0000
[ 5096.0160 ] Writing partition B_MB1_BCT with mb1_cold_boot_bct_MB1_sigheader.bct.encrypt [ 17344 bytes ]
[ 5096.0163 ] [................................................] 100%
[ 5096.3055 ] tegradevflash_v2 --write A_MEM_BCT mem_coldboot_sigheader.bct.encrypt
[ 5096.3068 ] Bootloader version 01.00.0000
[ 5096.3642 ] Writing partition A_MEM_BCT with mem_coldboot_sigheader.bct.encrypt [ 243712 bytes ]
[ 5096.3645 ] [................................................] 100%
[ 5099.4593 ] tegradevflash_v2 --write B_MEM_BCT mem_coldboot_sigheader.bct.encrypt
[ 5099.4604 ] Bootloader version 01.00.0000
[ 5099.5231 ] Writing partition B_MEM_BCT with mem_coldboot_sigheader.bct.encrypt [ 243712 bytes ]
[ 5099.5255 ] [................................................] 100%
[ 5102.6069 ] Flashing completed

[ 5102.6225 ] Coldbooting the device
[ 5102.6457 ] tegrarcm_v2 --chip 0x23 0 --ismb2
[ 5102.6475 ] MB2 version 01.00.0000
[ 5102.7267 ] Coldbooting the device
[ 5102.7285 ] tegrarcm_v2 --chip 0x23 0 --reboot coldboot
[ 5102.7297 ] MB2 version 01.00.0000
*** The target t186ref has been flashed successfully. ***
Reset the board to boot from internal eMMC.

Thank you so much!
Wishing you joy and success in the days ahead!

1 Like

You could also try using -S parameter to specify the size of APP, or it would just use the default one and cause this error

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