RAW CAN to communicate with ESC to control a motor

Hello,

I am using skynode v5x, with firmware version PX4 v1.16/v1.12, i am unable to transmit and receive messages via CAN, i’m using raw CAN , i open dev port and try to send messages through CAN1/CAN2, but i see CANH and L lines does not drive, it always stays on 2.5V and messages does not transmit or receive. I disabled uavcan, enabled nuttx, still i m unable to transmit/receive, only loopback mode works with enabling internal loop back via menuconfig, I am using pixhawk adapter board to be used as transiver for CAN voltages, i changed 2 adapter boards, I even tried to use an external transiver still it does not work. I tested internal loop back mode which works but not through physical CAN pins, Could you please help, i even tried tattu_can code which is in px4 repo still it doesnot receive messages. Iam using C/C++

It would be appreciated if you could help

Please share a link to your branch based off of PX4 main branch and I can take a look.

Hello,

I am using PX4 1.16V with skynode X300/v6x and an auterion adapter board v7, im unable to see normal raw CAN 2.0 via menuconfigs for Skynode v6x, it only shows me CANFD, is there a way to access stm32f103 in v6x to enable normal CAN 2.0?

Even if I enable CANFD im getting errors in code in stm32_fdcan_sock.c file, in px4 1.16V without me modifying anything, could you please help me with those errors, and also help me with any sample code for loopback/ CAN TX with CANfd in v1.16v for skynodeX.

i cloned px4 main branch and created a new branch but did not modify anything still i see errors in stm32_fdcan_sock.c file when i enable fdcan via menuconfigs, if i fix those errors im getting some linker errors.

Without looking at code or build output there’s nothing I can do to help





i directly cloned from px4 and enabled fdcan and tried to build and i see these build errors, and also if i try and fix them im getting linker error and errors in can.c file, i want help with how to enable canfd and make it work with px4 1.16v on skynode X

here is the repo link

Your code doesn’t compile. It looks like your include paths are incorrect. Here’s my advice:

Start by getting regular CAN working. Don’t even try to build your custom module until you can first build the firmware and verify that you see /dev/can0 in the filesystem. Also you need to disable uavcan in your .px4board.

i cant make regular can work on v6x since it has only canfd and no option to enable regular can in menuconfigs, could you help me how to turn regular can on in this? i made regular can work for v5x though,

Look at the can.c file, change it back to stm32_caninitialize

i already tried it and it says stm32_can.h no such file or dir, when this works for v5x why am i getting such error for v6x?

hello, a quick question, since stm32h7 doesnot have its own stm32_fdcan.c i m unable to use can_init/ can reg functions to open and send msgs via dev/can0, and since its canfd it doesnot support normal can.c functions and since it only has stm32_fdcansock.c functions under it are supported but they use linux based commands and since we are on nuttx thats not supported too, may i get some help to open dev/csn port on v6x somehow?

Ahh I see. I’m not sure then. I’ve only ever gotten this working on a v5x.

Maybe take a look at this example.