# Raspberry Pi 4 Model B 32bit

**URL:** <https://hub.mender.io/t/raspberry-pi-4-model-b-32bit/1236>\
**Category:** Buildroot\
**Created:** [November 13, 2019, 12:35am UTC](https://hub.mender.io/t/raspberry-pi-4-model-b-32bit/1236 "2019-11-13T00:35:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aduskett](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@aduskett](https://hub.mender.io/u/aduskett)\
**Post date:** [November 13, 2019, 12:35am UTC](https://hub.mender.io/t/raspberry-pi-4-model-b-32bit/1236/1 "2019-11-13T00:35:28Z")

</div>

The official [Mender documentation](https://docs.mender.io/) explains how Mender works. This is simply a board-specific complement to the official documentation.

# Board description

The Raspberry Pi 4 Model B is the latest addition to the Raspberry Pi family. It is the most powerful board within the Raspberry Pi family.

![](https://www.raspberrypi.org/homepage-9df4b/static/pi4-labelled-99c2e8935bb3cfdb27d23f634ea98a7e.png)

URL: [https://www.raspberrypi.org/products/raspberry-pi-4-model-b/](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/)  
Wiki: [https://elinux.org/RPi\_Hub](https://elinux.org/RPi_Hub?target=_blank)

# Test results

The Buildroot releases in the table below have been tested by the Mender community. Please update it if you have tested this integration on other releases:

| Buildroot Project | Build | Runtime |
| --- | --- | --- |
| 2019.11 | :test_works: | :test_works: |

**Build** Means that the Buildroot 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/devices/yocto-project/bootloader-support/u-boot/integration-checklistt?target=_blank) has been verified.

# Getting started

## Prerequisites

- A supported Linux distribution and dependencies installed on your workstation/laptop as described in the [Buildroot Manual](https://buildroot.org/downloads/manual/manual.html#requirement)
  - NOTE. Instructions depend on which Buildroot version you intend to use.

## Configuring the build

### Setup Buildroot environment

Set the Buildroot tag you are building for:

```auto
# set to your branch, make sure it is supported (see table above)
export BR2_TAG="2019.11-rc1"

```

Clone or download buildroot:

```auto
git clone git://git.buildroot.net/buildroot -b ${BR2_TAG}

```

Clone this repository:

```auto
git clone https://github.com/aduskett/buildroot-mender-configs.git -b rpi4_32

```

Change directory to buildroot:

```auto
cd buildroot

```

copy all files from buildroot-mender-configs:

```auto
cp -rf ../buildroot-mender-configs/* ./

```

## Configure build environment

Configure Buildroot:

## Configure build environment

Configure Buildroot:

```auto
make raspberrypi4_32_mender_defconfig

```

### 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 deployments](https://docs.mender.io/architecture/standalone-deployments?target=_blank), due to lack of server configuration.

You can edit the `board/mender/overlay/etc/mender/mender.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.

Build for Hosted Mender:

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

```

Build for Mender demo server:

```auto
ServerURL = "192.168.0.100"

```

### Building the image

You can now proceed with building an image:

```auto
make

```

### Using the build output

After a successful build, the images and build artifacts are placed in `buildroot/output/images`

The disk image sdcard.img 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/artifacts/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/architecture/mender-artifacts?target=_blank) 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 only in [Standalone deployments](https://docs.mender.io/architecture/standalone-deployments?target=_blank).

### Created a mender artifact

Open board/mender/post-image.sh and uncomment the line  
`# create_mender_image "buildroot-rasperrypi-${BR2_VERSION}.mender"`  
Then re-run

```auto
make

```

The mender file will automatically be generated after the build is complete, which can be found in `output/images/`

---

<div class="post-metadata">

**Author:** ![tuupola](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/tuupola/32/187_2.png) [@tuupola](https://hub.mender.io/u/tuupola)\
**Post date:** [November 13, 2019, 5:49pm UTC](https://hub.mender.io/t/raspberry-pi-4-model-b-32bit/1236/2 "2019-11-13T17:49:22Z")

</div>

I think the **Configure Mender server URL (optional)** part is from Yocto build. I ended up doing:

```
$ vi board/mender/overlay/etc/mender/mender.conf

```

and editing `ServerURL` and `TenantToken` there.

---

<div class="post-metadata">

**Author:** ![aduskett](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@aduskett](https://hub.mender.io/u/aduskett)\
**Post date:** [November 13, 2019, 6:45pm UTC](https://hub.mender.io/t/raspberry-pi-4-model-b-32bit/1236/3 "2019-11-13T18:45:09Z")

</div>

You are absolutely correct and I modified the post to fix the incorrect links. Sorry about that!
