Jetson Board parameters

Hi,

I would like to know effect of Jetson board parameters:

  1. Lets say, I create a massflash image with BOARDID=3668 FAB=301 BOARDSKU=0001 BOARDREV=E.0 and flash this image on another board let’s say BOARDID=3668 FAB=100 BOARDSKU=0001 BOARDREV=C.0 , the massflash image is successfully flashed on the another board and there are no issues. (& vice versa)

If this is the case, then why are these parameters different ? Do they affect anything or can I use it interchangeably ?

Thanks

  1. I created an image which consists of internal qspi image & external image together(Secureboot+Disk encryption together) for setting up the boot-order NVME as highest priority using below commands :
#internal image creation
sudo ./tools/kernel_flash/l4t_initrd_flash.sh  -u $ROOT_DIR/keys/sd/jetson.pem -v $ROOT_DIR/keys/sbk_key.txt -p "-c bootloader/t186ref/cfg/flash_l4t_t194_qspi_p3668.xml" --showlogs --no-flash jetson-xavier-nx-devkit-emmc internal
#external image creation
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/jetson.pem -v $ROOT_DIR/keys/sbk_key.txt -p "-i ./ekb.key" --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_nvme_rootfs_enc.xml -S 40GiB --no-flash --append --external-only --direct nvme0n1 --showlogs jetson-xavier-nx-devkit-emmc nvme0n1p1

I intend to create a bootable-USB Image from current rootfs, where I copy the above generated external image:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --direct $loop_device_path_name --external-device sda1 -c ./tools/kernel_flash/flash_l4t_external.xml -S 40GiB jetson-xavier-nx-devkit-emmc external

Once, I plug-in the bootable-USB to the jetson, the external image created above, is flashed via systemd service to the NVME directly by running below commands:

pushd /Linux_for_Tegra

echo "Flash the NVMe SSD... "
# Run the specified command
sudo  ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_nvme_rootfs_enc.xml --external-only -S 40GiB --direct nvme0n1 --showlogs jetson-xavier-nx-devkit-emmc external

echo "NVMe has been successfully flashed."

popd

But , when I reboot the jetson and try to boot the jetson up, the default boot order is still EMMC and not NVME which I expected to be as I created the image above giving ADDITIONAL_DTB_OVERLAY_OPT=“BootOrderNvme.dtbo” as env argument. This does not work after bootable-USB is used to update the NVME. Maybe, this way it is not writing the QSPI with the boot-order ?

Because when I create a normal massflash image with the same argument ADDITIONAL_DTB_OVERLAY_OPT=“BootOrderNvme.dtbo” and flash the jetson (having default boot-order as EMMC), after flashing the image, the boot-priority is changed to NVME as first priority.

Could you please help me in telling me why the same boot-order is not changed when I update the NVME via bootable-USB ? But, it does get changed when I update the NVME via Massflash image ?

Isn’t the QSPI not getting overwritten when updating NVME via bootable-USB ?

Thanks for your support in advance.

Hi adit_bhrgv,

Are you using the devkit or custom board for Xavier NX?
What’s your Jetpack version in use?

FAB and BOARDREV could be used to identify the minor difference between the same ID/SKU modules.
You can check the board config to know if any configuration may depend on FAB/BOARDREV.
In your case, it seems fine to use the one massflash package for the modules with different FAB/BOARDREV.
But we would suggest using the matched BOARDID/BOARDSKU/FAB/BOARDREV to generate the package for your module.

For the default boot-order, please refer to Customizing the Default Boot Order in L4TConfiguration.dtbo in the BSP Directory.

Sorry that I’m clear about how you implement this.
Do you mean that you created a service in bootable-USB and boot from it and this service will run the script you shared to flash the NVMe? Do you use x86 Ubuntu host to flash the board? Or you use another Jetson as host to flash the board?

Yes, I created a systemd service which flashes the NVMe on jetson when the bootable-USB is connected to the jetson.

It uses the “Linux_for_ Tegra” folder which I kept it inside the rootfs of the bootable-USB. This folder contains the external image, aarch64 nvsimg2img tool used to flash the NVME on jetson from jetson itself. So, I don’t need to connect the jetson to a host x86 PC.

When the systemd service is finished updating/flashing the NVME, I reboot the jetson, disconnect the bootable-USB and try to boot from NVME, but I see the default boot priority as <EMMC, NVME> instead of <NVME,EMMC> which should have been changed, as I used ADDITIONAL_DTB_OVERLAY_OPT=“BootOrderNvme.dtbo” while creating the external image present in “Linux_for_Tegra” folder(on bootable-USB rootfs) which is flashed on the NVME.

Didn’t the QSPI gets overwritten in this case which stores the boot-order ?

I hope I am more clear now about this implementation.

I am using custom board for Xavier NX. and Jetpack 5.1.2 or BSP 35.4.1

It seems your approach only flash the image to external NVMe rather than internal QSPI.
Is there any flash log saved to do further check? You can check if it flashes the internal QSPI in your approach.

We have not verified this use case since we always flash the board from x86 host PC.
It seems your customization to use USB to flash the Jetson.
For the boot-order issue, please check if configuring it in L4TConfiguration.dtbo helps in your case.

I think the flash command might need to change by including QSPI flash as well:

Changing this command from :

sudo  ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_nvme_rootfs_enc.xml --external-only -S 40GiB --direct nvme0n1 --showlogs jetson-xavier-nx-devkit-emmc external

to

sudo  ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --external-device nvme0n1p1  -p "-c bootloader/t186ref/cfg/flash_l4t_t194_qspi_p3668.xml" -c ./tools/kernel_flash/flash_l4t_nvme_rootfs_enc.xml -S 40GiB --direct nvme0n1 --showlogs jetson-xavier-nx-devkit-emmc external

I will try this today and post the result here.

I changed the above command but it doesn’t tend to flash the QSPI, it just flashes the external device i.e NVME. Atleast from the logs, it doesn’t suggest that it is flashing the QSPI.
Could it be that I also need to flash qspi using --qspi-only flag ? Since, I also have --direct flag in the flash command, probably it is just flashing NVME .

When we are flashing the board from the host, we will perform the following 3 steps.

  1. Prepare image for internal QSPI with --no-flash option
  2. Prepare image for external NVMe with --no-flash option
  3. flash them with --flash-only option

I would suggest you checking the flash log for details.

Hi, I checked the logs from flashing massflash image where it does flash the QSPI and change the boot-order accordingly:

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%usb0

But this is not called automatically, when I run the below command to flash the nvme connected to jetson using --direct option :

sudo  ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_nvme_rootfs_enc.xml  -S 40GiB --direct nvme0n1 --showlogs jetson-xavier-nx-devkit-emmc external

I tried to call manually on jetson itself from the Linux_for_Tegra I copied to bootable-usb, but then I got errors from file “Linux_for_Tegra/tools/kernel_flash/l4t_flash_from_kernel.sh”:

sudo ./tools/kernel_flash/l4t_flash_from_kernel.sh --no-reboot --qspi-only
blockdev: cannot open /dev/mmcblk0boot0: No such file or directory
Flash index file is /Linux_for_Tegra/tools/kernel_flash/internal/flash.idx
Number of lines is 42
max_index=41

[ 0]: l4t_flash_from_kernel: Starting to flash to qspi

Flash index file is /Linux_for_Tegra/tools/kernel_flash/internal/flash.idx
Number of lines is 42
max_index=41

inside erase_spi... /dev/mtd0
mtd_debug: error!: open()
QSPI storage size:  bytes.
mtd_debug: error!: open()
[ 0]: l4t_flash_from_kernel: Error flashing qspi

I guess this is because /dev/mtd0 is not available on jetson but only for host x86 pc.
Could you please suggest me if I can modify the flash_qspi( ) in “Linux_for_Tegra/tools/kernel_flash/l4t_flash_from_kernel.sh” to flash the QSPI from the jetson itself. (not x86 PC)

As I mentioned earlier, below steps I used to create the internal+external image, then create a bootable-USB and boot the jetson from this bootable USB :

#internal image creation
sudo ./tools/kernel_flash/l4t_initrd_flash.sh  -u $ROOT_DIR/keys/sd/jetson.pem -v $ROOT_DIR/keys/sbk_key.txt -p "-c bootloader/t186ref/cfg/flash_l4t_t194_qspi_p3668.xml" --showlogs --no-flash jetson-xavier-nx-devkit-emmc internal
#external image creation
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/jetson.pem -v $ROOT_DIR/keys/sbk_key.txt -p "-i ./ekb.key" --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_nvme_rootfs_enc.xml -S 40GiB --no-flash --append --external-only --direct nvme0n1 --showlogs jetson-xavier-nx-devkit-emmc nvme0n1p1

Flash QSPI without host device - Referring to this post, is it true that QSPI flashing setting the boot-order requires a host X86 PC ? That means, I cannot flash the QSPI from jetson itself ? Could you please confirm this ?

Thanks

Sorry that I can not suggest you since we don’t verify this use case before.

Bootloader and some partitions are stored in QSPI including the boot-device, boot-order.
As my understaning, we always use the x86 host PC to flash the board.
It would also not work with using another Jetson device as host to flash the current Jetson.

It is because /dev/mtd0 can only be accessed within an initrd environment; this node is blocked when the device boots into Linux kernel normally.

You cannot flash a Jetson device with a Jetson device. It’s never supported.

On Jetson itself, in rootfs(booted from USB-Stick), I copy a Linux_for_Tegra folder which contains all the necessary stuff for flashing. From this folder, I ran the below command to flash the internal NVME (using --direct nvme0n1) on the jetson. I could update the software on the NVME after this step.

pushd /Linux_for_Tegra

echo "Flash the NVMe SSD... "
# Run the specified command
sudo  ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_nvme_rootfs_enc.xml --external-only -S 40GiB --direct nvme0n1 --showlogs jetson-xavier-nx-devkit-emmc external

echo "NVMe has been successfully flashed."

popd

But running this command, doesn’t update the boot-order on the jetson as the QSPI is not over-written by ADDITIONAL_DTB_OVERLAY_OPT=“BootOrderNvme.dtbo” argument which I used to create the image. Can I not somehow update the QSPI from jetson itself like I updated the NVME from jetson ?

Idea is to boot the jetson from NVME as the first boot priority after the software is updated via USB-Stick.

You can just change the booting priority in UEFI menu.

Or refer to the following thread to use efibootmgr tool to configure the boot order after boot up.
Boot order change after restore from orin A to orin B - #3 by KevinFFF