Raspberry Pi Compute Module 3

The official Mender documentation explains how Mender works. This is simply a board-specific complement to the official documentation.

Board description

The Compute Module 3 is a Raspberry Pi 3 in a more flexible form factor, intended for industrial application which contains 4GB eMMC with combination of the BCM2837 processor and 1GB RAM.

URL: Buy a Compute Module 3 – Raspberry Pi

Test results

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:

Yocto Project Build Runtime
thud (2.6) :test_works: :test_works: 1
sumo (2.5) :test_works: :test_works:

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

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 has been verified.

Getting started

Prerequisites

  • A supported Linux distribution and dependencies installed on your workstation/laptop as described in the Yocto Mega Manual
    • NOTE. Instructions depend on which Yocto version you intend to use.
  • Google repo tool installed and in your PATH .

Setup Yocto environment

Set the Yocto Project branch you are building for:

# set to your branch, make sure it is supported (see table above)
export BRANCH="sumo"  

Create a directory for your mender-raspberrypi setup to live in and clone the
meta information.

mkdir mender-raspberrypi && cd mender-raspberrypi

Initialize repo manifest:

repo init -u https://github.com/mendersoftware/meta-mender-community \
           -m meta-mender-raspberrypi/scripts/manifest-raspberrypi.xml \
           -b ${BRANCH}

Fetch layers in manifest:

repo sync

Next, initialize the build environment:

source setup-environment raspberrypi

Building the image

You can now proceed with building an image:

MACHINE=raspberrypi-cm3 bitbake core-image-base

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

Using the build output

  • tmp/deploy/images/raspberrypi0-wifi/core-image-base-raspberrypi-cm3.sdimg
  • tmp/deploy/images/raspberrypi0-wifi/core-image-base-raspberrypi-cm3.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 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 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.

Flash instructions

For flashing we need compute module io board V3 or custom hardware where module is attached.

Following setup will describe flashing sdimg to module by using Compute module IO board.

To store sdimg to eMMC we need to install usbboot tool which will mount eMMC on host computer. Tool can be fetched from usbboot. Follow instructions in Readme how to compile and install.

When installed run:

sudo ./rpiboot

Afterwards change J4 on compute module to position USB SLAVE and connect usb with host PC and power on board. After few seconds partitions of eMMC should appear. Then follow the official documentation on provisioning a new device to store sdimg to device.
When flashing is done disconnect usb from host PC and switch jumper back to BOOT ENABLE position.

Known issues

Boot firmware files

See Updating Raspberry Pi boot firmware files using Yocto Project and Mender.

See this thread where the limitations of the boot firmware files on Raspberry Pi are discussed.

Devicetree is not updated

To be able to support update of Linux kernel and devicetree, Mender requires these to be installed in the /boot directory for each rootfs (normally /dev/mmcblk0p2 and /dev/mmcblk0p3). On the other hand, the Raspberry Pi boot firmware requires that the DTB file is in the same partition as the boot firmware (/dev/mmcbl0p1) and the config.txt file. For now Mender will not use the DTB that is delivered with new artifacts and will continue to boot with the original DTB that was populated using the sdimg file.

Problem using ‘dtoverlay=pi3-disable-bt’

pi3-disable-bt disables the Bluetooth device and restores UART0/ttyAMA0 to GPIOs 14 and 15. It is also necessary to disable the system service that initialises the modem so it doesn’t use the UART

There is currently a known issue with above functionality, that is to enable UART0 on PIN 14 and 15.

It is actually not something that is caused by Mender specifically, but Mender requires U-boot to be present to support robust features such as roll-back. U-boot is typically not enabled if you do a stock Raspberry Pi and some people are often surprised that the Bluetooth UART stopped working when they integrate meta-mender.

The problem is in U-boot which does conflicting configuration, and there is a workaround reported here and it has been reported to U-boot but unclear when/if it will be fixed.


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!

3 Likes