Use can bus on stm32 (libcanard

Hello.
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.

1 Like

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

1 Like

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.

1 Like

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.

Hi Benjamin Stonking,
I am trying to implement Cyphal/CAN on Nucleo-f446 by using GitHub - Dmivaka/STM32-HAL-Libcanard: Libcanard 2.0 example for STM32 HAL.

But unfortunately, this doesn’t work. I don’t see any CAN traffic on the bus.
I can send and receive regular CAN messages without cyphal.

When I use the dsdl compiled 7509.Hearbeat.h file, while compiling in CubeIDE I dont see any errors but there are a lot of assertion issues.

Please let me know if you could guide me in this regards.

Thanks.

Hi everyone i tried to implement GitHub - Dmivaka/STM32-HAL-Libcanard: Libcanard 2.0 example for STM32 HAL
,node is showing in bus monitor but data type is unknown.

and i want to implement batteryinfo.uavcan i tried dsdl compiler Nunavut , only serialization.h is genrated

Can you guide what exactly you did?

I’m also trying to make a custom battery which will be connected to autopilot using uavcan and i can gett the current voltages on mission planner using uavcan.