Rust has received official support for a new platform: overview and details
The Rust language development team has announced the addition of official support for a new hardware platform. This time, the RISC-V 32-bit architecture with bare-metal support (no operating system) has been added to the list of tier 2 target platforms. This is an important step for the embedded development community and for everyone working with microcontrollers and embedded systems.
What exactly was added?
In a recent update of the rustc compiler, a new target triplet was added: riscv32imac-unknown-none-elf. This means you can now compile Rust programs for 32-bit RISC-V processors with the IMAC instruction set (multiplication, atomic operations, compressed instructions) without being tied to any operating system.
This platform has received tier 2 status. This guarantees:
- Automatic building of the standard library (
coreandalloc) in the Rust repository; - Availability of official binary compiler builds for this target;
- Passing a basic set of tests with every commit to the repository;
- Support for
cargo buildandcargo testout of the box.
Why is this important for the community?
RISC-V is an open instruction set architecture (ISA) that is rapidly gaining popularity in the world of embedded systems, IoT, and even server solutions. Until now, Rust support for 32-bit RISC-V was limited to experimental builds or required manual configuration. Now, developers can start using Rust on real microcontrollers (for example, on chips from Espressif, SiFive, or GigaDevice) without needing to write complex build scripts.
This is especially relevant for projects that require safe memory management and high performance — Rust's strong points. The embedded community has been waiting for this news for a long time, as C and C++ have long been the only choice for bare-metal programming on RISC-V.
How to start using the new platform?
If you already have the latest stable Rust compiler installed, you can try compiling a simple program for this platform:
rustup target add riscv32imac-unknown-none-elfcargo new --bin my_riscv_projectcd my_riscv_project# In .cargo/config.toml specify:# [build]# target = "riscv32imac-unknown-none-elf"cargo buildAfter building, you will get an executable file that can be flashed onto a compatible microcontroller. Of course, for real work with peripherals, you will need crates like riscv and riscv-rt (startup code), which are already available on crates.io.
What's next?
The addition of this platform is part of Rust's long-term strategy to capture the systems programming niche. The development team's immediate plans include raising the status of this platform to tier 1, which will provide full support and a guarantee of backward compatibility. Official tutorials and examples for RISC-V on the Rust Embedded Working Group website are also expected to appear.
For readers of our site pythonlib.ru, this is a great reason to take a closer look at Rust.