# Raspberry Pi 5

**URL:** <https://hub.mender.io/t/raspberry-pi-5/6689>\
**Category:** Yocto Project\
**Tags:** yocto, raspberrypi-5, scarthgap\
**Created:** [March 25, 2024, 12:09pm UTC](https://hub.mender.io/t/raspberry-pi-5/6689 "2024-03-25T12:09:20Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [March 25, 2024, 12:09pm UTC](https://hub.mender.io/t/raspberry-pi-5/6689/1 "2024-03-25T12:09:21Z")

</div>

# Board description

The Raspberry Pi 5 Model is a popular single board computer based on Broadcom SoCs. It is the most recent board within the Raspberry Pi family.

 ![ID_230061_orig](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/2X/d/da1189218e7bf9e6a48373af74b84d3f14c6ef5d.jpeg)

URL: [https://www.raspberrypi.com/products/raspberry-pi-5/](https://www.raspberrypi.com/products/raspberry-pi-5/?target=_blank)

Wiki: [https://elinux.org/RPi\_Hub](https://elinux.org/RPi_Hub?target=_blank)

# Test results

Raspberry Pi 5 is a community contributed board integration, extending the range of supported RPi family boards to the newest and most powerful interation.

The Yocto Project releases in the table below have been tested by the Mender community. Please update it if you have tested this integration on other [Yocto Project releases](https://wiki.yoctoproject.org/wiki/Releases?target=_blank):

| Yocto Project | Build | Runtime |
| --- | --- | --- |
| scarthgap (5.0) | :test_works: | :test_works: [1](#footnote1) |

1. Disabled GRUB integration for ARM systems which is default in meta-mender. U-boot is still primary integration method for this board.

**Build** Means that the Yocto Project build using this Mender integration completes without errors and outputs images.

**Runtime** Means that Mender has been verified to work on the board. For U-Boot-based boards, the [integration checklist](https://docs.mender.io/system-updates-yocto-project/board-integration/bootloader-support/u-boot/integration-checklist?target=_blank) has been verified.

# Getting started

## Prerequisites

- A supported Linux distribution and dependencies installed on your workstation/laptop as described in the [Yocto Development Manual](https://docs.yoctoproject.org/dev-manual/start.html#preparing-the-build-host)
- NOTE. Instructions depend on which Yocto version you intend to use.
- kas [installed](https://hub.mender.io/t/using-kas-to-reproduce-your-yocto-builds/6020) and in your `PATH`.

## Configuring the build

### Setup Yocto environment

Create a directory for your `mender-raspberrypi5` setup to live in and clone the

meta information.

```bash
mkdir mender-raspberrypi5 && cd mender-raspberrypi5

```

Clone the `meta-mender-community` layer:

```bash
git clone https://github.com/theyoctojester/meta-mender-community \
  -b scarthgap

```

## Setup build environment

Change into the cloned repository and create a directory to hold the build:

```bash
cd meta-mender-community
mkdir my-raspberrypi5
cd my-raspberrypi5

```

Use `kas` to set up the build structure:

```bash
kas shell ../kas/raspberrypi5.yml

```

This opens a sub-shell which is initialized for the build process. You can close it using the `exit` command.

### Configure Mender server URL (optional)

This section is not required for a successful build but images that are generated by default are only suitable for usage with the Mender client in [standalone mode](https://docs.mender.io/artifact-creation/standalone-deployment), due to lack of server configuration.

You can edit the `conf/local.conf` file to provide your Mender server configuration, ensuring the generated images and Mender Artifacts are connecting to the Mender server that you are using. To use Hosted Mender, add your tenant token and set the server URL like this:

```auto
MENDER_SERVER_URL = "https://hosted.mender.io"
MENDER_TENANT_TOKEN = "<copy token here>"

```

To get your tenant token:

- log in to [https://hosted.mender.io](https://hosted.mender.io)
- click your email at the top right and then “My organization”
- press the “COPY TO CLIPBOARD”
- assign content of clipboard to MENDER\_TENANT\_TOKEN

### Building the image

You can now proceed with building an image:

```bash
bitbake core-image-base

```

Replace `core-image-base` with your desired image target.

### Using the build output

After a successful build, the relevant images and build artifacts are:

- `tmp/deploy/images/raspberrypi5/core-image-base-raspberrypi5.sdimg`
- `tmp/deploy/images/raspberrypi5/core-image-base-raspberrypi5.mender`

The disk image (with `.sdimg` suffix) is used to provision the device storage for devices without Mender running already. Please proceed to [the official documentation on provisioning a new device](https://docs.mender.io/system-updates-yocto-project/provisioning-a-new-device?target=_blank) for steps to do this.

On the other hand, if you already have Mender running on your device and want to deploy a rootfs update using this build, you should use the [Mender Artifact](https://docs.mender.io/overview/artifact) files, which have `.mender` suffix. You can either deploy this Artifact in managed mode with the Mender server (upload it under Releases in the server UI) or by using the Mender client [standalone mode](https://docs.mender.io/artifact-creation/standalone-deployment).

# References

- The template files that are used by this setup can be found in [mender-mender-community](https://github.com/theyoctojester/meta-mender-community/tree/raspberrypi5/kas/raspberrypi5.yml?target=_blank)
- The Mender integration layer for Raspberry Pi boards can be found in [meta-mender](https://github.com/mendersoftware/meta-mender-community/tree/scarthgap/meta-mender-raspberrypi?target=_blank).
- The official [Mender documentation](https://docs.mender.io/) explains how Mender works. This is simply a board-specific complement to the official documentation.

# Known issues

## Tested board versions

- Raspberry Pi 5 4GB - Josef, 2024-03-25

* * *

_If this post was useful to you, please press like, or leave a thank you note to the contributor who put valuable time into this and made it available to you. It will be much appreciated!_

---

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [August 13, 2024, 9:19am UTC](https://hub.mender.io/t/raspberry-pi-5/6689/2 "2024-08-13T09:19:44Z")

</div>

Awesome work!

The Pi3 and Pi4 posts all say that the bootfiles, firmware, etc are not copies. Is that issue solved with the Pi5 giving us true a/b booting? (except for uboot i guess?)

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [August 13, 2024, 9:28am UTC](https://hub.mender.io/t/raspberry-pi-5/6689/3 "2024-08-13T09:28:03Z")

</div>

Hi @mterwoord,

That’s one of the discrepancies between Debian-based and Yocto-based builds.

- Debian: kernel is on A/B partitions, device trees and overlays are not. This is required for the firmware loader magic to take effect, e.g. load/modify the device tree and modify the `cmdline` through `config.txt`.
- Yocto: kernel and device trees are on A/B partitions. `u-boot` and firmware which is in effect before `u-boot` are not.

Technically there could be a RPi-specific root filesystem Update Module which doesn’t require `u-boot` and the related magic altogether but uses the `autoboot` and `tryboot` features, but sadly this requires quite a bit more effort than I can invest at the moment. But I have it on the to-do list!

Greets,  
Josef

---

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [August 13, 2024, 9:35am UTC](https://hub.mender.io/t/raspberry-pi-5/6689/4 "2024-08-13T09:35:28Z")

</div>

Hi @TheYostoJester,

Thanks for the very fast answer.

> [@TheYoctoJester](#):
>
> - Debian: kernel is on A/B partitions, device trees and overlays are not. **This is required for the firmware loader** magic to take effect, e.g. load/modify the device tree and modify the `cmdline` through `config.txt`.
> - Yocto: kernel and device trees are on A/B partitions. `u-boot` and firmware which is in effect before `u-boot` are not.

You mention Debian places device trees and overlays NOT on the A/B partitions due to that being a requirement for the firmware loader. How is that not a requirement for Yocto-based builds?

I just ordered a Pi5 to do testing, but what I’m hoping I can do with the 5 is have all the files needing (kernel, device tree and overlays, etc) changes be on the A/B partitions. Does that work? I guess doing cmdline/config changes does need changes on the initial partition.

Thanks for answering!

Regards, Matthijs

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [August 13, 2024, 9:44am UTC](https://hub.mender.io/t/raspberry-pi-5/6689/5 "2024-08-13T09:44:35Z")

</div>

> [@mterwoord](#):
>
> You mention Debian places device trees and overlays NOT on the A/B partitions due to that being a requirement for the firmware loader. How is that not a requirement for Yocto-based builds?

Hi @mterwoord,

The key difference is that when using Yocto, we control the whole build. This means we know the required kernel configuration and device tree, and can make sure all of this is taken care for in the actual image. On Debian, the supplied golden image contains numerous unknowns. The most critical ones are

- users expect to be able to use and modify `config.txt`
- several RPi-specific start scripts expect the passed `cmdline` and partitions to behave in a certain way.

So fully technically speaking it is not a “Debian” requirement, it is required for the “Raspberry Pi OS” style user experience. One could possibly get rid of it, but it breaks a lot of use cases that we keep seeing.

As you stated you want kernel, DT and overlays on A/B, Yocto should have you covered already.

Greets,  
Josef

---

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [August 13, 2024, 9:46am UTC](https://hub.mender.io/t/raspberry-pi-5/6689/6 "2024-08-13T09:46:31Z")

</div>

Hi @TheYoctoJester ,

Thanks for clarifying.

Just making sure here: A/B fully works with changing kernel versions etc?

I guess I’ll have to think of what to do with my Pi3 stock now… 🙂

Regards,  
Matthijs

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [August 13, 2024, 9:49am UTC](https://hub.mender.io/t/raspberry-pi-5/6689/7 "2024-08-13T09:49:10Z")

</div>

Hi @mterwoord ,

> [@mterwoord](#):
>
> Just making sure here: A/B fully works with changing kernel versions etc?

On Yocto, yes. If not, then it is a bug.

Nitpick: I remember at least _one_ case where upgrading the firmware files was also required because of a hidden dependency. So those _might_ show up again, sadly.

Greets,  
Josef

---

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [August 13, 2024, 9:51am UTC](https://hub.mender.io/t/raspberry-pi-5/6689/8 "2024-08-13T09:51:33Z")

</div>

Hi @TheYoctoJester ,

Can’t resist asking this: So on Pi3 and Pi4, the limitation of putting the kernel/dtb(o)'s on the primary partition still exists?

Thanks!

Regards,  
Matthijs

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [August 13, 2024, 10:41am UTC](https://hub.mender.io/t/raspberry-pi-5/6689/9 "2024-08-13T10:41:12Z")

</div>

Hi @mterwoord,

> [@mterwoord](#):
>
> Can’t resist asking this: So on Pi3 and Pi4, the limitation of putting the kernel/dtb(o)'s on the primary partition still exists?

Only on Debianoids. Do you have any indication or post claiming that it applies to Yocto?

Greetz,  
Josef

---

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [August 13, 2024, 10:58am UTC](https://hub.mender.io/t/raspberry-pi-5/6689/10 "2024-08-13T10:58:00Z")

</div>

Hi @TheYoctoJester ,

For Pi 4, see [Raspberry Pi 4 Model B - Yocto 5.0 "scarthgap" and later](https://hub.mender.io/t/raspberry-pi-4-model-b-yocto-5-0-scarthgap-and-later/7024)

For Pi 3, see [Raspberry Pi 3 Model B/B+](https://hub.mender.io/t/raspberry-pi-3-model-b-b/57)

Or am I just completely misunderstanding those statements?

Thanks for valueable insights!

Regards,  
Matthijs

---

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [August 13, 2024, 11:03am UTC](https://hub.mender.io/t/raspberry-pi-5/6689/11 "2024-08-13T11:03:25Z")

</div>

Besides that note, I currently use a script that copies the files to the boot partition before rebooting into the new partition, but that’s brittle: A wrong build then bricks the device.

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [October 18, 2024, 8:11am UTC](https://hub.mender.io/t/raspberry-pi-5/6689/12 "2024-10-18T08:11:32Z")

</div>

A post was split to a new topic: [Raspberry Pi 5 and Yocto, modifications and adding users](https://hub.mender.io/t/raspberry-pi-5-and-yocto-modifications-and-adding-users/7244)

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [April 24, 2025, 8:43am UTC](https://hub.mender.io/t/raspberry-pi-5/6689/13 "2025-04-24T08:43:04Z")

</div>

A post was split to a new topic: [Adding 7 inch screen to RPi5 on Yocto](https://hub.mender.io/t/adding-7-inch-screen-to-rpi5-on-yocto/7744)
