freertos-build

Crates.iofreertos-build
lib.rsfreertos-build
version0.6.0
created_at2025-12-14 03:52:03.829493+00
updated_at2026-01-23 00:56:28.955082+00
descriptionUtility lib for building & using FreeRTOS in rust projects inside the build.rs.
homepagehttps://github.com/mcu-rust/FreeRTOS/tree/main/freertos-build
repository
max_upload_size
id1983740
size35,767
Jalon Wong (JalonWong)

documentation

README

freertos-build

CI Crates.io Docs.rs License Downloads

As part of the freertos-next ecosystem, freertos-build provides a simple and reliable way to build FreeRTOS applications using Cargo. It integrates FreeRTOS into your Rust project through a build.rs, automatically compiling the kernel sources and applying your custom FreeRTOSConfig.h.

See also freertos README.

📦 Usage

cargo add --build freertos-build

Add the following snippet to your application's build.rs:

use freertos_build::prelude::*;

fn main() {
    let mut b = freertos_build::Builder::new();
    b.cpu_clock(72.MHz());
    b.heap_size(10 * 1024);
    b.minimal_stack_size(80);
    b.interrupt_priority_bits(4, 5, 15);
    b.compile().unwrap();
}

Optional configuration:

// Use your own FreeRTOS-Kernel source tree
b.freertos_kernel("path/to/FreeRTOS-Kernel");

// Override the default port (relative to FreeRTOS-Kernel/portable)
b.freertos_port("GCC/ARM_CM3");

// Use UserConfig.h
b.user_config_dir("path/to/config/directory");

// Override the internal FreeRTOSConfig.h
b.freertos_config_dir("path/to/config/directory");

// Select the heap allocator from FreeRTOS-Kernel/portable/MemMang
// Default: heap_4.c
b.heap("heap_4.c");

b.use_timer_task(1, 10, 200);
b.max_task_priorities(5);
b.use_preemption(true);
b.idle_should_yield(true);
b.max_task_name_len(16);
b.queue_registry_size(8);
b.check_for_stack_overflow(2);
Commit count: 0

cargo fmt