Announcing canadensis (another Rust implementation of Cyphal)

I recently released version 0.2 of canadensis, which implements UAVCAN v1 in Rust. This version fixes many of the limitations and inconvenient aspects of the previous version.

Major new features in version 0.2 include:

  • A pure-Rust DSDL parser and code generator that produces Rust data types and serialization/deserialization code
    • A procedural macro that you can put in your Rust code to generate code from data types as part of the normal build process
  • Experimental UAVCAN/UDP and UAVCAN/Serial transports (these transports are not yet fully specified, but the canadensis implementations are compatible with pyuavcan)

The core functionality, UAVCAN/CAN transport, and UAVCAN/Serial transport work on microcontrollers with #![no_std], although they do use dynamic memory allocation. All functions that allocate memory return errors if memory allocation fails, instead of aborting or calling the global allocation error handler.

The UAVCAN/CAN transport is reasonably stable, and I have been using it successfully on some microcontrollers communicating over classic CAN.

There are some examples that run on Linux to show some ways to use different parts of canadensis.

Like all non-trivial software, canadensis contains bugs. Issues and pull requests are welcome in the canadensis repository.

6 Likes

I recently released new versions of several of the canadensis crates.
Major changes:

  • Cyphal/UDP updated to match the latest draft specification
  • Cyphal/Serial updated to use the new header format that is shared with Cyphal/UDP
  • Basic support for CAN loopback frames, which are useful for time synchronization
  • Documentation comments in generated data type code
  • Non-union DSDL types labeled #[canadensis(enum)] produce Rust enums instead of structs in the generated data type code

Full changelog

2 Likes