Custom rootfs, uboot and dts using uuu

Hello,

I am currently customizing a Buildroot for the Verdin i.MX8M-Mini and encountering issues with flashing the eMMC using UUU (Universal Update Utility).

I have the following components: rootfs, dtb, uboot.imx and the kernel (Image). However, I am unsure how to create a script that will work effectively for this process.

This is my current progress:

uuu_version 1.4.127

# UUU script to flash U-Boot, rootfs, and dtb


SDP: boot -f ../imx-boot.imx


SDPU: delay 1000

FB: ucmd if mmc dev 0; then; fastboot 0; fi

FB: ucmd setenv fastboot_dev mmc
FB: ucmd setenv mmcdev ${emmc_dev}
FB: ucmd mmc dev ${emmc_dev}


FB: flash -raw2sparse all ../imx-boot.imx


FB: flash -raw2sparse all ../rootfs.ext2


FB: flash -raw2sparse all ../imx8mm-verdin-wifi-dev.dtb


FB: ucmd reset

Any assistance or guidance on this matter would be greatly appreciated.

Thank you.

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

For flashing the eMMC on the Verdin i.MX8M Mini using UUU (Universal Update Utility) with a custom Buildroot rootfs, dtb, and U-Boot, your script is a good starting point. However, there are a few adjustments and clarifications that might help streamline the process.

  1. Correct Boot Command: Ensure that ../imx-boot.imx is the correct bootloader image for your Verdin i.MX8M Mini module. This file typically includes U-Boot, ATF, and optionally, a splash screen, packed into one. If you’re building U-Boot from source, you’ll need to follow the steps to generate imx-boot.imx as per the Toradex documentation.

  2. Partitioning and Formatting: Before flashing the rootfs, it’s essential to ensure that the eMMC is partitioned and formatted correctly. This step is not visible in your script. You can use UUU commands to partition the eMMC and format it to the desired filesystem. For example, to create two partitions (one for the rootfs and another for data), you might need to add commands to use gpt write and mmc erase.

  3. Flashing the Root Filesystem: When flashing the rootfs, ensure that the filesystem type matches what your system expects. Your script uses ../rootfs.ext2, which suggests an ext2 filesystem. While ext2 is supported, ext4 is more common for eMMC storage due to its journaling features, which improve reliability. If your rootfs is indeed ext4, it’s recommended to update the filename and filesystem type accordingly.

  4. Device Tree Blob (DTB) Flashing: The command to flash the DTB (FB: flash -raw2sparse all ../imx8mm-verdin-wifi-dev.dtb) should be correct, assuming that ../imx8mm-verdin-wifi-dev.dtb is the proper device tree for your configuration. However, it’s important to ensure that the DTB is flashed to the correct partition or location expected by U-Boot.

  5. Environment Variables: In your script, you’re setting fastboot_dev and mmcdev environment variables but not specifying the emmc_dev value. Typically, for eMMC on Verdin modules, emmc_dev is 0. Ensure that this value is set correctly in your script, possibly with a line like `FB: ucmd

Please, also check if these links can help you solve your problem:

Specifics: Build U-Boot for NXP i.MX 6/6ULL/7-based SoMs | Toradex Developer Center.

Hi @Frank !

Welcome to the Toradex Community!

Can you please share a bit about the motivation for using Buildroot in this project? We officially support only Yocto, so I recommend, if possible, trying it out so you can benefit from Toradex Easy Installer when installing images.

About your issues with UUU, when you start up the module in recovery mode, you will see on lsusb the VID and PID from NXP processor, you have to describe these two arguments to UUU to know which device it has to use. I recommend downloading our Toradex Easy Installer image and checking the file recovery/uuu.auto, which shows how we execute.

Also, after configuring these parameters, I recommend executing the -raw2sparse commands manually and checking if they are going to the correct address, U-Boot usually has all registries already configured.

Best regards,
Daniel Morais

Hi Daniel,

Thank you for your response.

The primary motivation for using Buildroot in this project is to achieve the fastest possible boot time, which is critical for our application. Given this requirement, Buildroot has been chosen over Yocto.

Currently, I have successfully submitted my own kernel, rootfs, and U-Boot using the Toradex Easy Installer. However, I’m not entirely sure if it is working as expected. From the modifications made in Buildroot, the output files I have are:

  • Rootfs.tar
  • rootfs.ext4
  • rootfs.ext2
  • Image (Kernel)
  • Device Tree Blob (dtb)
  • u-boot.imx

Additionally, I have an .img file that contains all the mentioned files.

I appreciate your guidance on configuring the UUU tool. I will check it.

Also, could you help me with the image.json using Toradex Easy Installer? I would like to know if is correctly made or if I missing something:

{
  "config_format": 2,
  "name": "Buildroot",
  "description": "A Buildroot Linux image with U-Boot, kernel, DTB, and rootfs",
  "version": "1.0",
  "release_date": "2024-05-26",
  "supported_product_ids": ["0060"],
  "kernel": {
    "file": "zImage",
    "dtb": ["imx8mm-verdin.dtb"]
  },
  "rootfs": {
    "file": "rootfs.tar",
    "format": "tar"
  },
  "volume_id": "custom-image",
  "blockdevs": [
    {
      "name": "mmcblk0",
      "partitions": [
        {
          "partition_size_nominal": 64,
          "want_maximised": false,
          "content": {
            "label": "boot",
            "filesystem_type": "fat",
            "mkfs_options": "",
            "filelist": ["zImage", "imx8mm-verdin.dtb"],
            "uncompressed_size": 64
          }
        },
        {
          "partition_size_nominal": 200,
          "want_maximised": true,
          "content": {
            "label": "rootfs",
            "filesystem_type": "ext4",
            "mkfs_options": "",
            "filename": "rootfs.tar",
            "uncompressed_size": 200
          }
        }
      ]
    }
  ],
  "installer": {
    "version": "5.7.2",
    "isinstaller": true,
    "file": "tezi.itb"
  }
}

Thank you for your support!

Best regards,
Frank

Hi @Frank ,

The easy installer image uses the tezi.itb as a FIT image, with kernel, dtb, and ramdisk in a single file, which differs from your case, more information about it can be found here.

With that in mind, to achieve what you want, please check the image.json from one of our base images here. For your case specifically, the reference images might be more suitable, since it uses the same files you have.

Best regards,
Daniel Morais

Thanks @daniel_m.tx
Based on what you told me I was able to run my own version of buildroot. Now I have another problems but I will try to figure it out by my self haha

Thank you for your support.

Best regards,
Franco