Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add DroneerF405 hwdef #28846

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Tools/AP_Bootloader/board_types.txt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,9 @@ AP_HW_ZeroOne_GNSS 5602
AP_HW_DroneBuild_G1 5700
AP_HW_DroneBuild_G2 5701

#IDs 5800-5809 reserved for Droneer
AP_HW_DroneerF405 5800
Hwurzburg marked this conversation as resolved.
Show resolved Hide resolved

# IDs 6000-6099 reserved for SpektreWorks

# IDs 6100-6109 reserved for MFE
Expand Down
Binary file added Tools/bootloaders/DroneerF405_bl.bin
Binary file not shown.
1,001 changes: 1,001 additions & 0 deletions Tools/bootloaders/DroneerF405_bl.hex

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
102 changes: 102 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Droneer F405 Flight Controller

The Droneer F405 is a flight controller produced by [Droneer](http://www.droneer.com/).

## Features

- STM32F405 microcontroller
- ICM42688-P IMU
- max7456 OSD
- 5 UARTs
- 9 PWM outputs
Hwurzburg marked this conversation as resolved.
Show resolved Hide resolved
- Dual Camera inputs
- 3S to 8S LIPO operation
- 5V,3A BEC, 10V,2A VTX BEC
- Physical: 37x37mm, 7g

## Pinout

![Droneer F405](DroneerF405_Board_Bottom.jpg "Droneer F405")
![Droneer F405](DroneerF405_Board_Top.jpg "Droneer F405")

## UART Mapping

The UARTs are marked Rn and Tn in the above pinouts. The Rn pin is the
receive pin for UARTn. The Tn pin is the transmit pin for UARTn.

- SERIAL0 -> USB
- SERIAL1 -> UART1 (Tramp)
- SERIAL2 -> UART2 (RCIN, DMA-enabled)
- SERIAL3 -> UART3 (User)
- SERIAL4 -> UART4 (GPS)
- SERIAL5 -> UART5 (ESC Telem, on ESC connector)

## RC Input

Hwurzburg marked this conversation as resolved.
Show resolved Hide resolved
RC input is configured on the R2 (UART2_RX) pin for most RC unidirectional protocols except SBUS which should be applied at the SBUS pin. PPM is not supported.The SBUS pin (SBU), is passed by an inverter to RX2 (UART2 RX), which can also be used for all ArduPilot supported receiver protocols, except CRSF/ELRS and SRXL2. CRSF/ELRS and SRXL2 require the RX2 and TX2 pin be connected instead of the SBUS pin.
* SRXL2 requires SERIAL2_OPTIONS be set to “4”.
* Fport should be connected to TX2 via a bi-directional inverter and SERIAL2_OPTIONS be set to “4”.See https://ardupilot.org/plane/docs/common-connecting-sport-fport.html

Any UART can also be used for RC system connections in ArduPilot and is compatible with all protocols except PPM (SBUS requires external inversion on other UARTs). See Radio Control Systems for details.

## FrSky Telemetry

FrSky Telemetry is supported using the Tx pin of any UART including SERIAL2/UART2. You need to set the following parameters to enable support for FrSky S.PORT (example shows SERIAL3).

- SERIAL3_PROTOCOL 10
- SERIAL3_OPTIONS 7

## OSD Support

The Droneer F405 supports analog OSD using OSD_TYPE 1 (MAX7456 driver). Simultaneous HD TVX OSD operation can also be obtained using an available UART whose protocol is set to "DisplayPort (42)" and OSD_TYPE2 set to "5".

The JST-GH-4P connector supports a standard DJI HD VTX connection. Pin 1 of the connector is 9v so be careful not to connect
this to a peripheral requiring 5v.

## PWM Output

The Droneer F405 supports up to 9 PWM outputs. The pads for motor output
M1 to M4 on the motor connector, plus M9(marked LED) for LED strip or another
PWM output.

The PWM is in 3 groups:

- PWM 1-4 in group1
- PWM 5-8 in group2
- PWM 9 in group3

Channels within the same group need to use the same output rate. If
any channel in a group uses DShot then all channels in the group need
to use DShot. Channels 1-4 support bi-directional DShot.

## Battery Monitoring

The board has a internal voltage sensor and connections on the ESC connector for an external current sensor input.
The voltage sensor can handle up to 8S.
LiPo batteries.

The default battery parameters are:

- BATT_MONITOR 4
- BATT_VOLT_PIN 12
- BATT_CURR_PIN 11
- BATT_VOLT_MULT 11
- BATT_AMP_PERVLT 30.2 (will need to be adjusted for whichever current sensor is attached)

## Compass

The Droneer F405 does not have a builtin compass, but you can attach an external compass using I2C on the SDA and SCL pads.

Hwurzburg marked this conversation as resolved.
Show resolved Hide resolved
## Firmware
Firmware for this board can be found here in sub-folders labeled “DroneerF405”.

## Loading Firmware

Initial firmware load can be done with DFU by plugging in USB with the
bootloader button pressed. Then you should load the "with_bl.hex"
firmware, using your favourite DFU loading tool.

Once the initial firmware is loaded you can update the firmware using
any ArduPilot ground station software. Updates should be done with the
\*.apj firmware files.

39 changes: 39 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/hwdef-bl.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# hw definition file for Droneer
# tested on the Droneer F405

# MCU class and specific type
MCU STM32F4xx STM32F405xx

# crystal frequency
OSCILLATOR_HZ 8000000

# board ID for firmware load
APJ_BOARD_ID AP_HW_DroneerF405

FLASH_RESERVE_START_KB 0
FLASH_SIZE_KB 1024
FLASH_BOOTLOADER_LOAD_KB 64

#PA14 LED_BOOTLOADER OUTPUT LOW GPIO(0) # blue
PC13 LED_ACTIVITY OUTPUT LOW GPIO(1) # Green
define HAL_LED_ON 0

# order of UARTs
SERIAL_ORDER OTG1 USART1

PA9 USART1_TX USART1
PA10 USART1_RX USART1

PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1


# Add CS pins to ensure they are high in bootloader
PA4 IMU_CS CS
PA13 OSD_CS CS
PC0 FLASH_CS CS
#PC1 SDCARD_CS CS

# Turn on switched supply and camera switch/output during bootloader to match default
#PA4 PINIO1 OUTPUT LOW
#PB5 PINIO2 OUTPUT LOW
180 changes: 180 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/hwdef.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
# hw definition file for processing by chibios_pins.py
# Droneer F405
# With F405 MCU, ICM42688P IMU and 7456 series OSD
# Based on DroneerF450 from Droneer

# MCU class and specific type.
MCU STM32F4xx STM32F405xx

HAL_CHIBIOS_ARCH_F405 1

# board ID for firmware load
APJ_BOARD_ID AP_HW_DroneerF405

# crystal frequency
OSCILLATOR_HZ 8000000

# board voltage
STM32_VDD 330U

STM32_ST_USE_TIMER 5
define CH_CFG_ST_RESOLUTION 16

# order of I2C buses
I2C_ORDER I2C1

# order of UARTs (and USB)
# this order follows the labels on the board
# namely COMPUTER, PPM/SBUS (configurable as USART), TX3/RX3, TX6/RX6
SERIAL_ORDER OTG1 USART1 USART2 USART3 UART4 UART5

# The pins that USB is connected on
PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1
PC5 VBUS INPUT OPENDRAIN

# USART1(VTX)
PA9 USART1_TX USART1 NODMA
PA10 USART1_RX USART1 NODMA
define DEFAULT_SERIAL1_PROTOCOL SerialProtocol_Tramp

# USART2, RC input
PA2 USART2_TX USART2
PA3 USART2_RX USART2
define DEFAULT_SERIAL2_PROTOCOL SerialProtocol_RCIN

# default to timer for RC input
#PA3 TIM9_CH2 TIM9 RCININT PULLDOWN LOW

# USART3
PC10 USART3_TX USART3 NODMA
PC11 USART3_RX USART3 NODMA
define DEFAULT_SERIAL3_PROTOCOL SerialProtocol_None

# UART4
PA0 UART4_TX UART4 NODMA
PA1 UART4_RX UART4 NODMA

# UART5
PC12 UART5_TX UART5 NODMA
PD2 UART5_RX UART5 NODMA
Hwurzburg marked this conversation as resolved.
Show resolved Hide resolved

define DEFAULT_SERIAL4_PROTOCOL SerialProtocol_GPS
define DEFAULT_SERIAL5_PROTOCOL SerialProtocol_ESCTelemetry

# The pins for SWD debugging with a STlinkv2 or black-magic probe (not tested)
#PA13 JTMS-SWDIO SWD
#PA14 JTCK-SWCLK SWD



# PWM output. 1 - 8 on ESC header
# --------------------- PWM -----------------------
PC6 TIM8_CH1 TIM8 PWM(1) GPIO(50) BIDIR
PC7 TIM8_CH2 TIM8 PWM(2) GPIO(51)
PC8 TIM8_CH3 TIM8 PWM(3) GPIO(52)
PC9 TIM8_CH4 TIM8 PWM(4) GPIO(53) BIDIR
PA15 TIM2_CH1 TIM2 PWM(5) GPIO(54)
PA8 TIM1_CH1 TIM1 PWM(6) GPIO(55)
PB10 TIM2_CH3 TIM2 PWM(7) GPIO(56)
PB11 TIM2_CH4 TIM2 PWM(8) GPIO(57)

PB1 TIM3_CH4 TIM3 PWM(9) GPIO(58)

# Board LEDs
PC13 LED_GREEN OUTPUT LOW GPIO(80)
define HAL_GPIO_A_LED_PIN 80

# External LEDs
#PB1 LED_STRIP OUTPUT GPIO(81) LOW
#define HAL_LED_STRIP_PIN 81

# Buzzer
#PB8 BUZZER OUTPUT GPIO(82) LOW
#define HAL_BUZZER_PIN 82

# Camera control
PA14 CAM_C OUTPUT HIGH GPIO(83)
define RELAY2_PIN_DEFAULT 83

# Note that this board needs PULLUP on I2C pins
PB6 I2C1_SCL I2C1 PULLUP
PB7 I2C1_SDA I2C1 PULLUP

# SPI1 - Internal IMU
PA4 MPU6000_CS CS
PA5 SPI1_SCK SPI1
PA6 SPI1_MISO SPI1
PA7 SPI1_MOSI SPI1

# SPI2 - OSD
PB15 SPI2_MOSI SPI2
PB14 SPI2_MISO SPI2
PB13 SPI2_SCK SPI2
# OSD max7456
PA13 OSD_CS CS

# SPI3 - dataflash
PB3 SPI3_SCK SPI3
PB4 SPI3_MISO SPI3
PB5 SPI3_MOSI SPI3
# Dataflash M25P16
PC0 FLASH_CS CS

# SPI Device table
SPIDEV icm42688 SPI1 DEVID1 MPU6000_CS MODE3 1*MHZ 10*MHZ
SPIDEV osd SPI2 DEVID1 OSD_CS MODE0 10*MHZ 10*MHZ
SPIDEV dataflash SPI3 DEVID1 FLASH_CS MODE3 32*MHZ 32*MHZ

# One IMU rotated in yaw
IMU Invensensev3 SPI:icm42688 ROTATION_PITCH_180_YAW_270

# Probe for I2C SPL06
BARO SPL06 I2C:0:0x76
define AP_BARO_BACKEND_DEFAULT_ENABLED 0
define AP_BARO_SPL06_ENABLED 1
define HAL_BARO_ALLOW_INIT_NO_BARO 1

# no built-in compass, but probe the i2c bus for all possible
# external compass types
define ALLOW_ARM_NO_COMPASS
define HAL_PROBE_EXTERNAL_I2C_COMPASSES
define HAL_I2C_INTERNAL_MASK 0
define HAL_COMPASS_AUTO_ROT_DEFAULT 2

# enable logging to dataflash
define HAL_LOGGING_DATAFLASH_ENABLED 1
define HAL_STORAGE_SIZE 15360
STORAGE_FLASH_PAGE 1

# flash size
FLASH_SIZE_KB 1024
# reserve 32k for bootloader and 32k for flash storage
FLASH_RESERVE_START_KB 64

# ADC
PC2 BATT_VOLTAGE_SENS ADC1 SCALE(1)
PC1 BATT_CURRENT_SENS ADC1 SCALE(1)
PC3 RSSI_ADC ADC1 SCALE(1)


# define default battery setup
define HAL_BATT_VOLT_PIN 12
define HAL_BATT_CURR_PIN 11
define HAL_BATT_VOLT_SCALE 11
define HAL_BATT_CURR_SCALE 30.2
define HAL_BATT_MONITOR_DEFAULT 4

# Analog RSSI pin (also could be used as analog airspeed input)
define BOARD_RSSI_ANA_PIN 12

# Setup for OSD
define OSD_ENABLED 1
define HAL_OSD_TYPE_DEFAULT 1
# Font for the osd
ROMFS_WILDCARD libraries/AP_OSD/fonts/font*.bin

DMA_PRIORITY TIM8* TIM3*

# minimal drivers to reduce flash usage
include ../include/minimize_fpv_osd.inc
Loading