Change the NX's eMMC storage size from 16GB to 128GB

hello!

16GB is really too small. I installed the JP5.1.2 system.
An error occurred while installing the development software using SDKmanage. From the logs, I can determine that it was due to the 16GB storage being too small and there was not enough space to install the software.
Even though I cleaned the cache files and used the commands “sudo apt-get clean” and “sudo apt-get autoclean” to clear the package cache, I still don’t have enough space to install software. I even install only one software at a time, and I clean the cache before each installation. But it still doesn’t work.
So, I can only purchase an eMMC storage chip of the same model but with larger capacity, and install it on the NX.
After reflashing the NX, I found that although the NX can recognize and use the 128GB storage chip, the system partition is still only 16GB.

Then I changed the value of the ‘num_sectors’ field of ‘sdmmc_user’ in the ‘flash_l4t_t194_spi_emmc_p3668.xml’ and ‘flash_l4t_t194_spi_emmc_p3668_rootfs_ab.xml’ files to 251658240, and the APPSIZE field to 53687091200 (50 GiB)

flash_l4t_t194_spi_emmc_p3668.xml.txt (39.7 KB)

flash_l4t_t194_spi_emmc_p3668_rootfs_ab.xml.txt (40.5 KB)

I also changed the value of the ‘EMMCSIZE’ variable in the ‘p3509-0000 p3668-0001-qspi-emmc.conf’ file to 130996502528 (128GiB)

Then I ran the command ‘sudo ./flash.sh jetson-xavier-nx-devkit-emmc internal’, but in the end, the flashing failed. Please help me, thank you.

What you are doing here is not supported and modifying the emmc would broke the module.

This module no longer under the warranty. You could not RMA this either.

Hi ! Wayne.

I know that this module exceeded the warranty period last year. If I don’t make changes to its EMMC and rely solely on the original 16GB of storage, I won’t be able to use the module properly. Being unable to install the basic drivers means I won’t be able to use deep learning neural networks.

So, I had no choice but to do this.

Please help me. Thank you!

Hello @xl370

You can check the README_initrd_flash.txt, this files says:

- This tool does not support size discovery for internal emmc/sdcard. Therefore,
  you might need to change the "num_sectors" field in the config file under
  bootloader/t186ref/cfg if the default "num_sectors" is incompatible. You must
  change "num_sectors" so that num_sectors \* sector_size is equal to or smaller
  the size of the internal emmc/sd card of your Jetson.
- This tool supports T194 and T234 devices. You can use the -h option to find out what options this tool supports.
- Below are listed some sample workflows for initrd flashing.

So it seems that you need to modify the num_sectors for emmc in the config file mentioned in the txt file, as Wayne mentioned, that feature is not supported.

Also, I suggest to use an NVME external storage, where you can perform:

sudo ADDITIONAL_DTB_OVERLAY_OPT=<opt> ./tools/kernel_flash/l4t_initrd_flash.sh --external-device <external-device> \
      -c <external-partition-layout> \
      [ --external-only ] \
      [ -S <APP-size> ] \
      [ --network <netargs> ] <board-name> <rootdev>

by using the -S parameter, you can define the APP size for your external storage. You can check some instructions at How to flash and boot a Jetson from NVMe SSD - RidgeRun Developer Wiki

I hope this helps
Regards
Eduardo Salazar
Embedded SW Engineer at RidgeRun

Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com/
Website: www.ridgerun.com

Hi ! EduardoSalazar96 and Wayne .

It’s okay, very simple.

I copied the configuration file from the following SD card and renamed it to emmc2.

      1.p3509-0000+p3668-0000-qspi-sd.conf -- > p3509-0000+p3668-0000-qspi-emmc2.conf
      2.bootloader/t186ref/cfg/flash_l4t_t194_spi_sd_p3668.xml -- > bootloader/t186ref/cfg/flash_l4t_t194_spi_emmc2_p3668.xml
      3.bootloader/t186ref/cfg/flash_l4t_t194_spi_sd_p3668_enc_rfs.xml -- > bootloader/t186ref/cfg/flash_l4t_t194_spi_emmc2_p3668_enc_rfs.xml
      4.bootloader/t186ref/cfg/flash_l4t_t194_spi_sd_p3668_enc_rootfs_ab.xml -- > bootloader/t186ref/cfg/flash_l4t_t194_spi_emmc2_p3668_enc_rootfs_ab.xml
      5.bootloader/t186ref/cfg/flash_l4t_t194_spi_sd_p3668_rootfs_ab.xml -- > bootloader/t186ref/cfg/flash_l4t_t194_spi_emmc2_p3668_rootfs_ab.xml
      6.bootloader/t186ref/BCT/tegra194-mb1-bct-misc-sd-l4t.cfg -- > bootloader/t186ref/BCT/tegra194-mb1-bct-misc-emmc2-l4t.cfg

Then create a symbolic link:“ln p3509-0000+p3668-0000-qspi-emmc2.conf jetson-xavier-nx-devkit-emmc2.conf”.

Then use the command ‘vim jetson-xavier-nx-devkit-emmc2.conf’ to edit the ‘jetson-xavier-nx-devkit-emmc2.conf’ file.

    1.EMMC_CFG=flash_l4t_t194_spi_sd_p3668.xml; -- > EMMC_CFG=flash_l4t_t194_spi_emmc2_p3668.xml;
    2.DTB_FILE=tegra194-p3668-0000-p3509-0000.dtb; -- > DTB_FILE=tegra194-p3668-0001-p3509-0000.dtb;
    3.MISC_COLD_BOOT_CONFIG="tegra194-mb1-bct-misc-sd-l4t.cfg"; -- >MISC_COLD_BOOT_CONFIG="tegra194-mb1-bct-misc-emmc2-l4t.cfg";
    4.#Rootfs A/B : EMMC_CFG=flash_l4t_t194_spi_sd_p3668_rootfs_ab.xml; -- >
#Rootfs A/B : EMMC_CFG=flash_l4t_t194_spi_emmc2_p3668_rootfs_ab.xml;
    5.# Disk encryption support : EMMC_CFG=flash_l4t_t194_spi_sd_p3668_enc_rfs.xml; -- > # Disk encryption support : EMMC_CFG=flash_l4t_t194_spi_emmc2_p3668_enc_rfs.xml;
    6.# Rootfs A/B + Disk encryption support : EMMC_CFG=flash_l4t_t194_spi_sd_p3668_enc_rootfs_ab.xml; -- > # Rootfs A/B + Disk encryption support : EMMC_CFG=flash_l4t_t194_spi_emmc2_p3668_enc_rootfs_ab.xml;

Edit the information in the following file.

file:  bootloader/t186ref/cfg/flash_l4t_t194_spi_emmc2_p3668.xml、bootloader/t186ref/cfg/flash_l4t_t194_spi_emmc2_p3668_enc_rfs.xml、bootloader/t186ref/cfg/flash_l4t_t194_spi_emmc2_p3668_enc_rootfs_ab.xml、bootloader/t186ref/cfg/flash_l4t_t194_spi_emmc2_p3668_rootfs_ab.xml.

Information : <device type="sdcard" instance="0" sector_size="512" num_sectors="123731968"> -- >  <device type="sdmmc_user" instance="3" sector_size="512" num_sectors="123731968">

Finally, execute the command ‘sudo ./flash.sh jetson-xavier-nx-devkit-emmc2 internal’ to flash the NX.

It will automatically adapt to the storage size of the eMMC.

zmy@zmy-desktop:~$ lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0          7:0    0    16M  1 loop
mmcblk0      179:0    0 116.5G  0 disk
├─mmcblk0p1  179:1    0 115.8G  0 part /
├─mmcblk0p2  179:2    0    64M  0 part
├─mmcblk0p3  179:3    0   448K  0 part
├─mmcblk0p4  179:4    0  32.6M  0 part
├─mmcblk0p5  179:5    0   2.5M  0 part
├─mmcblk0p6  179:6    0    64K  0 part
├─mmcblk0p7  179:7    0     1M  0 part
├─mmcblk0p8  179:8    0     1M  0 part
├─mmcblk0p9  179:9    0     1M  0 part
├─mmcblk0p10 179:10   0   1.5M  0 part
├─mmcblk0p11 179:11   0     1M  0 part
├─mmcblk0p12 179:12   0    64M  0 part
├─mmcblk0p13 179:13   0   448K  0 part
├─mmcblk0p14 179:14   0  32.5M  0 part
├─mmcblk0p15 179:15   0    80M  0 part
├─mmcblk0p16 179:16   0   512K  0 part
├─mmcblk0p17 179:17   0   100M  0 part
├─mmcblk0p18 179:18   0    64M  0 part
├─mmcblk0p19 179:19   0    80M  0 part
├─mmcblk0p20 179:20   0   512K  0 part
├─mmcblk0p21 179:21   0    64M  0 part
└─mmcblk0p22 179:22   0   128M  0 part
zram0        251:0    0 856.8M  0 disk [SWAP]
zram1        251:1    0 856.8M  0 disk [SWAP]
zram2        251:2    0 856.8M  0 disk [SWAP]
zram3        251:3    0 856.8M  0 disk [SWAP]

The following is Chinese

这里是中文:

首先我们要将SD卡的配置文件复制并重命名为emmc2:

      1.p3509-0000+p3668-0000-qspi-sd.conf -- > p3509-0000+p3668-0000-qspi-emmc2.conf
      2.bootloader/t186ref/cfg/flash_l4t_t194_spi_sd_p3668.xml -- > bootloader/t186ref/cfg/flash_l4t_t194_spi_emmc2_p3668.xml
      3.bootloader/t186ref/cfg/flash_l4t_t194_spi_sd_p3668_enc_rfs.xml -- > bootloader/t186ref/cfg/flash_l4t_t194_spi_emmc2_p3668_enc_rfs.xml
      4.bootloader/t186ref/cfg/flash_l4t_t194_spi_sd_p3668_enc_rootfs_ab.xml -- > bootloader/t186ref/cfg/flash_l4t_t194_spi_emmc2_p3668_enc_rootfs_ab.xml
      5.bootloader/t186ref/cfg/flash_l4t_t194_spi_sd_p3668_rootfs_ab.xml -- > bootloader/t186ref/cfg/flash_l4t_t194_spi_emmc2_p3668_rootfs_ab.xml
      6.bootloader/t186ref/BCT/tegra194-mb1-bct-misc-sd-l4t.cfg -- > bootloader/t186ref/BCT/tegra194-mb1-bct-misc-emmc2-l4t.cfg

再执行命令创建软链接:“ ln p3509-0000+p3668-0000-qspi-emmc2.conf jetson-xavier-nx-devkit-emmc2.conf ”。

再执行命令“vim jetson-xavier-nx-devkit-emmc2.conf”修改源“ p3509-0000+p3668-0000-qspi-emmc2.conf ”文件的以下信息:

    1.EMMC_CFG=flash_l4t_t194_spi_sd_p3668.xml; -- > EMMC_CFG=flash_l4t_t194_spi_emmc2_p3668.xml;
    2.DTB_FILE=tegra194-p3668-0000-p3509-0000.dtb; -- > DTB_FILE=tegra194-p3668-0001-p3509-0000.dtb;
    3.MISC_COLD_BOOT_CONFIG="tegra194-mb1-bct-misc-sd-l4t.cfg"; -- >MISC_COLD_BOOT_CONFIG="tegra194-mb1-bct-misc-emmc2-l4t.cfg";
    4.#Rootfs A/B : EMMC_CFG=flash_l4t_t194_spi_sd_p3668_rootfs_ab.xml; -- >
#Rootfs A/B : EMMC_CFG=flash_l4t_t194_spi_emmc2_p3668_rootfs_ab.xml;
    5.# Disk encryption support : EMMC_CFG=flash_l4t_t194_spi_sd_p3668_enc_rfs.xml; -- > # Disk encryption support : EMMC_CFG=flash_l4t_t194_spi_emmc2_p3668_enc_rfs.xml;
    6.# Rootfs A/B + Disk encryption support : EMMC_CFG=flash_l4t_t194_spi_sd_p3668_enc_rootfs_ab.xml; -- > # Rootfs A/B + Disk encryption support : EMMC_CFG=flash_l4t_t194_spi_emmc2_p3668_enc_rootfs_ab.xml;

编辑以下文件的信息:

文件:  bootloader/t186ref/cfg/flash_l4t_t194_spi_emmc2_p3668.xml、bootloader/t186ref/cfg/flash_l4t_t194_spi_emmc2_p3668_enc_rfs.xml、bootloader/t186ref/cfg/flash_l4t_t194_spi_emmc2_p3668_enc_rootfs_ab.xml、bootloader/t186ref/cfg/flash_l4t_t194_spi_emmc2_p3668_rootfs_ab.xml.

信息 : <device type="sdcard" instance="0" sector_size="512" num_sectors="123731968"> -- >  <device type="sdmmc_user" instance="3" sector_size="512" num_sectors="123731968">

最后执行命令“ sudo ./flash.sh jetson-xavier-nx-devkit-emmc2 internal ” 以重新烧录NX。

这将会自动适配emmc的大小,例如:

zmy@zmy-desktop:~$ lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0          7:0    0    16M  1 loop
mmcblk0      179:0    0 116.5G  0 disk
├─mmcblk0p1  179:1    0 115.8G  0 part /
├─mmcblk0p2  179:2    0    64M  0 part
├─mmcblk0p3  179:3    0   448K  0 part
├─mmcblk0p4  179:4    0  32.6M  0 part
├─mmcblk0p5  179:5    0   2.5M  0 part
├─mmcblk0p6  179:6    0    64K  0 part
├─mmcblk0p7  179:7    0     1M  0 part
├─mmcblk0p8  179:8    0     1M  0 part
├─mmcblk0p9  179:9    0     1M  0 part
├─mmcblk0p10 179:10   0   1.5M  0 part
├─mmcblk0p11 179:11   0     1M  0 part
├─mmcblk0p12 179:12   0    64M  0 part
├─mmcblk0p13 179:13   0   448K  0 part
├─mmcblk0p14 179:14   0  32.5M  0 part
├─mmcblk0p15 179:15   0    80M  0 part
├─mmcblk0p16 179:16   0   512K  0 part
├─mmcblk0p17 179:17   0   100M  0 part
├─mmcblk0p18 179:18   0    64M  0 part
├─mmcblk0p19 179:19   0    80M  0 part
├─mmcblk0p20 179:20   0   512K  0 part
├─mmcblk0p21 179:21   0    64M  0 part
└─mmcblk0p22 179:22   0   128M  0 part
zram0        251:0    0 856.8M  0 disk [SWAP]
zram1        251:1    0 856.8M  0 disk [SWAP]
zram2        251:2    0 856.8M  0 disk [SWAP]
zram3        251:3    0 856.8M  0 disk [SWAP]