Rust on the Arduino Due
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 7 commits ahead, 8 commits behind jensnockert:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
hardware
.gitignore
README.md
Rakefile
arduino.rs
core.rs
rust-arduino-circuit.png

README.md

dueboot

Infrastructure for programming an Arduino Due in the Rust programming language. This includes a sample sketch that can be modified to do most any other sketch.

Compiling

Install the prerequisites:

Then modify Rakefile:

  1. ARDUINO points to the directory in the Arduino Due installation that has tools to flash the device. Should contain arm-none-eabi-ar and arm-none-eabi-objcopy among other executables.
  2. RUSTC points to the rustc executable (the Rust compiler).
  3. LLC points to the LLVM compiler executable called llc.
  4. PORT is the name of the USB connection. Do an ls /dev/tty* to get a list of options. Most likely something like tty.usbmodem141.
  5. RUST_SRC is the name of the *.rs file that contains the main function for your sketch.

Then run rake burn to upload to the Arduino.

Here is a circuit diagram of the Arduino sketch:

Circuit diagram

Structure

core.rs - sample program (blinks 4 LEDs in series like Christmas lights with a potentiometer to control the speed).
          Feel free to change the program & circuit as you wish.
arduino.rs - extern stubs for the core Arduino libraries
hardware/ - from a random Arduino IDE for OS X

Credits