Homepage Knowledgebase GitHub

Controlling multiple Myxa over UAVCAN-v0

I’m trying to control multiple Myxas over UAVCAN-v0 line from a C language STM32 application.
For debugging I’m checking the traffic over CAN with a Babel board and UAVCAN Tool GUI.

So far I have succeeded in

  • Broadcasting Node Status
  • Replying to GetNodeInfo

The part I’m experiencing problems with is ESC control.
This is the code I call every 100ms to update their value (for the sake of testing I set them all to the same RPM)

    static inline void publishSetEscRPM(int32_t new_rpm)
        static uint8_t transfer_id;

        uint8_t buffer[UAVCAN_ESC_RPM_COMMAND_MESSAGE_SIZE];

        memset(buffer, 0, UAVCAN_ESC_RPM_COMMAND_MESSAGE_SIZE);

        for (uint_fast8_t i = 0; i < M3U_MOTOR_NO; i++)
            canardEncodeScalar(&(buffer[0]), 0 + (18UL * i), 18, &new_rpm);
        const int16_t enqueued_frames = canardBroadcast(&canard,

        (void) enqueued_frames;

As long as I remain within one single CAN telegram, which implies


everything works smoothly.

But if I try with


I cant’ control Myxa anymore and UAVCAN Tool GUI complains about

Transfer Error. CRC mismatch

I’m confused by the fact that the mutli-CAN-frame GetNodeInfo reply goes through flawlessly.

Any suggestions?

Thank you.

You are setting the data type signature to zero (second argument to canardBroadcast), hence the CRC is computed incorrectly. If you used the correct signature it would be working properly.

It makes perfectly sense.

Thank you.

For anybody who may be interested, signatures for standard namespace uavcan may be found here.