Flash of NVMe SSD

Hi

I recently installed an NVMe SSD in to my AGX Xavier as the native boot came out with jetpack 4.6. I thought that would be the easiest way to go around the issue that Docker images often filled up the internal space.
I tryed to get it flashed using the l4t_initrd_flash.sh but not with any luck. so i went and used the jetsonhacks repo and I managed to get the boot up on the SSD but then the nvidia container did not seem to work. Now I just want to flash my NVMe SSD with a fresh jetpack installation. But It looks like it is either failing or flashing the internal eMMC memory when using the l4t_initrd_flash.sh script.

I have also just tried following:
sudo ./flash.sh jetson-agx-xavier-devkit nvme0n1p1


~/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_AGX_XAVIER_TARGETS/Linux_for_Tegra$ sudo ./flash.sh jetson-agx-xavier-devkit nvme0n1p1

. . .
. . .

[ 62.0856 ] Coldbooting the device
[ 62.0907 ] tegrarcm_v2 --ismb2
[ 64.5745 ]
[ 64.5797 ] tegradevflash_v2 --reboot coldboot
[ 64.5828 ] Bootloader version 01.00.0000
[ 65.8312 ]
*** The target t186ref has been flashed successfully. ***
Make the target filesystem available to the device and reset the board to boot from external nvme0n1p1.
----------- (output attached)

After this is still see my old image and no Ubuntu setup prompt appears.
I am pretty confused of which part of the NVMe setup i do wrong. the SDK manager is not working with the SSD as I understand it. Do anyone have a step by step to reset my SSD image? or a good hint of where to start?

flashoutput.txt (69.8 KB)

Thanks,
Troels

Hi @troels

Can you please follow these steps to flash both the eMMC and nVME?

You can also use the --erase-all so that both the eMMC and nVME get erased before the flashing actually starts.

The problem you are having may be happening because the flash script can’t actually flash the nVME, so I recommend using the initrd whenever you are going to use the SSD for something. If you want to flash only the eMMC, you can follow the normal flashing procedure, so that at least you can get into the system and format the SSD manually:

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

If you have any more questions, please ask them.

Regards,
Roberto Gutierrez,
Embedded Software Engineer,

The jetson is in recovery mode (led is on only black screen on HDMI output)
and i see Nvidia in lsusb on the hos machine.

Erase all in l4t_initrd_flash seem not to work either:

troels@BC-ThinkPad:~/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_AGX_XAVIER_TARGETS/Linux_for_Tegra$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --erase-all
/home/troels/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_AGX_XAVIER_TARGETS/Linux_for_Tegra/tools/kernel_flash/l4t_initrd_flash_internal.sh --no-flash --erase-all
/home/troels/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_AGX_XAVIER_TARGETS/Linux_for_Tegra/tools/kernel_flash/l4t_initrd_flash_internal.sh: line 43: /home/troels/nvidia/nvidia_sdk/JetPack_4.6_theLinux_JETSON_AGX_XAVIER_TARGETS/Linux_for_Tegra/–no-flash.conf: No such file or directorythe
/home/troels/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_AGX_XAVIER_TARGETS/Linux_for_Tegra/tools/kernel_flash/l4t_initrd_flash.func: line 160: /home/troels/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_AGX_XAVIER_TARGETS/Linux_for_Tegra/–no-flash.conf: No such file or directory
---- flashoutput2.txt (6.8 KB)

any clues?

Hi,

You need to specify the command as follows:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device -c [ --external-only ] [ -S APP-size ] board-name rootdev

For example in your case:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1 -c ./tools/kernel_flash/flash_l4t_nvme.xml -S 8GiB --showlogs --erase-all jetson-agx-xavier-devkit nvme0n1p1

Regards,
Roberto

1 Like

Thanks a lot roberto. I can get it to work but only when I write 8GB as the APP size. I have a 500GB WD blue SN550 and was thinking to leave 1 GB for the small partition that specifying 499. but now I have tried 256, 480, and 499 but only 8 works. How do I make a bigger partition?

Hi @troels,

The configuration file in tools/kernel_flash/flash_l4t_nvme.xml has two entries:

  1. sector_size
  2. num_sectors

You need to configure it so that the multiplication of both, give you the size of the disk you are going to use. So you probably need to increase the num_sectors variable and leave the sector_size in 512 just for consistency, then you can use that amount of bytes you assigned, and subtract that 1GiB that you are talking into the size of the partition in the -S flag, so that you use something like sector_size*num_sectors/1024^3 - 1.

Best regards,
Roberto

2 Likes

Thanks @robertogs2!

Had no idea i needed to customise the xml file and calculate in Gibibytes! Thanks again!

Best regards,
Troels