Verdin-imx8mp custom u-boot via uuu

Dear community!

I would like to ask you a question about loading a custom u-boot via uuu into verdin-imx8mp board. And yes, I wanted to use a custom variant (not via EasyInstaller). Let me introduce, how I started… .
I downloaded&unpacked the Verdin-iMX8MP_ToradexEasyInstaller_6.7.0+build.7.zip as you guide on your webpage. I run sudo recovery/uuu -v -b emmc imx-boot-sd and was expecting, that it will flash the bootloader, but nothing like that happened.

DDRINFO: start DRAM init
DDRINFO: DRAM rate 4000MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
DDR configured as dual rank
SEC0:  RNG instantiated
Normal Boot
WDT:   Started watchdog@30280000 with servicing (60s timeout)
Trying to boot from BOOTROM
Boot Stage: USB boot
Find img info 0x&4802a7a0, size 888
Need continue download 1024
Download 949984, Total size 951104
NOTICE:  BL31: v2.6(release):lf_v2.6-g3c1583ba0a
NOTICE:  BL31: Built : 11:00:38, Nov 21 2022


U-Boot 2022.04-6.7.0+git.7588eb559ca2 (May 28 2024 - 11:19:14 +0000)

CPU:   i.MX8MP[8] rev1.1 1600 MHz (running at 1200 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 28C
Reset cause: POR
DRAM:  4 GiB
Core:  89 devices, 23 uclasses, devicetree: separate
WDT:   Started watchdog@30280000 with servicing (60s timeout)
MMC:   FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Model: Toradex 0058 Verdin iMX8M Plus Quad 4GB WB IT V1.1B
Serial#: 15380116
MISSING TORADEX CARRIER CONFIG BLOCKS
SEC0:  RNG instantiated

 BuildInfo:
  - ATF 3c1583b

Setting variant to wifi
Detect USB boot. Will enter fastboot mode!
Net:   eth1: ethernet@30be0000, eth0: ethernet@30bf0000 [PRIME]
Fastboot: Normal
Boot from USB for uuu
Hit any key to stop autoboot:  0 

Same situation happened with imx-boot-recoverytezi. I tried to run the sudo recovery/uuu -v recovery, but it haven’t flashed the bootloader either. Maybe because of missing DFU support? So I decided to follow some next “official” steps… .

So I decided to build an official image and use it like a basement. So I created a new directory and run repo init -u git://git.toradex.com/toradex-manifest.git -b scarthgap-7.x.y -m torizon/default.xml Then source the environment via MACHINE=verdin-imx8mp source setup-environment build and run bitbake imx-boot and it failed during compilation!!!.

25154+1 records in
25155+0 records out
100620 bytes (101 kB, 98 KiB) copied, 0.0168229 s, 6.0 MB/s
./../scripts/dtb_check.sh imx8mp-evk.dtb evk.dtb imx8mp-verdin-wifi-dev.dtb
 Can't find u-boot DTB file, please copy from u-boot
make[1]: *** [soc.mak:156: evk.dtb] Error 254
make: *** [Makefile:26: flash_evk_emmc_fastboot] Error 2
WARNING: exit code 2 from a shell command.

This is crazy, isn’t it? My expectation was just the reference and use it :frowning: . So back to my problem, what I wanted to achieve. As I wrote at the begging I wanted to create a custom u-boot and flash it via uuu.
So I prepared my custom Ycoto layer setup and use u-boot sources from here: u-boot-toradex.git - U-Boot bootloader for Apalis and Colibri modules. I’ve just took verdin-imx8mp_defconfig and imx8mp-verdin-wifi-dev.dts and compile it. Then just run sudo uuu -v imx-boot-verdin-imx8mp-sd.bin-flash_evk and tried to load it into board, but I failed again :frowning: .

U-Boot SPL 2024.04-26afaf7655 (Sep 27 2024 - 09:41:12 +0000)
DDRINFO: start DRAM init
DDRINFO: DRAM rate 4000MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
DDR configured as dual rank
SEC0:  RNG instantiated
Normal Boot
WDT:   Started watchdog@30280000 with servicing every 1000ms (60s timeout)
Trying to boot from BOOTROM
Boot Stage: USB boot
Find img info 0x4802a9a0, size 888
Need continue download 1024
Failed to find node!, err: -1!
Failed to find node!, err: -1!

I started to loading the SPL U-boot, but it failed on Failed to find node!, err: -1! which is pointing to

node = fdt_node_offset_by_compatible(fdt_addr, -1, "imx8m,mcu_rdc");
if (node < 0) {
		printf("Failed to find node!, err: %d!\n", node);
		ret = -1;
		goto exit;
}

The funny thing is, why he is searching for such a node. The compatible string is part of imx8mp-evk-u-boot.dtsi.
Last note, the same mechanism is working without any problems on NXP EVK board. I’ve just choose imx8mp_evk_defconfig and imx8mp-evk.dts.

U-Boot SPL 2024.04-e3fd706bd2 (Jul 17 2024 - 11:30:06 +0000)
DDRINFO: start DRAM init
DDRINFO: DRAM rate 4000MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
SEC0:  RNG instantiated
Normal Boot
Trying to boot from BOOTROM
Boot Stage: USB boot
Find img info 0x48022fa0, size 888
Need continue download 1024
NOTICE:  Do not release JR0 to NS as it can be used by HAB
NOTICE:  BL31: v2.10.0	(release):lf-6.6.23-2.0.0
NOTICE:  BL31: Built : 10:04:22, May 29 2024


U-Boot 2024.04-e3fd706bd2 (Jul 17 2024 - 11:30:06 +0000)

CPU:   i.MX8MP[8] rev1.1 1800 MHz (running at 1200 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 26C
Reset cause: POR
Model: NXP i.MX8MPlus LPDDR4 EVK board
DRAM:  6 GiB
TCPC:  Vendor ID [0x1fc9], Product ID [0x5110], Addr [I2C2 0x50]
SNK.Power3.0 on CC1
PDO 0: type 0, 5000 mV, 3000 mA [E]
PDO 1: type 0, 9000 mV, 3000 mA []
PDO 2: type 0, 15000 mV, 3000 mA []
PDO 3: type 0, 20000 mV, 2250 mA []
Requesting PDO 3: 20000 mV, 2250 mA
Source accept request
PD source ready!
tcpc_pd_receive_message: Polling ALERT register, TCPC_ALERT_RX_STATUS bit failed, ret = -62
Power supply on USB2
TCPC:  Vendor ID [0x1fc9], Product ID [0x5110], Addr [I2C1 0x50]
Core:  281 devices, 32 uclasses, devicetree: separate
MMC:   FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from nowhere... OK
In:    serial
Out:   serial
Err:   serial
SEC0:  RNG instantiated
switch to partitions #0, OK
mmc2(part 0) is current device
Detect USB boot. Will enter fastboot mode!
flash target is MMC:2
Net:   eth0: ethernet@30be0000 [PRIME], eth1: ethernet@30bf0000
Fastboot: Normal
Boot from USB for mfgtools

So now the question is, what’s wrong. Is it a defconfig or DTB problem and how to fix it?

Many thanks for the support,
Andy

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

Did you like my answer?

:+1: :-1:


Hi Andy,

It looks like you’re encountering several issues while trying to load a custom U-Boot via uuu into the Verdin iMX8MP board. Let’s break down the steps and address the potential problems:

1. Flashing U-Boot via uuu

When you run sudo recovery/uuu -v -b emmc imx-boot-sd, it should flash the bootloader. However, it seems like the process is not completing successfully. Here are a few things to check:

  • Ensure the correct USB port and cable: Sometimes, using a different USB cable or port (preferably non-USB3) can resolve enumeration issues.
  • Check the OTG mode: If you are using the Ixora Carrier Board, make sure that X9 is configured in OTG mode (remove JP2).

2. Building U-Boot with Yocto

You mentioned that you followed the steps to build an official image but encountered an error during the bitbake imx-boot process. The error indicates that the U-Boot DTB file is missing:

Can't find u-boot DTB file, please copy from u-boot
make[1]: *** [soc.mak:156: evk.dtb] Error 254
make: *** [Makefile:26: flash_evk_emmc_fastboot] Error 2

This suggests that the build process is looking for a specific DTB file that is not present. Ensure that the DTB files are correctly placed in the expected directories. You might need to manually copy the DTB files from the U-Boot build output to the appropriate location.

3. Custom U-Boot Compilation

You compiled a custom U-Boot using verdin-imx8mp_defconfig and imx8mp-verdin-wifi-dev.dts, but it failed with the error:

Failed to find node!, err: -1!

This error indicates that the device tree node imx8m,mcu_rdc is missing. This node is part of imx8mp-evk-u-boot.dtsi, but it seems like it is not included in your custom device tree.

Steps to Resolve:

  1. Verify Device Tree: Ensure that your custom device tree includes all necessary nodes. You might need to merge parts of imx8mp-evk-u-boot.dtsi into your custom device tree.
  2. Check U-Boot Configuration: Make sure that your verdin-imx8mp_defconfig is correctly set up to include all necessary configurations for the Verdin iMX8MP board.
  3. Use Official Sources: If possible, start with the official Toradex U-Boot sources and make incremental changes to ensure that each step works correctly.

Example Steps:

  1. Clone the U-Boot repository:
    git clone -b toradex_2022.04 git://git.toradex.com/u-boot-toradex.git
    cd u-boot-toradex
    
  2. Configure for Verdin iMX8MP:
    make verdin-imx8mp_defconfig
    
  3. Build U-Boot:
    make -j$(nproc)
    
  4. Flash U-Boot using uuu:
    sudo uuu -v imx-boot-verdin-imx8mp-sd.bin-flash_evk
    

If you continue to face issues, please provide more details about the specific changes you made to the device tree and configuration files. This will help in diagnosing the problem more accurately.

Many thanks for your patience and support,
Andy

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

How to flash uboot with uuu in recovery mode.

Hello @Andy99,

Also replying here for reference.

As Torizon OS 7 has not yet been released, the default matrix (-m torizon/default.xml) is not up to date with a working configuration.
What I would recommend while Torizon 7 has not been released is that you try the nightly matrix: -m torizon/integration.xml

However, as it has not been released, there will be bugs and it may not work at all.
From our internal tests, it is mostly working with the Verdin iMX8MP as the release approaches.

From your additional tests with u-boot, it also seems that the device tree being used is not for the Verdin iMX8MP, but for NXP’s EVK.
Documentation about building a newer u-boot version for the Verdin iMX8MP is still a work in progress.
I can also mention that we plan to release Torizon OS 7 with the upstream 2024.07 version of u-boot.

Best Regards,
Bruno

Hello again,

I made it working finally. The problems were in the missing rdc configuration in device-tree and usb-boot handling in soc.c.