Supporting various RPi Compute Modules in one image

Hi there, I’m currently facing something similar.

We have some devices running CM3, some CM3+, some CM4S and CM4 (so everything across the board)

I was hoping you could point me in the direction of how I can make debian with mender run on all of these?

Do I have to rebuild u-boot for each different one? How would I be able to do that? I know mender has some specific u-boot fork, but unfortunately I’m still at the beginning of my mender-journey.

Any tips or just hints in some direction would be very appreciated :slight_smile:

Kind regards

Hi @bztry,

Mender does not have a u-boot fork, but a relatively small patchset :slight_smile:
I’m not very familiar with the CMs, but in general the ones you mentioned should be able to run a common kernel, just differing device trees. Hence, the challenge is to provide a mechanism which loads the one matching your specific instantiation. From a Mender standpoint, building separate u-boot incarnations is not required.

As a starting point, have you tried using the generic mender-convert approach to your golden image? Did you encounter specific problems?


Hi @TheYoctoJester ,

thank you for this speedy feedback. Great forum with lots of tips here! Misused the word “fork” on my end, apologies :slight_smile:

What I tried so far with my CM3 device:

Flashed the original RpiOS (Bullseye, 32-bit, latest version) to USB → Booted fine

Flashed the mender Rpi3 image from here: Prepare a Raspberry Pi device | Mender documentation to USB → Did not boot

Run mender-convert on the original RpiOS from above, flashed to USB → Did not boot

And while writing this post, I decided to stick the USB in my normal rpi3 (not cm3) to try if it works and it looks like it does not, while it does work from sd-card. I just never noticed because I always run standard pis with sdcards and my CM3/CM4 devices have either USB or eMMC boot.

Which leads me to believe my issue is a duplicate of this thread?: Booting a converted image from USB - #5 by sdynes

I’ve also got some CM4 / CM4S devices (can only test with them next week) which have an integrated eMMC storage. Is eMMC also affected by this issue?

I can gladly test the workaround “kacf” mentioned in the other thread, but I do not know how :smiley:

Kind regards

Hi @bztry,

Not as speedy this time, sorry - but I think I found at least part of the problem. Using a single converted image for various board will not work, because the u-boot configurations differ. A board specific u-boot and device tree will not boot on another variant. Hence, you need separately converted images per board type.
Some additional thoughts and information:

  • the Raspberry Pi OS images can pull off that trick, because they do not use u-boot, and their binary blob bootloader employs some tricks to hand off to the kernel directly.
  • there is a Raspberry Pi specific A/B switching technique too. It can be used through an Update Module or state scripts, for example. There is no publicly available integration for this (yet) in mender-convert, but by @lueschem or Home | Rugpi can make use of it. Maybe this is helpful for your use case.



What I did was I downloaded the “forked” mender-boot from their git repo.
In the file configs/rpi_3_32b_defconfig, set CONFIG_DEFAULT_DEVICE_TREE to bcm2837-rpi-cm3-io3. Build the kernel like shown here:
Building with GCC — Das U-Boot unknown version documentation
on ubuntu or vm running ubuntu. Copy the generated u-boot.bin to kernel7.img into the image from mender raspiOS you downloaded.

Unfortunately, they are using an older version of u-boot which does not contain the device tree for the RPI cm 4s. Wonder if they are planning to update this anytime soon so we can also use rpi cm4s with Mender!

1 Like