freertos-std

Crates.iofreertos-std
lib.rsfreertos-std
version0.0.1
sourcesrc
created_at2023-07-18 15:41:32.470435
updated_at2023-07-31 15:01:02.281909
descriptionA Clone of the Rust Standard Library for FreeRTOS
homepage
repositoryhttps://github.com/sheref-sidarous/freertos-std
max_upload_size
id919557
size4,520,009
Sheref Sidarous (sheref-sidarous)

documentation

README

A Rust Standard Library implementation for FreeRTOS

This is an early alpha version of the Rust Standard Library port for FreeRTOS. So far, it has basic support of threads and sync primitives.

How to use

It is recommended to include this repo as a submodule in your workspace, this is because the FreeRTOS build system needs to include c files from it.

$ git submodule add git@github.com:sheref-sidarous/freertos-std.git

rust app:

  • Add freertos-std dependendcy as the std library in Cargo.toml
std = {path = "../freertos-std", features = ["panic_immediate_abort"], package = "freertos-std"}

Where path refers to where freertos-std were checked out

  • Build your app as a staticlib
[lib]
crate-type = ["staticlib"]
  • You will need to include the restricted_std feature in the top of your root lib.rs
#![feature(restricted_std)]

FreeRTOS build system:

  • Build the C file src/sys/freertos/rust_std_shim.c from freertos-std into the build system
  • Link the Rust app built static library

Example usage

Check out freertos-std-example for an example that builds and runs this library using Qemu

Commit count: 27

cargo fmt