freertos_rs 0.2.0

Rust interface for the FreeRTOS embedded operating system.

freertos.rs

A Rust wrapper for FreeRTOS. Nightly Rust is required.

The main entry point for your embedded executable should be provided by your platform's preffered compiler toolchain. For example, for STM microcontrollers, a project generated using STM32CubeMX and compiled using GCC could be used as a starting point. Additional shims between C and Rust provide access to drivers, hardware and FreeRTOS.

This library uses a C shim to communicate with FreeRTOS's API. Dynamic memory allocation is required at the moment.

Build Status

Documentation

Introduction article

Usage

First, add this to your Cargo.toml:

[dependencies]
freertos_rs = "0.2"

Next, add this to your project:

extern crate freertos_rs;

use freertos_rs::*;

Unit tests

This project includes unit tests that are run on the The GNU ARM Eclipse QEMU emulator. The basic firmware for STM32 is written in C, compiled with GCC and finally linked with the particular unit test's entry point. Since the QEMU emulator doesn't support FPU registers, slight changes were made to the FreeRTOS kernel. Lacking timer hardware emulation is simulated with a Systick-dependent IRQ trigger. Rust code invokes the cross compilation of this crate, compilation of the base firmware, final linkage and then runs the unit tests using the emulator.