Unable to flash AGX Xavier to External USB Drive: APP not found

Hi, I am trying to flash an external USB Drive for booting AGX Xavier via an external USB stick. I connected both my AGX Xavier, and a 128GB USB stick to the host PC, and followed the instructions here:

https://docs.nvidia.com/jetson/archives/r35.2.1/DeveloperGuide/text/SD/FlashingSupport.html#to-set-up-a-flash-drive-manually-for-booting

My flash command is this:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh -c tools/kernel_flash/flash_l4t_external.xml --external-device sda1 --direct sdd jetson-agx-xavier-devkit external

However, I get the following error (l4t_flash_from_kernel: APP image is not found !!!):

writing item=15, 9:0:APP, 819875840, 30064771072, , , fixed-<reserved>-1, 
[ 35]: l4t_flash_from_kernel: APP image /hdd1/sanaurrehman/NVIDIA_Flash/Own_NVIDIA_Flash/Jetpack_5p1p1/nvidia_sdk/JetPack_5.1.1_Linux_JETSON_AGX_XAVIER_TARGETS/Linux_for_Tegra/tools/kernel_flash/images/external/ is not found !!!
[ 35]: l4t_flash_from_kernel: Failed to write to APP
[ 35]: l4t_flash_from_kernel: The device size indicated in the partition layout xml is smaller than the actual size. This utility will try to fix the GPT.
[ 35]: l4t_flash_from_kernel: Error flashing external device
Cleaning up...

How can I fix this? I have tried using a different USB stick, and trying a different BSP package (I tried using source files from Jetpack 5.1 and Jetpack 5.1.1, but same result).

The complete log from the host PC’s terminal after I execute the command for flashing is attached.
MyLog.txt (125.0 KB)

Hi,

Please format the usb to ext4 first.
For example:

# In your host machine
sudo mkfs.ext4 ${YOUR_USB}

Also some questions to confirm:

  • Is your AGX Xavier a dev kit or a custom carrier board?
  • Our host requirement is Ubuntu 18.04/20.04 running on a physical machine, not a virtual machine(e.g. WSL, VirtualBox, VMware). Please check your host requirement.

Thanks

Thanks for the reply @DavidDDD . I have already tried formatting the USB drive to ext4 format before flashing. I still get the same issue.

My AGX Xavier is a devkit, not a custom carrier board, and my host is a native Ubuntu 18.04 machine.

Hi,

Could you share the num_sectors field in tools/kernel_flash/flash_l4t_external.xml.

Also plug the usb to host and use below command to get the num_sectors info of the usb.

sudo fdisk -l /dev/$YOUR_USB

Thanks

@DavidDDD , the num_sectors field contains 119537664. The output of sudo fdisk -l /dev/sdd is as follows:

Disk /dev/sdd: 115.5 GiB, 123983626752 bytes, 242155521 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 2D42A321-194B-4DB7-B0E8-072D28584B45

Device       Start      End  Sectors  Size Type
/dev/sdd1  1601320 60321575 58720256   28G Microsoft basic data
/dev/sdd2       40   131111   131072   64M Microsoft basic data
/dev/sdd3   131112   132007      896  448K Microsoft basic data
/dev/sdd4   132008   197543    65536   32M Microsoft basic data
/dev/sdd5   197544   328615   131072   64M Microsoft basic data
/dev/sdd6   328616   329511      896  448K Microsoft basic data
/dev/sdd7   329512   395047    65536   32M Microsoft basic data
/dev/sdd8   395048   558887   163840   80M Microsoft basic data
/dev/sdd9   558888   559911     1024  512K Microsoft basic data
/dev/sdd10  559912  1174311   614400  300M Microsoft basic data
/dev/sdd11 1174312  1305383   131072   64M EFI System
/dev/sdd12 1305384  1469223   163840   80M Microsoft basic data
/dev/sdd13 1469224  1470247     1024  512K Microsoft basic data
/dev/sdd14 1470248  1601319   131072   64M Microsoft basic data

Partition table entries are not in disk order.

I have also tried using a custom xml file by just changing the num_sectors value to 242155521, as shown in the above command output, but I still get the exact same error.

Hi,

Seems like usb have lots of partitions.
Have you tried formatting the USB drive every time before flash?

Thanks

This is the state of the USB after the flashing process had failed (these partitions were all created by the initrd flash script). I have tried formatting the USB before flash. I always create one ext4 partition. However, I am still getting the same error.

Ok. It seems I can flash the external USB drive if I use a different host (a laptop with Ubuntu 20.04). I did a clean install of Jetpack files in the new host machine, and was able to successfully flash the USB drive after that. So the problem is likely within the host machine. Strange, as I can use the flash.sh script without any issues in the old (already existing) host machine.

So in summary:

HOST A (Old Host, Ubuntu 18.04 PC): flash.sh works, but can’t flash the external USB drive.
HOST B (New Host, Ubuntu 20.04 Laptop): Can successfully flash the external USB drive.

Another thing I have observed: The bootable USB drive I created seems to work only with the specific dev kit that was connected to the host PC when the image was being flashed. Is it supposed to be like this? I was expecting that I would plug this USB into any dev kit, and that dev kit would boot from the USB. Is my understanding correct?

Yes.

We don’t support fully boot on the external device.
Please refer to this Q&A to get more information.

Thanks

@DavidDDD , the Q&A you linked states that the Xavier should be able to boot from the external drive as long as it is also able to boot from its internal device (in case of AGX Xavier, the internal device is the EMMC).

However, what I observe is slightly different. I have two devkits, both of which are able to boot from internal EMMC just fine. Let’s say devkit A has username: abc, and devkit B has username def.

I created a external bootable USB image by connecting the USB, and the devkit A (in recovery mode) to my host PC. The flash process goes fine, and when I connect the USB to devkit A, it boots from USB correctly.

However, when I connect the USB to devkit B, it fails to boot from USB (devkit B boots from EMMC instead).

I then did an experiment, by flashing a new EMMC image to devkit B, and settting its username and password to the devkit A’s username and password (username: abc in this example). I then connected the USB to devkit B, and it boots from USB in devkit B as well.

Therefore, there seems to be a link between the username and password, and the USB image. How can I create an image that is independent of this?

I tried to create a new USB image ‘offline’ using the command:
sudo BOARDID=2888 BOARDSKU=0004 FAB=400 ./tools/kernel_flash/l4t_initrd_flash.sh -c tools/kernel_flash/flash_l4t_external.xml --external-device sda1 --direct sdd jetson-agx-xavier-devkit external

but it still only boots on devkit A, and not on devkit B, unless both devkits have same username and password (username: abc in this example).

Hi,

Please refer to the this method to choose which device you want to boot up.

One question to confirm,
Is your experiment devkit A devkit B using same Jetpack version?

Thanks

@DavidDDD , I appreciate you continuing to help me. The issue is not in the boot order. The USB doesn’t show up in boot devices in the Boot Maintenance Manager in devkit B.

To answer your question, yes, both devkits have same Jetpack version (Jetpack 5.1)

Do you connect the usb to devkit B when flashing a new EMMC image?
What is your command to flash a new EMMC image?
Thanks

@DavidDDD , my workflow is as follows:

  1. I connect USB to host machine (Ubuntu 20.04), and format the USB drive so that it contains a single partition of ext4 type.

  2. I go to Linux For Tegra folder, and enter the following command on terminal to flash an image to the USB:
    sudo BOARDID=2888 BOARDSKU=0004 FAB=400 ./tools/kernel_flash/l4t_initrd_flash.sh -c tools/kernel_flash/flash_l4t_external.xml --external-device sda1 --direct sdd jetson-agx-xavier-devkit external

  3. After this process completes, I remove the USB from host, and connect it to devkit A. I power on devkit A, which successfully boots from USB. I remove USB, and power on devkit A. Devkit A successfully boots from EMMC. Hence, everything works great with devkit A.

  4. I connect the USB to devkit B, and power on devkit B. Devkit B boots from EMMC. The USB does not show in devkit B’s UEFI menu, so I cannot change the boot order. (Note that the USB is working fine, as I can access the USB just fine in devkit B when devkit B boots from EMMC.

  5. I connect devkit B to host machine (nothing else is connected to host), and flash a new EMMC image using flash.sh script. (sudo ./flash.sh jetson-agx-xavier-devkit mmcblk0p1) When flashing is done, I set the username and password of new image to the username and password of devkit A.

  6. I connect USB to devkit B, and power on devkit B. Devkit B successfully boots from USB.

Update: I think I have been able to resolve this issue. I flashed a new ‘offline’ USB image, but before creating this image, I deleted everything in the Linux_for_Tegra/tools/kernel_flash/images/external folder.

The image is flashed successfully, and I was able to boot from USB in both devkits without any dependency on username or password.

It is an interesting finding.
We will test in our side to check what’s goin on.
About the username and password, are you using l4t_create_default_user.sh or the OEM config to config the setting

Thanks

1 Like

Hi @DavidDDD . Apologies for the late reply. I am not using l4t_create_default_user.sh. I configure the username and password using the menu that appears when a device is flashed using flash.sh script. (I connect the devkit to an HDMI display).

1 Like

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