Xavier NX remains in recovery after successfull massflash with QSPI+external images & disk encryption

Referring to post,

the board comes to recovery after successfull flash 0955:7e19 from 0955:7035 while being flashed.

Commands ran to generate the Massflash image:

For QSPI image creation:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh -p "-c bootloader/t186ref/cfg/flash_l4t_t194_qspi_p3668.xml" --showlogs --no-flash jetson-xavier-nx-devkit-emmc internal

or 

sudo ./tools/kernel_flash/l4t_initrd_flash.sh  --showlogs --no-flash jetson-xavier-nx-devkit-qspi internal

For external image generation:

sudo ADDITIONAL_DTB_OVERLAY_OPT="BootOrderNvme.dtbo" ROOTFS_ENC=1 BOARDID=3668 FAB=301 BOARDSKU=0001 BOARDREV=E.0 ./tools/kernel_flash/l4t_initrd_flash.sh -u $ROOT_DIR/keys/key.pem -v $ROOT_DIR/keys/sd/sbk_key.txt  -p "-i ./ekb.key" --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_nvme_rootfs_enc.xml -S 40GiB --no-flash --massflash 8 --external-only --append --showlogs jetson-xavier-nx-devkit-emmc nvme0n1p1

This created a MASSFLASH image successfully, when we flashed this image to the Jetson board, the flashing is successfull and it gave no errors.

However, after flashing the board continues to be in RECOVERY Mode. 0955:7e19 and the board doesn’t boot up.

Do you know why the board doesn’t boot up after flashing ? Are we doing something wrong ?

hello adit_bhrgv,

please test without massflash, to confirm image blob has created correctly for flashing.

for disk encryption,
it’s currently NOT support to use generic passphrase, you should have unique ECID to enable disk encryption.

I tested already without massflash image, it also have the same behaviour. There is no error in image creation - both internal QSPI and external.

It has nothing to do with Disk encryption as this also has the same behaviour WITHOUT disk encryption and the boot stays in recovery mode after flashing is finished. When I don’t use --external-only flag in the command, the board can boot up successfully. But we don’t want to use --external-only flag, as we don’t want to flash emmc , but just nvme.

INFO: The board I am flashing to is a fused board so does it have anything to do with fusing while flashing appended images ?

sudo ADDITIONAL_DTB_OVERLAY_OPT="BootOrderNvme.dtbo" ROOTFS_ENC=1 BOARDID=3668 FAB=301 BOARDSKU=0001 BOARDREV=E.0 ./tools/kernel_flash/l4t_initrd_flash.sh -u $ROOT_DIR/keys/key.pem -v $ROOT_DIR/keys/sbk_key.txt -p "-i ./ekb.key -c bootloader/t186ref/cfg/flash_l4t_t194_qspi_p3668.xml" --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_nvme_rootfs_enc.xml -S 40GiB --no-flash --massflash 8 --showlogs jetson-xavier-nx-devkit-emmc nvme0n1p1

This command works fine for setting Boot order by setting it to QSPI via BootOrderNvme and also generating image for nvme. However, in flash.sh, there is a check as shown below which fails:

if [[ "${rootdev_type}" == "external" && "${disk_enc_enable}" -eq 1 ]]; then
	echo "Error: When disk encryption is enabled, root device cannot be ${target_rootdev}"
	exit 1;
fi;

If we comment this check, the massflash image works successfully.

Could you please comment if it is fine to comment this check or should we generate the massflash image only via appending QSPI and external images for NVME as the --append solution doesn’t seem to work for us ?

Thanks !

hello adit_bhrgv,

is image flash actually done? could you please also attach the complete flash messages for reference.
do you have UART connection for gathering console logs for checking the status?

let’s narrow down this with single target only.
according to your flash command-line, do you have target fused with PKC+SBK?

In which case do you want to know if flash is actually done ?

Yes, the flash happened actually in both cases:

Case 1: Jetson remains in 0955:7e19 mode, while flashing it changes to 0955:7035 and after it finished flashing, it changes back to 0955:7e19

sudo ./tools/kernel_flash/l4t_initrd_flash.sh  --showlogs --no-flash jetson-xavier-nx-devkit-qspi internal

sudo ADDITIONAL_DTB_OVERLAY_OPT="BootOrderNvme.dtbo" ROOTFS_ENC=1 BOARDID=3668 FAB=301 BOARDSKU=0001 BOARDREV=E.0 ./tools/kernel_flash/l4t_initrd_flash.sh -u $ROOT_DIR/keys/key.pem -v $ROOT_DIR/keys/sd/sbk_key.txt  -p "-i ./ekb.key" --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_nvme_rootfs_enc.xml -S 40GiB --no-flash --massflash 8 --external-only --append --showlogs jetson-xavier-nx-devkit-emmc nvme0n1p1

#from mfi folder
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --massflash 1

Case 2: Jetson successfully get flashed and boots up from NVME ; however we have to comment the check for disk encryption and root device as mentioned before.

sudo ADDITIONAL_DTB_OVERLAY_OPT="BootOrderNvme.dtbo" ROOTFS_ENC=1 BOARDID=3668 FAB=301 BOARDSKU=0001 BOARDREV=E.0 ./tools/kernel_flash/l4t_initrd_flash.sh -u $ROOT_DIR/keys/key.pem -v $ROOT_DIR/keys/sbk_key.txt -p "-i ./ekb.key -c bootloader/t186ref/cfg/flash_l4t_t194_qspi_p3668.xml" --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_nvme_rootfs_enc.xml -S 40GiB --no-flash --massflash 8 --showlogs jetson-xavier-nx-devkit-emmc nvme0n1p1


#from mfi folder
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --massflash 1
  • Do you need flashing logs for both Case 1 and Case 2 ?

  • Unfortunately, I don’t have UART connection for gathering console logs.

  • Yes, I am flashing a single target (–massflash 1) and YES, this target is fused with PKC+SBK

Hi adit_bhrgv,

We use below command to flash on fused Xavier-NX + JetPack-5.1.2, confirmed it can flash and boot up successfully.

$ sudo ADDITIONAL_DTB_OVERLAY_OPT="BootOrderNvme.dtbo" ./tools/kernel_flash/l4t_initrd_flash.sh -u rsa_priv.pem -v sbk.key --no-flash --massflash 1 --network usb0 --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_external.xml --showlogs jetson-xavier-nx-devkit-emmc nvme0n1p1
$ sudo tar xpvf mfi_jetson-xavier-nx-devkit-emmc.tar.gz 
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --massflash 1

This command which you ran also works for me.

Have you tried generating qspi image + external image with disk encryption with ( --external-only – append) as I mentioned in Case 1. commands above.

Could you please try that as well and post if it could boot jetson again?

you may see-also Topic 264454 for our steps to verify disk encryption.

Please find the flash logs

Works fine !
flash-logs-case2.txt (40.7 KB)

Jetson remains in recovery:
flash-logs-case1.txt (40.4 KB)
qspi-creation-logs-case1.txt (117.2 KB)
mfi-creation-case1.txt (183.0 KB)

hello adit_bhrgv,

please helps me to understand the difference between case-1 and case-2.
don’t you comment-out the if condition within flash.sh for case-2? it should related to disk encryption.

case1 : we generate internal QSPI image and then using --append to use with external image ( --external-only) with disk encryption.

In this case, after flashing , jetson can’t boot up successully and stays in recovery mode. I didn’t comment the check in flash.sh in this case.

Case2 : we don’t use ( --append --external-only ) flags, we directly create massflash image but use " -c bootloader/t186ref/cfg/flash_l4t_t194_qspi_p3668.xml"
within -p option as below:

-p “-i ./ekb.key -c bootloader/t186ref/cfg/flash_l4t_t194_qspi_p3668.xml

In this case, we do comment the check in flash.sh but that doesn’t stop creating massflash image and flashing it on jetson .
This works fine as expected and jetson could boot up successully with disk encryption enabled.

Hi adit_bhrgv,

For your case 1, confirmed we can flash and boot up successfully.
List our test steps for you reference:

  1. Generated eks_t194.img from source package and replace file to Linux_for_Tegra/bootloader
  2. QSPI image creation:
    $ sudo ./tools/kernel_flash/l4t_initrd_flash.sh -p "-c bootloader/t186ref/cfg/flash_l4t_t194_qspi_p3668.xml" -u rsa_priv.pem -v sbk.key --showlogs --no-flash jetson-xavier-nx-devkit-emmc internal
  3. External image generate:
    $ sudo ADDITIONAL_DTB_OVERLAY_OPT="BootOrderNvme.dtbo" ROOTFS_ENC=1 ./tools/kernel_flash/l4t_initrd_flash.sh -u rsa_priv.pem -v sbk.key -p "-i ekb.key" --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_nvme_rootfs_enc.xml --no-flash --massflash 1 --append --external-only --showlogs jetson-xavier-nx-devkit-emmc nvme0n1p1
  4. Untar MFI package to flash the target:
    $ sudo tar xpvf mfi_jetson-xavier-nx-devkit-emmc.tar.gz
    $ cd xpvf mfi_jetson-xavier-nx-devkit-emmc
    $ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --massflash 1

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