This repo provides an isolated and reproducible build environment for creating Rust binaries that run on the ESP32.
A simple "hello world" project is present in main.rs.
- Clone this repo
- Put your code under
src
- Update Cargo.toml
- Run either the one of the following commands to build the firmware Debug build:
earthly +firmware
Release build:
earthly --build-arg BUILD_TYPE=release +firmware
- Flash the firmware
Where:/dev/ttyUSB0
is the serial device of your ESP32.
Where:esp32-rust-build-environment
is the project name from yourCargo.toml
file.
earthly --build-arg SERIAL_PORT=/dev/ttyUSB0 --build-arg BUILD_BINARY=artifacts/debug/esp32-rust-build-environment +flash