| Crates.io | veecle-freertos-integration |
| lib.rs | veecle-freertos-integration |
| version | 0.1.2 |
| created_at | 2025-09-11 11:15:50.404666+00 |
| updated_at | 2025-09-16 11:14:52.642263+00 |
| description | Rust wrapper for FreeRTOS |
| homepage | |
| repository | https://github.com/veecle/freertos-integration |
| max_upload_size | |
| id | 1833657 |
| size | 132,196 |
Wrapper library to use FreeRTOS APIs in Rust.
See examples for usage.
All tests are written using the FreeRTOS POSIX port.
Tests are only guaranteed to be sound using ports where the following holds true:
vTaskEndScheduler is available and has not further requirements on the caller.taskYIELD is interrupt-safe.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.
During compilation there may arise several kinds of 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.
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.