ardupilot/Tools/AP_Periph
Andrew Tridgell 68f5c7b4dc AP_Periph: fixed reply for serial tunnel
add in serial index
2023-11-22 17:19:12 +11:00
..
AP_Periph.cpp Tools: allow more libraries to compile with no HAL_GCS_ENABLED 2023-09-05 22:23:51 +10:00
AP_Periph.h AP_Periph: Rate limit EFI driver updates 2023-10-17 10:14:03 +11:00
GCS_MAVLink.cpp Tools: tidy MSG_MCU_STATUS defines 2023-11-21 13:21:13 +11:00
GCS_MAVLink.h Tools: handle MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN as INT or LONG 2023-09-19 11:16:10 +10:00
Parameters.cpp AP_Periph: allow showing SerialManager params without HAL_GCS 2023-11-16 10:58:50 -08:00
Parameters.h Tools: add and use HAP_PERIPH_ENABLE_RTC 2023-10-11 19:17:27 +11:00
README.md Tools:add qualifier for ADSB type in readme 2023-09-18 13:41:04 -07:00
ReleaseNotes.txt AP_Periph: prepare for 1.6.0 release 2023-09-08 06:58:57 +10:00
adsb.cpp AP_Periph: fixed ADSB peripheral to send heartbeat 2023-10-02 21:45:28 +11:00
airspeed.cpp AP_Periph: re-structure peripheral code 2023-09-01 13:04:59 +10:00
baro.cpp AP_Periph: re-structure peripheral code 2023-09-01 13:04:59 +10:00
batt_balance.cpp AP_Periph: fixed array delete in batt_balance 2023-10-02 21:45:28 +11:00
batt_balance.h AP_Periph: added battery balance plug node 2023-08-26 21:12:42 +10:00
battery.cpp AP_Periph: support per-cell info in periph battery monitoring 2023-10-02 21:45:28 +11:00
buzzer.cpp AP_Periph: re-structure peripheral code 2023-09-01 13:04:59 +10:00
can.cpp AP_Periph: solve a potential case where last_transmit_us can change inside irqs 2023-11-02 15:55:21 +11:00
compass.cpp AP_Periph: re-structure peripheral code 2023-09-01 13:04:59 +10:00
efi.cpp AP_Periph: Rate limit EFI driver updates 2023-10-17 10:14:03 +11:00
esc_apd_telem.cpp AP_Periph: Fix bad conversion of APD ESC telemetry 2023-09-27 08:40:10 -07:00
esc_apd_telem.h AP_Periph: Support APD ESC telemetry 2023-05-25 17:35:27 -07:00
gps.cpp AP_Periph: re-structure peripheral code 2023-09-01 13:04:59 +10:00
hardpoint.cpp AP_Periph: define external hal symbol to correct compilation 2023-09-01 13:13:07 +10:00
hwing_esc.cpp AP_Periph: re-structure peripheral code 2023-09-01 13:04:59 +10:00
hwing_esc.h AP_Periph: fixed HWESC temperature decoding 2020-04-02 11:43:37 +11:00
i2c.h AP_Periph: added peripheral firmware 2019-08-27 10:29:56 +10:00
msp.cpp AP_Periph: fixed build for include changes 2022-02-22 12:13:19 +11:00
proximity.cpp AP_Periph: re-structure peripheral code 2023-09-01 13:04:59 +10:00
rangefinder.cpp AP_Periph: re-structure peripheral code 2023-09-01 13:04:59 +10:00
rc_in.cpp AP_Periph: fixed handling of first uart for RC input 2023-08-29 08:00:20 +10:00
rc_in.h AP_Periph: move RC IN parameters to sub-object 2023-08-19 20:27:24 +10:00
rc_out.cpp AP_Periph: add AP_PERIPH_SAFTEY_SWITCH_ENABLED 2023-09-19 09:29:26 +10:00
serial_tunnel.cpp AP_Periph: fixed reply for serial tunnel 2023-11-22 17:19:12 +11:00
version.cpp AP_Periph: Use new AP_FWVersionDefine header 2020-09-23 20:58:35 +10:00
version.h AP_Periph: mark master as 1.7.0-dev 2023-09-08 06:57:13 +10:00
wscript AP_Periph: fixed ADSB peripheral to send heartbeat 2023-10-02 21:45:28 +11:00

README.md

AP_Periph DroneCAN Peripheral Firmware

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:

  • STM32F1xx
  • STM32F3xx
  • STM32F4xx
  • STM32F7xx
  • STM32H7xx
  • STM32L4xx
  • STM32G4xx

More can be added using the hwdef.dat system

Features

The AP_Periph firmware can be configured to enable a wide range of DroneCAN sensor types. Support is included for:

  • GPS modules (including RTK GPS)
  • Magnetometers (SPI or I2C)
  • Barometers (SPI or I2C)
  • Airspeed sensors (I2C)
  • Rangefinders (UART or I2C)
  • ADSB (uAvionix compatible Ping ADSB receiver on UART)
  • Battery Monitor (Analog, I2C/SMBus, UART)
  • LEDs (GPIO, I2C or WS2812 serial)
  • Safety LED and Safety Switch
  • Buzzer (tonealarm or simple GPIO)
  • RC Output (All standard RCOutput protocols)
  • RC input
  • battery balance monitor
  • EFI engines
  • Proximity sensors

An AP_Periph DroneCAN firmware supports these DroneCAN features:

  • dynamic or static CAN node allocation
  • firmware upload
  • automatically generated bootloader
  • parameter storage in flash
  • easy bootloader update
  • high resiliance features using watchdog, CRC and board checks
  • firmware and parameter update via MissionPlanner or DroneCAN GUI tool when attached to an autopilot
  • firmware update via USB if USB port is provided
  • parameter update using SLCAN and DroneCAN GUI on standalone peripheral via USB, if provided

Building

Using f103-GPS as an example, build the main firmware like this:

  • ./waf configure --board f103-GPS
  • ./waf AP_Periph

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.

Flashing

To load directly with a stlink-v2, do this:

  • st-flash write build/f103-GPS/bin/AP_Periph.bin 0x8006400

for the CUAV_GPS which loads at offset 0x10000 use this:

  • st-flash write build/CUAV_GPS/bin/AP_Periph.bin 0x8010000

Flashing bootloader

To flash the bootloader use this:

  • st-flash write Tools/bootloaders/f103-GPS_bl.bin 0x8000000

Building bootloader

To build the bootloader use this:

  • Tools/scripts/build_bootloaders.py f103-GPS

the resulting bootloader will be in Tools/bootloaders

Firmware Builds

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.

User Bootloader Update

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.

SITL Testing

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

Discussion and Feedback

Please join the discussions at these locations: