Steps to running Rust on ESP32 by the Norse IoT club
Thanks to the esp-rust community for making this an easy process.
These instructions are mirrored on the wiki page.
The following instructions were taken from https://github.com/esp-rs/rust-build#rust-build.
Step 0: install Rust & Cargo from RustUp
- Go to https://rustup.rs/
Step 1: Install espup
cargo install espup
espup install # To install Espressif Rust ecosystem
# [Unix]: Source the following file in every terminal before building a project
. $HOME/export-esp.sh
Step 2: RISC-V Installation
rustup target add riscv32imc-unknown-none-elf
Step 3: The Cargo First Approach
cargo install cargo-generate
# STD Project
cargo generate esp-rs/esp-idf-template cargo
# NO-STD (Bare-metal) Project
cargo generate esp-rs/esp-template
cargo espflash flash <SERIAL>
# for me, this was cargo espflash flash --port /dev/ttyUSB0
See main.rs for the sample code.