• Specification
    • 1. Introduction
    • 2. Basic concepts
    • 3. Data structure description language
    • 4.1 CAN bus transport layer
    • 4.2 UDP bus transport layer
    • 4.3 MAVLink bus transport layer
    • 4.4 CANFD bus transport layer
    • 5. Application level conventions
    • 6. Application level functions
    • 7. List of standard data types
    • 8. Hardware design recommendations
    • dsdl
      • ardupilot
      • uavcan
  • Implementations
    • Libuavcan
      • Platforms
      • Tutorials
        • 1. Library build configuration
        • 2. Node initialization and startup
        • 3. Publishers and subscribers
        • 4. Services
        • 5. Timers
        • 6. Time synchronization
        • 7. Remote node reconfiguration
        • 8. Custom data types
        • 9. Node discovery
        • 10. Dynamic node ID allocation
        • 11. Firmware update
        • 12. Multithreading
        • 13. CAN acceptance filters
      • FAQ
    • Pydronecan
      • Examples
        • Automated ESC enumeration
        • Dump All Messages
        • ESC throttle control
      • Tutorials
        • 1. Setup
        • 2. Basic usage
        • 3. Advanced usage
        • 4. Parsing DSDL definitions
    • AP Periph
    • Libcanard
    • dronecan dsdlc
  • GUI Tool
    • Overview
    • Examples
    • User guide
  • Examples
    • Simple sensor node
  • Discussions
Implementations /  Libuavcan /  Platforms

Libuavcan platforms

In the context of Libuavcan, a platform is a particular hardware platform or an operating system that can execute libuavcan-based DroneCAN nodes. For example, the STM32 microcontroller family and the GNU/Linux OS are some of the officially supported libuavcan platforms.

A platform driver is a set of platform-specific C++ classes that implement the thin layer of glue logic needed to make libuavcan function with the particular platform at hand.

Adding support for a new platform

Implementing a platform driver for libuavcan is generally a quite straightforward task, especially if the driver is targeted for a certain application and need not to be generic.

Essentially, a libuavcan driver is a set of C++ classes implementing the following C++ interfaces:

  • uavcan::ICanDriver
  • uavcan::ICanIface
  • uavcan::ISystemClock

The interfaces listed above are defined in libuavcan/include/uavcan/driver/.

Note that the library core already includes a non-blocking prioritized TX queue, so normally a driver should not implement a software TX queue itself.

If the driver does not need to support redundant CAN bus interfaces, then the first two C++ interfaces can be implemented in the same C++ class.

Some features can be left unimplemented:

  • IO flags - needed for dynamic node ID allocation and time synchronization master.
  • TX timestamping - needed for clock synchronization master.
  • Hardware CAN filters configuration - not necessary if there is enough computational power to delegate filtering to the library software.

There are two extreme examples of the driver complexity level that can give a basic idea of the development effort required:

  • LPC11C24 driver - only necessary functionality, no redundant interface support, no TX timestamping - 600 LoC.
  • Linux driver - complete full-featured driver with hardware timestamping and redundant interfaces - 1200 LoC.

Contributions adding support for new platforms are always welcome.

Officially supported platforms

Official platform drivers are located in dedicated repositories here: github.com/DroneCAN. Contributions adding support for new platforms are always welcome.

Please refer to the platform driver source repositories for relevant documentation:

  • STM32
  • GNU/Linux
  • NXP LPC11C24

POSIX helpers

This is not a complete driver, but rather a set of C++ classes that implement certain libuavcan interfaces in a cross-platform way, so that they can be used on any POSIX-compliant operating system, e.g. Linux or NuttX. The libuavcan tutorials available in an adjacent section cover how to use these classes among other things.

The driver is implemented as a header-only C++ library. The sources can be found in the main libuavcan source repository.

At least the following classes are implemented in the POSIX driver:

  • Firmware version checker - implements a simple firmware version checking strategy for firmware update servers.
  • File server backend - implements file system I/O for UAVCAN file management services.
  • File system backends for dynamic node ID allocation servers.

Libuavcan

  • Platforms
  • Tutorials
    • 1. Library build configuration
    • 2. Node initialization and startup
    • 3. Publishers and subscribers
    • 4. Services
    • 5. Timers
    • 6. Time synchronization
    • 7. Remote node reconfiguration
    • 8. Custom data types
    • 9. Node discovery
    • 10. Dynamic node ID allocation
    • 11. Firmware update
    • 12. Multithreading
    • 13. CAN acceptance filters
  • FAQ

License

This work is licensed under a Creative Commons Attribution 4.0 International License.
Much of the content of this site is based upon prior work by Pavel Kirienko and the UAVCAN Development Team.
  • https://dronecan.org/discord
  • https://github.com/DroneCAN
  • Report a problem with this website

Generated Sun, 02 Jun 2024 21:47:21 +0000 © DroneCAN development team