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: Support for MicoAir743-AIO #28688

Open
wants to merge 4 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
2 changes: 1 addition & 1 deletion Tools/AP_Bootloader/board_types.txt
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ AP_HW_PhenixH7_Pro 1172
AP_HW_2RAWH743 1173
AP_HW_X-MAV-AP-H743V2 1174
AP_HW_BETAFPV_F4_2-3S_20A 1175
AP_HW_MicoAir743AIOv1 1176
AP_HW_MicoAir743-AIO 1176
AP_HW_CrazyF405 1177
AP_HW_FlywooF405HD_AIOv2 1180
AP_HW_FlywooH743Pro 1181
Expand Down
Binary file added Tools/bootloaders/MicoAir743-AIO_bl.bin
Binary file not shown.
1,279 changes: 1,279 additions & 0 deletions Tools/bootloaders/MicoAir743-AIO_bl.hex

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Tools/scripts/generate_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"SkystarsH7HD-bdshot" : ("Skystars", "H743 HD"),
"MicoAir405v2" : ("MicoAir F405 v2.1", "MicoAir"),
"MicoAir405Mini" : ("MicoAir F405 Mini", "MicoAir"),
"MicoAir743-AIO" : ("MicoAir H743 AIO", "MicoAir"),
"GEPRCF745BTHD": ("TAKER F745 BT","GEPRC"),
}

Expand Down
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.
90 changes: 90 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/MicoAir743-AIO/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# MicoAir743-AIO Flight Controller

The MicoAir743-AIO is a flight controller designed and produced by [MicoAir Tech](http://micoair.com/).

## Features

- STM32H743 microcontroller
- BMI088/BMI270 dual IMUs
- DPS310 barometer
- 12V 2A BEC; 5V 2A BEC
- MicroSD Card Slot
- 7 UARTs
- Integrated 4-in-1 AM32 35A ESC, 5 additional PWM outputs, one defaulted as serial LED

- 1 I2C
- 1 SWD

## Physical

![MicoAir H743 AIO Physical Size](MicoAir743-AIO_Physical_Size.jpg)

## UART Mapping

- SERIAL0 -> USB
- SERIAL1 -> UART1 (MAVLink2, DMA-enabled)
- SERIAL2 -> UART2 (DisplayPort, DMA-enabled)
- SERIAL3 -> UART3 (GPS, DMA-enabled)
- SERIAL4 -> UART4 (MAVLink2, DMA-enabled)
- SERIAL5 -> UART6 (RCIN, DMA-enabled)
- SERIAL6 -> UART7 (RX only, ESC Telemetry, DMA-enabled)
- SERIAL7 -> UART8 (User, DMA-enabled)

## RC Input

The default RC input is configured on the UART6. The SBus input on the HD VTX connector is tied to RX6.


## VTX Support

The SH1.0-6P connector supports a DJI Air Unit / HD VTX connection. Protocol defaults to DisplayPort. Pin 1 of the connector is 12v so be careful not to connect this to a peripheral requiring 5v.

## PWM Output

The MicoAir743-AIO supports up to 9 PWM outputs.

All the channels support DShot.

Channels 1-8 support bi-directional DShot.

PWM outputs are grouped and every group must use the same output protocol:

1, 2, 3, 4 are Group 1;

5, 6 are Group 2;

7, 8, 9 are Group 3;

Minderring marked this conversation as resolved.
Show resolved Hide resolved
PWM1-4 are internally tied to the 4-in-1 ESC. PWM 9 is labelled as LED output on the board.
## Battery Monitoring

The board has internal voltage sensor and current sensor for battery.
The voltage input should be 3~6S LiPo batteries.

The default battery parameters are:

- BATT_MONITOR 4
- BATT_VOLT_PIN 10
- BATT_CURR_PIN 11
- BATT_VOLT_MULT 21.2
- BATT_CURR_SCALE 14.14

## Compass

The MicoAir743-AIO does not have a built-in compass, but you can attach an external compass using I2C on the SDA and SCL connector.

## Mechanical

- Mounting: 25.5 x 25.5mm, Φ3mm
- Dimensions: 36 x 36 x 8 mm
- Weight: 10g

## Ports Connector

![MicoAir H743 AIO Ports Connection](MicoAir743-AIO_Ports_Connection.jpg)

## 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 favorite 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.
11 changes: 11 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/MicoAir743-AIO/defaults.parm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#BATTERY MONITOR ON
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ALL of these should be defined in the hwdef file instead of a defaults.parm file in order to save unnecessary flash useage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay! Thanks for your suggestion! I just learned about this.

BATT_MONITOR 4

#enable second OSD type
OSD_TYPE = 5

#Serial Port defaults
SERIAL2_PROTOCOL 42
SERIAL4_PROTOCOL 2
SERIAL5_PROTOCOL 23
SERIAL6_PROTOCOL 16
47 changes: 47 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/MicoAir743-AIO/hwdef-bl.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# hw definition file for processing by chibios_hwdef.py
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might ocnsider adding SD card interface in the bootloader to allow updating firmware directly from the SD card...not a blocker though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay! I will test and update the config files later.

# for the MicoAir743-AIO hardware

# MCU class and specific type
MCU STM32H7xx STM32H743xx

# board ID for firmware load
APJ_BOARD_ID AP_HW_MicoAir743-AIO

# crystal frequency
OSCILLATOR_HZ 8000000

# flash size
FLASH_SIZE_KB 2048

# bootloader is installed at zero offset
FLASH_RESERVE_START_KB 0

# the location where the bootloader will put the firmware
FLASH_BOOTLOADER_LOAD_KB 128



# order of UARTs (and USB)
SERIAL_ORDER OTG1 USART1

# USB
PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1

# USART1
PA9 USART1_TX USART1
PA10 USART1_RX USART1

# pins for SWD debugging
PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD

# CS pins
PA15 BMI270_CS CS
PD5 GYRO_CS CS
PD4 ACCEL_CS CS

# LEDs
PE6 LED_ACTIVITY OUTPUT LOW #green
PE4 LED_BOOTLOADER OUTPUT LOW #blue
define HAL_LED_ON 0
147 changes: 147 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/MicoAir743-AIO/hwdef.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# hw definition file for processing by chibios_hwdef.py
# for the MicoAir743-AIO hardware

# MCU class and specific type
MCU STM32H7xx STM32H743xx

# board ID for firmware load
APJ_BOARD_ID AP_HW_MicoAir743-AIO

# crystal frequency
OSCILLATOR_HZ 8000000

# ChibiOS system timer
STM32_ST_USE_TIMER 12
define CH_CFG_ST_RESOLUTION 16

# flash size
FLASH_SIZE_KB 2048
FLASH_RESERVE_START_KB 128

define HAL_STORAGE_SIZE 32768
STORAGE_FLASH_PAGE 14

# default to all pins low to avoid ESD issues
DEFAULTGPIO OUTPUT LOW PULLDOWN

# order of UARTs (and USB)
SERIAL_ORDER OTG1 USART1 USART2 USART3 UART4 USART6 UART7 UART8

# USB
PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1

# UARTs
PA9 USART1_TX USART1
PA10 USART1_RX USART1
PA2 USART2_TX USART2
PA3 USART2_RX USART2
PD8 USART3_TX USART3
PD9 USART3_RX USART3
PA0 UART4_TX UART4
PA1 UART4_RX UART4
PC6 USART6_TX USART6
PC7 USART6_RX USART6
PE8 UART7_TX UART7
PE7 UART7_RX UART7
PE1 UART8_TX UART8
PE0 UART8_RX UART8

# SWD
PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD

# two I2C bus
I2C_ORDER I2C2 I2C1

# I2C1 - CONNECTOR
PB6 I2C1_SCL I2C1
PB7 I2C1_SDA I2C1

# I2C2 - BARO
PB10 I2C2_SCL I2C2
PB11 I2C2_SDA I2C2

# PWM output pins
PE14 TIM1_CH4 TIM1 PWM(1) GPIO(50) BIDIR
PE13 TIM1_CH3 TIM1 PWM(2) GPIO(51)
PE11 TIM1_CH2 TIM1 PWM(3) GPIO(52) BIDIR
PE9 TIM1_CH1 TIM1 PWM(4) GPIO(53)
PB1 TIM3_CH4 TIM3 PWM(5) GPIO(54) BIDIR
PB0 TIM3_CH3 TIM3 PWM(6) GPIO(55)
PD12 TIM4_CH1 TIM4 PWM(7) GPIO(56) BIDIR
PD13 TIM4_CH2 TIM4 PWM(8) GPIO(57)

# LED-pad
PD14 TIM4_CH3 TIM4 PWM(9) GPIO(58) # M9

# Beeper
PD15 BUZZER OUTPUT GPIO(59) LOW
define HAL_BUZZER_PIN 59

# 9 PWM available by default
define BOARD_PWM_COUNT_DEFAULT 9

# LEDs
PE5 LED_RED OUTPUT LOW GPIO(0)
PE6 LED_GREEN OUTPUT LOW GPIO(1)
PE4 LED_BLUE OUTPUT LOW GPIO(2)

define AP_NOTIFY_GPIO_LED_RGB_RED_PIN 0
define AP_NOTIFY_GPIO_LED_RGB_GREEN_PIN 1
define AP_NOTIFY_GPIO_LED_RGB_BLUE_PIN 2

define AP_NOTIFY_GPIO_LED_RGB_ENABLED 1

# ADC for Power
PC0 BATT_VOLTAGE_SENS ADC1 SCALE(1)
PC1 BATT_CURRENT_SENS ADC1 SCALE(1)

define HAL_BATT_VOLT_PIN 10
define HAL_BATT_CURR_PIN 11
define HAL_BATT_VOLT_SCALE 21.12
define HAL_BATT_CURR_SCALE 14.14

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

# barometers
BARO DPS310 I2C:0:0x76

# microSD support
PC12 SDMMC1_CK SDMMC1
PD2 SDMMC1_CMD SDMMC1
PC8 SDMMC1_D0 SDMMC1
PC9 SDMMC1_D1 SDMMC1
PC10 SDMMC1_D2 SDMMC1
PC11 SDMMC1_D3 SDMMC1
define FATFS_HAL_DEVICE SDCD1

# SPI2 - IMUs
PD3 SPI2_SCK SPI2
PC2 SPI2_MISO SPI2
PC3 SPI2_MOSI SPI2
PD5 GYRO_CS CS
PD4 ACCEL_CS CS
PA15 BMI270_CS CS

# SPI devices
SPIDEV bmi088_a SPI2 DEVID1 ACCEL_CS MODE3 10*MHZ 10*MHZ
SPIDEV bmi088_g SPI2 DEVID2 GYRO_CS MODE3 10*MHZ 10*MHZ
SPIDEV bmi270 SPI2 DEVID3 BMI270_CS MODE3 1*MHZ 10*MHZ

# 2 IMUs
IMU BMI088 SPI:bmi088_a SPI:bmi088_g ROTATION_ROLL_180_YAW_270
IMU BMI270 SPI:bmi270 ROTATION_ROLL_180

# enable FAT filesystem support (needs a microSD defined via SDMMC)
define HAL_OS_FATFS_IO 1


# setup for BF migration
define HAL_FRAME_TYPE_DEFAULT 12
Loading