Espressif's Scott Mabin Reveals the Rust on ESP32 Roadmap for 2023
Efforts to make Rust a first-class language for Espressif devices continues, with plenty in the pipeline building atop existing work.
Espressif software engineer Scott Mabin has outlined the roadmap for work on getting Rust running nicely on the company's microprocessor line-up in 2023, including an increased focus on asynchronous operation, expanded chip support, and compatibility with the low-power RISC-V coprocessor available on selected ESP32 parts.
Released in 2015 by Graydon Hoare, Rust has proven a popular new programming language thanks in no small part for its integrated memory safety functionality — preventing at a stroke a whole range of common security flaws which are easily committed in other languages. Mabin, meanwhile, has been working on adding support for Espressif's microcontroller chips to Rust since 2019 — work that continues with a roadmap published for 2023.
"We have really exciting news about LLVM," Mabin writes of the progress on the project so far. "The first 10 [Tensilica] Xtensa patches have been approved and committed upstream. This is exciting for us: Espressif has been pushing this upstreaming effort since 2019! So it's very nice to have something upstream, with plenty more patches to follow. At this point, I'd also like to make it clear that you do not need the forked compiler for our RISC-V-based chips, ESP32-C2, ESP32-C3, ESP32-C6 etc. You only need the forked compiler for our Xtensa-based chips, ESP32, ESP32-S2 & ESP32-S3."
Still in the pipeline, though, is support for a key feature of selected ESP32 parts, and one which preceded Espressif's move to RISC-V as its primary instruction set architecture: the inclusion of an ultra-low-power RISC-V coprocessor, running alongside the primary Xtensa core(s). "We'd like to leverage esp-hal
for creating applications that can run on the constrained low-power core," Mabin explains, "for both no_std
and std
applications. The low-power core is too resource-constrained to run the full standard library, so using esp-hal
makes perfect sense here."
Other entries in the roadmap for 2023 include building on the project's first asynchronous support with additional non-blocking peripheral drivers and network stacks. "Those of you familiar with the Standard library approach may have noticed there is actually quite a good async networking solution already available using smol-rs
," Mabin says, "but we need to upstream many of our changes. Our main focus for no_std
async networking will be on the esp-wifi
crate."
This year will also bring Rust support for Espressif's ESP32-C6 microcontroller, along with "the ESP32-H2 and ESP32-P4 once they are officially released," says Mabin. The ESP32-H2 was announced in August 2021 as a 32-bit RISC-V design with IEEE 802.15.4, ZigBee, and Thread support, but has not yet entered general availability; the ESP32-P4 was announced in January this year as a performance-centric part combining two RISC-V cores running at up to 400MHz and including extensions focused on improving the performance of artificial intelligence and deep learning workloads, plus an additional low-power core running at 40MHz.
Additional features on the Rust-on-Espressif roadmap revealed by Mabin include improvements designed to reduce build times, primarily by "slimming down the ESP-IDF build," and better documentation. "We've made a lot of progress over the last year," says Mabin, "but moving so fast has left the documentation situation in a not-so-great state. We're rewriting the book this year to cut out irrelevant, outdated information as well as fill the gaps created in the last year."
The full roadmap, along with changelogs for 2022, is available on Mabin's blog.
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.