PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.29k stars 13.43k forks source link

Cannot enable CAN for FMU-V5 - is 'fmu-v5/src/can.c' wrong? #16058

Open BenAdamsonWecorp opened 3 years ago

BenAdamsonWecorp commented 3 years ago

I am trying to enable CAN on my CUAV V5+ for a custom application (not UAVCAN).

From reading fmu-v5/src/can.c, I believe to enable this driver I need to use ‘menuconfig’ to enable CONFIG_STM32_CAN1 among others. Unfortunately it seems the menuconfig tool renames this to CONFIG_STM32F7_CAN1 for this board.

Should I edit the source code of fmu-v5/src/can.c to use CONFIG_STM32F7_CAN1 in place of CONFIG_STM32_CAN1, or am I missing something here?

dagar commented 3 years ago

Should I edit the source code of fmu-v5/src/can.c to use CONFIG_STM32F7_CAN1 in place of CONFIG_STM32_CAN1, or am I missing something here?

Yes you can edit that to work like the can init in actual NuttX boards. We should probably add something simple to the builds like px4_fmu-v5_can that has NuttX CAN enabled and skips UAVCAN.