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-halandesp-idf-halto make the RGB LED on the esp32-s3-devkitC light flash. - Use the
logcrate to sendinfo!logs to the espmonitor (instead of plain prints)
- Use
embedded-svcandesp-idf-svcto 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
ccacheandsccachefor 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 --releasefrom any of the example directories
esp-idf-halincludes 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-haltraits and accept objects implimenting those traits as inputs.esp-idf-svcprovidesesp-idf-sys: raw bindings to functions and types in the esp-idf. This should be a last resort, instead useesp-idf-svcandesp-idf-hal