OpenCyphal/libcanard

A compact implementation of the Cyphal/CAN protocol in C for high-integrity real-time embedded systems

What it solves

Libcanard provides a robust, high-integrity transport layer for embedded systems that need to communicate over a CAN bus. It implements the Cyphal standard, allowing different hardware components in a vehicle or robot to exchange data reliably in real-time without requiring a complex operating system.

How it works

The library acts as a middleware between the application logic and the CAN hardware. It handles the complexities of the Cyphal/CAN protocol, including:

  • Message Routing: Managing subscriptions and publishing data to specific subject IDs.
  • Frame Management: Handling both Classic CAN and CAN FD, including multi-frame transfers and priority-based preemption.
  • Resource Optimization: Using a minimal memory footprint (starting from 32K ROM/RAM) and efficient data structures like AVL trees for fast subscription lookups.
  • Hardware Abstraction: Using a clean, minimal interface (vtable) that allows developers to plug in their own platform-specific CAN drivers.

Who it’s for

It is designed for developers of high-integrity real-time embedded systems, specifically those building aerospace and robotic applications that rely on CAN bus communication.

Highlights

  • Extreme Efficiency: Compatible with 8/16/32/64-bit platforms and highly resource-constrained baremetal MCUs.
  • ** CURLOPT Redundancy**: Supports redundant and non-redundant CAN configurations.
  • Broad Compatibility: Supports Cyphal v1.1, v1.0, and legacy UAVCAN v0 (DroneCAN).
  • Priority Handling: Features an RX pipeline that supports priority level preemption without losing data transfers.

Related

  • Project
  • Project
  • Project
  • Project
  • Project