Flash to SD card using Jetpack

Hello there

I have a customized Xavier NX board, and there is only a 128GB SD card inside according to ‘gnome-disks’. And since the board is not able to open, I cannot remove the SD card inside.
image

I need to flash the system to the SD card using Jetpack. However, every time I chose EMMC/SD, it creates a 15GB partition and flashes the system to it, instead of the whole 128GB.

I notice that there is an option, custom, but I am not sure what I should type.
I tried to use flash.sh instead. I modified <device type="sdcard" instance="0" sector_size="512" num_sectors="209715200"> in file “flash_l4t_t194_spi_sd_p3668.xml”, and I tried to run

sudo ./flash.sh -S 103809024KiB jetson-xavier-nx-devkit mmcblk0p1

However, I still encountered the following error:

[  16.9282 ] Erasing sdcard: 0 ......... 0000000074740311: E> NV3P_SERVER: Failed to open instance 0 of device 6.
[  16.9318 ] 
[  16.9319 ] [Failed]
[  16.9319 ] 
Error: Return value 17
Command tegradevflash_v2 --pt flash.xml.bin --create
Failed flashing t186ref.

The full log is here
log.txt (60.0 KB)

I strongly appreciate any help in advance!

Hi,

I think you wanted to set the size of the whole SD card to 100GB, and the size of the rootfs to 99GB. Then apparently you should use either 101376KiB or 99GiB, but not 103809024KiB. Also, such operation leaves only 1GB for other partitions on the disk, and I’m not sure if it’s enough. You may also try like 97 or maybe 95.

If that still does not work, please give r35 a try.

Hi,
Thank you for your reply.

I changed
<device type="sdcard" instance="0" sector_size="512" num_sectors="209715200">
to
<device type="sdcard" instance="0" sector_size="512" num_sectors="244277248">

Then I tried with sudo ./flash.sh -S 100GiB jetson-xavier-nx-devkit mmcblk0p1. But I got the same error.

Then I tried with the latest r35, with <device type="sdcard" instance="0" sector_size="512" num_sectors="244277248"> and sudo ./flash.sh -S 100GiB jetson-xavier-nx-devkit mmcblk0p1. But I encountered a endless loop

[ 1758.5407 ] tegrarcm_v2 --isapplet
[ 2766.4491 ] tegrarcm_v2 --ismb2
[ 3782.2580 ] tegradevflash_v2 --iscpubl
[ 3782.2595 ] CPU Bootloader is not running on device.

Full log is here:
cpu_error.txt (57.9 KB)

Hi,

I’m kind of not sure about r32, but r35 should by default use all the space of the storage device.
Can you leave the partition layout file unchanged, take out the -s option and try again?

Hi.

I changed
<device type="sdcard" instance="0" sector_size="512" num_sectors="244277248">
back to default
<device type="sdcard" instance="0" sector_size="512" num_sectors="123731968">

And run ./flash.sh jetson-xavier-nx-devkit mmcblk0p1
But I encountered the same endless loop:

...
[   6.8381 ] [................................................] 100%
[   7.7595 ] tegrarcm_v2 --boot recovery
[   7.7613 ] Applet version 01.00.0000
[   9.1025 ] tegrarcm_v2 --isapplet
[ 1010.1889 ] tegrarcm_v2 --ismb2
[ 2026.0236 ] tegradevflash_v2 --iscpubl
[ 2026.0245 ] CPU Bootloader is not running on device.
[ 3042.8061 ] tegrarcm_v2 --isapplet
...

Full log file is here
loop.txt (50.9 KB)

I can successfullly flash my xaiver via GUI, but it always flashes it to 15GB in rootfs.

Hi,

can you make a summary of what you encountered here?
Under what circumstances do you succeed in flashing the device, but end up getting only 15GB for rootfs? Because it looks like you fail to flash it even with the default setting.

This is what I get on my Xavier NX:

nvidia@tegra-ubuntu:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p1  117G  5.5G  107G   5% /
none            3.4G     0  3.4G   0% /dev
tmpfs           3.4G   36K  3.4G   1% /dev/shm
tmpfs           686M   11M  675M   2% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.4G     0  3.4G   0% /sys/fs/cgroup
tmpfs           686M   44K  686M   1% /run/user/1000
nvidia@tegra-ubuntu:~$ sudo dmesg | grep dts
[    0.007795] DTS File Name: /dvs/git/dirty/git-master_linux/kernel/kernel-5.10/arch/arm64/boot/dts/../../../../../../hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-0000-p3509-0000.dts

I can successfully flash my Xavier NX using GUI Jetpack, but it always flashes it to a 15G rootfs.

No matter what commands I used with flash.sh, it never succeeds.

Commands: sudo ./flash.sh -S 100GiB jetson-xavier-nx-devkit mmcblk0p1 and sudo ./flash.sh jetson-xavier-nx-devkit mmcblk0p1
Error: endless loop:

[ 1758.5407 ] tegrarcm_v2 --isapplet
[ 2766.4491 ] tegrarcm_v2 --ismb2
[ 3782.2580 ] tegradevflash_v2 --iscpubl
[ 3782.2595 ] CPU Bootloader is not running on device.

Did you mean SDK Manager here?

Yes, GUI Jetpack is SDK Manager here. But I always use R35.

Hi,

then can you help to collect both flashing log and serial console log when you fail to flash it with flash.sh? I need them in full length, not the cropped version.
Put aside the issue of the size of rootfs, SDK Manager is just a front-end GUI tool of the underlying flashing scripts, and it sounds weird that they act differently.

Hi,
Here are the log files for

SDK Manager:
sdk_manager_log.zip (113.4 KB)
o

flash.sh:
command_line.txt (51.0 KB)

Hi,

from the flashing log with SDK Manager, your device is jetson-xavier-nx-devkit-emmc, but not jetson-xavier-nx-devkit, can you please confirm it?
Also, can you please attach the UART log during bootup, and also result of df -h after you get into the system.

Hi,

Yes, you are right, it is jetson-xavier-nx-devkit-emmc , not jetson-xavier-nx-devkit. Sorry for my mistake. I can successfully flash the board using command: sudo ./flash.sh jetson-xavier-nx-devkit-emmc mmcblk0p1. But the rootfs is still only 15GiB. Full log is here:
emmc_default.txt (68.2 KB)

Here is the log file during bootup, I hope this is what you asked:
kern.log (294.9 KB)

And the output from df -h:

erfan@erfan-desktop:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p1   14G  5.4G  7.7G  42% /
none            3.4G     0  3.4G   0% /dev
tmpfs           3.4G   36K  3.4G   1% /dev/shm
tmpfs           685M   11M  675M   2% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.4G     0  3.4G   0% /sys/fs/cgroup
tmpfs           685M   36K  685M   1% /run/user/1000

I tried to use command :sudo ./flash.sh -S 100GiB jetson-xavier-nx-devkit-emmc mmcblk0p1. But it failed. Here is the full log.
emmc_100GB.txt (30.8 KB)

Hi,

if you are using the eMMC version of Xavier NX, then it’s capacity is indeed only 16GB.
I’m not sure why it’s shown to have 128GB in the picture.

It’s because there is a sd card inside, I can see it but cannot remove it. Since it is a customized board, the manufacturer probably removed the emmc.

Hi,

then please contact the vendor for help.
We won’t be able to test it if we do not have the board at our disposal.

I will. But is there any way to expand the rootfs by modifying the flash_l4t_t194_spi_emmc_p3668.xml?

I don’t think so. The size of the rootfs partition is determined dynamically in runtime.

I see, thank you very much.

I think there is probably a mistake here… we don’t sell and not allow a vendor to “remove emmc” on a module because customize a module is not allowed…

Please be aware that vendor only makes their carrier board. They still get module from us. And our module will only have emmc on it if this is production module.

I guess what actually happened before was your vendor use software to enable a sdcard “on the carrier board”. And they disabled the emmc by the software (not physically removed from hardware).

That was what happened in the beginning.

You thought it was a sdcard module by this behavior so you tried to use jetson-xavier-nx-devkit to flash your board and lots of tricks which try to flash a sdcard.

But actually this thing is totally a emmc module at all. So jetson-xavier-nx-devkit won’t be able to flash it because “jetson-xavier-nx-devkit” is only for sdcard module and such module will have sdcard “on the module” but not “on the carrier board”.

There are two kinds of modules we sold here. One kind is sdcard module, which will be coming along with a devkit carrier board and won’t have emmc.
And another one is emmc module which won’t have sdcard slot. This kind is the one vendor got to make their own product.