RISC-V Architecture Layer for OpenEmbedded/Yocto
This is the general hardware-specific BSP overlay for RISC-V based devices. The core BSP portion should work with different OpenEmbedded/Yocto distributions and layer stacks.
K3 Platform Support:
This layer has been extended from meta-riscv (commit: 41a010a) to include full support for the K3 platform. It supports multiple K3 boards and provides two image output formats:
- SD Card (WIC): Directly bootable
.wicimage for SD card flashing - Titan: Partition images for use with the SpacemiT Titan flashing tool
Yocto Compatibility:
This layer is developed against the master branch of openembedded-core and bitbake (post-Scarthgap 5.0, towards Styhead 5.1). It has not been tested against stable release branches.
| MACHINE | SoC | Supported Boards |
|---|---|---|
k3 |
SpacemiT K3 | COM260, Pico-ITX... |
All board variants are built from a single MACHINE=k3 target. The corresponding device trees are included in the bootfs automatically (see conf/machine/k3.conf for the full DTB list).
Pre-built images are available on the Releases page.
- Recommended: Ubuntu 22.04/24.04, WSL2, or equivalent Linux environment.
- Required tools:
git,bash,python3, and Yocto host dependencies (see Yocto Project host packages).
Builds are performed inside a Docker container based on Ubuntu 24.04 LTS (x86_64).
The following packages are installed on top of the base ubuntu:24.04 image:
sudo apt update
sudo apt install gawk wget git git-lfs diffstat unzip texinfo gcc g++ build-essential \
chrpath cpio python3 python3-pip python3-pexpect python3-git python3-jinja2 \
python3-subunit xz-utils zstd liblz4-tool lz4 lzop file locales curl make \
binutils cpp dosfstools iproute2 iputils-ping mesa-common-dev rpcsvc-proto \
subversion ssh sudo vim p7zip-full netcat-openbsd
sudo locale-gen en_US.UTF-8Use the repo tool to initialize the source code:
mkdir riscv-yocto && cd riscv-yocto
repo init -u https://github.com/yingjie-liu-spacemit/spacemit-yocto.git -b k3 -m tools/manifests/riscv-yocto.xml
repo sync
repo start work --allRun the following command to configure your environment:
. layers/meta-riscv/tools/envsetup.shBoth targets produce .wic (SD card) and .ext4 + Titan partition images simultaneously.
Minimal Linux, suitable for quick boot, serial debugging, and basic network testing:
MACHINE=k3 bitbake core-image-minimalGraphical environment with Weston (Wayland) compositor, supporting simple graphical applications on K3 (GPU acceleration available):
MACHINE=k3 bitbake core-image-weston| User | Password |
|---|---|
root |
bianbu |
After a successful build, the image files are located in build/tmp/deploy/images/k3/.
Use the dd command to write the .wic image to your SD card (replace /dev/sdX with your actual device identifier):
sudo dd if=core-image-minimal-k3.rootfs.wic of=/dev/sdX bs=4M conv=fsync status=progress
sudo sync(Replace the filename accordingly if you built core-image-weston.)
Titan is SpacemiT's proprietary flashing tool for writing images via USB. The build also generates partition images compatible with Titan (bootfs.ext4, rootfs.ext4, and firmware binaries).
Submit patches via GitHub pull requests. Use GitHub issues to report problems or provide feedback.
- liuyingjie
<yingjie.liu@spacemit.com>

