Five EmbedDev logo Five EmbedDev

An Embedded RISC-V Blog

Docker Images

The reference docker images for building and simulating examples from this blog have been updated:

https://github.com/five-embeddev/build-and-verify/tree/main/docker

Target Description
riscv-tool-build Base image for compiling tools
riscv-spike RISC-V ISA Simulator.
riscv-openocd OpenOCD JTAG debugger interface
riscv-xpack-gcc X-PACK packaged GCC
riscv-spike-debug-sim RISC-V Spike ISA configured to run with OpenOCD
riscv-spike-debug-gdb RISC-V Spike ISA configured to run with OpenOCD & GDB
riscv-rust Rust for RISC-V
riscv-gnu-toolchain Build GCC for RISC-V
riscv-gnu-toolchain-2 Build GCC for RISC-V (using docker compose to conserve resources)

Docker Examples

Examples of usage:

https://github.com/five-embeddev/build-and-verify/tree/main/examples

Example Description
build-c/ Build a simple C test program for host and target
build-rust/ Build a small rust program
build-run-sim/ Build a full baremetal example and simulate with Spike, debug with GDB
test-code-c/ Small example program

Build with Cmake

e.g. https://github.com/five-embeddev/build-and-verify/tree/main/examples/build-run-sim

docker run \
    --rm \
    -v .:/project \
    -v /home/five/five-embeddev-wsl/build-and-verify/examples/build-run-sim/../test-code-c:/project/test_code \
        fiveembeddev/riscv_xpack_gcc_dev_env:latest \
        cmake \
                -S test_code \
                -B build \
                -G "Unix Makefiles" \
                -DCMAKE_TOOLCHAIN_FILE=../test_code/riscv.cmake
docker run \
    --rm \
    -v .:/project \
    -v /home/five/five-embeddev-wsl/build-and-verify/examples/build-run-sim/../test-code-c:/project/test_code \
        fiveembeddev/riscv_xpack_gcc_dev_env:latest \
                make \
                        VERBOSE=1 \
                        -C build