veecle-freertos-integration

Crates.ioveecle-freertos-integration
lib.rsveecle-freertos-integration
version0.1.2
created_at2025-09-11 11:15:50.404666+00
updated_at2025-09-16 11:14:52.642263+00
descriptionRust wrapper for FreeRTOS
homepage
repositoryhttps://github.com/veecle/freertos-integration
max_upload_size
id1833657
size132,196
(veecle-release-bot)

documentation

README

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:

  • vTaskEndScheduler is available and has not further requirements on the caller.
  • taskYIELD is 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.

Commit count: 30

cargo fmt