Each directory is an entirely independent project showing how to use some feature of rust on esp32s3
Basic "hello world", but entirely in rust by using the esp-idf-sys crate and
existing support in std
for println
and main
.
- Use
embedded-hal
andesp-idf-hal
to make the RGB LED on the esp32-s3-devkitC light flash. - Use the
log
crate to sendinfo!
logs to the espmonitor (instead of plain prints)
- Use
embedded-svc
andesp-idf-svc
to store data to NVS and retrieve data from NVS (at startup)
- Install the esp rust toolchain
git clone https://github.com/esp-rs/rust-build.git
./rust-build/install-rust-toolchain.sh
- Install some tools:
cargo install cargo-espflash
cargo install ldproxy
- Install
ccache
andsccache
for caching (highly recommended), and configure them
# Note: package manager dependent
nix-env -i ccache sccache
Add this to your ~/.cargo/config.toml
[build]
rustc-wrapper = "sccache"
- Run
../cargo-esp espflash --monitor --release
from any of the example directories
esp-idf-hal
includes rust types and functions that allow access to basic/typical peripherals on the esp32s3, like GPIO, SPI, etc. It impliments traits inembedded-hal
. Generic code (code that doesn't want to be platform specific) can useembedded-hal
traits and accept objects implimenting those traits as inputs.esp-idf-svc
providesesp-idf-sys
: raw bindings to functions and types in the esp-idf. This should be a last resort, instead useesp-idf-svc
andesp-idf-hal