Raspberry Pi 4
Description and Resources
The Raspberry Pi 4 is a versatile single-board computer suitable for a wide
range of applications. This guide walks through building Zarhus OS using
meta-zarhus, flashing the OS onto an SD card, and accessing the device
via UART for debugging.
Additional resources for the Raspberry Pi 4:
Zarhus OS Setup
Build Zarhus OS
-
Clone the
meta-zarhusrepository:git clone https://github.com/zarhus/meta-zarhus -
Follow the instructions in the repository's building guide to build Zarhus OS for Raspberry Pi 4.
Once built, you can move onto flashing.
Flash Zarhus OS Image to SD Card
To flash the image to the SD card:
```sh
cd build/tmp/deploy/images/raspberrypi4
sudo bmaptool copy --bmap zarhus-base-image-debug-raspberrypi4.rootfs.wic.bmap zarhus-base-image-debug-raspberrypi4.rootfs.wic.gz /dev/sdc
```
Replace /dev/sdX with your SD card device (e.g. /dev/sdb).
Ensure you are writing to the correct device.
UART Console Access
Hardware Setup
To connect via UART for debugging:
-
Use a UART-to-USB adapter and connect it to the Raspberry Pi 4 GPIO pins:
GPIO Pin Description Pin 6 GND Pin 8 UART TXD Pin 10 UART RXD Refer to the Raspberry Pi GPIO Pinout for the full pinout.
-
Plug the USB end into your host machine.
Software Setup
-
Install a terminal program (e.g.,
minicomfor Linux). -
Launch
minicomon a Linux host to connect to the RPi4:minicom -D /dev/ttyUSBXAlso make sure
Hardware Flow Controlis off (CTRL-A, thenZto open the menu, thenOtoConfigure minicom, then chooseSerial port setup, then (if it's enabled) pressFto disableHardware Flow Control). -
You should now see the Zarhus OS boot console.
From this point, you can login (login root) to monitor and debug the
Raspberry Pi 4 running Zarhus OS.