Custom build of MatekL431-Periph with AP_DRONECAN_SERIAL_ENABLED fails to compile (Canard::Semaphore / DroneCAN drivers stripped)

What I’m trying to do

I need a Matek CAN-L431 (AP_Periph) node to act as a serial-over-CAN tunnel so the flight controller (Cube Orange+) can reach a serial peripheral over the DroneCAN bus. Physical path:

Cube Orange+ CAN2 → Matek CAN-L431 → (L431 UART) → Gremsy T3V3 gimbal → AirPixel ENTIRE R3 geotagging module.

The goal is to send camera trigger (DO_DIGICAM_CONTROL / MAVLink camera) over CAN2 to the peripheral. This requires AP_DRONECAN_SERIAL_ENABLED (DroneCAN virtual serial ports) on the L431.

Board: MatekL431-Periph, APJ_BOARD_ID 1062, STM32L431xx, 256KB flash. ArduPilot: Cube running ArduCopter 4.5.7. CAN bus at 1 Mbit/s.

What I’ve confirmed already (so we can skip these)

  • Stable MatekL431-Periph build: features.txt shows !AP_DRONECAN_SERIAL_ENABLED — feature is OFF.
  • Stable MatekL431-Serial build: features.txt also shows !AP_DRONECAN_SERIAL_ENABLED and !HAL_ENABLE_DRONECAN_DRIVERS — feature is OFF here too.
  • The node hardware is healthy: it enumerates on the bus, reports node info, and returns params. The only missing piece is the tunnel firmware feature.
  • CAN2 wiring/config is correct and verified (known-good devices enumerate on it).

So no stable prebuilt target ships with the serial tunnel enabled, which is why I went to the custom build server.

The problem: custom build fails to compile

Using the ArduPilot Custom Firmware Builder (custom.ardupilot.org), vehicle AP_Periph, board MatekL431-Periph, I selected:

  • Enable DroneCAN support (HAL_ENABLE_DRONECAN_DRIVERS)
  • Enable DroneCAN virtual serial ports (AP_DRONECAN_SERIAL_ENABLED)
  • Enable Serial device registration (AP_SERIALMANAGER_REGISTER_ENABLED)
  • Enable Serial Options on AP_Periph (AP_PERIPH_SERIAL_OPTIONS_ENABLED)
  • Enable SLCAN serial protocol (AP_CAN_SLCAN_ENABLED)

The build log’s “Selected Features” header lists all five correctly, but the configure step then removes the DroneCAN drivers:

Removing HAL_ENABLE_DRONECAN_DRIVERS
Removing AP_DRONECAN_SERIAL_ENABLED

…and the build then fails compiling AP_Notify (DroneCAN_RGB_LED / MMLPlayer), which still depend on the now-removed DroneCAN driver layer:

../build_src/modules/DroneCAN/libcanard/canard/handler_list.h:115:20:
error: 'Semaphore' in namespace 'Canard' does not name a type
  115 |     static Canard::Semaphore sem[CANARD_NUM_HANDLERS];

../build_src/libraries/AP_Notify/MMLPlayer.cpp:69:35:
error: 'can' is not a member of 'AP'
  69 |     uint8_t can_num_drivers = AP::can().get_num_drivers();

compilation terminated due to -Wfatal-errors.
Build failed
 -> task in 'objs/AP_Notify' failed

git-sha of the build: 2d534eb84267867f66e12c87f256af6ed7af33de

Questions

  1. Is there a known-good feature recipe for a MatekL431 AP_Periph build with AP_DRONECAN_SERIAL_ENABLED that compiles? Specifically, which features must be kept/disabled so the builder doesn’t strip HAL_ENABLE_DRONECAN_DRIVERS?
  2. Is the “Removing HAL_ENABLE_DRONECAN_DRIVERS” behavior a known custom-build-server dependency bug, or am I missing a prerequisite toggle?
  3. Would disabling AP_Notify / DroneCAN RGB LED avoid the compile conflict, and is that safe on this board?
  4. If custom.ardupilot.org can’t currently produce this, is a local ./waf configure --board MatekL431-Periph with the feature flags the recommended route, and are there known extra_hwdef flags needed?

Any working feature list or a pointer to a prebuilt with the serial tunnel enabled would be hugely appreciated. Happy to provide the full build log.

Thanks.