Linux/Mac users: Make sure you have the dependencies installed,that are mentiond in the esp-idf install guide. You dont need to manually install esp-idf, just its dependencies.
For detailed instructions see Setting Up a Development Environment chapter of The Rust on ESP Book.
If you don't have rustup
installed yet, follow the instructions on the rustup.rs site
cargo install cargo-generate
cargo install ldproxy
cargo install espup
cargo install espflash
cargo install cargo-espflash # Optional
Note
If you are running macOS or Linux then
libuv
must also be installed forespflash
andcargo-espflash
; this is available via most popular package managers. If you are running Windows you can ignore this step.# macOS brew install libuv # Debian/Ubuntu/etc. apt-get install libuv-dev
Also, the
espflash
andcargo-espflash
commands shown below, assume that version2.0
or greater.
git clone https://github.com/nikoincc/esp32-wifi-template-std.git
cd <your-path-to-copied-project>
Note
in main you need to change SSID and PASS to acsess esp32 board operates at a frequency of 2.4 GHz, so we connect to the 2.4 GHz network accordingly
So in "src/main.rs" change:
ssid: "YOUR_SSID"
password: "YOUR_PASS"
cargo build
connect to your esp32
In the root of the project:
cargo espflash flash --release --monitor
- The
--monitor
argument for theespflash
command to open a serial monitor after flashing the device. - For more details on
espflash
usage see the README
For more information, check out:
- The Rust on ESP Book
- The ESP STD Embedded Training
- The esp-idf-hal project
- The embedded-hal project
- The esp-idf-svc project
- The embedded-svc project
- The esp-idf-sys project
- The Rust for Xtensa toolchain
- The Rust-with-STD demo project