Rust & RIOT combined for ergonomic embedded development
RIOT-rs is an operating system for secure, memory-safe, low-power Internet of Things (IoT). RIOT-rs is based on Rust from the ground up, and uses formal verification for critical modules. To learn more about our motivations, see this manifesto.
Hardware targets include varieties of IoT hardware based on 32-bit microcontroller architectures (such as Cortex-M, RISC-V).
In practice, RIOT-rs builds on top of Embassy. Compared to what Embassy already provides, RIOT-rs brings additional value in terms of abstraction, operating system functionalities, and integration for a (curated) set of software modules, tools and libraries, as well as a stronger focus on cybersecurity and formal verification.
In particular, RIOT-rs aims to combine:
Overall, RIOT-rs gives you a 'batteries-included' experience, on par with RIOT.
The following list of hardware is currently supported:
This is currently work-in-progress. Expect missing functionalities and frequent changes! If you are not so adventurous, but nevertheless looking for a way to run your Rust module on a microcontroller, you could try to glue it directly on top of Embassy, or instead, run your module in a riot-wrappers.
The following assumes you have a Nordic nrf52840dk connected to your PC. (For other supported boards, you can find your board's name in ./src/riot-rs-boards/Cargo.toml and use it instead of 'nrf52840dk' in the below guidelines.)
The following instructions will enable you to flash and run the hello-world
example:
install needed system dependencies. On Ubuntu, the following is sufficient:
apt install build-essential curl git python3 pkg-config \
libssl-dev llvm-dev cmake libclang-dev gcc-arm-none-eabi \
clang libnewlib-nano-arm-none-eabi unzip lld ninja-build
install rustup
install laze: cargo install laze
install probe-rs: cargo install probe-rs-tools --locked
clone this repository and cd into it
install rust targets: laze build install-toolchain
Compile, flash and the hello-world example using probe-rs run
laze -C examples/hello-world build -b nrf52840dk run
Please look at the build system documentation for more usage information.
RIOT-rs makes heavy use of Rust unstable features. For the time being, it is recommended to use a current nightly.
Please see the chapter on coding conventions in the documentation.
RIOT-rs is licensed under either of
at your option.
~~RIOT-rs links with many components of RIOT OS, which is licenced under the terms of LGPLv2.1.~~
Copyright (C) 2020-2023 Freie Universität Berlin, Inria, Kaspar Schleiser
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.