12 releases (6 breaking)

0.7.0 May 30, 2022
0.6.2 Nov 15, 2021
0.6.0 Sep 5, 2021
0.5.1 May 15, 2021
0.3.0 Dec 28, 2020

#1392 in Embedded development

Download history 1545/week @ 2023-06-06 895/week @ 2023-06-13 1381/week @ 2023-06-20 1778/week @ 2023-06-27 1517/week @ 2023-07-04 1404/week @ 2023-07-11 1132/week @ 2023-07-18 1520/week @ 2023-07-25 1386/week @ 2023-08-01 1130/week @ 2023-08-08 1247/week @ 2023-08-15 1068/week @ 2023-08-22 1143/week @ 2023-08-29 1387/week @ 2023-09-05 1490/week @ 2023-09-12 1315/week @ 2023-09-19

5,657 downloads per month
Used in 37 crates (18 directly)



bxCAN peripheral driver

crates.io docs.rs CI

This crate implements a driver for the bxCAN peripheral found in many low- to middle-end STM32 microcontrollers.

Please refer to the changelog to see what changed in the last releases.


Add an entry to your Cargo.toml:

bxcan = "0.7.0"

Check the API Documentation for how to use the crate's functionality.

Rust version support

This crate supports at least the 3 latest stable Rust releases. Bumping the minimum supported Rust version (MSRV) is not considered a breaking change as long as these 3 versions are still supported.


Driver for the STM32 bxCAN peripheral.

This crate provides a reusable driver for the bxCAN peripheral found in many low- to middle-end STM32 microcontrollers. HALs for compatible chips can reexport this crate and implement its traits to easily expose a featureful CAN driver.


  • Supports both single- and dual-peripheral configurations (where one bxCAN instance manages the filters of a secondary instance).
  • Handles standard and extended frames, and data and remote frames.
  • Support for interrupts emitted by the bxCAN peripheral.
  • Transmission respects CAN IDs and protects against priority inversion (a lower-priority frame may be dequeued when enqueueing a higher-priority one).
  • Implements the embedded-hal traits for interoperability.
  • Support for both RX FIFOs (as [Rx0] and [Rx1]).


  • Support for querying error states and handling error interrupts is incomplete.

Cargo Features

Feature Description
unstable-defmt Implements defmt's Format trait for the types in this crate.[^1]

[^1]: The specific version of defmt is unspecified and may be updated in a patch release.