Let me try to summarize the steps I did to get a driver working on CAN2:
Add this to boards/px4/fmu-v6x/init/rc.board_defaults
:
ifup can1
Update NuttX submodule to this hack:
Add to boards/px4/fmu-v6x/default.px4board
:
CONFIG_BOARD_UAVCAN_INTERFACES=1
Add to boards/px4/fmu-v6x/nuttx-config/nsh/defconfig
:
CONFIG_NETDEV_CAN_BITRATE_IOCTL=y
CONFIG_NETDEV_IFINDEX=y
CONFIG_NET_CAN=y
CONFIG_NET_CAN_RAW_TX_DEADLINE=y
CONFIG_NET_CAN_SOCK_OPTS=y
CONFIG_NET_CAN_NOTIFIER=y
CONFIG_NET_TIMESTAMP=y
CONFIG_STM32H7_FDCAN1=y
CONFIG_STM32H7_FDCAN2=y
CONFIG_CANUTILS_CANDUMP=y
CONFIG_CANUTILS_CANSEND=y
And then basically try out cansend
and candump
and adapt those to what I needed.
And I think I still have to set ENABLE_UAVCAN
to 0
to actually get it to work, even though that shouldn’t be required.