Hello.
I’m trying to send Heartbeat on a libcanard + STM32 platform specific bxCAN withina a STM32CubeIDE project.
As a bus monitor I’m using Babel + UAVCAN GUI tool on Linux.
Every second I prepare the message and pass it to the CAN transmitter this way:
static CanardInstance canard;
static const uint16_t HeartbeatSubjectID = 7509;
static inline void publishHeartbeat(void)
{
static CanardTransferID transfer_id;
uint32_t now_ticks = xTaskGetTickCount();
uint8_t buffer[7];
// destination offset value bit-length
canardDSDLSetUxx(&buffer[0], 40, 2, 8); // mode
canardDSDLSetUxx(&buffer[0], 0, now_ticks / 1000, 32); // uptime
canardDSDLSetUxx(&buffer[0], 48, 0x7F, 8); // vssc
canardDSDLSetUxx(&buffer[0], 32, 2, 8); // health
const CanardTransfer transfer = {.timestamp_usec = now_ticks * 1000,
.priority = CanardPriorityNominal,
.transfer_kind = CanardTransferKindMessage,
.port_id = HeartbeatSubjectID,
.remote_node_id = CANARD_NODE_ID_UNSET,
.transfer_id = transfer_id,
.payload_size = sizeof(buffer),
.payload = &buffer[0]};
++transfer_id;
uint32_t enqueued_frames = canardTxPush(&canard, &transfer);
if (enqueued_frames < 1)
{
// TODO: manage error
}
}
The message goes all the way through to UAVCAN GUI, but can’t be decoded beacuse:
- <unknown message 32085>
- Toggle bit value 32 incorrect on frame 0
I paste below the associated screenshot:
Any clues on what I may be missing/doing wrong?
Thanks in advance.
Alberto