SiFive HiFive1

Overview

The HiFive1 is an Arduino-compatible development board with an FE310 RISC-V SoC. More information can be found on SiFive’s website.

Programming and debugging

Building

Applications for the hifive1 board configuration can be built as usual (see Build an Application) using the corresponding board name:

# On Linux/macOS
mkdir build && cd build

# On Windows
mkdir build & cd build

# Use cmake to configure a Ninja-based build system:
cmake -GNinja -DBOARD=hifive1 ..

# Now run ninja on the generated build system:
ninja

Flashing

In order to upload the application to the device, you’ll need OpenOCD with RISC-V support. Download the tarball for your OS from the SiFive website and extract it.

The Zephyr SDK uses a bundled version of OpenOCD by default. You can overwrite that behavior by adding the -DOPENOCD=<path/to/riscv-openocd/bin/openocd> parameter when building:

# On Linux/macOS
mkdir build && cd build

# On Windows
mkdir build & cd build

# Use cmake to configure a Ninja-based build system:
cmake -GNinja -DBOARD=hifive1 -DOPENOCD=<path/to/riscv-openocd/bin/openocd> ..

# Now run ninja on the generated build system:
ninja

When using a custom toolchain it should be enough to have the downloaded version of the binary in your PATH.

Now you can flash the application as usual (see Build an Application and Run an Application for more details):

ninja flash

Depending on your OS you might have to run the flash command as superuser.

Debugging

Refer to the detailed overview about Custom Board, DeviceTree and SOC Definitions.