Flashing a Xavier NX with initrd Jetpack 5.1.1

I have this case of use:

I need to flash a Xavier NX production module to boot from the nvme, all the components of the image, including the boot image must be located on the nvme.

But the command is not flashing at all. It’s reporting a successful flash, but it is not done.

The command that I’m using is this:

time sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c tools/kernel_flash/cai_nvme_partition_template.xml --showlogs --external-only --network usb0 p3509-0000+p3668-0001-qspi-emmc nvme0n1p1

Attached pls find the log of the flashing session.
flash_1-10_0_20230807-172725.log (9.2 KB)

What do you mean with it is not done?
The flashing log looks fine. Also, can you just use the default partition layout file, or is there any reason you have to customize it?

I meant that nothing is written on the nvme, I have tested with a wiped nvme (Zero written with dd), a brand new nvme (without being used before), and a previous written nvme (Using the SDK Manager). The results are always the same, nothing is written on the nvme.

The reason to use a custom partition layout, is because the size must reflect the real size of the nvme (I’m using 125 GB that is a little less than the real size of the 128GB), and edited the device type, beacuse on the initrd README file, is stated that on the partition layout, the device “type” needs to be “nvme”, anyway I have tested with the default partition layout with the same results.

Usually the disk storage promoted by the disk manufacturers is calculated with 1000 instead of 1024, so it’s expected you don’t really get 128GB (1024x1024x1024x128 byte) with a 128GB disk.

The README file itself kind of out-dated. You should use external as shown in the default one.

Then SDK Manager works fine?

Yes, the SDK Manager work fine, but as the carrier board that we are using is based on the development board is customized, we need to copy 2 files: .cfg and .dbt to the bootloader/t186ref/BCT/ and kernel/dtb/ directories, before flashing.

In addition we need to do all the process with an script, because we need to guarantee the very same results every time

Then what’s the real issue here?
It’s totally fine that you write a script to automate the process.

The real issue is that we need to use initrd and when we use it, the nvme is not being written.

We need to use the nvme for everything (Booting, storing apps, and data).

I mean if SDK Manager works fine, then just go for it.
It’s also available in CLI, so you can use shell scripts to automate the flashing process.
https://docs.nvidia.com/sdk-manager/sdkm-command-line-install/index.html

Well, this could work, but we do have 2 different platforms Xavier NX, and Orin NX, for the Orin, the initrd works fine, but not for the Xavier.

And we need to automatize all the flashing process, and the first thing that we do in the scripts is to identify the platform Orin or Xavier copying customization files, create platform structure and so on.

By the way, the final goal is to create a master image on a nvme, that can be cloned externally and then on the assembly line be assembled into the custom carrier board.

This reason why we need to use initrd.

Then you check the script and the README file inside /Linux_for_Tegra/tools/backup-restore/.

That is not the problem, our problem is to flashing the Xavier NX with initrd.

I think we are not on the same page now.

You said that SDK Manager was working fine, then how about manual initrd flash with the default partition layout file?
If it’s about the storage size issue, then I think this is the reason:

If this were the reason, why is not working when I use the default partition layout?

You said you were using the customized one.
What exactly did you use?

The only c ustomizations that I did on this file was:

<device type="nvme" instance="0" sector_size="512" num_sectors="250000000">

Attached please find the file
cai_nvme_partition_template.xml (9.7 KB)

Then will it succeed with the default partition layout?

Also, please use

device type=“external”

, but not

device type=“nvme”

Hi DaveYYY,

I tried this command:

time sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1 -c tools/kernel_flash/cai_nvme_partition_template.xml --showlogs --external-only --network usb0 p3509-0000+p3668-0001-qspi-emmc nvme0n1p1

With the customized partition layout modified in this way:

<device type=“external” instance=“0” sector_size=“512” num_sectors=“250000000”>

And it works perfectly, I will close the case marking this note as a solution.

Thanks a lot.

Hi,

I don’t see the contents here.
So it worked after changing device type back to external?

For some reason, the editor is not taking the line that I pasted. (I had to backslash the angle brackets)

Yes,

It work perfectly

Thank you so much.

1 Like