Use can bus on stm32 (libcanard

I use example GitHub - Dmivaka/STM32-HAL-Libcanard: Libcanard 2.0 example for STM32 HAL.
Connected via can bus stm32 to pixhawk and function canardRxAccept does not receive a single frame from the can bus.
For example, a frame comes as I understand Health and it is not accepted because there is no toggle bit.
Other non-broadcast frames fail another check no start_of_transfer bit
What am I doing wrong?
I want to accept dronecan packages.

I didn’t understand the example above (
This GitHub - skyyuzhang/UAVCAN_NODE_FreeRTOS: UAVCAN node base on FreeRTOS example working.

Vadim, did you ever get your problem solved? I had similar issues, and after much effort was able to get libcanard working on an STM32L4. I can help right away if you haven’t got it working yet. If not, I’ll make a big post showing how I got it working and put it here for posterity sake.

1 Like

Could you please write a note about how it’s done?

FAIZ, I’m sorry I missed this message from you so many months ago. Did you get your problem solved? I have a draft of an article on this topic that’s close to complete, but got distracted. If you need help, I can finish it soon and post it.

I just wanted to note, that if you’re new to CAN and are working on implementing it into an STM32 evaluation board such as a Nucleo, read your boards spec sheet and documentation carefully. Although you board may say it supports CAN, it likely doesn’t not include a critical peripheral on the board which is a CAN bus controller such as the MCP2515. The actual CAN bus is comprised of a differential pair of signals and you need a CAN bus controller to capture these signals and convert them to compatible inputs for your MCU’s CAN Rx and Tx pins. So if you’ve just connected CAN Rx and Tx lines from you ardupilot to your external device, make sure you’re not missing the CAN bus controller.