Files
ardupilot/libraries/AP_CANManager
Andrew Tridgell 1bfd33b6e8 AP_CANManager: fixed mutex ordering deadlock in MAVCAN
we had a deadlock between the mutex in HAL_ChibiOS CAN layer and the
MAVLinkCAN object

the deadlock arose because the low level CAN layer holds the HAL CAN
mutex before it calls up to the MAVLinkCAN frame callback

on the mavlink side, it took the MAVLinkCAN mutex before calling down
to the CAN send layer, this meant it took the 2 mutexes in the
opposite order

the symptoms were:

 - failure to boot if we have active MAVCAN during reboot as we
 deadlock during the scheduler delay callback

 - deadlock during heavy MAVCAN usage
2025-06-08 14:18:23 +10:00
..
…

Testing And Debugging

Testing under SITL

A wide range of DroneCAN peripherals are supported in the SITL simulation system. The simplest way of starting a DroneCAN enabled simulated vehicle is to use sim_vehicle.py.

For a quadplane use: sim_vehicle.py with the option -f quadplane-can

For a quadcopter use: sim_vehicle.py with the option -f quad-can