#copper #real-time #middleware

no-std cu-crsf

A copper-rs bridge to communicate through CRSF. The initial motivation is for an easy control & telemetry over radio link with ELRS for your robot.

3 releases (breaking)

Uses new Rust 2024

new 0.13.0 Feb 13, 2026
0.12.0 Jan 14, 2026
0.11.0 Nov 26, 2025

#54 in #copper

Apache-2.0

61KB
818 lines

cu-crsf

Serial bridge for TBS Crossfire / ExpressLRS receivers. It parses CRSF packets coming from a UART into Copper messages and can optionally forward RC or link statistics back out over the same link.

Channels

  • rc_rx (RcChannelsPayload): latest RC channel values from the receiver.
  • lq_rx (LinkStatisticsPayload): downlink link-quality metrics.
  • rc_tx / lq_tx: optional uplink of RC or link statistics toward the transmitter.

Resources and configuration

The bridge expects a serial resource (anything implementing embedded_io Read/Write + Send + Sync). Point the bridge's resources map at a bundle entry.

std builds

Use cu_linux_resources::LinuxResources as the serial provider; it stores owned resources in fixed slots like <bundle>.serial0 through <bundle>.serial5. For serial config keys (serialN_dev, serialN_baudrate, parity/stopbits/timeout), see cu_linux_resources README: Config Keys / Serial.

resources: [
  (
    id: "linux",
    provider: "cu_linux_resources::LinuxResources",
    config: { "serial3_dev": "/dev/ttyUSB0", "serial3_baudrate": 420000 },
  ),
],
bridges: [
  (
    id: "crsf",
    type: "cu_crsf::CrsfBridgeStd",
    resources: { serial: "linux.serial3" },
    channels: [ Rx (id: "rc_rx"), Rx (id: "lq_rx") ],
  ),
],

no-std builds

Provide your own bundle that moves a UART into the ResourceManager (as an owned resource). If your UART type is not Sync, wrap it once at bundle registration time with cu_linux_resources::Exclusive<T>.

The resources module in examples/cu_elrs_bdshot_demo shows a complete pattern:

resources: [
  ( id: "radio", provider: "my_app::resources::RadioBundle" ),
],
bridges: [
  (
    id: "crsf",
    type: "cu_crsf::CrsfBridge<SerialResource, SerialPortError>",
    resources: { serial: "radio.serial" },
    channels: [ Rx (id: "rc_rx"), Tx (id: "lq_tx") ],
  ),
],

See examples/cu_elrs_bdshot_demo for a full wiring that feeds CRSF RC channels into a BDShot bridge on the RP2350 reference board.

Dependencies

~17–34MB
~473K SLoC