tree: d7b1eb52bc8ac69ee862e23112d78cd1f78a8987 [path history] [tgz]
  1. src/
  2. build.rs
  3. Cargo.toml
  4. layout.ld
  5. Makefile
  6. README.md
boards/hifive1/README.md

SiFive HiFive1 Rev B RISC-V Board

Arduino-compatible dev board for RISC-V. This is the second release of this board (“Rev B”).

Programming

Running make flash should load the kernel onto the board. You will need a relatively new (i.e. from git) version of OpenOCD.

The kernel also assumes there is the default HiFive1 software bootloader running on the chip.

Running in QEMU

The HiFive1 application can be run in the QEMU emulation platform for RISC-V, allowing quick and easy testing.

Unfortunately you need QEMU 5.1, which at the time of writing is unlikely to be avaliable in your distro. Luckily Tock can build QEMU for you. From the top level of the Tock source just run make ci-setup-qemu and follow the steps.

QEMU can be started with Tock using the following arguments (in Tock's top-level directory):

$ qemu-system-riscv32 -M sifive_e,revb=true -kernel $TOCK_ROOT/target/riscv32imac-unknown-none-elf/release/hifive1.elf  -nographic

Or with the qemu make target:

$ make qemu

QEMU can be started with Tock and a userspace app using the following arguments (in Tock's top-level directory):

qemu-system-riscv32 -M sifive_e,revb=true -kernel $TOCK_ROOT/target/riscv32imac-unknown-none-elf/release/hifive1.elf -device loader,file=./examples/hello.tbf,addr=0x20430000 -nographic

Or with the qemu-app make target:

$ make APP=/path/to/app.tbf qemu-app

The TBF must be compiled for the HiFive board which is, at the time of writing, supported for Rust userland apps using libtock-rs. For example, you can build the Hello World exmple app from the libtock-rs repository by running:

$ cd [LIBTOCK-RS-DIR]
$ make flash-hifive1
$ tar xf target/riscv32imac-unknown-none-elf/tab/hifive1/hello_world.tab
$ cd [TOCK_ROOT]/boards/hifive
$ make APP=[LIBTOCK-RS-DIR]/rv32imac.tbf qemu-app

HiFive1 Revision A

Tock has dropped support for the older (“Rev A”) version of this board. Since that version of the hardware is no longer being produced, Tock has decided to no longer maintain the older board file. If would like to run Tock on the rev A version, you should use the version 1.5 release of Tock.