⚠️: This section still references
betaRustContents should be updated to work on
stableRust when possible
⚠️: This section was last checked on 2018-09-13
Dealing with microcontrollers involves using several different tools as we‘ll be dealing with an architecture different than your laptop’s and we'll have to run and debug programs on a remote device.
We'll use all the tools listed below. Any recent version should work when a minimum version is not specified, but we have listed the versions we have tested.
cargo-binutils ~0.1.4qemu-system-arm. Tested versions: 3.0.0git OR cargo-generate. If you have neither installed then don't worry about installing either.Next, follow OS-agnostic installation instructions for a few of the tools:
Install rustup by following the instructions at https://rustup.rs.
Then switch to the beta channel.
$ rustup default beta
NOTE Make sure you have a beta equal to or newer than 1.30-beta. rustc -V should return a date newer than the one shown below. If 1.30-beta is not out yet then use the nightly channel for the time being.
$ rustc -V rustc 1.30.0-beta (????????? 2018-09-1?)
For bandwidth and disk usage concerns the default installation only supports native compilation. To add cross compilation support for the ARM Cortex-M architecture install the following compilation targets.
$ rustup target add thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabi thumbv7em-none-eabihf
cargo-binutils$ cargo install cargo-binutils $ rustup component add llvm-tools-preview
Now follow the instructions specific to the OS you are using: