FreeRTOS-Next
Wrapper library to use FreeRTOS API in Rust.
- It includes the source code of FreeRTOS-Kernel. Current version is
V11.2.0.- If you have any specific requirements, please prepare your source code and call
b.freertos("path/to/your/kernel");in yourbuild.rsfile.
- If you have any specific requirements, please prepare your source code and call
- It implements some useful traits:
Usage
- Add dependencies to your Rust APP
cargo add freertos-next
cargo add --build freertos-build
- Add this snippet to your APP's
build.rs:
- Optional:
// If you want to use you own source code.
b.freertos;
// Path relative to 'FreeRTOS-Kernel/portable'.
// If the default path is not what you want.
b.freertos_port;
// Set the heap_?.c allocator to use from 'FreeRTOS-Kernel/portable/MemMang'
// (Default: heap_4.c)
b.heap;
It needs freertos-build to work with. stm32f1-FreeRTOS-example shows how to use this crate with stm32f1-hal together.
Used C compiler
freertos-build depends on the cc crate. So the C compiler
used can be set by using the CC enviroment variable or otherwise defined by internal
defaults. For the ARM architecture this is the arm-none-eabi-gcc which can be found here.
Install:
# on Ubuntu
sudo apt-get install -y gcc-arm-none-eabi
# on Windows
scoop install gcc-arm-none-eabi
See also repository.