Live data from Hacker News

Rust on Espressif chips

mabez.dev

21–30 of 71 posts

Re: Rust on Espressif chips

#21
post #16

Earlier quoted context omitted.

Yes but they didn't yet release dual-core RISC-V based or did I miss it? I use it's dual-core capabilities extensively as I heavily utilize WiFi and still have to maintain low-latency processing of IO input. Didn't look much into RISC-V ESP but does it have some interrupts without multiplexor?

Yes, esp32-c3 [0] can be bought already, e.g., from mouser [1] or sparkfun [2] either as dev kit or as native module for a self-designed PCB. [0]: https://www.espressif.com/en/products/socs/esp32-c3 [1]: https://www.mouser.de/new/espressif/espressif-esp32c3wroom02... [2]: https://www.sparkfun.com/products/18034

They asked for dual core. The C3 is single core.

> ESP32-C3 is a single-core, 32-bit, RISC-V-based MCU with 400KB of SRAM, which is capable of running at 160MHz

https://www.espressif.com/en/news/ESP32_C3

Re: Rust on Espressif chips

#22
post #4

I was looking forward to trying Rust on my ESP32 projects but always had a hard time. All the tooling is too complicated. There is flasher coded in python, IDF coded in C, you need to run MinWin on Windows which makes it even harder. You can't run all of this in docker because docker for windows doesn't allow mapping COM ports into container and stuff. Everything about just compiling a code seems so tiresome and unst…

Well not to be inflammatory, but aren't you making your life more difficult by doing development on Windows? You could just run Windows in a VM if you need any Windows specific software, and have your main OS be something more suitable for software development.

Of course ideally everything would just work on Windows, and there's nothing wrong with running Windows as your main os, but the reality is that especially bleeding edge software development tools will never be as good on Windows as they are on Linux or MacOS, just because bleeding edge open source software developers generally do not use Windows.

Re: Rust on Espressif chips

#23

Earlier quoted context omitted.

> But genuine question, is Rust ever going to catch on in the mainstream? It seems to have a bunch of nice to have features and great optimization. But the pick up, from what I've seen, has been less than stellar. I'm not sure where you've gotten that impression. Rust is mainstream at this point. All the big companies (e.g. FAAMG) are using Rust. Lots of large products are: Firefox of course, but also, parts of AWS,…

I think the key is that it's mainstream at the system/platform layer, not so much the application layer (though maybe one day!). Its benefits to the former are clear and undeniable; a paradigm-shift. Its benefits to the latter are pretty mixed by comparison. Anyone who mostly hangs out at the application-layer and doesn't follow this stuff closely could miss the adoption it's getting elsewhere.

I don’t see Rust becoming mainstream in the enterprise layer anytime soon. 90% or enterprise software consists of a REST API getting JSON payloads and saving them in a DB. The most complex part is often managing the “bus factor”, rather than some technical challenge. You often need just a bit more than VB6.

Rust requires a higher cognitive cost than C# or Python, but doesn’t provide massive improvements in the areas most relevant to enterprise developers (ORMs, JSON serialization, SDKs, etc…)

Re: Rust on Espressif chips

#24
post #20

as someone who occasionally dabbles in diy esp based home automation devices (mostly with esp8266) but completely new to Rust, where's the best place to get started? some code example to look at?

This repository was linked in the author's first post: https://github.com/ivmarkov/rust-esp32-std-demo

Re: Rust on Espressif chips

#25
Oh, this is exciting. I've been trying to get PlatformIO to play nicely with my ESP32C3's but it's been a pain. Only the standard Espressif RTOS tooling seems to do anything but hang the chip for some reason, and I don't know enough about PlatformIO to modify my config to make it work or to open an issue on Github.

Replacing one complex, half broken tool chain with another isn't such a bad deal, and I'm very much in favour of writing Rust instead of C(++).

Re: Rust on Espressif chips

#26
post #2

I'm curious about this as someone who is interested in making DIY smart home products as well as their recently announced Zigbee radio module. But genuine question, is Rust ever going to catch on in the mainstream? It seems to have a bunch of nice to have features and great optimization. But the pick up, from what I've seen, has been less than stellar.

In what space? If you're talking about embedded, it's going to be pretty slow for industry to start using rust en masse. There's a huge amount of inertia in embedded, and the developers are somewhat beholden to manufacturers to release tooling around rust. In the software space, rust is being used by quite a few companies [0]. 0: https://www.rust-lang.org/production/users

It may be true that manufacturers are ignoring Rust but that certainly does not stop or hinder me. Tools like svd2rust mean I only need to rely on the accuracy of their svd files (industry standard register maps) - see https://github.com/rust-embedded/svd2rust

Additionally, I use vanilla VS Code and rust analyser so no need to use manufacturer supplied lock-in IDEs. There are many compiler targets to choose from for cross compilation and tools like probe-run to flash chips.

One major issue is lack of manufacturer provided code examples written in Rust. For that I rely on the Rust community. A typical example being nrf-hal for Nordic Bluetooth chips.

Re: Rust on Espressif chips

#27
post #4

I was looking forward to trying Rust on my ESP32 projects but always had a hard time. All the tooling is too complicated. There is flasher coded in python, IDF coded in C, you need to run MinWin on Windows which makes it even harder. You can't run all of this in docker because docker for windows doesn't allow mapping COM ports into container and stuff. Everything about just compiling a code seems so tiresome and unst…

I had an easy time getting setup with the esp32c3 with this repository (linked to in author's first post): https://github.com/ivmarkov/rust-esp32-std-demo

Also got it working on WSL2. I could install flashing and monitoring tools as Windows binaries, which have access to Windows ports. https://pfesenmeier.github.io/wsl2-and-embedded-development/

Re: Rust on Espressif chips

#28
post #2

I'm curious about this as someone who is interested in making DIY smart home products as well as their recently announced Zigbee radio module. But genuine question, is Rust ever going to catch on in the mainstream? It seems to have a bunch of nice to have features and great optimization. But the pick up, from what I've seen, has been less than stellar.

> But genuine question, is Rust ever going to catch on in the mainstream? It seems to have a bunch of nice to have features and great optimization. But the pick up, from what I've seen, has been less than stellar. I'm not sure where you've gotten that impression. Rust is mainstream at this point. All the big companies (e.g. FAAMG) are using Rust. Lots of large products are: Firefox of course, but also, parts of AWS,…

>Rust is mainstream For sure it depends what you mean by mainstream. If a FAANG uses language X, it's language X mainstream?

I'd venture to say that to be considered mainstream a language has to at least pass 1% threshold in Tiobe index (or the equivalent in Redmonk or others).

If Rust is mainstream, then Fortran is über mainstream

Re: Rust on Espressif chips

#29

Earlier quoted context omitted.

> But genuine question, is Rust ever going to catch on in the mainstream? It seems to have a bunch of nice to have features and great optimization. But the pick up, from what I've seen, has been less than stellar. I'm not sure where you've gotten that impression. Rust is mainstream at this point. All the big companies (e.g. FAAMG) are using Rust. Lots of large products are: Firefox of course, but also, parts of AWS,…

I think the key is that it's mainstream at the system/platform layer, not so much the application layer (though maybe one day!). Its benefits to the former are clear and undeniable; a paradigm-shift. Its benefits to the latter are pretty mixed by comparison. Anyone who mostly hangs out at the application-layer and doesn't follow this stuff closely could miss the adoption it's getting elsewhere.

[deleted]

Re: Rust on Espressif chips

#30
post #27
post #4

I was looking forward to trying Rust on my ESP32 projects but always had a hard time. All the tooling is too complicated. There is flasher coded in python, IDF coded in C, you need to run MinWin on Windows which makes it even harder. You can't run all of this in docker because docker for windows doesn't allow mapping COM ports into container and stuff. Everything about just compiling a code seems so tiresome and unst…

I had an easy time getting setup with the esp32c3 with this repository (linked to in author's first post): https://github.com/ivmarkov/rust-esp32-std-demo Also got it working on WSL2. I could install flashing and monitoring tools as Windows binaries, which have access to Windows ports. https://pfesenmeier.github.io/wsl2-and-embedded-development/

That's because the c3 is a RISC-V chip and so doesn't require all of the annoying tooling that parent comment is referring to.

The rest of Espressif's product line, including the extremely popular original ESP32 and the older 8266, use different chip architecture (xtensa) that requires a more annoying setup.

Post reply on HN