Colibri IMX8X with Yocto Mender

I built an image using the yocto project following this page from toradex:

Using BSP 5.7 based on Dunfell.

I then made appropriate modifications to uboot following the apalis imx8x for mender.

I added the meta-mender and meta-mender-community layers and rebuilt the image. I was able to build and install the image successfully on the imx8x module. However when I boot the device I cannot get past “Starting Kernel”

Please find my uboot environment variables below:

Can you please advise what I am missing:

Colibri iMX8X # printenv
altbootcmd=run mender_altbootcmd; run bootcmd
apply_overlays=for overlay_file in ${fdt_overlays}; do echo Applying Overlay: ${overlay_file} && load ${mender_uboot_boot} ${loadaddr} ${overlays_prefix}${overlay_file} && fdt apply ${loadaddr}; env set overlay_file; done; true
arch=arm
baudrate=115200
board=colibri-imx8x
board_name=Colibri iMX8QXP
board_rev=v1.0
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_net_usb_start=usb start
boot_pci_enum=pci enum
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr
boot_scripts=boot.scr
boot_syslinux_conf=extlinux/extlinux.conf
boot_targets=mmc1 mmc0 usb0 dhcp
bootargs=root=/dev/mmcblk0p2 console=ttyLP3,115200 earlycon=lpuart32,0x5a090000,115200,115200 root=PARTUUID= rootwait mmcdev=0
bootcmd=run distro_bootcmd
bootcmd_args=run rootfsargs_set && env set bootargs ${defargs} ${rootfsargs} ${setupargs} ${vidargs} ${tdxargs}
bootcmd_boot=echo "Bootargs: ${bootargs}" && booti ${kernel_addr_r} - ${fdt_addr_r}
bootcmd_dhcp=setenv devtype dhcp; run boot_net_usb_start; run boot_pci_enum; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;
bootcmd_dtb=echo Loading DeviceTree: ${fdtfile}; load ${mender_uboot_root} ${fdt_addr_r} ${load_prefix}${fdtfile}
bootcmd_kernel=load ${mender_uboot_root} ${kernel_addr_load} ${load_prefix}${kernel_image}
bootcmd_mfg=select_dt_from_module_version && fastboot 0
bootcmd_mmc0=devnum=0; run mmc_boot
bootcmd_mmc1=devnum=1; run mmc_boot
bootcmd_overlays=run load_overlays_file && run fdt_resize && run apply_overlays
bootcmd_prepare=run set_bootcmd_kernel; run set_bootcmd_dtb; run set_load_overlays_file; run set_apply_overlays
bootcmd_run=run m4boot; run bootcmd_dtb && run bootcmd_overlays && run bootcmd_args && run bootcmd_kernel && run bootcmd_unzip && run bootcmd_boot; echo "Booting from ${devtype} failed!"
bootcmd_unzip=unzip ${kernel_addr_load} ${kernel_addr_r}
bootcmd_usb0=devnum=0; run usb_boot
bootcount=1
bootdelay=1
bootfstype=fat
bootlimit=1
commit_atf=2fa8c63
commit_mkimage=6a315dbc
commit_scfw=216a2c2e
commit_secofw=c9de51c0
console=ttyLP3,115200 earlycon=lpuart32,0x5a090000,115200
cpu=armv8
devplist=1
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
ethact=ethernet@5b040000
ethaddr=00:14:2d:67:c5:09
ethprime=eth0
fastboot_dev=mmc0
fdt_addr=0x83000000
fdt_addr_r=0x83100000
fdt_board=eval-v3
fdt_resize=fdt addr ${fdt_addr_r} && fdt resize 0x20000
fdtcontroladdr=fce6c558
fdtfile=imx8qxp-colibri-eval-v3.dtb
fileaddr=96000000
filesize=a264a5
finduuid=part uuid mmc ${mmcdev}:2 uuid
image=Image
initrd_addr=0x83800000
ipaddr=192.168.10.2
kernel_addr_load=0x87000000
kernel_addr_r=0x96000000
kernel_image=Image.gz
load_cmd=load ${mender_uboot_root}
load_cmd_boot=load ${mender_uboot_boot}
load_overlays_file=load ${mender_uboot_boot} ${loadaddr} ${overlays_file}; env import -t ${loadaddr} ${filesize}
load_prefix=boot/
loadaddr=0x87000000
loadm4image_0=${load_cmd} ${loadaddr} ${m4_0_image}
m4_0_image=m4_0.bin
m4boot_0=run loadm4image_0; dcache flush; bootaux ${loadaddr} 0
mender_altbootcmd=if test ${mender_boot_part} = 2; then setenv mender_boot_part 3; setenv mender_boot_part_hex 3; else setenv mender_boot_part 2; setenv mender_boot_part_hex 2; fi; setenv upgrade_available 0; saveenv; run mender_setup
mender_boot_kernel_type=booti
mender_boot_part=2
mender_boot_part_hex=2
mender_boot_part_name=/dev/mmcblk0p2
mender_check_saveenv_canary=1
mender_dtb_name=imx8qxp-colibri-eval-v3.dtb
mender_kernel_name=Image.gz
mender_kernel_root=/dev/mmcblk0p2
mender_kernel_root_name=/dev/mmcblk0p2
mender_post_setup_commands= ; setenv tdxargs ${tdxargs} ${bootargs};
mender_saveenv_canary=1
mender_setup=if test "${mender_saveenv_canary}" != "1"; then setenv mender_saveenv_canary 1; saveenv; fi; if test "${mender_pre_setup_commands}" != ""; then run mender_pre_setup_commands; fi; if test "${mender_systemd_machine_id}" != ""; then setenv bootargs "systemd.machine_id=${mender_systemd_machine_id} ${bootargs}"; fi; setenv mender_kernel_root /dev/mmcblk0p${mender_boot_part}; if test ${mender_boot_part} = 2; then setenv mender_boot_part_name /dev/mmcblk0p2; else setenv mender_boot_part_name /dev/mmcblk0p3; fi; setenv mender_kernel_root_name ${mender_boot_part_name}; setenv mender_uboot_root mmc 0:${mender_boot_part_hex}; setenv mender_uboot_root_name ${mender_boot_part_name}; setenv expand_bootargs "setenv bootargs \\"${bootargs}\\""; run expand_bootargs; setenv expand_bootargs; if test "${mender_post_setup_commands}" != ""; then run mender_post_setup_commands; fi
mender_try_to_recover=if test ${upgrade_available} = 1; then reset; fi
mender_uboot_boot=mmc 0:1
mender_uboot_dev=0
mender_uboot_if=mmc
mender_uboot_root=mmc 0:2
mender_uboot_root_name=/dev/mmcblk0p2
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
mmcargs=setenv bootargs console=${console},${baudrate} root=PARTUUID=${uuid} rootwait mmcdev=0
mmcpart=1
netmask=255.255.255.0
overlays_file=overlays.txt
overlays_prefix=overlays/
panel=NULL
preboot=setenv fdtfile ${soc}-colibri-${fdt_board}.dtb
ramdisk_addr_r=0x8a000000
rootfsargs_set=env set rootfsargs root=${mender_kernel_root} ro rootwait
rootpath=/srv/nfs
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done; setenv devplist
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x83200000
sec_boot=no
serial#=06800649
serverip=192.168.10.1
set_apply_overlays=env set apply_overlays "for overlay_file in \\${fdt_overlays}; do echo Applying Overlay: \\${overlay_file} && ${load_cmd_boot} \\${loadaddr} \\${overlays_prefix}\\${overlay_file} && fdt apply \\${loadaddr}; env set overlay_file; done; true"
set_bootcmd_dtb=env set bootcmd_dtb "echo Loading DeviceTree: \\${fdtfile}; ${load_cmd} \\${fdt_addr_r} \\${load_prefix}\\${fdtfile}"
set_bootcmd_kernel=env set bootcmd_kernel "${load_cmd} \\${kernel_addr_load} \\${load_prefix}\\${kernel_image}"
set_load_overlays_file=env set load_overlays_file "${load_cmd_boot} \\${loadaddr} \\${overlays_file}; env import -t \\${loadaddr} \\${filesize}"
setup=run mmcargs
soc=imx8qxp
soc_type=imx8qxp
tdxargs=console=ttyLP3,115200 earlycon=lpuart32,0x5a090000,115200,115200 root=PARTUUID= rootwait mmcdev=0
update_uboot=askenv confirm Did you load u-boot-dtb.imx (y/N)?; if test "$confirm" = "y"; then setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200; mmc dev 0 1; mmc write ${loadaddr} 0x0 ${blkcnt}; fi
upgrade_available=0
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
vendor=toradex
vidargs=video=imxdpufb5:off video=imxdpufb6:off video=imxdpufb7:off

Environment size: 7532/16379 bytes

My partions look like this:


Partition Map for MMC device 0  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     49152           65536           afdac397-01     0c Boot
  2     114688          7241728         afdac397-02     83
  3     7356416         7241728         afdac397-03     83
  4     14598144        262144          afdac397-04     83

Terminal output trying to boot:


U-Boot 2020.04-5.7.0-devel+git.33bb8e968332 (Jul 06 2022 - 12:21:53 +0000)

CPU:   NXP i.MX8QXP RevC A35 at 1200 MHz at 44C

DRAM:  2 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... OK
In:    serial
Out:   serial
Err:   serial
Model: Toradex Colibri iMX8 QuadXPlus 2GB Wi-Fi / BT IT V1.0D, Serial# 06800649

 BuildInfo:
  - SCFW 216a2c2e, SECO-FW c9de51c0, IMX-MKIMAGE 6a315dbc, ATF 2fa8c63
  - U-Boot 2020.04-5.7.0-devel+git.33bb8e968332

flash target is MMC:0
Net:   eth0: ethernet@5b040000 [PRIME]
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:  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
2902 bytes read in 13 ms (217.8 KiB/s)
## Executing script at 83200000
Loading DeviceTree: imx8qxp-colibri-eval-v3.dtb
126986 bytes read in 18 ms (6.7 MiB/s)
112 bytes read in 6 ms (17.6 KiB/s)
Applying Overlay: colibri-imx8x_parallel-rgb_overlay.dtbo
1498 bytes read in 20 ms (72.3 KiB/s)
Applying Overlay: colibri-imx8x_ad7879_overlay.dtbo
403 bytes read in 13 ms (30.3 KiB/s)
Applying Overlay: display-vga_overlay.dtbo
831 bytes read in 15 ms (53.7 KiB/s)
10642597 bytes read in 250 ms (40.6 MiB/s)
Uncompressed size: 25700864 = 0x1882A00
Bootargs: root=/dev/mmcblk0p2 ro rootwait video=imxdpufb5:off video=imxdpufb6:off video=imxdpufb7:off console=ttyLP3,115200 earlycon=lpuart32,0x5a090000,115200,115200 root=PARTUUID= rootwait mmcdev=0
## Flattened Device Tree blob at 83100000
   Booting using the fdt blob at 0x83100000
   Loading Device Tree to 00000000fce25000, end 00000000fce67fff ... OK

Starting kernel ...


After further digging this is where I think I am hanging:

booti ${kernel_addr_r} - ${fdt_addr_r}

Hi @moh-dev

That is simply the command when U-Boot launches the kernel so unfortunately, it doesn’t tell us much. But the colibri-imx8 board has never been integrated with Mender. Have you made an attempt at the settings for that? At a minimum you will need to create the colibri-imx8 bootloader config here: meta-mender-community/meta-mender-toradex-nxp/recipes-bsp/u-boot/files/toradex-bsp-5.6.0 at dunfell · mendersoftware/meta-mender-community · GitHub

I’ve not looked into this but it shouldn’t be too difficult.

Drew

Hi both @drewmoseley and @moh-dev I’ve just created a PR for colibri-imx8x for Toradex BSP 5.7.0. Seems to be working fine in my builds.

Thanks.

I also figured it out last night.

This is change I needed to get the system to boot.

colibri-imx8x.h

 -  "console=ttyLP3,115200 earlycon=lpuart32,0x5a090000,115200\0"
+  "console=ttyLP3\0" \