Skip to content

CRC mismatch in canardHandleRxFrame for valid multi-frame messages #87

@justinavar

Description

@justinavar

Multi-frame transfers from my STM32-based node (using [libcanard or custom transport]) are successfully received and handled by both PX4 and dronecan_gui_tool. However, when receiving messages to STM32 and CRC checking is enabled canardHandleRxFrame, the transfers are rejected due to a CRC mismatch.

If I remove the CRC check from canardHandleRxFrame, messages are handled as expected - which suggests that the transmitted payloads are valid, but the CRC is being calculated differently than expected.

Testing steps:

  1. Construct a multi-frame message (two frames in my case, either equipment.indication.LightsCommand or custom message)
  2. Send the transfer from dronecan gui tool using USB to CAN adapter to STM32
  3. On the sending node:
    • CRC check fails (canard.c line 655, calculated wrong at line 639 at canardHandleRxFrame)
    • If I edit the canardHandleRxFrame to go straight to ins->on reception without CRC checking, reception is handled and message is decode just fine

example of the calculated and actual values for the frame after CRC calculation:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions