Upgrade a functional BSP5 to BSP6 on verdin8MM , Got Failed to load 'imx8mm-verdin-wifi-device.dtb' Booting from mmc failed! SCRIPT FAILED: continuing... libfdt fdt_check_header(): FDT_ERR_BADMAGIC

Hello, I am looking to upgrade a BSP5 to BSP6. I have created an image based on bsp6 and flashed it to Verdin8MM, but the device is unable to boot using this image. I have connected a serial cable to view the log, and I have observed that the u-boot is unable to load the dts file, as indicated below.

U-Boot 2022.04-6.5.0-devel+git.28dc906f6107 (Dec 22 2023 - 09:31:10 +0000)

CPU:   i.MX8MMQ rev1.0 1600 MHz (running at 1200 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 49C
Reset cause: POR
DRAM:  2 GiB
Core:  114 devices, 21 uclasses, devicetree: separate
WDT:   Started watchdog@30280000 with servicing (60s timeout)
MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... OK
In:    serial
Out:   serial
Err:   serial
Model: Toradex 0055 Verdin iMX8M Mini Quad 2GB WB IT V1.1B
Serial#: 06895030
get_tdx_eeprom: cannot find EEPROM by node
MISSING TORADEX CARRIER CONFIG BLOCKS
get_tdx_eeprom: cannot find EEPROM by node
Setting variant to wifi
flash target is MMC:0
Net:   eth0: ethernet@30be0000
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:  1  0 
MMC: no card present
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
6010 bytes read in 7 ms (837.9 KiB/s)
## Executing script at 50280000
Loading DeviceTree: imx8mm-verdin-wifi-device.dtb
Failed to load 'imx8mm-verdin-wifi-device.dtb'
Booting from mmc failed!
SCRIPT FAILED: continuing...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
e7e[re[999;999He[6ne8Scanning disk mmc@30b40000.blk...
MMC: no card present
Scanning disk mmc@30b50000.blk...
Disk mmc@30b50000.blk not ready
Card did not respond to voltage select! : -110
Scanning disk mmc@30b60000.blk...
Disk mmc@30b60000.blk not ready
Found 3 disks
No EFI system partition
ERROR: invalid device tree
starting USB...
Bus usb@32e40000: Port not available.
Bus usb@32e50000: USB EHCI 1.00
scanning bus usb@32e50000 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
BOOTP broadcast 11
BOOTP broadcast 12
BOOTP broadcast 13
BOOTP broadcast 14
BOOTP broadcast 15
BOOTP broadcast 16
BOOTP broadcast 17

I came across a post mentioning that the GPIO name configuration has been changed compared to BSP5. I tried configuring it using the GPIO set and clear commands in U-Boot, but it didn’t work. Enclose you can find the GPIO configuration. Any suggestions on how to resolve this issue? I’m working with a custom board.
gpio_kernel_5.log (3.9 KB)
gpio_kernel_6.log (4.0 KB)

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,

The error message “libfdt fdt_check_header(): FDT_ERR_BADMAGIC” indicates that the Device Tree Blob (DTB) file could not be properly read by U-Boot. This could be due to several reasons, such as a corrupt DTB file, incorrect DTB file name, or the DTB file not being properly placed in the expected directory.

Given that you are upgrading from BSP5 to BSP6 and facing issues with device tree loading, here are some steps to troubleshoot and potentially resolve the issue:

  1. Verify the DTB File Name and Location: Ensure that the DTB file name mentioned in the boot script (imx8mm-verdin-wifi-device.dtb) matches exactly with the DTB file present in your boot partition. Also, confirm that the file is located in the correct directory as expected by the boot script.

  2. Check for DTB File Corruption: It’s possible that the DTB file might be corrupted. Try regenerating the DTB file from the DTS source or use a known good DTB file from a similar setup that works.

  3. Review U-Boot Environment Variables: The U-Boot environment variables related to device tree loading (fdt_file, fdt_addr, etc.) should be correctly set. You can print the current environment variables in U-Boot using the printenv command and compare them with a working setup.

  4. Custom Board Considerations: Since you mentioned working with a custom board, ensure that any modifications made to the device tree to support your custom hardware are correctly implemented. Differences in hardware between the standard Verdin modules and your custom board might require adjustments in the device tree.

  5. Update U-Boot Script: If the GPIO configuration or other hardware specifics have changed between BSP5 and BSP6, you might need to update your U-Boot script (boot.scr) to accommodate these changes. This includes correctly setting up GPIOs or other peripherals before the kernel is booted.

  6. Reflash the Bootloader: If the bootloader itself has been corrupted or is not properly configured for BSP6, reflashing it with a version compatible with BSP6 might resolve the issue.

  7. Check MMC Detection: The log shows “MMC: no card present” messages, which could indicate an issue with MMC detection. Ensure that the MMC interface is correctly configured in the device tree and that the physical connections on your custom board are intact.

If after following these steps the issue persists,

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

How to Run a Hello World on the Cortex-M | Toradex Developer Center.

I came across a post mentioning that the GPIO name configuration has been changed compared to BSP5. I tried configuring it using the GPIO set and clear commands in U-Boot, but it didn’t work. Enclose you can find the GPIO configuration. Any suggestions on how to resolve this issue? I’m working with a custom board.
gpio_kernel_5.log (3.9 KB)
gpio_kernel_6.log (4.0 KB)

Hello @Rabeb,

There were many significant changes in the device tree between BSP 5 and BSP 6.

The recommended approach for such an upgrade is to:

  1. Compare the base BSP 5 device tree provided by Toradex with your custom device tree for BSP5
  2. Implement the changes on a BSP 6 device tree provided by Toradex.
    • This should be done in the most incremental way possible, to make sure that each new change has the intended effect.

To understand what may be wrong, can you send us your original device tree for BSP 5 and the new one for BSP 6?

This can be done either directly here on this thread or via the support email, however you prefer.

Best Regards,
Bruno