Error when flashing an NVMe ssd with initrd

Hi all. I am attempting to flash a Jetson Xavier NX (developer kit) with Jetpack 4.6.1 using initrd. Flashing to a brand new WD Black SN750 500GB NVM SSD. The SSD says it has ~474 GB of free space so I set the APP partition size to 450GB. I used the number of bytes to calculate the number of sectors (943718439) and saved it to flash_l4t_nvme.xml. But each time I encounter the error, I change the number of sectors in the XML file to whatever the actual is. But I still encounter the error.

I have followed some troubleshooting steps outlined in this thread but still can’t resolve the error: Issue with flashing an NVMe ssd with initrd

Here is the command I am using to flash:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_nvme.xml -S 450GiB  --showlogs jetson-xavier-nx-devkit nvme0n1p1

And here is the terminal log at the end where the error occurs:

[   4.1229 ] Assuming zero filled SBK key
[   4.5377 ] Copying signatures
[   4.5398 ] tegrahost_v2 --chip 0x19 0 --partitionlayout flash.xml.bin --updatesig images_list_signed.xml
[   6.8701 ] 
[   6.8732 ] tegraparser_v2 --generategpt --pt flash.xml.bin
[   6.8747 ] End sector for APP, expected at: 943718405, actual: 943718439
[   6.8750 ] 
Error: Return value 4
Command tegraparser_v2 --generategpt --pt flash.xml.bin
Error: /home/triton-ai/nvidia/nvidia_sdk/HWImage/JetPack_4.6_Linux_JETSON_XAVIER_NX_TARGETS/Linux_for_Tegra/bootloader/signed/flash.idx is not found
Error: failed to relocate images to /home/triton-ai/nvidia/nvidia_sdk/HWImage/JetPack_4.6_Linux_JETSON_XAVIER_NX_TARGETS/Linux_for_Tegra/tools/kernel_flash/images
Cleaning up..

Hi!

In order to make sure that your sector size and bytes per sector is correct, you can get them if you plug in your disk to your Jetson prior to flashing. If your progress has been like mine, you can still boot to your Jetson.

While the disk is plugged in, but before flashing, gather the following:

Sector size: cat /sys/block/nvme0n1/queue/hw_sector_size
Size: cat /sys/block/nvme0n1/size

Replace nvme0n1 if your disk is placed elsewhere. Enter these values into flash_l4t_nvme.xml you point to in your command and try again. Best of luck.

Thank you for the reply. Initrd successfully* completed this time. (*allegedly)

However, when I power-off and reboot the Xavier NX, it’s stuck at the Nvidia splash screen. No response via SSh either, but I can still boot it to recovery mode. My logs are attached, the thing that jumped out at me was in step 3, initrd is still attempting to flash to the onboard emmc or sda device, not the nvme0n1. Not sure if that is correct for the flash procedure to look for the sda and emmc before moving to the nvme device. I wonder if I need to change the boot order using C-boot or U-boot before the Xavier will boot from the nvme SSD. :/
flash_log_10_14_21 (208.1 KB)

***************************************
*                                     *
*  Step 3: Start the flashing process *
*                                     *
***************************************
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for device to expose ssh ......Run command: if [ -f /qspi/l4t_flash_from_kernel.sh ]; then USER=root /qspi/l4t_flash_from_kernel.sh --no-reboot --qspi-only ; fi on root@fe80::1%enp0s26u1u3
blockdev: cannot open /dev/sdd: No medium found
[ 0]: l4t_flash_from_kernel: Starting to create gpt for emmc
Active index file is /home/triton-ai/nvidia/nvidia_sdk/HWImage/JetPack_4.6_Linux_JETSON_XAVIER_NX_TARGETS/Linux_for_Tegra/tools/kernel_flash/images/internal/flash.idx
Number of lines is 62
max_index=61
blockdev: cannot open /dev/mmcblk0boot0: No such file or directory
Flash index file is /qspi/internal/flash.idx
Number of lines is 62
max_index=61
[ 0]: l4t_flash_from_kernel: Starting to flash to qspi
Erasing 64 Kibyte @ 0 --  0 % complete writing item=49, 6:0:primary_gpt, 512, 19968, gpt_primary_6_0.bin, 16896, fixed-<reserved>-0, 7e37780d87bfc38b1ad0f9e9d11142e871f75de0
Error: Error opening /dev/sdb: No medium found
Erasing 64 Kibyte @ 1ff0000 -- 100 % complete 
Flash index file is /qspi/internal/flash.idx
Number of lines is 62
max_index=61
Writing br_bct_BR.bct (parittion: BCT) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/br_bct_BR.bct
Writing /qspi/internal/br_bct_BR.bct (2888 bytes) into  /dev/mtd0:0
Copied 2888 bytes from /qspi/internal/br_bct_BR.bct to address 0x00000000 in flash
Writing /qspi/internal/br_bct_BR.bct (2888 bytes) into  /dev/mtd0:4096
Copied 2888 bytes from /qspi/internal/br_bct_BR.bct to address 0x00001000 in flash
Writing /qspi/internal/br_bct_BR.bct (2888 bytes) into  /dev/mtd0:32768
Copied 2888 bytes from /qspi/internal/br_bct_BR.bct to address 0x00008000 in flash
Writing mb1_t194_prod_sigheader.bin.encrypt (parittion: mb1) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/mb1_t194_prod_sigheader.bin.encrypt
Writing /qspi/internal/mb1_t194_prod_sigheader.bin.encrypt (249312 bytes) into  /dev/mtd0:131072
Copied 249312 bytes from /qspi/internal/mb1_t194_prod_sigheader.bin.encrypt to address 0x00020000 in flash
Writing mb1_t194_prod_sigheader.bin.encrypt (parittion: mb1_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/mb1_t194_prod_sigheader.bin.encrypt
Writing /qspi/internal/mb1_t194_prod_sigheader.bin.encrypt (249312 bytes) into  /dev/mtd0:393216
Copied 249312 bytes from /qspi/internal/mb1_t194_prod_sigheader.bin.encrypt to address 0x00060000 in flash
Writing mb1_cold_boot_bct_MB1_sigheader.bct.encrypt (parittion: MB1_BCT) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/mb1_cold_boot_bct_MB1_sigheader.bct.encrypt
Writing /qspi/internal/mb1_cold_boot_bct_MB1_sigheader.bct.encrypt (30400 bytes) into  /dev/mtd0:655360
Copied 30400 bytes from /qspi/internal/mb1_cold_boot_bct_MB1_sigheader.bct.encrypt to address 0x000a0000 in flash
Writing mb1_cold_boot_bct_MB1_sigheader.bct.encrypt (parittion: MB1_BCT_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/mb1_cold_boot_bct_MB1_sigheader.bct.encrypt
Writing /qspi/internal/mb1_cold_boot_bct_MB1_sigheader.bct.encrypt (30400 bytes) into  /dev/mtd0:720896
Copied 30400 bytes from /qspi/internal/mb1_cold_boot_bct_MB1_sigheader.bct.encrypt to address 0x000b0000 in flash
Writing mem_coldboot_sigheader.bct.encrypt (parittion: MEM_BCT) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/mem_coldboot_sigheader.bct.encrypt
Writing /qspi/internal/mem_coldboot_sigheader.bct.encrypt (198656 bytes) into  /dev/mtd0:786432
Copied 198656 bytes from /qspi/internal/mem_coldboot_sigheader.bct.encrypt to address 0x000c0000 in flash
Writing mem_coldboot_sigheader.bct.encrypt (parittion: MEM_BCT_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/mem_coldboot_sigheader.bct.encrypt
Writing /qspi/internal/mem_coldboot_sigheader.bct.encrypt (198656 bytes) into  /dev/mtd0:1048576
Copied 198656 bytes from /qspi/internal/mem_coldboot_sigheader.bct.encrypt to address 0x00100000 in flash
Writing spe_t194_sigheader.bin.encrypt (parittion: spe-fw) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/spe_t194_sigheader.bin.encrypt
Writing /qspi/internal/spe_t194_sigheader.bin.encrypt (94960 bytes) into  /dev/mtd0:1310720
Copied 94960 bytes from /qspi/internal/spe_t194_sigheader.bin.encrypt to address 0x00140000 in flash
Writing spe_t194_sigheader.bin.encrypt (parittion: spe-fw_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/spe_t194_sigheader.bin.encrypt
Writing /qspi/internal/spe_t194_sigheader.bin.encrypt (94960 bytes) into  /dev/mtd0:1572864
Copied 94960 bytes from /qspi/internal/spe_t194_sigheader.bin.encrypt to address 0x00180000 in flash
Writing nvtboot_t194_sigheader.bin.encrypt (parittion: mb2) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/nvtboot_t194_sigheader.bin.encrypt
Writing /qspi/internal/nvtboot_t194_sigheader.bin.encrypt (181232 bytes) into  /dev/mtd0:1835008
Copied 181232 bytes from /qspi/internal/nvtboot_t194_sigheader.bin.encrypt to address 0x001c0000 in flash
Writing nvtboot_t194_sigheader.bin.encrypt (parittion: mb2_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/nvtboot_t194_sigheader.bin.encrypt
Writing /qspi/internal/nvtboot_t194_sigheader.bin.encrypt (181232 bytes) into  /dev/mtd0:2097152
Copied 181232 bytes from /qspi/internal/nvtboot_t194_sigheader.bin.encrypt to address 0x00200000 in flash
Writing preboot_c10_prod_cr_sigheader.bin.encrypt (parittion: mts-preboot) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/preboot_c10_prod_cr_sigheader.bin.encrypt
Writing /qspi/internal/preboot_c10_prod_cr_sigheader.bin.encrypt (24016 bytes) into  /dev/mtd0:2359296
Copied 24016 bytes from /qspi/internal/preboot_c10_prod_cr_sigheader.bin.encrypt to address 0x00240000 in flash
Writing preboot_c10_prod_cr_sigheader.bin.encrypt (parittion: mts-preboot_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/preboot_c10_prod_cr_sigheader.bin.encrypt
Writing /qspi/internal/preboot_c10_prod_cr_sigheader.bin.encrypt (24016 bytes) into  /dev/mtd0:2424832
Copied 24016 bytes from /qspi/internal/preboot_c10_prod_cr_sigheader.bin.encrypt to address 0x00250000 in flash
Writing mce_c10_prod_cr_sigheader.bin.encrypt (parittion: mts-mce) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/mce_c10_prod_cr_sigheader.bin.encrypt
Writing /qspi/internal/mce_c10_prod_cr_sigheader.bin.encrypt (143200 bytes) into  /dev/mtd0:2490368
Copied 143200 bytes from /qspi/internal/mce_c10_prod_cr_sigheader.bin.encrypt to address 0x00260000 in flash
Writing mce_c10_prod_cr_sigheader.bin.encrypt (parittion: mts-mce_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/mce_c10_prod_cr_sigheader.bin.encrypt
Writing /qspi/internal/mce_c10_prod_cr_sigheader.bin.encrypt (143200 bytes) into  /dev/mtd0:2686976
Copied 143200 bytes from /qspi/internal/mce_c10_prod_cr_sigheader.bin.encrypt to address 0x00290000 in flash
Writing mts_c10_prod_cr_sigheader.bin.encrypt (parittion: mts-proper) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/mts_c10_prod_cr_sigheader.bin.encrypt
Writing /qspi/internal/mts_c10_prod_cr_sigheader.bin.encrypt (3430416 bytes) into  /dev/mtd0:2883584
Copied 3430416 bytes from /qspi/internal/mts_c10_prod_cr_sigheader.bin.encrypt to address 0x002c0000 in flash
Writing mts_c10_prod_cr_sigheader.bin.encrypt (parittion: mts-proper_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/mts_c10_prod_cr_sigheader.bin.encrypt
Writing /qspi/internal/mts_c10_prod_cr_sigheader.bin.encrypt (3430416 bytes) into  /dev/mtd0:7077888
Copied 3430416 bytes from /qspi/internal/mts_c10_prod_cr_sigheader.bin.encrypt to address 0x006c0000 in flash
Writing warmboot_t194_prod_sigheader.bin.encrypt (parittion: sc7) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/warmboot_t194_prod_sigheader.bin.encrypt
Writing /qspi/internal/warmboot_t194_prod_sigheader.bin.encrypt (65504 bytes) into  /dev/mtd0:11272192
Copied 65504 bytes from /qspi/internal/warmboot_t194_prod_sigheader.bin.encrypt to address 0x00ac0000 in flash
Writing warmboot_t194_prod_sigheader.bin.encrypt (parittion: sc7_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/warmboot_t194_prod_sigheader.bin.encrypt
Writing /qspi/internal/warmboot_t194_prod_sigheader.bin.encrypt (65504 bytes) into  /dev/mtd0:11403264
Copied 65504 bytes from /qspi/internal/warmboot_t194_prod_sigheader.bin.encrypt to address 0x00ae0000 in flash
Writing slot_metadata.bin (parittion: SMD) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/slot_metadata.bin
Writing /qspi/internal/slot_metadata.bin (191 bytes) into  /dev/mtd0:11534336
Copied 191 bytes from /qspi/internal/slot_metadata.bin to address 0x00b00000 in flash
Writing slot_metadata.bin (parittion: SMD_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/slot_metadata.bin
Writing /qspi/internal/slot_metadata.bin (191 bytes) into  /dev/mtd0:11599872
Copied 191 bytes from /qspi/internal/slot_metadata.bin to address 0x00b10000 in flash
Writing xusb_sil_rel_fw_sigheader.encrypt (parittion: xusb-fw) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/xusb_sil_rel_fw_sigheader.encrypt
Writing /qspi/internal/xusb_sil_rel_fw_sigheader.encrypt (133120 bytes) into  /dev/mtd0:11665408
Copied 133120 bytes from /qspi/internal/xusb_sil_rel_fw_sigheader.encrypt to address 0x00b20000 in flash
Writing xusb_sil_rel_fw_sigheader.encrypt (parittion: xusb-fw_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/xusb_sil_rel_fw_sigheader.encrypt
Writing /qspi/internal/xusb_sil_rel_fw_sigheader.encrypt (133120 bytes) into  /dev/mtd0:11862016
Copied 133120 bytes from /qspi/internal/xusb_sil_rel_fw_sigheader.encrypt to address 0x00b50000 in flash
Writing cboot_t194_sigheader.bin.encrypt (parittion: cpu-bootloader) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/cboot_t194_sigheader.bin.encrypt
Writing /qspi/internal/cboot_t194_sigheader.bin.encrypt (469840 bytes) into  /dev/mtd0:12058624
Copied 469840 bytes from /qspi/internal/cboot_t194_sigheader.bin.encrypt to address 0x00b80000 in flash
Writing cboot_t194_sigheader.bin.encrypt (parittion: cpu-bootloader_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/cboot_t194_sigheader.bin.encrypt
Writing /qspi/internal/cboot_t194_sigheader.bin.encrypt (469840 bytes) into  /dev/mtd0:13500416
Copied 469840 bytes from /qspi/internal/cboot_t194_sigheader.bin.encrypt to address 0x00ce0000 in flash
Writing tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt (parittion: bootloader-dtb) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt
Writing /qspi/internal/tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt (208736 bytes) into  /dev/mtd0:14942208
Copied 208736 bytes from /qspi/internal/tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt to address 0x00e40000 in flash
Writing tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt (parittion: bootloader-dtb_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt
Writing /qspi/internal/tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt (208736 bytes) into  /dev/mtd0:15400960
Copied 208736 bytes from /qspi/internal/tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt to address 0x00eb0000 in flash
Writing bmp.blob (parittion: BMP) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/bmp.blob
Writing /qspi/internal/bmp.blob (149554 bytes) into  /dev/mtd0:15859712
Copied 149554 bytes from /qspi/internal/bmp.blob to address 0x00f20000 in flash
Writing bmp.blob (parittion: BMP_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/bmp.blob
Writing /qspi/internal/bmp.blob (149554 bytes) into  /dev/mtd0:16056320
Copied 149554 bytes from /qspi/internal/bmp.blob to address 0x00f50000 in flash
Writing tos-trusty_t194_sigheader.img.encrypt (parittion: secure-os) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/tos-trusty_t194_sigheader.img.encrypt
Writing /qspi/internal/tos-trusty_t194_sigheader.img.encrypt (410560 bytes) into  /dev/mtd0:16252928
Copied 410560 bytes from /qspi/internal/tos-trusty_t194_sigheader.img.encrypt to address 0x00f80000 in flash
Writing tos-trusty_t194_sigheader.img.encrypt (parittion: secure-os_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/tos-trusty_t194_sigheader.img.encrypt
Writing /qspi/internal/tos-trusty_t194_sigheader.img.encrypt (410560 bytes) into  /dev/mtd0:18874368
Copied 410560 bytes from /qspi/internal/tos-trusty_t194_sigheader.img.encrypt to address 0x01200000 in flash
Writing eks_sigheader.img.encrypt (parittion: eks) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/eks_sigheader.img.encrypt
Writing /qspi/internal/eks_sigheader.img.encrypt (5136 bytes) into  /dev/mtd0:21495808
Copied 5136 bytes from /qspi/internal/eks_sigheader.img.encrypt to address 0x01480000 in flash
Writing eks_sigheader.img.encrypt (parittion: eks_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/eks_sigheader.img.encrypt
Writing /qspi/internal/eks_sigheader.img.encrypt (5136 bytes) into  /dev/mtd0:21561344
Copied 5136 bytes from /qspi/internal/eks_sigheader.img.encrypt to address 0x01490000 in flash
Writing adsp-fw_sigheader.bin.encrypt (parittion: adsp-fw) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/adsp-fw_sigheader.bin.encrypt
Writing /qspi/internal/adsp-fw_sigheader.bin.encrypt (81312 bytes) into  /dev/mtd0:21626880
Copied 81312 bytes from /qspi/internal/adsp-fw_sigheader.bin.encrypt to address 0x014a0000 in flash
Writing adsp-fw_sigheader.bin.encrypt (parittion: adsp-fw_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/adsp-fw_sigheader.bin.encrypt
Writing /qspi/internal/adsp-fw_sigheader.bin.encrypt (81312 bytes) into  /dev/mtd0:22675456
Copied 81312 bytes from /qspi/internal/adsp-fw_sigheader.bin.encrypt to address 0x015a0000 in flash
Writing camera-rtcpu-rce_sigheader.img.encrypt (parittion: rce-fw) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/camera-rtcpu-rce_sigheader.img.encrypt
Writing /qspi/internal/camera-rtcpu-rce_sigheader.img.encrypt (272752 bytes) into  /dev/mtd0:23724032
Copied 272752 bytes from /qspi/internal/camera-rtcpu-rce_sigheader.img.encrypt to address 0x016a0000 in flash
Writing camera-rtcpu-rce_sigheader.img.encrypt (parittion: rce-fw_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/camera-rtcpu-rce_sigheader.img.encrypt
Writing /qspi/internal/camera-rtcpu-rce_sigheader.img.encrypt (272752 bytes) into  /dev/mtd0:24772608
Copied 272752 bytes from /qspi/internal/camera-rtcpu-rce_sigheader.img.encrypt to address 0x017a0000 in flash
[ 162]: l4t_flash_from_kernel: Warning: skip writing sce-fw partition as no image is specified
[ 162]: l4t_flash_from_kernel: Warning: skip writing sce-fw_b partition as no image is specified
Writing bpmp_t194_sigheader.bin.encrypt (parittion: bpmp-fw) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/bpmp_t194_sigheader.bin.encrypt
Writing /qspi/internal/bpmp_t194_sigheader.bin.encrypt (856352 bytes) into  /dev/mtd0:27918336
Copied 856352 bytes from /qspi/internal/bpmp_t194_sigheader.bin.encrypt to address 0x01aa0000 in flash
Writing bpmp_t194_sigheader.bin.encrypt (parittion: bpmp-fw_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/bpmp_t194_sigheader.bin.encrypt
Writing /qspi/internal/bpmp_t194_sigheader.bin.encrypt (856352 bytes) into  /dev/mtd0:29491200
Copied 856352 bytes from /qspi/internal/bpmp_t194_sigheader.bin.encrypt to address 0x01c20000 in flash
Writing tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt (parittion: bpmp-fw-dtb) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt
Writing /qspi/internal/tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt (199808 bytes) into  /dev/mtd0:31064064
Copied 199808 bytes from /qspi/internal/tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt to address 0x01da0000 in flash
Writing tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt (parittion: bpmp-fw-dtb_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt
Writing /qspi/internal/tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt (199808 bytes) into  /dev/mtd0:32112640
Copied 199808 bytes from /qspi/internal/tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt to address 0x01ea0000 in flash
[ 169]: l4t_flash_from_kernel: Warning: skip writing CPUBL-CFG partition as no image is specified
[ 169]: l4t_flash_from_kernel: Warning: skip writing CPUBL-CFG_b partition as no image is specified
Writing qspi_bootblob_ver.txt (parittion: VER) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/qspi_bootblob_ver.txt
Writing /qspi/internal/qspi_bootblob_ver.txt (101 bytes) into  /dev/mtd0:33292288
Copied 101 bytes from /qspi/internal/qspi_bootblob_ver.txt to address 0x01fc0000 in flash
Writing qspi_bootblob_ver.txt (parittion: VER_b) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/qspi_bootblob_ver.txt
Writing /qspi/internal/qspi_bootblob_ver.txt (101 bytes) into  /dev/mtd0:33357824
Copied 101 bytes from /qspi/internal/qspi_bootblob_ver.txt to address 0x01fd0000 in flash
Writing gpt_secondary_3_0.bin (parittion: secondary_gpt) into /dev/mtd0
Sha1 checksum matched for /qspi/internal/gpt_secondary_3_0.bin
Writing /qspi/internal/gpt_secondary_3_0.bin (16896 bytes) into  /dev/mtd0:33537536
Copied 16896 bytes from /qspi/internal/gpt_secondary_3_0.bin to address 0x01ffbe00 in flash
Reach the end of the SPI device
[ 169]: l4t_flash_from_kernel: Successfully flash the qspi
[ 169]: l4t_flash_from_kernel: Flashing success
Cleaning up...

So I’ve found I need to flash the Jetson Xavier NX twice in order for it to boot from the SSD. The first flash command I use is:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_nvme.xml -S 440GiB  --showlogs jetson-xavier-nx-devkit nvme0n1p1

It flashes the qspi which I assume is the QSPI-NOR on the module?

Flashing it the first time only gets the splash screen to load. I have to flash it a second time using an extra script flag:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-only --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_nvme.xml -S 450GiB  --showlogs jetson-xavier-nx-devkit nvme0n1p1

The second flash actually flashes the SSD with the APP partition. Then the device boots properly. I am confused why initrd will not flash the APP partition on the first flash command, but will for the second only with the --external-only flag. I was advised to look at the nsdkmanager_flash.sh script to make sense of it all, but can’t find where the sdk manager stores it.

I found that what our students are using is the jetsonhacks method which looks to emulate flashing to the onboard emmc but changes the storage argument to the nvme ssd and runs the nvsdkflashmanager settings for initrd as if it were a production kit.
My question is what are those initrd settings for flashing the production kit?