Tools/AP_Periph/README.md
This is an ArduPilot based DroneCAN peripheral firmware. This firmware takes advantage of the wide range of sensor drivers in ArduPilot to make building a DroneCAN peripheral firmware easy.
The AP_Periph firmware is based on the same ChibiOS hwdef.dat system that is used to define pinouts for STM32 based flight controllers supported by ArduPilot. That means you can add support for a new DroneCAN peripheral based on the STM32 by just writing a simple hwdef.dat that defines the pinout of your device.
We have over 60 build targets building for AP_Periph firmwares. All ArduPilot supported MCUs can be used, including:
More can be added using the hwdef.dat system
The AP_Periph firmware can be configured to enable a wide range of DroneCAN sensor types. Support is included for:
An AP_Periph DroneCAN firmware supports these DroneCAN features:
Using f103-GPS as an example, build the main firmware like this:
that will build a file build/f103-GPS/bin/AP_Periph.bin. You can now load that using the CAN bootloader and either dronecan_gui_tool or MissionPlanner DroneCAN support.
To load directly with a stlink-v2, do this:
for the CUAV_GPS which loads at offset 0x10000 use this:
To flash the bootloader use this:
To build the bootloader use this:
the resulting bootloader will be in Tools/bootloaders
Firmware targets are automatically built and distributed on the ArduPilot firmware server on firmware.ardupilot.org. These firmwares can be loaded using Mission Planner or the DroneCAN GUI Tool. Parameters for peripherals can be changed using the Mission Planner DroneCAN support or using DroneCAN GUI Tools.
The bootloader is automatically stored in ROMFS in the main firmware. End users can update the bootloader by setting the DroneCAN parameter "FLASH_BOOTLOADER" to 1. After setting it to 1 the node will respond with a debug text message which can be seen in the DroneCAN GUI tool to show the result of the flash.
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
Please join the discussions at these locations: