Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Rust and esp32 was a rough ride for setup. The pthread rwlock thing stumped me for a while because I missed `esp_idf_sys::link_patches()` in main. I eventually found that missing piece and got it going.

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.



I've had pretty good luck with rust on stm32. Toolchain was just a matter of `rustup target install thumbv7m-none-eabi` and `cargo-embed`. The little bit of mismatch between the various HAL projects makes switching specific MCUs un-fun, but as long as you're just sticking with one, I would recommend.


I wrote [this STM32-Hal lib](https://github.com/David-OConnor/stm32-hal) that makes switching easy. Switching between and within STM32 families is transparent, with some exceptions like DMA MUX.


This is fantastic! Thanks for sharing. I’m excited to try this on my next project


The esp32 vs avr split covers a pretty wide range of needs. esp32 for wifi stuff, horsepower, or just more pins. The AVR is for power sipping things: ATtiny pulls 10nA(!) in deep sleep and you don't need a voltage regulator on a 1s lithium cell.

Since this is all hobby projects anyway, I may pick up an stm32 board for the next round just to see what's up.


I'd recommend an STM32 for now as well, it was quite easy to get a project going in Rust on those chips.


What's the equivalent step to CubeMX, manually selecting compatible features to turn on in cargo.toml and declaring which pin (if applicable) yourself?


VSCode can run with its backend in a container:

https://code.visualstudio.com/docs/remote/containers




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: