Orin NX creating nvme image

Hello,
I’m trying to make a system image from orin nx external nvme (nvidia_sdk folder version: Jetson_Linux_R35.2.1_aarch64).

Although I’m able to make this image, I’m unable to flash it back into external nvme. It seems like, that the image is being flashed, but it always ends with this error (after a few minutes): error: file_write: write: No space left on device.

Snippet from flash log (full flash log in the attachment):

Copied 16896 bytes from /mnt/internal/gpt_secondary_3_0.bin to address 0x03ffbe00 in flash
[ 414]: l4t_flash_from_kernel: Successfully flash the qspi
error: file_write: write: No space left on device
Cannot write output file
[ 588]: l4t_flash_from_kernel: /mnt/simg2img /mnt/external/system.img /dev/nvme0n1p1 failed
[ 588]: l4t_flash_from_kernel: Error flashing external device
Flash failure
Cleaning up...

My steps for creating an image and flashing back into the device are as follows:

  1. Create image with this command: sudo img2simg /dev/nvme0n1p1 system.img.ext (no problem)
  2. Copy created image into ../Linux_for_Tegra/tools/kernel_flash/images/external and rename it to system.img. (no problem)
  3. Sign the image and update system.img.sha1sum. (no problem)
  4. Try to flash with: (this fails)
    sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_external_custom.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" --showlogs --network usb0 p3509-a02+p3767-0000 internal

Is this workflow wrong?

Thank you for you help.
flash_1-2_0_20230310-145503.log (81.6 KB)

Some additional notes:
Tried to specify APP partition size with -S, it didn’t help.

I’m able to flash the orin nx and external nvme with this command without any issues:
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_external_custom.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" --showlogs --network usb0 p3509-a02+p3767-0000 internal

flash_l4t_external_custom.xml → this document has only first num_sectors parameter modified, according to used nvme

please directly run with sudo --no-flash instead of running img2simg by yourself and copy the image.

Run --flash-only in the 2nd stage when you try to flash.

And does the xml file include the correct nvme size?

The whole point of my workflow is to create image with some additional custom software etc. … I’m cloning nvme with img2simg from running orin nx to another external storage.

Wouldn’t --no-flash option just regenerate system.img from rootfs and sdk components and therefore result in new clean image? If yes, that is not what I intend to do.

Xml config does contain the right size.

for the clone case, please use the backup_restore script here.

Thank you for the answer. This seems to be working.

Do you expect that this works even with unformatted nvme with different size (larger than the original nvme)?

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