Rust on Espressif chips Q1 2022
mabez.dev
mabez.dev
It's hard to tell which MCU is pulling ahead for me. Rust/esp32 is so new it's not even merged to mainline llvm and I'm constantly updating esp-* libraries. OTOH, AVR/Arduino has been "just working" for me except you're stuck on a Rust build that's over a year old now due to a bug.
And then both architectures seem to suffer a bit because I stuff all the toolchains in a container, lest they explode all over the filesystem. But then VSCode can't really autocomplete anymore since it doesn't have all the pieces.
That all said, they're both super fun and it's nice to see things moving along.
Since this is all hobby projects anyway, I may pick up an stm32 board for the next round just to see what's up.
Been learning a lot of rust recently. Can't say it'd be my first choice for application or web server stuff when there's GC'd langs available. But I'm over enough of the learning curve that I prefer it to C or C++.
Still Rust seems nicer than C/C++ for a lot of applications. I'm glad there's a couple of options for better safety / security in embedded.
And the experience is exactly as you’ve described
I'll likely setup a new template project for all of that, as I think PlatformIO's lib folder allowing people to add C libraries (including their own they write) and manage, build, and flash their boards is quite nice. Its a bit different to how Nesper sets up its project, so I reckon a secondary template project is the way to go.
Wrote my own tasks too, just to be sure.
Honestly one thing I'd love to do is see if I can get Nim calling the ESP32 toolchain itself: compile out to object files and just have CMake link them, rather than the current --compileOnly:on approach. Might be more trouble than it's worth though!
Also, I have full JTAG debugging (including breakpoints in the Nim source) working remarkably well!
Let me know if you ever get a chance to do a writeup for using JTAG with Nim and ESP32's. I've never tried it, but it'd be cool to show it to people.
OTOH, my experience of those libraries has been decidedly mixed, with it being relatively easy to get things apparently-working only to later sink dozens of hours into debugging that occasional weird crash.
That said, a lot of those weird crashes we run in to even in pure C itself. ESP-IDF has some... quirks. Don't get me started on heap corruption.
The joys of embedded, I suppose.
If anyone has got PPPoS working with LwIP, I'd love an email haha.
https://docs.zephyrproject.org/latest/reference/networking/p...