Homepage GitHub

Incorrect RX CanardTransfer.payload_size


When sending both single- and multi-frame CanardTransfers, I’ve found that the value of payload_size on the receiving node differs from its value on the sending node. For example, here is an excerpt from my logger output on the receiving node. The parenthesized value is the value of CanardTransfer.payload_size on the sending node.

“incorrect length: 147 (144)”
“incorrect length: 108 (100)”
“incorrect length: 124 (115)”
“incorrect length: 92 (86)”
“incorrect length: 15 (14)”
“incorrect length: 31 (25)”

The reported size is always larger than the expected size, and the difference to the correct value appear to be consistent for a given length, but varies from 1 to 9.
Is this expected behavior?

Version info:





If you are using CAN FD, yes. Related sections of the Specification:

  • Implicit truncation of excessive data
  • Transfer payload decomposition

Hi @pavel.kirienko.

Yes, we’re using CAN FD. It’s easy enough to deal with now that I know to expect that behavior.
Thanks much,


Why do you need to deal with it? DSDL (auto-generated deserialization code) handles it for you.

Hi @pavel.kirienko.

One thing at a time. :slight_smile: Besides, I’m not sure how to describe unformatted, variable-length binary data using DSDL. Not that I’ve had any time to look into it.


Okay. To save you time:

uint32 CAPACITY = 1024 ** 2
uint8[<=CAPACITY] unformatted_data
@extent CAPACITY * 8 * 2

If the required capacity is under 256 bytes you can just use uavcan.primitive.Unstructured.1.0.

Thanks - it’s on my to-do list. :slight_smile: