Rust on Espressif chips
mabez.dev
mabez.dev
"ESP32 ESP32-CAM WiFi"
"ESP8266 ESP32 ESP-32S"
"SX1276 ESP32 with LoRa 868MHz-915MHz"
Remember Chinese disposable brand sites tend to disappear without warning, so you always have to archive everything they have on their support sites, i.e., datasheets, code, examples, doc, diagrams, etc.
is this a good time to learn and start writing for the ESP32 in Rust, or should I wait a little more?
Yes, it's a weekend and also a holiday today ;-)
Is there any good guide for getting Rust working on ESP32? (the old Xtensa dual core model, or the newer C3 or C6 models)
I’ve also been looking at maybe trying an RP2040 board I have, but the Getting Started[0] guide seems very incomplete. It doesn’t even seem to mention that you need a nightly build of Rust, but I’m pretty sure you do.
I also doubt that running “cargo run” is going to result in an example being loaded onto any development board, so that seems like a confusing thing to show in the guide.
[0]: https://github.com/embassy-rs/embassy/blob/main/examples/stm...
The no_std hal is still a bit of a moving target so it's not as beginner friendly, the most mature here seems to be the SlimeVR firmware: https://github.com/SlimeVR/SlimeVR-Rust/tree/main/firmware
For std hal there are a few more, OFMon being a good one: https://github.com/arashsm79/OFMon
Works fine for most things but I’ve also told myself many times now that I would like to dive deeper when I find the time.
My background is in web and Java. Never done C or C++.
Is rust on esp already good enough for a beginner?
The biggest thing in Rust that you need to become familiar with from Java is the ownership system. First, Java is a default copy-by-reference language, whereas Rust is move by default. So learn the difference between, T, &T, and &mut T. Learning the ownership system will make you disappointed in Java’s thread-safety story. Rust makes thread safety and multiple references to values very obvious and you need to be explicit about how things should be shared. This will probably be your biggest hurtle, based on my experience.
Read the book, these concepts are all explained very nicely: https://doc.rust-lang.org/book/
It's mostly declarative, like writing a kubernetes helm chart with some templating, which should be somewhat at home for web folks.