libFLARM
Embeddable Collision Avoidance Software Stack
libFLARM is a software library that implements part of the FLARM communication and collision avoidance software stack. It takes navigation and timing data as input, sends and receives FLARM radio packets, computes collision hazards, and outputs aircraft and alarm data ready to drive a display.
Built for Embedded Integration
libFLARM is completely hardware-independent. All access to hardware is abstracted behind device drivers that the host system implements — for the radio transceiver, the GNSS receiver and the system time base. This lets you build on the MCU, radio and GNSS module that best fit your product.
Data and events flow between the library and the host application through a proprietary publish/subscribe message broker: the host publishes navigation and timing data, and subscribes to the aircraft traffic and alarm information the library produces.
The library uses a memory-friendly model suited to constrained devices. It needs no real-time operating system: all state is managed internally, and the host simply calls the library periodically. Calls never block on I/O and return quickly. No dynamic memory allocation is required — all memory is reserved statically or at initialization — and an optional custom allocator lets you decide exactly where in RAM the library’s state lives. For energy-constrained designs, the library also reports when it next needs to run, so the host can enter deep-sleep states in between.
Ready to integrate FLARM into your avionics or drone hardware? libFLARM is available for commercial projects. Contact us for more information and pricing!
Product-Highlights
- Hardware-Agnostic Design: Hardware interaction is entirely decoupled from the core library. All radio and system peripherals are abstracted via driver interfaces and data structures implemented by the host system.
- No RTOS Required: The library operates state-internally via an opaque handle and does not require a real-time operating system. The host system simply invokes libFLARM periodically to consume inputs and generate outputs.
- Zero Dynamic Memory Allocation: All memory is allocated statically or during initialization. No heap allocation is required during runtime, memory is never freed by the library, and custom memory allocators are fully supported to place state into specific RAM regions.
- Non-Blocking & Deterministic Execution: All library API calls execute quickly and never block on I/O. It includes a customizable random generator interface, enabling repeatable, deterministic execution for Software-in-the-Loop (SIL) and Hardware-in-the-Loop (HIL) testing.
- Ultra-Low Resource Footprint: Demands as little as 20 kB of Flash and 5.6 kB of RAM. For lightweight tracking beacons or unmanned vehicles requiring broadcast capabilities only, a TX-only variant is available that reduces RAM usage to 2.6 kB.
- Deep-Sleep Power Management: Built for energy-constrained devices, libFLARM provides a “deadline” timestamp indicating when it next requires execution in the absence of external signals, allowing host processors to remain in deep sleep to conserve power.
- Publish/Subscribe Architecture: Features a built-in publish/subscribe (pub/sub) message broker for decoupled data exchange between the library and host application, complete with FIFO buffering to handle latency spikes. Built-in Navigation Fix Extrapolation: Includes an optional Constant Turn Rate and Velocity (CTRV) extrapolation module to project navigation solutions forward when GNSS latency prevents meeting strict real-time windows.
Technical Specifications & Requirements
-
CPU Core32-bit architecture, little-endian memory layout
-
Clock SpeedMinimum 20 MHz. Non-FPU processors supported (may require additional clock cycles)
-
Code Size (Flash)~20 kB (standard build)
-
RAM Footprint5.6 kB (Full) / 2.6 kB (transmit-only) plus stack allocation
-
Toolchain
Standard GCC for cross compilation, e.g., arm-none-eabi-gcc targeting embedded platforms