Custom Firmware builder - DroneCAN beeing selected automatically leading to build error

I am trying to build minimalistic image for F405AIO with only needed features selected.
For some reason, despite not selecting DroneCAN (which I consider obvious for FC without CAN) it is beeing selected at some build step anyway leading to build error.

Not sure why DroneCAN appears on the selected features list, as it was not enabled at all.

EKF3, EKF3_OPTFLOW, BARO_TEMPCAL, MSP_BARO, SPL06, DroneCAN, CompassLearn, FixedYawCal, QMC5883L, MODE_SPORT, ESC_EXTENDED_TELM, FILESYSTEM_MISSION, FILESYSTEM_PARAM, FILESYSTEM_ROMFS, FILESYSTEM_SYS, UBLOX, BatchSampler, HarmonicNotches, AP_MAVLINK_FTP_ENABLED, FENCEPOINT_PROTOCOL, MAVLINK_MSG_MISSION_REQUEST, MAVLINK_MSG_RC_CHANNELS_RAW, MAV_DEVICE_OP, MAV_MSG_SERIAL_CONTROL, REQUEST_AUTOPILOT_CAPA, MSP, MSP_COMPASS, MSP_DISPLAYPORT, MSP_GPS, MSP_OPTICALFLOW, MSP_RANGEFINDER, LED_CONTROL, NOTIFY_NEOPIXEL, NOTIFY_PROFILED, PLAY_TUNE, TONEALARM, OSD, OSD_EXTENDED_LINK_STATS, OSD_PARAM, OSD_SIDEBARS, BOOTLOADER_FLASHING, COMPASS_CAL, CUSTOM_ROTATIONS, Logging, SDCARD_FORMATTING, RC_CRSF, RC_Protocol, RSSI, RANGEFINDER, RANGEFINDER_MAVLINK, FENCE, AIRSPEED, OPTICALFLOW, RPM, RPM_ESC_TELEM, RPM_HARMONIC_NOTCH, CRSF, FrSky, FrSky SPort, FrSky SPort PassThrough, QUAD

and that leads to build error:

In file included from ../build_src/libraries/AP_DroneCAN/AP_DroneCAN.h:23,
                 from ../build_src/libraries/AP_BattMonitor/AP_BattMonitor_DroneCAN.h:6,
                 from ../build_src/libraries/AP_BattMonitor/AP_BattMonitor_DroneCAN.cpp:7:
../build_src/libraries/AP_DroneCAN/AP_Canard_iface.h:4:10: fatal error: canard/interface.h: No such file or directory
    4 | #include <canard/interface.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.

Can you link to your failed build? In recent code, in AP_BattMonitor_config.h

#ifndef AP_BATTERY_UAVCAN_BATTERYINFO_ENABLED
#define AP_BATTERY_UAVCAN_BATTERYINFO_ENABLED AP_BATTERY_BACKEND_DEFAULT_ENABLED && HAL_ENABLE_DRONECAN_DRIVERS
#endif

Looks like when you deselect DroneCAN in the firmware builder it automatically de-selects lots of other features, but I wonder if it explicitly sets HAL_ENABLE_DRONECAN_DRIVERS to False or not.

When the default feature list is pulled for that board, “!HAL_ENABLE_DRONECAN_DRIVERS” is provided

Not sure what would be the link to specific build as it just allow to open commit, build log and build dir.

obraz

DroneCAN support is not selected by default, not sure why it is on selected features list for build later. Also none of CAN related feature is selected.

Was it this build?

After you create a build, you can see yours and everyone’s build on the main page, then check the icons on the right of the build to see your build output and the full log folder

That is what I linked to (just below image).: Index of /builds/copter:SpeedyBeeF405AIO:df9d5750cc0fb7e6cf17f2fd34ba6336d79fd73a:e09b68deaea42a073f07976011bb2599

Build for SpeedyBee F405AIO

This build worked. I selected new build, copter, then your board. I didn’t change any options and then selected Generate Build. It looks like DroneCAN support was properly disabled for me in this build

Sure, default build works fine. But… de-select all not used stuff - like lidars, compasses etc and for some reason CAN, despite NOT BEEING SELECTED gets into the build options.

ok, so when I run the firmware builder in Firefox with dev tools open, I have a breakpoint set on
add_build.js line 100, conditionally triggered on “child == ‘DroneCAN’”

            checkUncheckOptionByLabel(child, check);

As you click through options, which ever one you remove should trigger DroneCAN being added back in for some reason.

If you can be explicit about which features you were trying to remove, that would help.

Edit.
Also, as a last step, you could try explicitly checking then unchecking DroneCAN support after you’ve selected all of your options

For instance, if you wish to disable all rangefinders, pressing the “all” selector first enables all the rangefinders in the list, which re-enables DroneCAN. When you then press it again, all rangefinders will be disabled except DroneCAN support will remain enabled. You may be running into this problem as you click through the menus.

Ok, point of fact, you had “Extended ESC Telem” selected which requires DroneCAN support. The UI should have warned you.

And in reality, the sneakier bug is that you did not intend for DroneCAN support to be included, yet it was, but with it being included, the battery code failed to build.

1 Like

That is exactly what I just found. Extended ESC telemetry selects droneCAN support. I guess was not paying attention.

I was expecting that option to be estended esc telemetry but over dshot, not CAN.