Embedded

From Rust Community Wiki
Jump to navigation Jump to search

Rust supports a lot of processors other than x86 and ARM, and can be used to program embedded controllers for automobiles and IoT devices.

Customize std[edit | edit source]

Xargo[edit | edit source]

Xargo builds and manages "sysroots" (cf. rustc --print sysroot). Making it easy to cross compile Rust crates for targets that don't have binary releases of the standard crates, like the thumbv*m-none-eabi* targets. And it also lets you build a customized std crate, e.g. compiled with -C panic=abort, for your target.

Xargo is now in maintenance mode.[1] Work is in progress to incorporate its features into Cargo.

Cargo[edit | edit source]

The customize std feature of Cargo is under active development in the std-aware Cargo working group. The experimental implementation is in nightly under the flag -Z build-std .[2]

Books[edit | edit source]

Crates[edit | edit source]

The crates.io has No standard library and Embedded development categories.

Crates for low level data manipulation
Crate Maintained by Description
Cargo vec.svgbitvec myrrlyn A crate for manipulating memory, bit by bit.
Cargo vec.svgbyteorder Andrew Gallant Convenience methods for encoding and decoding numbers in big-endian or little-endian order.
Cargo vec.svgmemchr Andrew Gallant et al. Heavily optimized routines for searching bytes.
Crates for maintaining no_std crates
Crate Maintained by Description
Cargo vec.svgno-std-compat jD91mZM2 A compatibility layer to ease porting crates to no_std.
Cargo vec.svgautocfg Josh Stone Automatically configure code based on compiler support in build scripts.
Cargo vec.svgcargo-bloat Evgeniy Reizner Find out what takes most of the space in your executable.
Popular no_std crates
Crate Maintained by Description
Cargo vec.svgdashmap Acrimon Performant concurrent associative array/hashmap.
Cargo vec.svgsmallvec Simon Sapin Vec which stores up to a small number of items on the stack.
Cargo vec.svgtime Jacob Pratt Simple time handling.

See Also[edit | edit source]

References[edit | edit source]

  1. PSA: Xargo is now in maintenance mode japaric/xargo/issues/193
  2. Unstable Features, The Cargo Book, https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std.