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

hwdef: Add a new hwdef param for AEROFOX H7 flight control #28533

Open
wants to merge 2 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
5 changes: 4 additions & 1 deletion Tools/AP_Bootloader/board_types.txt
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,10 @@ AP_HW_CUAV-7-NANO 7000
# IDs 7100-7109 reserved for V-UAV
AP_HW_VUAV-V7pro 7100

# please fill gaps in the above ranges rather than adding past ID #7109
# IDs 7200-7209 reserved for AEROFOX
AP_HW_AEROFOX_H7 7200
Hwurzburg marked this conversation as resolved.
Show resolved Hide resolved

# please fill gaps in the above ranges rather than adding past ID #7209


# OpenDroneID enabled boards. Use 10000 + the base board ID
Expand Down
Binary file added Tools/bootloaders/AEROFOX-H7_bl.bin
Binary file not shown.
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.
101 changes: 101 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/AEROFOX-H7/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# AEROFOX-H7 Flight Controller

The AEROFOX-H7 is a flight controller produced by AEROFOX(http://aerofox.cn)

<img src="AEROFOX-H7_IMG.png" alt="" width="400">

## Features
Processor
STM32H743

Sensors
ADIS16470 (appears in the advanced version)
ICM45686 (appears in the advanced version)
ICM42688
QMC5883L
SPL06-001

Power
2S-12S (MAX60V) Lipo input voltage
5V BEC for system power supply( 5V peripheral current limit 1.2A)
5V/12V BEC for VTX( Current limit 2.5A, need strong heat dissipation)
Dual power automatic switching and condition monitoring

Interfaces
16x PWM output
7x UARTs for RC, TELEM, GPS and other peripherals
2x I2C ports for external compass, airspeed, baro
2x CAN port
4x Relay output
4x ADC input

FPC connector
The connector includes an SPI, an I2C, an PWM IMU heating control pin.

## Pinout
<img src="AEROFOX-H7_pinout.png" alt="" width="800">

## UART Mapping

Hwurzburg marked this conversation as resolved.
Show resolved Hide resolved
All UARTs, except UART1, are DMA enabled. UART corresponding to each SERIAL port, and its default protocol, are shown below:
- SERIAL0 -> USB (MAVLink2)
- SERIAL1 -> UART7 (ESC Telemetry)
- SERIAL2 -> UART4 (User configured)
- SERIAL3 -> UART5 (User configured)
- SERIAL4 -> USART2 (User configured)
- SERIAL5 -> USART1 (GPS)
- SERIAL6 -> UART8 (RCIN)
- SERIAL7 -> USART3 (MAVLink2)

## RC Input

SERIAL 6 is configured for RC input by default and is compatible with all ArduPilot supported protocols except PPM. For protocols requiring half-duplex serial to transmit telemetry (such as FPort) you should set SERAIL6_OPTIONS = 4 (Half-Duplex)

## PWM Output

The AEROFOXH7 support up to 16PWM outputs. All pins support DShot. Outputs 1-8 support bi-directional DShot.

The 16 PWM outputs are in 9 groups:

- PWM 1,2 in group1
- PWM 3,4 in group2
- PWM 5,6 in group3
- PWM 7,8 in group4
- PWM 9,10 in group5
- PWM 11 in group6
- PWM 12 in group7
- PWM 13,14 in group8
- PWM 15,16 in group9

Channels within the same group need to use the same output rate. If any channel in a group uses DShot, then all channels in that group need to use DShot.

## Battery Monitoring

The board has a builting voltage and current sensor. The voltage sensor can handle up
to 12S LiPo batteries.

### The power A is onboard voltage sensor
It is enabled by default and has the following parameters set by default:s
- BATT_MONITOR 4
Hwurzburg marked this conversation as resolved.
Show resolved Hide resolved
- BATT_VOLT_PIN 19
- BATT_CURR_PIN 9
- BATT_VOLT_MULT 21
- BATT_AMP_PERVL 40

### The power B is external PMU input
An additional power monitor input is provided and can be enabled by setting:
- BATT_MONITOR 4, then reboot and set the following:
- BATT_VOLT_PIN 10
- BATT_CURR_PIN 11
- BATT_VOLT_MULT 34
- BATT_AMP_PERVLT should be set as required by the specific monitor used

## Compass

A 5883L compass is installed inside the H7 flight control. When high current devices such as ESC and BEC are installed under the flight control board, the on-board compass is usually disabled and an external compass used mounted to minimize motor current effects.

## Loading Firmware
The board comes pre-installed with an ArduPilot compatible bootloader, allowing the
loading of *.apj firmware files with any ArduPilot compatible ground station. The
hardware also supports the PX4 Betaflight INAV firmware, which needs to be changed with STlink.

53 changes: 53 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/AEROFOX-H7/hwdef-bl.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# MCU class and specific type
MCU STM32H7xx STM32H743xx

# crystal frequency
OSCILLATOR_HZ 24000000

# board ID for firmware load
APJ_BOARD_ID AP_HW_AEROFOX_H7

FLASH_SIZE_KB 2048

# bootloader is installed at zero offset
FLASH_RESERVE_START_KB 0

# the location where the bootloader will put the firmware
# the H743 has 128k sectors
FLASH_BOOTLOADER_LOAD_KB 128

#define LED pins
PE14 LED_BOOTLOADER OUTPUT OPENDRAIN HIGH # red
PE12 LED_ACTIVITY OUTPUT OPENDRAIN HIGH # green
PE13 LED_RED OUTPUT OPENDRAIN HIGH # blue

# order of UARTs (and USB)
SERIAL_ORDER OTG1 USART1

# UART1 is debug
PA9 USART1_TX USART1 NODMA
PA10 USART1_RX USART1 NODMA

PC13 VDD_3V3_SENSORS_EN OUTPUT LOW OPENDRAIN
PC4 nVDD_5V_PERIPH_EN OUTPUT HIGH OPENDRAIN
PE8 nVDD_12V_PERIPH_EN OUTPUT LOW OPENDRAIN

PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1

PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD

define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 32768
define HAL_LED_ON 1

# define BOOTLOADER_DEBUG SD7

# Add CS pins to ensure they are high in bootloader
PD7 16470_CS CS
PD4 42688_1_CS CS
PC15 42688_2_CS CS

PD10 FRAM_CS CS SPEED_VERYLOW
PC14 FLASH_CS CS
Loading
Loading