Below are the steps that I was using for flashing to NVMe drive mounted to the carrier board of Jetson Xavier NX :
Apply patches and cross-build the customized kernel :
I followed the instructions in the Developer Guide to apply my modification to official kernel and successfully built the Image, tegra194-p3668-0001-p3509-0000.dtb and nvgpu.ko for my custom carrier board.
$ cd /workspace/Platforms/Nvidia-Jetson/Software/SDK_downloads/JetPack_5.0.2_Linux_JETSON_XAVIER_NX_TARGETS/Linux_for_Tegra
$ sudo run apply_binaries.sh
Generate new system image and flash to target board :
a. eMMC :
The flashing said successful, the board rebooted and I selected to boot from NVMe but the older custom system in NVMe still persisted (with older username and password). Of course no custom driver loaded.
I then used the following convenient script : $ sudo ./nvsdkmanager_flash.sh --storage nvme0n1p1, it also finished successfully, the board rebooted and I selected to boot from NVMe (there’s no eMMC anymore, which is the difference compared to using flash.sh command) → The system was updated but with default BSP and required intial setup for Ubuntu as well.
Thanks for your prompt reply. By initrd_flash, do you mean l4t_initrd_flash.sh script ? If YES, could you narrow down which workflow for my case if possible? Also, according to the following instruction Flashing Support — Jetson Linux<br/>Developer Guide 34.1 documentation, the NVMe SSD needs to be connected to host PC, NOT target device → Is that correct?
I also found that maybe the example 2 of workflow 10 close to my case as I also want to boot from the attached NVMe SSD:
Example 2: In this example, you want to boot Jetson Xavier NX SD from an
attached NVMe SSD. The SD card does not need to be plugged in. You can also
apply this if you don’t want to use the emmc on the Jetson Xavier NX emmc.
First step: Put the device into recovery mode, then generate qspi only images
for the internal device:
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --no-flash jetson-xavier-nx-devkit-qspi internal
Note: The board name given here is not jetson-xavier-nx-devkit or
jetson-xavier-nx-devkit-emmc so that no SD card or eMMC images are generated.
Second step: Put the device into recovery mode, then generate a normal
filesystem for the external device:
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --no-flash
–external-device nvme0n1p1
-S 8GiB -c ./tools/kernel_flash/flash_l4t_nvme.xml
–external-only --append jetson-xavier-nx-devkit external
Third step: Put the device into recovery mode, then flash both images:
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only
But I am not sure how to replace jetson-xavier-nx-devkit-qspi in the first step in case of Xavier NX eMMC, maybe jetson-xavier-nx-devkit-emmc-qspi ?
It seems that with example 2 of workflow 10 above, I could boot from NVMe SSD (only storage option to boot from in UEFI) and my custom kernel drivers were also loaded. However, I wonder how to extend to the correct size of the NVMe SSD instead of 8GiB in order to have place for installing other SDK compopents :