#cyphal #uavcan #uav #can #distributed-computing

no-std canadensis_bxcan

Bridge between Canadensis and the BXCAN peripherals found in some microcontrollers

6 releases

0.3.1 Nov 8, 2024
0.3.0 Mar 31, 2023
0.2.2 Oct 18, 2022
0.2.1 Apr 12, 2022
0.1.0 Jul 11, 2021

#1840 in Embedded development

Download history 24/week @ 2024-09-21 5/week @ 2024-09-28 2/week @ 2024-10-12 77/week @ 2024-11-02 42/week @ 2024-11-09

119 downloads per month

MIT/Apache

285KB
6K SLoC

Canadensis: A Cyphal implementation

This project implements (most of) Cyphal (previously called UAVCAN v1.0). As the Cyphal website explains, "Cyphal is an open technology for real-time intravehicular distributed computing and communication based on modern networking standards (Ethernet, CAN FD, etc.). It was created to address the challenge of on-board deterministic computing and data distribution in next-generation intelligent vehicles: manned and unmanned aircraft, spacecraft, robots, and cars."

This is currently an independent project, not affiliated with the Cyphal Consortium.

Submodule note

This repository uses a submodule for the public regulated data types. When cloning, use git clone --recursive. If you have already cloned the repository without the recursive option, run git submodule init followed by git submodule update. Otherwise, some tests will fail.

Published crates

Crate Description
canadensis (documentation) The main library with all core transport-independent functionality
canadensis_data_types (documentation) Rust types corresponding to the Cyphal public regulated data types
canadensis_can (documentation) Cyphal/CAN transport
canadensis_bxcan (documentation) Compatibility for bxCAN embedded CAN controllers
canadensis_linux (documentation) Compatibility for Linux SocketCAN interfaces
canadensis_serial (documentation) Experimental Cyphal/Serial transport
canadensis_udp (documentation) Experimental Cyphal/UDP transport
canadensis_pnp_client (documentation) A client library for plug-and-play node ID allocation
canadensis_crc (documentation) Access to the software image CRC
canadensis_write_crc (documentation) A tool to calculate and write the CRC of a software image for use with canadensis_crc
canadensis_codegen_rust (documentation) A DSDL processor that generates Rust data types and serialization code
canadensis_macro (documentation) A procedural macro that generates Rust data types and serialization code from inline and/or external DSDL files

Other crates (canadensis_bit_length_set, canadensis_core, canadensis_derive_register_block, canadensis_dsdl_frontend, canadensis_dsdl_parser, canadensis_encoding, and canadensis_filter_config) are re-exported in various places, so you normally will not need to depend on them directly.

Status

This code is intended to conform to version 1.0-beta of the Cyphal specification.

Most of the functionality works. Some parts are incomplete:

  • There are some tests, but there are probably several bugs in areas that have not been tested.
  • The amount of dynamic memory allocation can be reduced, or at least documented better.
  • It needs better documentation

Principles

  • Runs on embedded devices
  • Uses dynamic memory allocation, but only when necessary
  • Supports Cyphal/CAN (classic CAN and CAN FD)
  • Supports Cyphal/Serial and Cyphal/UDP (these transports are not fully specified yet, but the canadensis implementations were compatible with pycyphal when they were released)

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

Canadensis compatibility for bxCAN CAN controllers

This library provides various utilities that make it easier to use canadensis with the bxCAN CAN controllers found on many STM32 microcontrollers.

Dependencies

~6MB
~105K SLoC