Raspberry Pi 5 support

Hi, has anybody tried using Mender on Raspberry Pi 5? When can we expect the official support?

It’s not yet officially supported in Yocto either, but there have been some changes for porting it.

Hi @janaperic,

I am actively watching the situation there, but we are tied to Yocto upstream. Until a reasonably well maintained BSP (preferably in GitHub - agherzan/meta-raspberrypi: Yocto/OE BSP layer for the Raspberry Pi boards) emerges, Mender is not able to support it. The main problem is that the standard RPi boot flow does not use u-boot, so until that or something similar is in place, no A/B mechanism is possible.

Where have you seen any Yocto work being done on it?

Greetz,
Josef

Hi Josef,

Thank you for a quick reply.
I’ve come across this PR (Add Raspberry Pi 5 by floion · Pull Request #1237 · agherzan/meta-raspberrypi · GitHub) for adding RPi 5 config files to meta-raspberrypi, which gave me hope it will be merged soon.

If I understood correctly their blocker right now is U-Boot, which doesn’t yet support RPi 5, and I haven’t found any information on when that’s going to be solved.

I guess we will have to wait a bit longer :slight_smile:
Thanks again!

Hi @janaperic,

Thats a nice find! With the mentioned company working on it, u-boot support is probably not too far away too. So thats good news indeed. Maybe @leon-anavi can point us to a preliminary fork here or at least give a short update?

Greetz,
Josef

2 Likes

Yes, Raspberry Pi 5 support hasn’t been added to U-Boot yet. Recently Dmitry Malkin shared in the U-Boot mailing list 3 patches to add initial support for Raspberry Pi 5 to a state just to enter U-Boot’s command-line prompt through UART: U-Boot - Patchwork

Furthermore a U-Boot device tree will be required for Raspberry Pi 5 and a driver to read the microSD card. As far as I saw from the Linux kernel device tree and drivers, in Raspberry Pi 5 SDIO1 is used to drive the SD card therefore I expect something similar will be required in U-Boot. So there is work in progress but don’t hold your breath. Raspberry Pi 5 is quite different from Raspberry Pi 4 and it is not just a matter of a few configurations to get U-Boot fully working.

2 Likes

Some u-boot related remarks:

The Raspberry Pi bootloader does read and modify the device tree binary. This becomes a headache when running u-boot on top of the stock boot loader. I described some details here: Fix the dtb handling during A/B update · Issue #23 · lueschem/edi-pi · GitHub

Luckily, the Raspberry Pi folks baked the tryboot feature into the stock boot loader/kernel: firmware: raspberrypi: Add support for tryonce reboot flag · raspberrypi/linux@7576667 · GitHub

Based on this feature it is possible to implement a robust A/B mechanism without u-boot. I have done this for Debian and you can find the description here: Debian Bullseye Upgrade for the Raspberry Pi - edi

Another guy has done an integration with a custom update module too: GitHub - silitics/rugpi: An open-source platform empowering you to build innovative products based on Raspberry Pi.

The tryboot feature has proven to be very reliable on my Debian based installations. Once I get the Pi 5 I will also integrate into the edi-pi setup (GitHub - lueschem/edi-pi: Debian tool chain and image generation for Raspberry Pi 2, 3 and 4.). Also on Yocto I would prefer “tryboot” over u-boot.

1 Like

Hi @lueschem,

Thanks a lot for the input! Yeah the tryboot approach is definitely a valid alternative - just nobody has taken on it so far and/or contributed it. So in edi, there already is a state script setup respectively update module that offers these semantics? If so, can you point me to it? Baking it into a Yocto build should not be too complicated then.

Plus, the rugpi thing is neat, never heard of that so far. Thanks for bringing it up!

Greetz,
Josef

Hi,

In the mean time there are some very promising patches for Raspberry Pi 5 in the U-Boot mailing list by Ivan T. Ivanov which are based on previous patch set by Dmitry Malkin. With some modifications on top of them I was able to boot Poky images with meta-raspberrypi for Raspberry Pi 5. I am planning to integrate this in meta-mender-raspberrypi.

Best regards, Leon

3 Likes

With the edi setup I am actually using a script that fakes u-boot so that mender-client thinks that it is running on a normal u-boot based system. The script intercepts (with the help of the PATH variable) the calls to fw_setenv, fw_printenv and reboot.
I did not analyze how rugpi does achieve the same goal of matching mender together with tryboot using a custom update module.

1 Like

Now thats an interesting approach @lueschem. :slight_smile: It definitely makes it easier to transplant into an existing Mender setup. Will need to play a bit with it.

By just looking at it, the tryboot approach needs a different partitioning scheme though? Or am I mistaken here, and boot+A+B+persistent should work?

Greetz,
Josef

Yes, this is what I am using and what was part of the initial offering. Now the bootloader also supports multiple boot partitions.

1 Like