Unable to successfully boot Raspberry Pi 4 Yocto with Mender

Hello,

I have followed the below guide to generate an Image using Yocto for the Raspberry Pi 4. After a couple of hours, the compilation finished with success. My host OS is Ubuntu 20.04.

The branch was selected as “dunfell” with recipe as “core-image-base”

Below is my local.conf file for reference:

DISTRO ?= "poky"

PACKAGE_CLASSES ?= "package_rpm"

EXTRA_IMAGE_FEATURES ?= "debug-tweaks"

USER_CLASSES ?= "buildstats image-mklibs image-prelink"

PATCHRESOLVE = "noop"

BB_DISKMON_DIRS ??= "\
    STOPTASKS,${TMPDIR},1G,100K \
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,${SSTATE_DIR},1G,100K \
    STOPTASKS,/tmp,100M,100K \
    ABORT,${TMPDIR},100M,1K \
    ABORT,${DL_DIR},100M,1K \
    ABORT,${SSTATE_DIR},100M,1K \
    ABORT,/tmp,10M,1K"

PACKAGECONFIG_append_pn-qemu-system-native = " sdl"

CONF_VERSION = "1"


INHERIT += "rm_work"


MENDER_ARTIFACT_NAME = "release-1"

INHERIT += "mender-full"

DISTRO_FEATURES_append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""


MACHINE ?= "raspberrypi4"

RPI_USE_U_BOOT = "1"

MENDER_STORAGE_TOTAL_SIZE_MB = "1024"
MENDER_BOOT_PART_SIZE_MB = "40"
IMAGE_INSTALL_append = " kernel-image kernel-devicetree"
IMAGE_FSTYPES_remove += " rpi-sdimg"

MENDER_FEATURES_ENABLE_append = " mender-uboot mender-image-sd"
MENDER_FEATURES_DISABLE_append = " mender-grub mender-image-uefi"

KERNEL_DEVICETREE = "bcm2711-rpi-4-b.dtb"

ENABLE_UART = "1"

After burning the .sdimg to an SD card, I have inserted the SD card to the Raspberry Pi 4, connected the board to the PC via USB-serial cable and turned on the board.

Below is my log from serial for reference:

https://1drv.ms/u/s!AuZmsghKqp9tjPJyucDmX7-I60vpxA?e=iM3xQe

It boots all the way until “raspberrypi4 login:” and then shows loading some bluetooth drivers and at the end it gets stuck.

What’s more interesting is that, when I plug and unplug Ethernet, output shows like this:

Poky (Yocto Project Reference Distro) 3.0.4 raspberrypi4 ttyS0                  
                                                                                
raspberrypi4 login: [   13.279168] Bluetooth: HCI UART driver ver 2.3           
[   13.283732] Bluetooth: HCI UART protocol H4 registered                       
[   13.289076] Bluetooth: HCI UART protocol Three-wire (H5) registered          
[   13.297796] Bluetooth: HCI UART protocol Broadcom registered                 
[   13.454604] Bluetooth: BNEP (Ethernet Emulation) ver 1.3                     
[   13.460011] Bluetooth: BNEP filters: protocol multicast                      
[   13.465394] Bluetooth: BNEP socket layer initialized                         
[   13.492085] Bluetooth: RFCOMM TTY layer initialized                          
[   13.497054] Bluetooth: RFCOMM socket layer initialized                       
[   13.502479] Bluetooth: RFCOMM ver 1.11                                       
[  910.482314] bcmgenet fd580000.genet eth0: Link is Down                       
[  925.042407] bcmgenet fd580000.genet eth0: Link is Up - 1Gbps/Full - flow conx

So, it seems that it’s not stuck at loading Bluetooth.

I would really appreciate if anyone could help me in this issue.

Best Regards,
Lakshantha

data written to stdout past the login screen is not unusual over serial. when you say stuck, do you mean its not responding to keyboard input over the serial connection?

Thanks for the response.

I mean, I cannot login.

When I press ENTER, there is no response.

In normal scenario of a boot process, it should stop at login so that I can enter username. But it’s not the case here.

from your log it looks like you into userspace with userspace services starting up.
so i would first check your serial config settings in your terminal emulator to ensure they are correct for two-way comms.

I am using minicom.

sudo minicom -D /dev/ttyUSB0 -b 115200

This is how I access.

This is how I normally access my RPi OS over serial and it has responded to keyboard inputs in the same configuration before.

Do I need to create a user in local.conf ?

hmmm, not sure then. can you see it on the network, ping it etc

Now I have Disabled “Hardware Flow Control” in minicom setup and when I press ENTER, it shows login and I can finally login now!

It’s weird. For RPi OS I dont need to do this

great. prob because you need to match how its configured on the back-end, and its configured differently depending on how the image is built

You mean match with Mender config side?

no, with the yocto build settings, there will be a machine config in your yocto build somewhere with the settings

Oh I see. Got you.

Thank you very much for the guidance again. Really appreciate it!

You have been very helpful yesterday also with my X86 local Mender Server issue.

Now finally I can test local OTA updates from the X86 Mender Server to the RPi4 client!

Best Regards,
Lakshantha

2 Likes