Flashing Orin NX with a backup system Image

Hi,

I am trying to re use the backup system image to flash the Orin NX dev kit. My system image is 67GB.

Previously for Xavier we would use

sudo ./flash.sh -r jetson-xavier-devkit mmcblk0p1

I was able to successfully boot up the Orin with a usb and the command i used is:

sudo ADDITIONAL_DTB_OVER\LAY_OPT="BootOrderNvme.dtbo" ./tools/kernel_flash/l4t_initrd_flash.sh --external-device sda1 -c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" --showlogs --network usb0 jetson-orin-nano-devkit internal

Now i want to flash the Orin with the backup image.
I copied this image to /bootloader/system.img and ran the following command

sudo ADDITIONAL_DTB_OVER\LAY_OPT="BootOrderNvme.dtbo" ./tools/kernel_flash/l4t_initrd_flash.sh --reuse --external-device sda1 -c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" --showlogs --network usb0 jetson-orin-nano-devkit internal

For some reason, reuse does not work as re using the existing system image, and the system image is being built again.

I tried to by pass some portions of the script but that did not help.

I also replaced the system.img in /tools/kernel_flash/images/external with backup image but the APP partition writing fails.

Also I learnt that flash.sh will not support flashing for Orin.

sudo ./flash.sh -r jetson-orin-nano-devkit sda1

Please advice.
Thanks

Hi,

you should use --flash-only instead of --reuse.

How did you backup the image?
Just in case you want to use the backup image from Xavier NX on Orin NX, then it’s not going to work.

Please either backup the entire device according to the README file in /Linux_for_Tegra/tools/backup-restore/, or cloning rootfs using initrd:
https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/text/SD/FlashingSupport.html#cloning-rootfs-with-initrd

Hi,

Yes we have backed up the system image (system.img.raw) in a similar manner and then used mksparse.

when i use --flash-only it gets stuck at this point does not go any further.

[   3.7387 ] Sending membct and RCM blob
[   3.7392 ] tegrarcm_v2 --instance 3-3 --chip 0x23 0 --pollbl --download bct_mem mem_rcm_sigheader.bct.encrypt --download blob blob.bin
[   3.7396 ] BL: version 1.2.0.0-t234-54845784-562369e5 last_boot_error: 0
[   3.7476 ] Sending bct_mem
[   3.7562 ] Sending blob

flashlog.txt (51.3 KB)

Also i have replaced the system image in …/Linux_for_Tegra/bootloader

Hi,

system.img under Linux_for_Tegra/bootloader/ is for MB2 flashing with eMMC/SD card, for initrd flash, please try replacing the file under Linux_for_Tegra/tools/kernel_flash/images/external/.

Hi @DaveYYY ,

Thank you. I replaced it under the right path.

And this is what I got


Waiting for device to expose ssh ...Device has booted into initrd. You can ssh to the target by the command:
$ ssh root@fc00:1:1:0::2
Cleaning up...
Log is saved to Linux_for_Tegra/initrdlog/flash_3-3_0_20230825-101412.log

Please always attach the full log here.
Also with serial console log.

@DaveYYY

flash_3-3_0_20230825-101834.log (7.0 KB)
Here is the log.

The command I used is

sudo ADDITIONAL_DTB_OVER\LAY_OPT="BootOrderNvme.dtbo" ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --external-device sda1 -c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" --showlogs --network usb0 jetson-orin-nano-devkit internal

We also need serial console log to know if the device has booted into initrd successfully.
Also, you actually don’t need this as you are flashing into a USB drive:

ADDITIONAL_DTB_OVERLAY_OPT=“BootOrderNvme.dtbo”

Hi @DaveYYY ,

Yes i used the command,

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --external-device sda1 -c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" --showlogs --network usb0 jetson-orin-nano-devkit internal

And i have attached the console log:

consoleLog.txt (24.4 KB)

Thanks

Hi,

is it the full log you can capture?
It just got stuck in UEFI and could not continue?

Then can you try flashing the QSPI memory on the module with this command?

sudo ./flash.sh --no-systemimg -c bootloader/t186ref/cfg/flash_t234_qspi.xml jetson-orin-nano-devkit sda1

Hi,

It took time, this is the updated log from where it got stuck.

consoleLog1.txt (57.8 KB)

Thanks.

Then the initrd looks fine now.
Is flashing the USB drive still failing?

@DaveYYY

As per the flash log, it says device has booted to initrd. And according to the console log, initrd is fine. I should be able to access the Orin now which has the backup system image flashed on it…

So the issue is solved?

@DaveYYY ,

Unfortunately no. My USB device has nothing flashed on it, it is empty.
My system.img is 67 GB
And the orin is not booting up.

Then what’s the flashing log and serial console log now?
The same as this?

Waiting for device to expose ssh ......RTNETLINK answers: File exists
RTNETLINK answers: File exists
Waiting for device to expose ssh ...Device has booted into initrd. You can ssh to the target by the command:
$ ssh root@fc00:1:1:0::2
Cleaning up...
1 Like

@DaveYYY It is the same as I have uploaded above.

Then does changing the host PC make any difference?

@DaveYYY

I am checking the USB drive if it has been successfully flashed or not…
There are no files present, which means the image is not flashed.

In the log we see, making system.img is being skipped.

By using --flash-only how do we make sure that
Linux_for_Tegra/tools/kernel_flash/images/external/system.img is being used?

Hi,

I think that’s not the main point here.
Even if your system.img is not reused, it should just proceed with creating another one.

157 flash_through_ssh()
158 {
159 	wait_for_flash_ssh "${1}"
160 	if [ -n "${initrd_only}" ]; then
161 		echo "Device has booted into initrd. You can ssh to the target by the command:"
162 		echo "$ ssh root@${1}"
163 		exit
164 	fi
165 	run_flash_commmand_on_target "${1}"
166 	exit 0
167 }

As you can see in the flashing script ( l4t_network_flash.func), this log will only appear when initrd-only is specified, which you did not do and is weird. That’s why I asked you to try with a different host PC.