Unable to Send Multi-Frame DSDL Public Data Types Indefinitely

I am currently working on implementing DroneCAN with Libcanard on an STM32 board and facing an issue where I can send single-frame DSDL public data types indefinitely without any problems, but when I attempt to send multi-frame DSDL public data types, they stop after a certain period instead of continuing indefinitely.

The system remains functional, and single-frame messages (like Heartbeat and Voltage) continue transmitting, but multi-frame messages (like Parameters) stop appearing on the bus after a certain duration.

After further analysis, I have noticed that the transmission queue (queue->size) behaves differently for single-frame vs. multi-frame messages, which seems to be causing the failure.

Key Observation

  1. For Single-Frame Messages
    The function process_canard_TX_queue() handles the queue size correctly.
    The value of queue->size remains between 0 and 1, ensuring smooth operation.

  2. For Multi-Frame Messages**
    The queue->size continuously increases instead of decreasing after transmission.
    Eventually, it crosses the limit set in canardTxInit(), causing the transmission to stop.

Relevant Code Reference
queue = canardTxInit(100, CANARD_MTU_CAN_CLASSIC);

Are you sure you’re implementing DroneCAN, not Cyphal/CAN?

I am actually trying to implement droneCAN, but I am a bit confused between DroneCAN and Cyphal. My end goal is to send DroneCAN messages from my device which can be read via DroneCAN present on flight controllers like Pixhawk.

You are not the first to wander here by mistake.

The recent name change is intended to reduce the confusion you described. At the moment, there is no such thing as “UAVCAN” anymore. It has been forked into two independent projects:

  • DroneCAN was formerly known as the legacy UAVCAN v0; it also incorporates UAVCAN v0.5 which has never seen widespread use.
  • OpenCyphal was formerly known as UAVCAN v1.

Which software and tooling you need depends on which of these two protocols are used in your vehicles.

If you are truly working on DroneCAN You probably want to start at the official DroneCAN website

This being said, please consider

Building any non-trivial system based on DroneCAN today would be a mistake unless you strongly require compatibility with legacy hardware out there. This is because of its inherent architectural limitations, which are covered in the Guide. I am fairly confident saying this since I was more involved in the architecting and designing of both DroneCAN and Cyphal than anybody else.

Cyphal/CAN is already supported in PX4. Although the support might be considered somewhat minimal, it should be easy to extend since the hard part is already done (mostly by @PetervdPerk, @JacobCrabill, and others).

Cyphal/CAN is minimally supported in a fork of ArduPilot. There is an upstream pull request which appears to be failing to gain the attention of the maintainers but one might hope to see it merged one day.
forum.opencyphal.org/t/new-to-uavcan-and-completely-confussed/1650/12

2 Likes