This repo contains instructions and code to run Rust on the MCH2022 badge.
It also contains instructions and recommendations on how to start a new project.
Installing the toolchainsInstall the Rust toolchain for ESP, see full instructions here
chmod a+x install-rust-toolchain.sh
./install-rust-toolchain.sh \ --extra-crates "cargo-espflash ldproxy" \ --clear-cache "YES" --export-file ~/export-esp.sh \ --esp-idf-version "release/v4.4" \ --minified-esp-idf "YES" \ --build-target "esp32"
cargo espflash save-image ESP32 rust4mch.img
Or run the build.sh
script.
../mch2022-tools/webusb_push.py rust4mch rust4mch.img
Or run the upload.sh
script
The official process for the badge can be found here. https://www.badge.team/docs/badges/mch2022/software-development/rust/
It provides a simple 'hello world' example over serial and a more advanced example.
Use esp-idf-template as starting point:
cargo generate https://github.com/esp-rs/esp-idf-template
cargo-generate
will as you a few questions, after those, you will have a "Hello, world!" Rust binary crate for the ESP-IDF framework.
Answer the questions as follows:
Use esp-template as starting point:
cargo generate https://github.com/esp-rs/esp-template
cargo-generate
will as you a few questions, after those, you will have a bare-metal minimalist project!
This project added a minimal hello world example in the examples
directory. You can run it as follows:
cargo build --example hello_world
cd target/xtensa-esp32-espidf/debug/examples/
esptool.py --chip esp32 elf2image hello_world
Reset the badge. Connect a serial program to /dev/ttyACM0 at 115k2 baud. After that you can navigate to the apps and run the app.
Rust on ESP32 STD Demo AppThe best example on useing std Rust on the ESP32 can be found here. It uses a lot of peripheral and protocols.
https://github.com/ivmarkov/rust-esp32-std-demo.git
git clone https://github.com/ivmarkov/rust-esp32-std-demo.git
cd rust-esp32-std-demo/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4