Skip to content
A template for building Rust applications for HiFive1 boards
Rust
Branch: master
Clone or download
Latest commit a80f1e0 Sep 7, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.cargo Use link script from hifive1 Jul 16, 2019
examples Fix handshake pin name Jul 20, 2019
src update for latest hifive1 Jul 16, 2019
.gitignore Remove Cargo.lock Jul 16, 2019
Cargo.toml Convert into a template for cargo-generate Jul 16, 2019
README.md readme: fix link Sep 7, 2019
gdb_init Replace .gdbinit Jun 7, 2019

README.md

riscv-rust-quickstart

A template for building Rust applications for HiFive1 boards

This project is developed and maintained by the RISC-V team.

Dependencies

To build embedded programs using this template you'll need:

  • Rust 1.36 or a newer toolchain. e.g. rustup default stable

  • The cargo generate subcommand. Installation instructions.

  • rust-std components (pre-compiled core crate) for the RISC-V target. Run:

$ rustup target add riscv32imac-unknown-none-elf

Using this template

NOTE: This is the very short version that only covers building programs. For the long version, which additionally covers flashing, running and debugging programs, check the embedded Rust book.

  1. Instantiate the template.
$ cargo generate --git https://github.com/riscv-rust/riscv-rust-quickstart
 Project Name: app
 Creating project called `app`...
 Done! New project created /tmp/app

$ cd app
  1. If you have an old HiFive1 board, edit Cargo.toml: replace board-hifive1-revb with board-hifive1.

  2. Run the programmer software.

  • HiFive1 Rev B:
/path/to/JLinkGDBServer -device FE310 -if JTAG -speed 4000 -port 3333
  • HiFive1:
/path/to/openocd -f board/sifive-hifive1.cfg
  1. Build the template application or one of the examples.
$ cargo build
or
$ cargo build --example leds_blink
  1. Run the template application or one of the examples.
$ cargo run
or
$ cargo run --example leds_blink

License

Copyright 2017-2019 RISC-V team

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

You can’t perform that action at this time.