Need help: How can I flash boot image under recovery mode?

Hi Nvidia,

When I developing sensor driver, after flashing boot image to board of agx orin, system reboot continuously and can not enter ubuntu desktop. I don’t want to do whole images flashing since I have important files in rootfs. How can I flash only boot image under this circumstance?

Thanks

I met below error when I use flash.sh under recovery:

$ sudo ./flash.sh -k kernel jetson-agx-orin-devkit mmcblk0p1
[sudo] password for icsd:
Error: Invalid target board - jetson-agx-orin-devkit.

Usage: sudo ./flash.sh [options] <target_board>

Any idea? Thanks.

*** Please note that this reply is generated by LLM automatically ***

To address your issue, I’ll provide a step-by-step solution to flash only the boot image on your Jetson AGX Orin without re-flashing the entire system.

Understanding the Problem

When you flash a new boot image to the Jetson AGX Orin, the system reboots continuously and fails to enter the Ubuntu desktop. This is likely due to a mismatch between the boot image and the root file system (rootfs).

Solution

To flash only the boot image without re-flashing the entire system, you can use the flash.sh script provided by NVIDIA. Here’s a step-by-step guide:

  1. Put the device into recovery mode: Connect your Jetson AGX Orin to your host machine using a USB cable. Open a terminal on your host machine and run the following command to put the device into recovery mode:
$ sudo ./flash.sh -r jetson-agx-orin-devkit

This will reboot the device into recovery mode.

  1. Flash the boot image: Once the device is in recovery mode, run the following command to flash the new boot image:
$ sudo ./flash.sh -k boot.img jetson-agx-orin-devkit

Replace boot.img with the path to your new boot image file.

  1. Reboot the device: After flashing the boot image, reboot the device:
$ sudo ./flash.sh -r jetson-agx-orin-devkit

This will reboot the device normally.

Comparison with Full Flashing

Flashing only the boot image is different from flashing the entire system. When you flash the entire system, the flash.sh script will erase the entire device, including the root file system (rootfs), and re-flash everything. This is not what you want, as you have important files in the rootfs.

By flashing only the boot image, you can update the boot image without touching the rootfs. This approach is useful when you only need to update the boot image, and you don’t want to lose your files in the rootfs.

Additional Tips

  • Make sure you have the correct boot image file for your Jetson AGX Orin device.
  • If you’re using a custom boot image, ensure that it’s compatible with your device and the rootfs.
  • If you encounter any issues during the flashing process, try re-flashing the entire system or seeking help from NVIDIA support.

I hope this helps you resolve your issue and flash only the boot image on your Jetson AGX Orin without re-flashing the entire system.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

Thanks @carolyuu

That would be useful. I will try it.

@carolyuu

Do you know why below error happens:

$ sudo ./flash.sh -k ~/jetson/Linux_for_Tegra/source/public/kernel_out/arch/arm64/boot/Image “jetson-agx-orin-devkit” mmcblk0p1
###############################################################################

L4T BSP Information:

R35 , REVISION: 3.1

User release: 0.0

###############################################################################
Error: tegrarcm is missing.

Hi,

Please refer to flash.xml, as there is no kernel partition.

Please try below commands to boot into initrd as a root and backup data or reverse your modification.

$ cd Linux_for_Tegra
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --initrd <board-name> <rootdev>

Thanks

Hi @DavidDDD

Sorry I don’t quite understand your meaning. Is your command to backup rootfs on board? If so, where is the backup and what’s its name?

BTW, do you know there is a way to flash DTB individually for Orin? Flash DTB only also helpful to my issue. Thanks!

Why this platform has no ability to update kernel image individually by flashing? It’s sounds abnormal. There must be a way.

Now it seems I have to reflash all images to board. which means my data in rootfs will be gone.

@DavidDDD

I even can’t enter system of the device, how could I do the backup then?

Hi,

Please refer to this similar topics, we suggest to replace kernel image directly.

the kernel image by default is read from rootfs but not partition.

To log in to initrd, you’ll need to have a micro‑USB cable ready to connect the host to the device.

And follow the below topics to enter serial console.

Run the commands

# In host
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --initrd jetson-agx-orin-devkit internal

And you could enter into initrd as serial console show

# In serial console
bash-5.1# 

Run lsblk to check your rootfs

# In serial console
bash-5.1# lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
mtdblock0     31:0    0    64M  0 disk 
mmcblk0      179:0    0  59.3G  0 disk 
|-mmcblk0p1  179:1    0  57.8G  0 part 
|-mmcblk0p2  179:2    0   128M  0 part 
|-mmcblk0p3  179:3    0   768K  0 part 
|-mmcblk0p4  179:4    0  31.6M  0 part 
|-mmcblk0p5  179:5    0   128M  0 part 
|-mmcblk0p6  179:6    0   768K  0 part 
|-mmcblk0p7  179:7    0  31.6M  0 part 
|-mmcblk0p8  179:8    0    80M  0 part 
|-mmcblk0p9  179:9    0   512K  0 part 
|-mmcblk0p10 179:10   0    64M  0 part 
|-mmcblk0p11 179:11   0    80M  0 part 
|-mmcblk0p12 179:12   0   512K  0 part 
|-mmcblk0p13 179:13   0    64M  0 part 
|-mmcblk0p14 179:14   0   400M  0 part 
`-mmcblk0p15 179:15   0 479.5M  0 part 

Mount your rootfs to your assigned directory

# In serial console
mount /dev/mmcblk0p1 /tmp

After you mount your rootfs, you could do **backup data** or replace kernel image like below commands

Replace kernel image

  • Prepare original kernel image in USB
  • Insert USB in AGX Orin
# In serial console
cp ${usb_kernel_image} /tmp/boot/Image

Thanks

@DavidDDD

Thanks! seems be good way for a try. Do you know where to get the 5.1.1 OS images for a download? my sdkmanager shows oldest one support is 5.1.5….

Hi,

Please refer Jetson Linux 35.3.1 | NVIDIA Developer

Download the bsp and you could find Linux_for_Tegra/kernel/Image

Thanks

Thanks very much.

@DavidDDD

I downloaded the driver and rootfs images, and extracted them, and when I used flash.sh to do the flash, I met below errors, do you know why?

$ sudo ./flash.sh jetson-agx-orin-devkit mmcblk0p1
###############################################################################

L4T BSP Information:

R35 , REVISION: 3.1

User release: 0.0

###############################################################################

Target Board Information:

Name: jetson-agx-orin-devkit, Board Family: t186ref, SoC: Tegra 234,

OpMode: production, Boot Authentication: NS,

Disk encryption: disabled ,

###############################################################################
copying emc_fuse_dev_params(/home/orin/nvidia/nvidia_sdk/jet-5.1.1-image/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-br-bct-diag-boot.dts)… done.
copying device_config(/home/orin/nvidia/nvidia_sdk/jet-5.1.1-image/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-device-p3701-0000.dts)… done.
copying misc_config(/home/orin/nvidia/nvidia_sdk/jet-5.1.1-image/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-misc-p3701-0000.dts)… done.
./tegraflash.py --chip 0x23 --applet “/home/orin/nvidia/nvidia_sdk/jet-5.1.1-image/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.0801 ] tegrarcm_v2 --chip 0x23 0 --ismb2applet
[ 0.0816 ] File rcm_state open failed
[ 0.0817 ] ERROR: failed to read rcm_state
[ 0.0817 ]
[ 0.0996 ] tegrasign_v3.py --key None --getmode mode.txt
[ 0.1003 ] Assuming zero filled SBK key
[ 0.0830 ] Pre-processing config: tegra234-mb1-bct-device-p3701-0000.dts
[ 0.2509 ] Pre-processing config: tegra234-mb1-bct-misc-p3701-0000.dts
[ 0.2787 ] Parsing partition layout
[ 0.2852 ] tegraparser_v2 --pt readinfo_t234_min_prod.xml.tmp
[ 0.2924 ] Kernel DTB used: None
[ 0.2925 ] WARNING: dce base dtb is not provided

[ 0.2925 ] Parsing partition layout
[ 0.2950 ] tegraparser_v2 --pt readinfo_t234_min_prod.xml.tmp
[ 0.2983 ] Creating list of images to be signed
[ 0.3052 ] tegrahost_v2 --chip 0x23 0 --partitionlayout readinfo_t234_min_prod.xml.bin --list images_list.xml zerosbk
[ 0.3078 ] MB1: Nvheader already present is mb1_t234_prod_aligned.bin
[ 0.3139 ] Header already present for mb1_t234_prod_aligned_sigheader.bin
[ 0.3148 ] MB1: Nvheader already present is mb1_t234_prod_aligned.bin
[ 0.3247 ] Header already present for mb1_t234_prod_aligned_sigheader.bin
[ 0.3262 ] MB1: Nvheader already present is psc_bl1_t234_prod_aligned.bin
[ 0.3358 ] Header already present for psc_bl1_t234_prod_aligned_sigheader.bin
[ 0.3367 ] adding BCH for mb2_t234_aligned.bin
[ 0.3466 ] MB1: Nvheader already present is psc_bl1_t234_prod_aligned.bin
[ 0.3695 ] Header already present for psc_bl1_t234_prod_aligned_sigheader.bin
[ 0.3705 ] adding BCH for mb2_t234_aligned.bin
[ 0.3958 ] Filling MB1 storage info
[ 0.3958 ] Parsing dev params for multi chains
[ 0.4129 ] Generating br-bct
[ 0.4175 ] Updating dev and MSS params in BR BCT
[ 0.4177 ] tegrabct_v2 --dev_param tegra234-br-bct-diag-boot_cpp.dtb --brbct br_bct.cfg --chip 0x23 0
[ 0.4277 ] Updating bl info
[ 0.4300 ] tegrabct_v2 --brbct br_bct_BR.bct --chip 0x23 0 --updateblinfo readinfo_t234_min_prod.xml.bin
[ 0.4314 ] WARNING: boot chain is not completed. set to 0
[ 0.4339 ] Generating signatures
[ 0.4518 ] tegrasign_v3.py --key None --list images_list.xml --pubkeyhash pub_key.key --sha sha512
[ 0.4523 ] Assuming zero filled SBK key
[ 0.5091 ] Warning: pub_key.key is not found
[ 0.4920 ] Parsing dev params for multi chains
[ 0.4920 ] Generating br-bct
[ 0.4937 ] Updating dev and MSS params in BR BCT
[ 0.4940 ] tegrabct_v2 --dev_param tegra234-br-bct-diag-boot_cpp.dtb --brbct br_bct.cfg --chip 0x23 0
[ 0.4970 ] Updating bl info
[ 0.4993 ] tegrabct_v2 --brbct br_bct_BR.bct --chip 0x23 0 --updateblinfo readinfo_t234_min_prod.xml.bin --updatesig images_list_signed.xml
[ 0.5012 ] WARNING: boot chain is not completed. set to 0
[ 0.5062 ] Get Signed section of bct
[ 0.5086 ] tegrabct_v2 --brbct br_bct_BR.bct --chip 0x23 0 --listbct bct_list.xml
[ 0.5113 ] Signing BCT
[ 0.5292 ] tegrasign_v3.py --key None --list bct_list.xml --pubkeyhash pub_key.key --sha sha512
[ 0.5297 ] Assuming zero filled SBK key
[ 0.5379 ] Sha saved in br_bct_BR.sha
[ 0.5388 ] Warning: pub_key.key is not found
[ 0.5212 ] Updating BCT with signature
[ 0.5236 ] tegrabct_v2 --brbct br_bct_BR.bct --chip 0x23 0 --updatesig bct_list_signed.xml
[ 0.5259 ] Offset :4608 Len :3584
[ 0.5271 ] Generating SHA2 Hash
[ 0.5449 ] tegrasign_v3.py --key None --list bct_list.xml --sha sha512
[ 0.5451 ] Assuming zero filled SBK key
[ 0.5452 ] Assuming zero filled SBK key
[ 0.5525 ] Sha saved in br_bct_BR.sha
[ 0.5360 ] Updating BCT with SHA2 Hash
[ 0.5384 ] tegrabct_v2 --brbct br_bct_BR.bct --chip 0x23 0 --updatesha bct_list_signed.xml
[ 0.5405 ] Offset :4608 Len :3584
[ 0.5420 ] Offset :68 Len :8124
[ 0.5420 ]
[ 0.5422 ] Generating coldboot mb1-bct
[ 0.5444 ] 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.5465 ] MB1-BCT version: 0.10
[ 0.5469 ] ERROR: carveout /misc/carveout/aux_info@CARVEOUT_UNUSED5/ is not supported
[ 0.5488 ] ERROR: carveout /misc/carveout/aux_info@CARVEOUT_UNUSED5/ is not supported
[ 0.5499 ] ERROR: carveout /misc/carveout/aux_info@CARVEOUT_UNUSED5/ is not supported
[ 0.5512 ] ERROR: carveout /misc/carveout/aux_info@CARVEOUT_MCE_COVERAGE/ is not supported
[ 0.5515 ] ERROR: carveout /misc/carveout/aux_info@CARVEOUT_MCE_COVERAGE/ is not supported
[ 0.5516 ] ERROR: carveout /misc/carveout/aux_info@CARVEOUT_MCE_COVERAGE/ is not supported
[ 0.5516 ] ERROR: /misc/tsc_controls/tsc_locking_config is not supported
[ 0.5516 ] ERROR: /misc/tsc_controls/tsc_locking_diff_configuration is not supported
[ 0.5516 ] ERROR: /misc/tsc_controls/tsc_locking_ref_frequency_configuration is not supported
[ 0.5516 ] ERROR: /misc/tsc_controls/tsc_locking_control is not supported
[ 0.5516 ] ERROR: /misc/tsc_controls/tsc_locking_adjust_configuration is not supported
[ 0.5516 ] ERROR: /misc/tsc_controls/tsc_locking_fast_adjust_configuration is not supported
[ 0.5516 ] ERROR: /misc/tsc_controls/tsc_locking_adjust_delta_control is not supported
[ 0.5516 ] ERROR: /misc/tsc_controls/tsc_capture_control_ptx is not supported
[ 0.5516 ] ERROR: /misc/tsc_controls/tsc_capture_config_ptx is not supported
[ 0.5517 ] ERROR: /misc/tsc_controls/tsc_stscrsr is not supported
[ 0.5517 ] ERROR: /misc/tsc_controls/tsc_locking_adjust_num_control is not supported
[ 0.5517 ]
[ 0.5517 ] Parsing config file :tegra234-mb1-bct-device-p3701-0000_cpp.dtb
[ 0.5517 ] Added Platform Config 9 data with size :- 100
[ 0.5517 ]
[ 0.5518 ] Updating mb1-bct with firmware information
[ 0.5539 ] tegrabct_v2 --chip 0x23 0 --mb1bct mb1_cold_boot_bct_MB1.bct --updatefwinfo readinfo_t234_min_prod.xml.bin
[ 0.5606 ] tegrahost_v2 --chip 0x23 0 --align mb1_cold_boot_bct_MB1_aligned.bct
[ 0.5650 ] tegrahost_v2 --chip 0x23 0 --magicid MBCT --appendsigheader mb1_cold_boot_bct_MB1_aligned.bct zerosbk
[ 0.5669 ] adding BCH for mb1_cold_boot_bct_MB1_aligned.bct
[ 0.5860 ] tegrasign_v3.py --key None --list mb1_cold_boot_bct_MB1_aligned_sigheader.bct_list.xml --pubkeyhash pub_key.key --sha sha512
[ 0.5865 ] Assuming zero filled SBK key
[ 0.5909 ] Warning: pub_key.key is not found
[ 0.5766 ] 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.5805 ] Generating recovery mb1-bct
[ 0.5826 ] 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.5845 ] MB1-BCT version: 0.10
[ 0.5849 ] ERROR: carveout /misc/carveout/aux_info@CARVEOUT_UNUSED5/ is not supported
[ 0.5864 ] ERROR: carveout /misc/carveout/aux_info@CARVEOUT_UNUSED5/ is not supported
[ 0.5874 ] ERROR: carveout /misc/carveout/aux_info@CARVEOUT_UNUSED5/ is not supported
[ 0.5884 ] ERROR: carveout /misc/carveout/aux_info@CARVEOUT_MCE_COVERAGE/ is not supported
[ 0.5889 ] ERROR: carveout /misc/carveout/aux_info@CARVEOUT_MCE_COVERAGE/ is not supported
[ 0.5889 ] ERROR: carveout /misc/carveout/aux_info@CARVEOUT_MCE_COVERAGE/ is not supported
[ 0.5889 ] ERROR: /misc/tsc_controls/tsc_locking_config is not supported
[ 0.5889 ] ERROR: /misc/tsc_controls/tsc_locking_diff_configuration is not supported
[ 0.5889 ] ERROR: /misc/tsc_controls/tsc_locking_ref_frequency_configuration is not supported
[ 0.5890 ] ERROR: /misc/tsc_controls/tsc_locking_control is not supported
[ 0.5890 ] ERROR: /misc/tsc_controls/tsc_locking_adjust_configuration is not supported
[ 0.5890 ] ERROR: /misc/tsc_controls/tsc_locking_fast_adjust_configuration is not supported
[ 0.5890 ] ERROR: /misc/tsc_controls/tsc_locking_adjust_delta_control is not supported
[ 0.5890 ] ERROR: /misc/tsc_controls/tsc_capture_control_ptx is not supported
[ 0.5890 ] ERROR: /misc/tsc_controls/tsc_capture_config_ptx is not supported
[ 0.5890 ] ERROR: /misc/tsc_controls/tsc_stscrsr is not supported
[ 0.5890 ] ERROR: /misc/tsc_controls/tsc_locking_adjust_num_control is not supported
[ 0.5891 ]
[ 0.5891 ] Parsing config file :tegra234-mb1-bct-device-p3701-0000_cpp.dtb
[ 0.5891 ] Added Platform Config 9 data with size :- 100
[ 0.5891 ]
[ 0.5892 ] Updating mb1-bct with firmware information
[ 0.5912 ] tegrabct_v2 --chip 0x23 0 --mb1bct mb1_bct_MB1.bct --recov --updatefwinfo readinfo_t234_min_prod.xml.bin
[ 0.5972 ] tegrahost_v2 --chip 0x23 0 --align mb1_bct_MB1_aligned.bct
[ 0.6013 ] tegrahost_v2 --chip 0x23 0 --magicid MBCT --appendsigheader mb1_bct_MB1_aligned.bct zerosbk
[ 0.6037 ] adding BCH for mb1_bct_MB1_aligned.bct
[ 0.6227 ] tegrasign_v3.py --key None --list mb1_bct_MB1_aligned_sigheader.bct_list.xml --pubkeyhash pub_key.key --sha sha512
[ 0.6232 ] Assuming zero filled SBK key
[ 0.6272 ] Warning: pub_key.key is not found
[ 0.6118 ] tegrahost_v2 --chip 0x23 0 --updatesigheader mb1_bct_MB1_aligned_sigheader.bct.encrypt mb1_bct_MB1_aligned_sigheader.bct.hash zerosbk
[ 0.6156 ] Error: Skip generating mem_bct because sdram_config is not defined
[ 0.6157 ] Error: Skip generating mem_bct because sdram_config is not defined
[ 0.6157 ] Copying signatures
[ 0.6180 ] tegrahost_v2 --chip 0x23 0 --partitionlayout readinfo_t234_min_prod.xml.bin --updatesig images_list_signed.xml
[ 0.6304 ] mb1_t234_prod_aligned_sigheader.bin.encrypt filename is from images_list
[ 0.6306 ] psc_bl1_t234_prod_aligned_sigheader.bin.encrypt filename is from images_list
[ 0.6308 ] Boot Rom communication
[ 0.6328 ] 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.6350 ] BR_CID: 0x80012344705DD5176C00000002038140
[ 0.7377 ] Sending bct_br
[ 0.8385 ] ERROR: might be timeout in USB write.
Error: Return value 3
Command 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
Reading board information failed.

sdkmanager --archived-versions

above command can help me download 5.1.1 with sdkmanager. Thanks

@DavidDDD

use sdkmanager met the same issue as this.

The error is gone when doing another try with uart log opened… not sure if it is related to the uart log part.