5 ms·
Mabez Rust on Espressif chips – Q4 update
- the__alchemist 3y agoFor anyone interested in trying rust on Espressif and/or Risc-V: Support is rapidly improving. Right now (Or at least CAO 2 weeks ago), the (semi?) official packages had dependency mismatches making getting started a pain. (Think pinning Git dependency patches), but overall, not a bad experience. 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.
- sergiogasquez 3y agoRegarding defmt and probe-rs, here are some resources: https://esp-rs.github.io/no_std-training/03_6_defmt.html https://esp-rs.github.io/no_std-training/03_6_defmt.html and https://esp-rs.github.io/book/tooling/debugging/probe-rs.html https://esp-rs.github.io/book/tooling/debugging/probe-rs.htm...
- vollbrecht 3y agoThe rust standard library support was not that complicated to add because a) esp-idf ( with the FreeRTOS kernel) is used underneath b) esp-idf has unix like features and exposes a posix layer for stuff like networking and filesytem. If you want to look at the full initial PR on rust-lang github look for PR number 87666.
- quchen 3y agoI've looked at Rust-on-ESP a number of times in the past, but it's never been at a level of "I can make an LED blink within an hour or so". Is there a write-up for interested but not deeply involved people somewhere? How far are we from "clone this, run ./flash and the LED will blink"? How hard is it to use existing Arduino libs (e.g. MQTT, popular sensors, FastLed), or what would the ecosystem look like? I keep daydreaming about replacing my C-IoT-home mess in Rust in the meantime. :-)
- the__alchemist 3y agoThis is what I threw together: https://github.com/David-OConnor/esp32c3_quickstart https://github.com/David-OConnor/esp32c3_quickstart 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.
- sergiogasquez 3y ago> In theory, there is a quickstart CLI tool that should generate a project, but it is currently broken. 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 https://github.com/esp-rs/esp-idf-template) - esp-template (no_std): https://github.com/esp-rs/esp-template https://github.com/esp-rs/esp-template
- the__alchemist 3y agoYep - that's what I'm referring to. Broken as of when I tried 2 weeks ago; can't speak to it currently.
- ukd1 3y agoYa, the tooling is improving (e.g. https://github.com/esp-rs/espup https://github.com/esp-rs/espup) - but still, the experience with Rust is always interesting; I try it every few months, then give up as it breaks, sometimes check tinygo, then realize it's still missing wifi/bt support, and go back to c. Micropython is interesting, but also the developer experience around the tooling isn't great. I was spoiled with rails imho. (if tinygo supported more than one core, and had wifi/bt support on esp32, I'd not be looking back that often)
- steveklabnik 3y agoHopefully it will continually improve given that at least one person is paid to work on it full time. It's come a long long way over the past few years.
- Havoc 3y agoThat sounds promising but probably another quarters wait for good measure given my decidedly modest rust skill
- vollbrecht 3y agoThe learning curve is quite step especially if you don't already have a good understanding of embedded systems.Funnily enough we see many rust beginners + embedded beginners directly jumping on the bandwagon and joining the Matrix channel playing around. I think there is no right or wrong answer to the question of when to start trying it out, or leave it be.
- k8svet 3y agoI was just blown away looking at code for Embassy, some sort of Rust embedded framework. Are these competing projects? Complimentary ones?
- vollbrecht 3y agoEmbassy is a separate project, but you can use it's framework directly on either the no_std or the std(esp-idf) esp projects. For the no_std variant they provide a special version of a embassy_executor tied to the esp's and for the std case you can use whatever runtime fits your bill from tokio to smol to embassy.