3 unstable releases
Uses new Rust 2024
| 0.1.2 | Sep 16, 2025 |
|---|---|
| 0.1.1 | Sep 11, 2025 |
| 0.1.0 |
|
| 0.0.0 | Sep 11, 2025 |
#1468 in Embedded development
205 downloads per month
Used in 3 crates
(via veecle-osal-freertos)
340KB
4.5K
SLoC
Veecle FreeRTOS Integration
Wrapper library to use FreeRTOS APIs in Rust.
Usage
See examples for usage.
Tests
All tests are written using the FreeRTOS POSIX port.
Tests are only guaranteed to be sound using ports where the following holds true:
vTaskEndScheduleris available and has not further requirements on the caller.taskYIELDis interrupt-safe.
Adding new tests
New tests should be added as separate integration tests in tests.
Each test must be placed in a separate file to ensure one test per binary.
These tests must use harness = false and the common::test macro instead of the standard #[test] macro, see its documentation for more details.
Starting and stopping the FreeRTOS scheduler from multiple tests in parallel leads to interference between the tests. The FreeRTOS memory allocator also interacts with the scheduler globals so it must not be used in a multi-threaded binary. Because of that, integration tests are used where each file in the tests directory will be compiled as a separate binary.
Every test must include pub mod common;.
Marking the module as pub avoids Clippy warnings about unused code for common functionality not used by the specific test.
While pub mod common; allows access to shared functionality, the main reason is to use the FreeRTOS-allocator as the global allocator.
Troubleshooting compilation errors
During compilation there may arise several kinds of errors.
Linker errors
If a program uses FreeRTOS functions that are not enabled in the FreeRTOSConfig.h file, then compiling fails with linker errors.
Refer to the FreeRTOS customization page to learn how to enable specific functions.
Rust compiler errors
If the program uses bindings from the veecle-freertos-sys crate that has been excluded, then compiling fails with Rust errors.
The veecle-freertos-sys crate generates the Rust bindings for FreeRTOS based on the FreeRTOSConfig.h file.
Make sure everything is properly configured so none of the required bindings gets excluded.
Dependencies
~0–2.3MB
~45K SLoC