Getting Started with Zephyr on RISC-V - Ubuntu

Using a12.mill

Installation

Create a conda virtual environment.

conda create -yp ./.conda-env/ python=3.10
conda activate ./.conda-env/

Install system dependencies.

on a12.mill, cmake version is too low, so we need to install a newer one in conda environment.

conda install anaconda::cmake

additionally, we need these

conda install conda-forge::ninja

Install west, the build tool for zephyr.

pip install west

Create a new project.

west init ./getting-started/
cd ./getting-started/
west update

Export a Zephyr CMake package. This allows CMake to automatically load boilerplate code required for building Zephyr applications.

west zephyr-export

Install Python dependencies.

pip install -r ./zephyr/scripts/requirements.txt

Install Zephyr SDK

cd ./zephyr/
west sdk install

Build blinky

west build -p always -b sparkfun_red_v_things_plus samples/basic/blinky

build for spike

west build -p always -b qemu_riscv64 samples/hello_world

on windows

https://github.com/ninja-build/ninja/releases

https://www.segger.com/downloads/jlink/

https://7-zip.org/download.html

pacman -S dtc

The workflow roughly follows the official tutorial.

Last updated

Was this helpful?