Build U-Boot from source BSP 7.x.y for i.MX8M Mini

Hello everyone,

i tried the same from my other question but with the new BSP 7.x.y: Build U-Boot from source BSP 6.x.y for i.MX8M Mini - Technical Support - Toradex Community

I followed the manual about Build U-Boot From Source Code | Toradex Developer Center and the specifics for i.MX8M Mini in the BSP 7.x.y version.

In the final build step i get this error:

If a copy all lpddr4_pmu_train_*.bin files from the firmware-imx-8.10.1 then the error appears again but the build runs to the end and i get the flash.bin.

root@8230b752980f:~/workspace/imx-mkimage# make clean; make SOC=iMX8MM flash_evk_emmc_fastboot
imx8qm clean done
imx8qx clean done
imx8dxl clean done
imx8ulp clean done
imx93 clean done
imx91 clean done
imx95 clean done
Compiling mkimage_imx8
PLAT=imx8mm HDMI=no
Compiling mkimage_imx8
cc -O2 -Wall -std=c99 -static …/iMX8M/mkimage_imx8.c -o mkimage_imx8 -lz
…/iMX8M/mkimage_imx8.c: In function ‘copy_file.constprop’:
…/iMX8M/mkimage_imx8.c:345:21: warning: ‘write’ reading 5 bytes from a region of size 4 [-Wstringop-overread]
345 | if (write(ifd, (char *)&zero, 4-tail) != 4-tail) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
…/iMX8M/mkimage_imx8.c:303:13: note: source object ‘zero’ of size 4
303 | int zero = 0;
| ^~~~
In file included from …/iMX8M/mkimage_imx8.c:24:
/usr/include/unistd.h:378:16: note: in a call to function ‘write’ declared with attribute ‘access (read_only, 2, 3)’
378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
| ^~~~~
40098+0 records in
40098+0 records out
160392 bytes (160 kB, 157 KiB) copied, 0.0483781 s, 3.3 MB/s
./…/scripts/dtb_check.sh imx8mm-evk.dtb evk.dtb
Use u-boot DTB: fsl-imx8mm-evk.dtb
./…/scripts/pad_image.sh tee.bin
ERROR: ./…/scripts/pad_image.sh: Could not find file tee.bin. Exiting.
./…/scripts/pad_image.sh bl31.bin
Padding bl31.bin to 43488 bytes
./…/scripts/pad_image.sh u-boot-nodtb.bin evk.dtb
Padding evk.dtb to 69304 bytes
BL32=tee.bin DEK_BLOB_LOAD_ADDR=0x40400000 TEE_LOAD_ADDR=0xbe000000 ATF_LOAD_ADDR=0x00920000 …/iMX8M/mkimage_fit_atf.sh evk.dtb > u-boot.its
bl31.bin size:
43488
u-boot-nodtb.bin size:
811432
evk.dtb size:
69304
./mkimage_uboot -E -p 0x5000 -f u-boot.its u-boot.itb
FIT description: Configuration to load ATF before U-Boot
Created: Fri Feb 21 10:53:46 2025
Image 0 (uboot-1)
Description: U-Boot (64-bit)
Created: Fri Feb 21 10:53:46 2025
Type: Standalone Program
Compression: uncompressed
Data Size: 811432 Bytes = 792.41 KiB = 0.77 MiB
Architecture: AArch64
Load Address: 0x40200000
Entry Point: unavailable
Image 1 (fdt-1)
Description: evk
Created: Fri Feb 21 10:53:46 2025
Type: Flat Device Tree
Compression: uncompressed
Data Size: 69304 Bytes = 67.68 KiB = 0.07 MiB
Architecture: Unknown Architecture
Image 2 (atf-1)
Description: ARM Trusted Firmware
Created: Fri Feb 21 10:53:46 2025
Type: Firmware
Compression: uncompressed
Data Size: 43488 Bytes = 42.47 KiB = 0.04 MiB
Architecture: AArch64
OS: Unknown OS
Load Address: 0x00920000
Default Configuration: ‘config-1’
Configuration 0 (config-1)
Description: evk
Kernel: unavailable
Firmware: uboot-1
FDT: fdt-1
Loadables: atf-1
./mkimage_imx8 -version v1 -dev emmc_fastboot -fit -loader u-boot-spl-ddr.bin 0x7E1000 -second_loader u-boot.itb 0x40200000 0x60000 -out flash.bin
Platform: i.MX8M (mScale)
ROM VERSION: v1
BOOT DEVICE: emmc_fastboot
Using FIT image
LOADER IMAGE: u-boot-spl-ddr.bin start addr: 0x007e1000
SECOND LOADER IMAGE: u-boot.itb start addr: 0x40200000 offset: 0x00060000
Output: flash.bin
fit_size: 888
1+0 records in
1+0 records out
888 bytes copied, 0.000141596 s, 6.3 MB/s
FIT hash: d36b84ab8698e54060d1f3d07275332c656a2c4ba3c63d1106f77909b5c7ec2
========= IVT HEADER [HDMI FW] =========
header.tag: 0x0
header.length: 0x0
header.version: 0x0
entry: 0x0
reserved1: 0x0
dcd_ptr: 0x0
boot_data_ptr: 0x0
self: 0x0
csf: 0x0
reserved2: 0x0
boot_data.start: 0x0
boot_data.size: 0x0
boot_data.plugin: 0x0
========= IVT HEADER [PLUGIN] =========
header.tag: 0x0
header.length: 0x0
header.version: 0x0
entry: 0x0
reserved1: 0x0
dcd_ptr: 0x0
boot_data_ptr: 0x0
self: 0x0
csf: 0x0
reserved2: 0x0
boot_data.start: 0x0
boot_data.size: 0x0
boot_data.plugin: 0x0
========= IVT HEADER [LOADER IMAGE] =========
header.tag: 0xd1
header.length: 0x2000
header.version: 0x41
entry: 0x7e1000
reserved1: 0x0
dcd_ptr: 0x0
boot_data_ptr: 0x7e0fe0
self: 0x7e0fc0
csf: 0x8203c0
reserved2: 0x0
boot_data.start: 0x7e0bc0
boot_data.size: 0x41860
boot_data.plugin: 0x0
========= OFFSET dump =========
Loader IMAGE:
header_image_off 0x0
dcd_off 0x0
image_off 0x40
csf_off 0x3f400
spl hab block: 0x7e0fc0 0x0 0x3f400

Second Loader IMAGE:
sld_header_off 0x5fc00
sld_csf_off 0x60c20
sld hab block: 0x401fadc0 0x5fc00 0x1020
fit-fdt csf_off 0x62c20
fit-fdt hab block: 0x401fadc0 0x5fc00 0x3020
SPL CSF block:
Blocks = 0x7e0fc0 0x0 0x3f400 “flash.bin”
SLD CSF block:
Blocks = 0x401fadc0 0x5fc00 0x1020 “flash.bin”,
SLD FIT-FDT CSF block:
Blocks = 0x401fadc0 0x5fc00 0x3020 “flash.bin”

But this U-Boot isn’t bootable on my hardware:

  • Verdin imx8m mini (PN 0055)
  • Mallow Carrier Board

I tried to run this U-Boot with these steps:

  • From running u-boot “U-Boot 2022.04-6.7.0-devel+git.7588eb559ca2 (May 28 2024 - 11:19:14 +0000)”
  • set the serverip environment variable to my tftp server
  • "dhcp ${loadaddr} imx-boot
  • “run update_uboot”
  • “reset”

After the reset command in u-boot it hangs “forever” with the last serial output “resetting …”. With the recovery mode i get my hardware back running with an older u-boot version.

Maybe did you have some ideas what could be get wrong here or how i could debug this issues?

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

Thank you for reaching out with your question. Let’s address the issues you’re encountering while building U-Boot for the i.MX8M Mini with BSP 7.x.y.

  1. Missing ‘tee.bin’ File:

    • The error message indicates that the ‘tee.bin’ file is missing. This file is part of the ARM Trusted Firmware (ATF) and is essential for the boot process. Please ensure that you have built the ATF correctly. You can obtain the ATF from NXP’s repositories and follow the build instructions to generate the necessary ‘bl31.bin’ file, which should be included in your boot container.
  2. Build Environment and Dependencies:

    • Verify that all required dependencies and tools are installed, including the ARM GNU Toolchain. Ensure your environment variables (such as CROSS_COMPILE, ARCH, and PATH) are correctly set to point to the toolchain.
    • Confirm that you have the correct version of the DDR firmware and that it is included in your build process.
  3. Non-Bootable U-Boot:

    • Double-check your U-Boot configuration to ensure the correct defconfig is used for the i.MX8M Mini.
    • Review the build logs for any warnings or errors that might indicate missing components or misconfigurations.
    • Use the serial console to capture any output during the boot process, as this can provide clues about where the boot process is failing.
  4. Debugging Steps:

    • If the device hangs after the ‘reset’ command, it might be due to incorrect memory settings or missing firmware components. Ensure that all firmware files are correctly placed and referenced in your build scripts.
    • Consider using a known working configuration as a baseline and incrementally apply your changes to isolate the issue.

By following these steps, you should be able to identify and resolve the issues preventing your U-Boot from booting correctly. If problems persist, carefully review each step of the build process to ensure all components are correctly integrated.

I hope this helps you get your U-Boot up and running. If you have any more questions, feel free to ask.

Best regards,
Toradex AI Assistant.

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

Build a Reference Image with Yocto Project/OpenEmbedded | Toradex Developer Center.

Some additional notes:

  • i use docker to build it, based on ubuntu 22.04
  • instead of building the “Device Tree Compiler” from source i installed it via “apt-get install device-tree-compiler” → 1.6.1

Feedback to @ToradexAI:

  1. bl31.bin exist in my imx-mkimage/iMX8M directory before starting the final build. This is the git-hash 74dd541f91bfe5f10b88a0028dcfb0ff55b369b2 of the trused firmware repo.
  2. ARCH=arm64; CROSS_COMPILE=aarch64-none-linux-gnu-; DTC_FLAGS=-@; PATH is extended with the location of the cross-compiler. For example if i use “aarch64-none-linux-gnu-gcc --version” it get returned the version 12.3.Rel1
  3. i use the verdin-imx8mm_defconfig and no issue appears when i build it with “make -j$(nproc) 2>&1 | tee build.log”.