The ConnectCore 6UL uses a NAND flash as main storage media. The flash is divided into logical partitions per the U-Boot variable mtdparts, which contains a string in the format described by the Linux kernel parameters in drivers/mtd/parsers/cmdlinepart.c.

Partitioning strategies

Digi reserves one MTD partition for each piece of the system such as the bootloader, kernel, and root file system. The Linux system partitions then have a UBI volume (named after the MTD partition) to hold a UBIFS file system. This strategy, which is the default for the ConnectCore 6UL, has the disadvantage of not optimizing the reserved physical blocks for bad block handling or NAND wear leveling.

Digi Embedded Yocto also supports a new partitioning strategy that uses one MTD partition (named system) with multiple UBI volumes for the Linux system partitions. To learn about this strategy and how to prepare your ConnectCore 6UL to use this partition table, see Single-MTD system partitioning.

Multi-MTD system partitioning

The multi-MTD system partitioning strategy uses one UBI volume per MTD partition. This is the default for the ConnectCore 6UL.

Single system partition table (default)

The default partition table set in the U-Boot mtdparts variable establishes the following partitions:

NAND flash layout

  • bootloader: Contains the U-Boot bootloader image that is executed when the device is powered on. It starts the installed operating system and allows some device configurations.

  • environment: Contains the U-Boot environment and its redundant copy.

  • safe: Contains the encryption key for encrypted partitions. Refer to the TrustFence documentation for more information on encrypted partitions.

  • linux: Contains the Linux kernel, device tree files, and U-Boot boot scripts. U-Boot reads the operating system files from this partition.

  • recovery: Contains a recovery Linux ramdisk image that can be launched (instead of the default operating system) to perform firmware updates on the device.

  • rootfs: Contains the Linux root file system.

  • update: Serves as a placeholder partition to store firmware update files prior to launching a firmware update process on the device.

On variants of the ConnectCore 6UL with 256 MiB of NAND flash, the size of the update partition has been reduced to the minimum in favor of the rootfs partition. For this reason, it cannot be used to store firmware update files. To launch firmware updates in these variants, you must place the firmware update files on an external storage media.

Dual boot partition table

On a dual boot-enabled system (see Prepare your target for dual boot) the mtdparts variable establishes the following partitions:

NAND flash layout for dual boot

  • bootloader: Contains the U-Boot bootloader image that is executed when the device is powered on. It starts the installed operating system and allows some device configurations.

  • environment: Contains the U-Boot environment and its redundant copy.

  • safe: Contains the encryption key for encrypted partitions. Refer to the TrustFence documentation for more information on encrypted partitions.

  • linux_a: Contains the Linux kernel, device tree files, and U-Boot boot scripts. U-Boot reads the operating system files from this default partition.

  • linux_b: Same as linux_a (for system B).

  • rootfs_a: Linux root file system partition (for system A)

  • rootfs_b: Linux root file system partition (for system B)

Single-MTD system partitioning

The single-MTD system partitioning strategy uses multiple UBI volumes on one MTD partition named system.

Single system UBI volumes

The default partition table set in the U-Boot mtdparts variable establishes the following partitions:

NAND flash layout

  • bootloader: Contains the U-Boot bootloader image that is executed when the device is powered on. It starts the installed operating system and allows some device configurations.

  • environment: Contains the U-Boot environment and its redundant copy.

  • safe: Contains the encryption key for encrypted partitions. Refer to the TrustFence documentation for more information on encrypted partitions.

  • system: Contains the Linux system partitions as UBI volumes.

    • linux: (UBI volume) Contains the Linux kernel, device tree files, and U-Boot boot scripts. U-Boot reads the operating system files from this volume.

    • recovery: (UBI volume) Contains a recovery Linux ramdisk image that can be launched (instead of the default operating system) to perform firmware updates on the device.

    • rootfs: (UBI volume) Contains the Linux root file system.

    • update: (UBI volume) Placeholder volume to store firmware update files prior to launching a firmware update process on the device.

On variants of the ConnectCore 6UL with 256 MiB of NAND flash, the size of the update partition has been reduced to the minimum in favor of the rootfs partition. For this reason, it cannot be used to store firmware update files. To launch firmware updates in these variants, you must place the firmware update files on an external storage media.

Dual boot UBI volumes

On a dual boot-enabled system (see Prepare your target for dual boot) the mtdparts variable establishes the following partitions:

NAND flash layout for dual boot

  • bootloader: Contains the U-Boot bootloader image that is executed when the device is powered on. It starts the installed operating system and allows some device configurations.

  • environment: Contains the U-Boot environment and its redundant copy.

  • safe: Contains the encryption key for encrypted partitions. Refer to the TrustFence documentation for more information on encrypted partitions.

  • system: Contains the Linux system partitions as UBI volumes.

    • linux_a: (UBI volume) Contains the Linux kernel, device tree files, and U-Boot boot scripts. U-Boot reads the operating system files from this default volume.

    • linux_b: (UBI volume) Same as linux_a (for system B).

    • rootfs_a: (UBI volume) Linux root file system volume (for system A)

    • rootfs_b: (UBI volume) Linux root file system volume (for system B)

Limitations

The single-MTD system partition strategy has the following limitations:

  • Partition encryption is not supported. Partition encryption works at the MTD partition level; support for this functionality would require U-Boot to have decryption capabilities it does not currently have.

  • Read-only rootfs is not yet supported.

Change the partitioning strategy

You can control the partition table strategy using variable singlemtdsys and running some scripts to repartition the NAND.

The scripts partition_nand_linux and singlemtdsys are only available on U-Boot dub-2020.04-r5 or later versions. If you have an older U-Boot version, you can also use the firmware install scripts after setting or clearing singlemtdsys. This will program U-Boot on your device and do all partitioning and UBI volumes automatically.

See Program the firmware, for instructions on performing a full firmware install.

From Multi-MTD to Single-MTD system partition

  1. Set U-Boot variable singlemtdsys to "yes":

    => setenv singlemtdsys yes
  2. Run the script partition_nand_linux to recreate the partition table in variable mtdparts:

    => run partition_nand_linux
  3. Run the script ubivolscript to generate the default system UBI volumes:

    => run ubivolscript
  4. Save the environment:

    => saveenv

From Single-MTD to Multi-MTD system partition

  1. Clear U-Boot variable singlemtdsys:

    => setenv singlemtdsys
  2. Run the script partition_nand_linux to recreate the partition table in variable mtdparts:

    => run partition_nand_linux
  3. Save the environment:

    => saveenv