NuttX CAN drivers on STM32H7x3

Hi Julian.There’s a problem bothering me. Why is the Ethernet device missing after configuring the CAN port?
1686646289975
After disabling the CAN port, the Ethernet port can work normally.

Hi,
I actually could get the NuttX CAN-Drivers to work on CAN 2. Are there any updates of getting the UAVCAN drivers to work on CAN1 at the same time?

Thanks in advance for your help.

I don’t know what the plans are.

@david_s5 do you know the plans regarding socketcan and dronecan internal drivers on H7?

Hi @david_s5 ,do you have any advice for this issue?

Sorry no. I do not, have an idea where it stands.

1 Like

I replicated the steps posted here by @JulianOes and was able to send 11bit CAN frames using a Pixhawk 6x, thanks for the infos!
Unfortunately I am having some trouble with receiving:

I monitor can0 of the Pixhawk using candump on the MAVLink Console in QGC. When sending a frame with a second device, candump shows nothing. When sending a second frame, the second frame and also the first one (in wrong order) gets received by candump.
When running a module in the background that continuously sends out frames over can0, these are not shown in candump. But when additionally sending on the second device, the same thing happens as described above, but one or both of the frames shown by candump are the ones sent by the module in the background instead of the ones received via the physical can bus.

Does anyone know what that behaviour could be caused by?

Hi all,

I’ve been struggling (again) on the canbus these days, just to realized that in the past I’ve never been able to establish a canbus comunication above 125kbps on Nuttx & PX4.

For this project, I’m on PX4 v1.13, hardware: Pixhawk 4 and I had to set in boards/px4/fmu-v5/nuttx-config/nsh/defconfig:

CONFIG_CAN=y
CONFIG_STM32F7_CAN1=y
CONFIG_STM32F7_CAN1_BAUD=125000

and in default.px4board I disabled the uavcan and enabled the tattu_can:

CONFIG_DRIVERS_UAVCAN=n
CONFIG_DRIVERS_TATTU_CAN=y

Then the tattu_can works pretty much straight forward.

I hope this can help some future users :slight_smile:

1 Like

@JulianOes Does this discussion mean that we are missing a basic guide or tutorial on CAN drivers?

Can you help write one? At least a starting point so we can build on it going forward?

Usually this kind of guide would go something like

  1. Start from an existing driver - here are one or two that are good starting points
  2. Quick list of the main things you have to derive from and what they do for you/
  3. Instructions for adding it to the build.
  4. Instructions for starting it.
  5. User instructions for any subscriptions/publications that anyone using the feature is going to need.

In an ideal world, there is a worked example that people can modify like the helloworld app. That has been very helpful over the years for getting docs back into good state when things have drifted in the code.

That would be good but we firstly need NuttX to improve the blocking read (if it hasn’t been fixed in the meantime).

Hello, I enabled canfd0 and 1, and when I used cansend can0 5A1#123456111 in nsh, I found that the device could not be found, and the message “if_nametoindex: no such device” was displayed. How should I check this, thank you

Have you tried to first run:

ifup can0
ifup can1

You can also put this in boards/px4/fmu-v6x/init/rc.board_defaults so it runs on startup.