This is a template project for running rust code on the ISU CyBot platform. This template is a derivative of the template from the rust embedded folks here.
Follow the steps to install rust on your machine here;
- Run
rustup target add thumbv7em-none-eabihf
to add the Cortex-M4 with FPU target to your rust toolchain - Install cargo-binutils with
cargo install cargo-binutils
- Follow OS specific instructions from the embedded rust book. You need openocd and the gdb/gcc for arm but qemu is optional.
- Optional but recommended install gdbgui to get a more visual debugging environment
- Clone this repo to your machine or use cargo-generate.
cargo generate --git https://github.com/Atrociously/cybot-template
git clone https://github.com/Atrociously/cybot-template
In the project you just downloaded in the src/
directory is your main.rs which should look like this
#![no_std]
#![no_main]
use cybot::entry;
#[entry]
fn main() -> ! {
// Your Code Goes Here!
loop {}
}
- Run
openocd
while connected to the cybot via USB. - In another CMD window run
gdb-multiarch target/thumbv7em-none-eabihf/OUTFILE
orgdbgui -g arm-none-eabi-gdb
- Follow information here for debugging instructions.
Most of the complex stuff is hidden within the cybot crate.
You can look at the docs by running cargo doc --open
and looking for the cybot crate on the left.