This repository contains a small example application for the Arduino Due written in Rust.
The example makes the on-board LED blink 1 time per second.
The interaction with the board is based on the
sam3x8e
crate, which unfortunately seems
unmaintained and for which an updated version
that works with stable Rust is used.
rustup target add thumbv7m-none-eabi
.cargo-binutils
via cargo install cargo-binutils
and rustup component add llvm-tools-preview
.That's all!
cargo objcopy --bin app --target thumbv7m-none-eabi --release -- --output-target=binary image.bin
to build the application in release mode
and generate a binary that can be flashed on the board.stty -F /dev/ttyACM0 raw ispeed 1200 ospeed 1200 cs8 -cstopb ignpar eol 255 eof 255
. This assumes /dev/ttyACM0
is the
device.mode com8:1200,n,8,1
. This assumes com8 is the device.
Running mode
without arguments lists all devices.bossac -e -w -v -b -R image.bin
for flashing the application and
rebooting.At this point the on-board LED should start blinking.
cortex-m-rt
sam3x8e
can be generated by cloning the git repository
and running cargo doc --open
.