iMX8QM hangs at 'Starting kernel ...'

Hi,

I’m building a custom Yocto image, and have incorporated the meta-boot2qt layer, as I need to use the eglfs_viv integration. I have a range of patches in use for the kernel and u-boot, and the build compiles successfully. I’ve used these same kernel and u-boot patches on the Toradex-supplied Qt5 multimedia example without issue. I’ve incorporated the meta-boot2qt layer as I need to use the eglfs_viv plugin.

The build specifications are as follows:

  1. Distro: tdx-xwayland
  2. Distro version: 5.5.0-devel-20220130233056+build.0
  3. U-Boot version: 2020.04-5.5.0-devel+git.81bc8894031d

I setup the OE build environment per the usual process (as documented in the Toradex literature), and added the meta-bootqt layer with:

git clone --depth 1 --branch v5.15.8-lts git://code.qt.io/yocto/meta-boot2qt.git

I made sure to use a branch of meta-boot2qt which was compatible with the Dunfell branch of Yocto in use for the OE build. With the meta-boot2qt layer added, I copied their “b2qt-embedded-qt5-image” image and modified it as the build image. As mentioned above, this all compiled without issue.

After flashing the new image to the Apalis iMX8QM via the latest Toradex Easy Installer (version 5.5.0+build.6), I receive the following output on booting:

U-Boot 2020.04-5.5.0-devel+git.81bc8894031d (Nov 30 2021 - 11:36:12 +0000)

CPU:   NXP i.MX8QM RevB A53 at 1200 MHz

DRAM:  4 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... OK
In:    serial
Out:   serial
Err:   serial
Model: Toradex Apalis iMX8 QuadMax 4GB IT V1.0B, Serial# 06543249

 BuildInfo:
  - SCFW 778670e2, SECO-FW d63fdb21, IMX-MKIMAGE 8947fea3, ATF 835a8f6
  - U-Boot 2020.04-5.5.0-devel+git.81bc8894031d

switch to partitions #0, OK
mmc0(part 0) is current device
flash target is MMC:0
Net:   eth0: ethernet@5b040000
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:  0
MMC: no card present
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
5754 bytes read in 16 ms (350.6 KiB/s)
## Executing script at 83100000
** Bad device specification ${boot_devtype} ${boot_devnum} **
** Bad device specification ${boot_devtype} ${boot_devnum} **
Loading hdp firmware from 0x000000009c000000 offset 0x0000000000002000
Loading hdp firmware Complete
Loading DeviceTree: imx8qm-apalis-eval.dtb
168354 bytes read in 34 ms (4.7 MiB/s)
43 bytes read in 16 ms (2 KiB/s)
Applying Overlay: apalis-imx8_hdmi_overlay.dtbo
2177 bytes read in 27 ms (78.1 KiB/s)
7090737 bytes read in 223 ms (30.3 MiB/s)
Uncompressed size: 16089600 = 0xF58200
Bootargs: pci=nomsi root=PARTUUID=b6d6a897-02 ro rootwait
## Flattened Device Tree blob at 83000000
   Booting using the fdt blob at 0x83000000
   Loading Device Tree to 00000000fd600000, end 00000000fd64cfff ... OK

Starting kernel ...

It seems that there’s some error with the boot_devtype and boot_devnum device specification? I’ve checked the u-boot-initial-env-sd file in the build deploy TEZI folder, and everything seems normal. I’ve also tried setting the values directly in the U-Boot command line (mmc and 0 respectively), but the issue remains.

I’ve done some research on this issue and haven’t come up with anything else; are you able to point me in the right direction?

Thanks!

Hi @jars121

Did your system work before appling meta-boot2qt layer ?

Is your console parameter set correctly in u-boot env?
I’m asking because I had a similar problem in the past and the system was running correctly but my console parameter was set wrong and also my system was hanging on “Starting kernel”.

Hi @Merlin

Thanks for your comment. I’ve used the same build with Toradex’s Qt5 multimedia image (without adding the meta-boot2qt layer) without issue.

Was your device actually running correctly, and the console just wasn’t being updated once the kernel started? What issue did you find with your console parameter?

EDIT: I also suspect that if it were just a console parameter issue, I wouldn’t be seeing the ** Bad device specification ${boot_devtype} ${boot_devnum} ** error in the u-boot output.

I know this isn’t a direct answer, but my experience has been better with starting from the boot2qt image from Qt. I follow the steps described here:

https://doc.qt.io/QtForDeviceCreation/b2qt-customization-requirements.html

I assume you have a good reason to not go that route, but it could be informative if it works as to what layers are different.

Also, I’m curious what advantages there are to building the way you are (as I’ve never done it that way). I’ve not built for the Apalis, but 6/7/8 of colibris.

Hi @Patricks

Thanks for your comment, it’s much appreciated. I actually tried using the boo2qt image previously, but was never able to fetch the Qt files from their repository when compiling. I followed the guide for registering with Gerrit, but neither the SSH or HTTPS authentication methods seemed to work.

I’ve incorporated the meta-boot2qt layer into the standard OE build previously on an iMX6 so I figured I’d give that a go in the iMX8 in the meantime. I don’t know if there are any advantages per se, but I’m fairly comfortable with the standard OE build process, and incorporating a single additional layer is (seemingly) much more straight forward than trying to get Gerrit to work with the boot2qt image.

I struggled with the Gerrit login working as well. I think my issue was one of timing, but I documented my steps to help the next person in my company figure it out. You’ve probably already done this, but it may work after giving time for the account to finish getting created/sync’d. For me, it wasn’t until the user settings page showed my correct login email that it started working.

  • Goto https://codereview.qt-project.org
  • Click to login (you may also need to pick a username)
  • Once logged in, click on your username in the top right and select settings
  • Under Settings->SSH Keys, add your ssh public key
  • Add the following to your ~/.ssh/config
Host codereview.qt-project.org
    Port 29418
    # Use your Gerrit username, not email or your username on your own machine.
    # You can view this from Settings in gerrit when logged in.
    User <yourgerritusername>
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_rsa

Thanks again Patrick, your support is much appreciated.

I think I’ve made some headway. I had been through the exact Gerrit process you’ve listed yesterday, and it looks like it may have been a timing issue as well. I’ve tried another boot2qt build this morning, and didn’t run into the same access errors as I was seeing yesterday. The build didn’t complete however, I ran into some issues right at the end of the build (to do with packaging the final image).

I’m trying a clean build at the moment. Just to confirm, you used the repo init -u git://code.qt.io/yocto/boot2qt-manifest -m <manifest> repo for boot2qt?

It looks like I spoke too soon. I’ve just finished the latest clean build, this time using boot2qt (as discussed above) rather than incorporating the meta-boot2qt layer into the standard OE build. The result is exactly the same; the build compiled without issue, I’m able to flash the image to the iMX8QM with Toradex Easy Installer, but the device hangs at “Starting kernel …”:

U-Boot 2020.04-0+git.81d4185cf830 (Sep 21 2021 - 10:05:05 +0000)

CPU:   NXP i.MX8QM RevB A53 at 1200 MHz

DRAM:  4 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... OK
In:    serial
Out:   serial
Err:   serial
Model: Toradex Apalis iMX8 QuadMax 4GB IT V1.0B, Serial# 06543249

 BuildInfo:
  - SCFW bc122ee1, SECO-FW d63fdb21, IMX-MKIMAGE 8947fea3, ATF 835a8f6
  - U-Boot 2020.04-0+git.81d4185cf830

switch to partitions #0, OK
mmc0(part 0) is current device
Saving Environment to MMC... Writing to MMC(0)... OK
flash target is MMC:0
Net:   eth0: ethernet@5b040000
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:  0
MMC: no card present
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
5752 bytes read in 16 ms (350.6 KiB/s)
## Executing script at 83100000
** Bad device specification ${boot_devtype} ${boot_devnum} **
** Bad device specification ${boot_devtype} ${boot_devnum} **
Loading hdp firmware from 0x000000009c000000 offset 0x0000000000002000
Loading hdp firmware Complete
Loading DeviceTree: imx8qm-apalis-eval.dtb
168544 bytes read in 34 ms (4.7 MiB/s)
43 bytes read in 15 ms (2 KiB/s)
Applying Overlay: apalis-imx8_hdmi_overlay.dtbo
2177 bytes read in 27 ms (78.1 KiB/s)
7087619 bytes read in 223 ms (30.3 MiB/s)
Uncompressed size: 16089600 = 0xF58200
Bootargs: pci=nomsi root=PARTUUID=7b1e82de-02 ro rootwait
## Flattened Device Tree blob at 83000000
   Booting using the fdt blob at 0x83000000
   Loading Device Tree to 00000000fd600000, end 00000000fd64cfff ... OK

Starting kernel ...

As with my original post, the device specification error remains:

** Bad device specification ${boot_devtype} ${boot_devnum} **

I don’t modify the resultant u-boot-initial-env-sd:

bootcmd=run distro_bootcmd
bootdelay=1
baudrate=115200
ipaddr=192.168.10.2
serverip=192.168.10.1
preboot=setenv fdtfile ${soc}-apalis${variant}-${fdt_board}.dtb
rootpath=/srv/nfs
netmask=255.255.255.0
loadaddr=0x87000000
arch=arm
cpu=armv8
board=apalis-imx8
board_name=apalis-imx8
vendor=toradex
soc=imx8
sec_boot=no
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
boot_pci_enum=pci enum
boot_net_usb_start=usb start
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
scsi_init=if ${scsi_need_init}; then scsi_need_init=false; scsi scan; fi
scsi_boot=run scsi_init; if scsi dev ${devnum}; then devtype=scsi; run scan_dev_for_boot_part; fi
boot_efi_binary=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr ${fdtcontroladdr};fi;load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
efi_dtb_prefixes=/ /dtb/ /dtb/current/
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootaa64.efi; then echo Found EFI removable media binary efi/boot/bootaa64.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
boot_prefixes=/ /boot/
boot_scripts=boot.scr.uimg boot.scr
boot_script_dhcp=boot.scr.uimg
boot_targets=mmc1 mmc2 mmc0 usb0 dhcp 
boot_syslinux_conf=extlinux/extlinux.conf
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
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
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
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
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;run scan_dev_for_efi;
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
bootcmd_mmc1=devnum=1; run mmc_boot
bootcmd_mmc2=devnum=2; run mmc_boot
bootcmd_mmc0=devnum=0; run mmc_boot
bootcmd_usb0=devnum=0; run usb_boot
bootcmd_dhcp=setenv devtype dhcp; run boot_net_usb_start; run boot_pci_enum; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00011:UNDI:003000;setenv bootp_arch 0xb;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
distro_bootcmd=scsi_need_init=; for target in ${boot_targets}; do run bootcmd_${target}; done
m4_0_image=m4_0.bin
m4_1_image=m4_1.bin
loadm4image_0=${load_cmd} ${loadaddr} ${m4_0_image}
loadm4image_1=${load_cmd} ${loadaddr} ${m4_1_image}
m4boot_0=run loadm4image_0; dcache flush; bootaux ${loadaddr} 0
m4boot_1=run loadm4image_1; dcache flush; bootaux ${loadaddr} 1
fdt_addr_r=0x83000000
hdp_addr=0x9c000000
kernel_addr_r=0x80280000
ramdisk_addr_r=0x8a000000
scriptaddr=0x83100000
boot_scripts=boot.scr
boot_script_dhcp=boot.scr
bootcmd_mfg=select_dt_from_module_version && fastboot 0
boot_file=Image
console=ttyLP1 earlycon
fdt_high=
boot_fdt=try
fdt_board=eval
finduuid=part uuid mmc ${mmcdev}:2 uuid
hdp_file=hdmitxfw.bin
loadhdp=${load_cmd} ${hdp_addr} ${hdp_file}
mmcautodetect=yes
mmcargs=setenv bootargs console=${console},${baudrate} root=PARTUUID=${uuid} rootwait mmcdev=0
mmcpart=1
panel=NULL
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
video=imxdpufb5:off video=imxdpufb6:off video=imxdpufb7:off
setup=run loadhdp; hdp load ${hdp_addr}; run mmcargs
defargs=pci=nomsi

Is there something I’m missing here?

I’ve tried using the nightly pre-release of Toradex Easy Installer (20220-01-31 | 5.6.0-devel-20220131+build.260) in case the Latest Release version I’ve been using (5.5.0+build.6) were to blame for some reason. Unfortunately the “Bad device specification” error and kernel hang issue remains.

Just closing this issue out. I ended up doing a plethora of clean builds, tweaking something each time, and in the end determined that I had an issue with my modified device tree. I’ve pulled a number of nodes out of the device tree, and now the kernel issue is fixed. I haven’t identified the specific device tree issue just yet, but I wanted to post a conclusion here in case someone has a similar ‘kernel hang’ issue in the future.