Mabez Rust on Espressif chips – Q4 update
mabez.dev
mabez.dev
The IDF is interesting, in that it works with the standard library; not the usual embedded experience, but I don't understand the mechanisms by how they made it work, or how much of the networking etc would work the same was it would does on a PC.
I was unable to get probe-rs and defmt working with it; maybe will give another try, as this article points to it working.
Note: Note all the the official dev boards have JTAG connected to USB. Check for that specifically.
In theory, there is a quickstart CLI tool that should generate a project, but it is currently broken. This is the repo I set up that "just works" for C3.
(if tinygo supported more than one core, and had wifi/bt support on esp32, I'd not be looking back that often)
Which tool do you mean? `cargo-generate` it's working fine for both templates:
- esp-idf-template(std): https://github.com/esp-rs/esp-idf-template)
- esp-template (no_std): https://github.com/esp-rs/esp-template
You just need to declare them correctly inside your Cargo.toml and it will automatically expose it all inside Rust. Though i have to say using C api's can be a hazard and to effectively using it you now have two problems as a potential rust beginner. First you need a good rust unsafe understanding and second you need good C understanding. So nothing i would recommend to a beginner, in either of this fields.
Really.
ESP-RS (baremetal) is usable, and nice.
I would happily recommend it if you can live with the state of bluetooth/wifi not being awesome quite yet.
ESP-IDF-* is a consistent mess. APIs break continuously and in ways that are often hard to upgrade.
It is very difficult to find a combination of library versions that work with anything else in the ecosystem (embedded-), mainly due to esp-idf not keeping up or doing weird things. This is deliberate - they want to move esp- everything forward together, which is nice, except nobody else in the entire embedded ecosystem is on their release schedule so the result is things are always broken. Even funnier is that this all happens while esp-idf itself is rather stable and usable.
In fact, at various times, it has been in a known-broken state with the latest stable ESP-IDF for months. Known broken here doesn't mean "some stuff doesn't work". It means "it doesn't build at all and requires you hand-patch git checkouts to make it work".
You can read how at least one main maintainer responds to issues (which basically amount to explaining why everyone else is wrong and they are right. It's fun to watch them recommend their own libraries as the one-true-way and tell people that they think it's a mistake to use loops so they don't care that something doesn't work), and get a good feeling for why all the above is true.
Everyone else in the community is quite nice and reasonable, and seems to care about users.
But at this point, i'm literally taking projects I wrote in ESP rust and moving them back to C++ (one right now, in fact, i'm taking a break to write this comment) and will try again for years.
Given how it has gone, and the direction that certain folks push in, i don't have a lot of faith it will get significantly better.
If you want to do baremetal, do it and live with it. If you want to try to use esp-idf, i would highly recommend you don't do it.
I literally have to keep copies of patched, pinned, libraries and sdks to something that works in the esp rust things i have.
For future rust work, i will only use things supported by embassy.
> I would happily recommend it if you can live with the state of bluetooth/wifi not being awesome quite yet.
ESP32's main niche is embedded WiFi and Btle. With Bluetooth there are some alternatives, but Espressif is the nicest. For Wi-Fi, there are no integrated alternatives I'm aware of. So, if I'm on ESP, it's probably because of WiFi and/or Btle, which makes IDF appealing.
But the state is why i couldn't use baremetal at the time - the firmware kept crashing.
For this kind of thing, NRF's softdevices are a much nicer alternative and work fine in embassy.