Pushing U-Boot to Custom SD Card Image

I have created my own custom image based on the toradex multimedia reference image. I want to update u-boot, but I’m very confused on how to actually push my code to my board for the test process. Adding the changes to the yocto image seems straightforward, but I’d like to test the changes I make to the u-boot source before patching it. For reference, I’m trying to update GPIOs to startup low from u-boot based on this article (last section).

I followed the instructions from this u-boot build guide. I got through all the steps and created the flash.bin/imx-boot. I now want to push this to my SD card instead of the boot partition which comes with the .wic file that my custom image creates.

I tried pushing the flash.bin with dd to the boot partition on my SD card with the wic preloaded. This didn’t work, and just corrupted the whole SD card. The board could not boot from it.

I see that several other people have asked similar questions. I think that I have some misunderstandings about what is actually being built by imx-mkimage and how I need to add this to my sd card. What is included in this flash.bin file?

It seems that all the guides need me to update this via Tezi? I’m not sure why that is; if I could update what I needed from Yocto then I shouldn’t need to modify anything in the eMMC on the board, right? From what I can tell, imx-mkimage should have build the SECO, SCFW, ATF, and U-Boot into a single binary. Is that correct?

Also, what is UUU and do I need to use it to update my SD card? It seems like it’s a utility to update the eMMC on the board, but again I shouldn’t need to do that. The documentation for this tool from NXP is confusing as to what it actually does.

I’ve included my imx-boot if that’s of any help to anyone.

flash.bin (1.1 MB)

Resources I used:

My Hardware:

  • Toradex Colibri iMX8QXP
  • Yocto Version: Scarthgap
  • uname -r: 6.6.101-7.4.0-devel

Any help is much appreciated. Thanks!

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


[(1)](Specifics: Build U-Boot for NXP i.MX 8/8X-based SoMs | Toradex Developer Center): Specifics: Build U-Boot for NXP i.MX 8/8X-based SoMs

Understanding Your U-Boot Build and Deployment

What’s in the flash.bin File

For your Colibri iMX8QXP module, the flash.bin file (also called imx-boot) contains multiple firmware components packaged into a single boot container(1). According to the Toradex documentation, this boot container includes(1):

  • DDR memory timings
  • SCU firmware (SCFW) - System Controller Unit firmware
  • ARM-trusted firmware (ATF)
  • U-Boot
  • Any potential Cortex-M4 auxiliary firmware

The NXP i.MX 8QuadMax/i.MX 8QuadXPlus boots using a Cortex-M4 boot CPU called System Controller Unit (SCU), and all these components are stored in a single boot container that’s read by the boot ROM from the boot device, starting at a specific offset(1).

Why Direct DD to SD Card Failed

The reason your dd command corrupted the SD card is that the boot container needs to be placed at a specific offset (33kB for V1.0A modules booting from SD cards)(1). Simply copying it to the boot partition won’t work because:

  1. The boot ROM expects the container at a precise location
  2. The partition structure and filesystem get corrupted when you overwrite them

Recommended Approach: Use Yocto Integration

Instead of manually deploying the U-Boot binary, the most reliable approach is to integrate your changes into your Yocto build. Here’s how to do this properly:

Method 1: Create a U-Boot Recipe Append

Create a custom layer and add a U-Boot append recipe(2):

$ mkdir -p meta-customer/recipes-bsp/u-boot
$ touch meta-customer/recipes-bsp/u-boot/u-boot-toradex_%.bbappend

(2)

Add your GPIO initialization changes to the append file:

do_configure:append() {
    # Add your GPIO initialization code here
    # Modify the appropriate board file or configuration
}

(2)

Method 2: Add Custom Board Configuration

You can modify the board initialization by creating patches or direct modifications in your append recipe(2). For GPIO initialization, you would typically modify the board-specific files during the configure step.

Testing Workflow

  1. Build your custom image with the U-Boot changes integrated via Yocto
  2. Flash the complete .wic image to your SD card using standard tools
  3. Boot and test your GPIO changes
  4. Iterate by modifying your Yocto recipe and rebuilding

About UUU Tool

The Universal Update Utility (UUU) is primarily used for updating the eMMC on Toradex modules, not SD cards. Since you’re working with SD card boot, you don’t need UUU for your testing workflow.

Alternative: Manual Testing with TEZI

If you absolutely need to test the raw U-Boot binary before integrating it into Yocto, you can use Toradex Easy Installer (TEZI)(3):

  1. Create a custom TEZI image with your modified imx-boot
  2. Use TEZI to flash the complete image to your module
  3. This ensures proper placement and doesn’t corrupt the filesystem

However, the Yocto integration approach is more maintainable and less error-prone for development iterations.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

What from IMX boots depends on settings in the fuses. You can’t change it easily from eMMC to SD or SPI (already installed u-boot in contrast can launch Linux from any available and config-allowed media). The easiest to try your new u-boot image could be using recovery mode and uuu or imxusb utilities to load u-boot over USB and launch it.

@camstillo

All Verdin modules are fused to boot from eMMC. If you have a functional U-Boot in the eMMC, you can then boot from any other media using the Distro Boot mechanism.