This repository contains the final code for the Rust on ESP32 workshop and the presentation.
To view the presenation, use presenterm.
- Make sure you have
rustupinstalled on your system. - Make sure you have the latest Rust version installed with
rustup update. If you don't have any toolchain installed, installstable. - Install the dependencies used for the workshop:
cargo install cargo-generate espup espflash - Install the Xtensa Rust toolchain with
espup install -f export-esp.sh. (The-f export-esp.shis optional; the file will be saved in$HOMEif it isn't provided.) - Make sure the toolchain was installed correctly:
ls -a ~/.rustup/toolchains - Source the generated export file with
source export-esp.sh. This needs to be done in each new shell session (or the exports can be added to the shell profile).
The rest of this process will be done together, so wait here unless you want to wait later.
- Generate a new project with
cargo generate esp-rs/esp-templatechoosingrust-on-esp32or a more creative project nameesp32truefalsetruefalsefalsefalseyes
- Enter the project directory:
cd rust-on-esp32 - Build the project with
cargo build --releaseor upload it withcargo run --release.
If espflash is missing permission to access device, add the user to the dialout group with sudo usermod -a -G dialout $USER.
This requires logging out and in again.
If cargo build fails with the error
error: linker `xtensa-esp32-elf-gcc` not found
|
= note: No such file or directory (os error 2)make sure you have sourced export-esp.sh.