Skip to main content
Version: kirkstone_1-08-00

Raspberry Pi

Overview

Clea OS can be built for the Raspberry Pi 4.

The RaspberryPi image depends on the external layer meta-raspberrypi.

Features provided by meta-raspberrypi

Supported boards

At the time of writing, the official layer supports the following boards:

MACHINEBoard name
raspberrypiRaspberryPi
raspberrypi2RaspberryPi 2
raspberrypi3RaspberryPi 3 in 32 bits mode
raspberrypi3-64RaspberryPi 3 in 64 bits mode
raspberrypi4RaspberryPi 4 in 32 bits mode
raspberrypi4-64RaspberryPi 4 in 64 bits mode
raspberrypi-cmRaspberryPi Compute Module (CM1)
raspberrypi-cm3RaspberryPi Compute Module 3 (CM3)
raspberrypi0RaspberryPi Zero
raspberrypi0-wifiRaspberryPi Zero WiFi
raspberrypi0-2wRaspberryPi0 2 Wifi in 32 bits mode
raspberrypi0-2w-64RaspberryPi0 2 Wifi in 64 bits mode
raspberrypi5RaspberryPi 5

Clea OS 1.5+ supports the machine raspberrypi4-64.

Layer structure

DirectoryDescription
docs/Some documentation
recipes-bsp/
  • Support for U-boot can be enabled by setting the variables ENABLE_UART = "1" and RPI_USE_U_BOOT = "1". This sets the kernel image type to uImage and deploys U-boot in the final image. U-boot upstream already supports the raspberry pi boards, so the layer relies on the u-boot recipe provided by poky (v2022.01).
  • recipes-bsp/armstubs: some assembly code needed by some RaspberryPi boards (not 4B), initially loaded in RAM by the GPU
  • recipes-bsp/gpio-shutdown: with ENABLE_GPIO_SHUTDOWN = "1" configures the system to shutdown through a configurable GPIO (GPIO3 by default)
recipes-kernel/Recipes for linux 5.10 and 5.15 (default=5.15)
recipes-connectivity/
  • patches bluez5
  • adds pi-bluetooth 0.1.17 as a dependency to bluez5
recipes-core/
  • defines a test image that contains all the features exposed by the layer
  • configures the raspberry pi splash image for psplash
  • installs some udev configuration files
recipes-devtools/
  • pi-blaster (efficient PWM on the GPIOs)
  • python3 with some libraries to access GPIOs and hardware
  • raspi-gpio: GPIO debug tool
recipes-graphics/Mainly sets up the VC4 graphics driver for Broadcom GPUs
recipes-multimedia/
  • mainly sets up gstreamer1.0 and omxplayer
  • provides picamera (library to interface with the RaspberryPi Camera module)
recipes-sato/Sets up sato
wic/WKS file (overridden by Clea OS)

Clea OS on the Raspberry Pi

Building

Building Clea OS for the Raspberry Pi 4 works the same as for the other boards. Follow the instructions provided on Build Clea OS or on the seco-manifest.

Use one of the following commands to setup the project (the first for Clea OS Embedded, the second for Clea OS Things).

$ . seco-setup.sh -d raspberrypi4_64_clea-os_embedded
$ . seco-setup.sh -d raspberrypi4_64

Running

info

The UART on the Raspebrry Pi is on GPIO 14/15 and is enabled by default in Clea OS. You can use a UART-USB adapter to connect these pins to the PC.

To run it:

  • flash the wic image to a micro-SD card using dd or bmaptool as reported on the Installation page;
  • connect the UART adapter;
  • connect a monitor and keyboard (optionally);
  • insert the microSD and power on the board.

Bootloader

The RaspberryPi boards have their own bootloader, so U-boot is not required.

In Clea OS Things U-boot is always enabled because it handles the boot partition selection logic; in Clea OS Embedded, U-boot is disabled and the embedded bootloader loads the kernel directly.

The bootloader expects to find the following files in the first FAT32 partition of the SD card.

FileDescription
bootcode.binbinary blob of the second-stage bootloader (only on RaspberryPi versions < 4)
start*.elf, fixup*.datfirmware binary blobs and data
*.dtb, overlays/*.dtbodevice tree blobs
kernel*.imgvarious kernel/bootloader image files, used for the different Raspberry Pi models
cmdline.txtkernel command line passed in to the kernel when it boots
config.txtRaspberryPi configuration parameters (the initramfs is configured here)

The bootloader is comprised of two stages: the first stage resides in the SoC, the second:

  • for the RaspberryPi 4 resides in an SPI EEPROM and can be updated using dedicated utilities;
  • for the previous models, it resides in the file bootcode.bin in the boot partition.