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

AP_HAL_ChibiOS: hwdef: ARK_FPV board support #28603

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions Tools/AP_Bootloader/board_types.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ TARGET_HW_PX4_FMU_V5X 51
TARGET_HW_PX4_FMU_V6 52
TARGET_HW_PX4_FMU_V6X 53
TARGET_HW_ARK_FMU_V6X 57
TARGET_HW_ARK_FPV 59
TARGET_HW_MINDPX_V2 88
TARGET_HW_PX4_FLOW_V1 6
TARGET_HW_PX4_DISCOVERY_V1 99
Expand Down Expand Up @@ -57,6 +58,7 @@ Reserved "PX4 [BL] FMU v6X.x" 53
Reserved "PX4 [BL] FMU v6C.x" 56

Reserved "ARK [BL] FMU v6X.x" 57
Reserved "ARK [BL] FPV" 59
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this causes CI to fail

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah seems like a pretty low id

Copy link
Contributor

Choose a reason for hiding this comment

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

The ID is already set in PX4 and QGC. Why would the board ID make the CI fail?

Copy link
Collaborator

Choose a reason for hiding this comment

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

IDK, one for @peterbarker

Copy link
Contributor Author

Choose a reason for hiding this comment

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


Reserved "GUMSTIX [BL] FMU v6" 54
Reserved "ARK CAN FLOW" 80
Expand Down
Binary file added Tools/bootloaders/ARK_FPV_bl.bin
Binary file not shown.
181 changes: 181 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/ARK_FPV/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# ARK FPV Flight Controller

https://arkelectron.com/product/ark-fpv-flight-controller/


## Features
#### Processor
- STM32H743 32-bit processor
- 480MHz
- 2MB Flash
- 1MB RAM
#### Sensors
- Invensense IIM-42653 Industrial IMU with heater resistor
- Bosch BMP390 Barometer
- ST IIS2MDC Magnetometer
#### Power
- 5.5V - 54V (2S - 12S) input
- 12V, 2A output
- 5V, 2A output. 300ma for main system, 200ma for heater
#### Interfaces
- **Micro SD**
- **USB-C**
- VBUS In, USB
- **PWM**
- VBAT In, Analog Current Input, Telem RX, 4x PWM and Bidirectional-DSHOT capable
- JST-GH 8 Pin
- **PWM EXTRA**
- 5x PWM and Bidirectional-DSHOT capable
- JST-SH 6 Pin
- **RC Input**
- 5V Out, UART
- JST-GH 4 Pin
- **POWER AUX**
- 12V Out, VBAT In/Out
- JST-GH 3 Pin
- **TELEM**
- 5V Out, UART with flow control
- JST-GH 6 Pin
- **GPS**
- 5V Out, UART, I2C
- JST-GH 6 Pin
- **CAN**
- 5V Out, CAN
- JST-GH 4 Pin
- **VTX**
- 12V Out, UART TX/RX, UART RX
- JST-GH 6 Pin
- **SPI** (OSD or External IMU)
- 5V Out, SPI
- JST-SH 8 Pin
- **DEBUG**
- 3.3V Out, UART, SWD
- JST-SH 6 Pin

##### Dimensions
- Size: 3.6 × 3.6 × 0.8 cm
- Weight: 7.5g with MicroSD card

## Pinout
#### PWM UART4 - 8 Pin JST-GH
| Pin | Signal Name | Voltage |
|-----|-----------------|--------------|
| 1 | VBAT IN | 5.5V-54V |
| 2 | CURR_IN_EXT | 3.3V |
| 3 | UART4_RX_EXT | 3.3V |
| 4 | FMU_CH1_EXT | 3.3V |
| 5 | FMU_CH2_EXT | 3.3V |
| 6 | FMU_CH3_EXT | 3.3V |
| 7 | FMU_CH4_EXT | 3.3V |
| 8 | GND | GND |

#### RC - 4 Pin JST-GH
| Pin | Signal Name | Voltage |
|-----|---------------------|---------|
| 1 | 5.0V | 5.0V |
| 2 | USART6_RX_IN_EXT | 3.3V |
| 3 | USART6_TX_OUTPUT_EXT| 3.3V |
| 4 | GND | GND |

#### PWM EXTRA - 6 Pin JST-SH
| Pin | Signal Name | Voltage |
|-----|-----------------|---------|
| 1 | FMU_CH5_EXT | 3.3V |
| 2 | FMU_CH6_EXT | 3.3V |
| 3 | FMU_CH7_EXT | 3.3V |
| 4 | FMU_CH8_EXT | 3.3V |
| 5 | FMU_CH9_EXT | 3.3V |
| 6 | GND | GND |

#### POWER AUX - 3 Pin JST-GH
| Pin | Signal Name | Voltage |
|-----|-------------|--------------|
| 1 | 12.0V | 12.0V |
| 2 | VBAT IN/OUT | 5.5V-54V |
| 3 | GND | GND |

#### CAN - 4 Pin JST-GH
| Pin | Signal Name | Voltage |
|-----|-------------|---------|
| 1 | 5.0V | 5.0V |
| 2 | CAN1_P | 5.0V |
| 3 | CAN1_N | 5.0V |
| 4 | GND | GND |

#### GPS - 6 Pin JST-GH
| Pin | Signal Name | Voltage |
|-----|---------------------|---------|
| 1 | 5.0V | 5.0V |
| 2 | USART1_TX_GPS1_EXT | 3.3V |
| 3 | USART1_RX_GPS1_EXT | 3.3V |
| 4 | I2C1_SCL_GPS1_EXT | 3.3V |
| 5 | I2C1_SDA_GPS1_EXT | 3.3V |
| 6 | GND | GND |

#### TELEM - 6 Pin JST-GH
| Pin | Signal Name | Voltage |
|-----|-----------------------|---------|
| 1 | 5.0V | 5.0V |
| 2 | UART7_TX_TELEM1_EXT | 3.3V |
| 3 | UART7_RX_TELEM1_EXT | 3.3V |
| 4 | UART7_CTS_TELEM1_EXT | 3.3V |
| 5 | UART7_RTS_TELEM1_EXT | 3.3V |
| 6 | GND | GND |

#### VTX - 6 Pin JST-GH
| Pin | Signal Name | Voltage |
|-----|-----------------------|---------|
| 1 | 12.0V | 12.0V |
| 2 | GND | GND |
| 3 | UART5_TX_TELEM2_EXT | 3.3V |
| 4 | UART5_RX_TELEM2_EXT | 3.3V |
| 5 | USART2_RX_TELEM3_EXT | 3.3V |
| 6 | GND | GND |

#### SPI (OSD or IMU) - 8 Pin JST-SH
| Pin | Signal Name | Voltage |
|-----|---------------------|---------|
| 1 | 5.0V | 5.0V |
| 2 | SPI6_SCK_EXT | 3.3V |
| 3 | SPI6_MISO_EXT | 3.3V |
| 4 | SPI6_MOSI_EXT | 3.3V |
| 5 | SPI6_nCS1_EXT | 3.3V |
| 6 | SPI6_DRDY1_EXT | 3.3V |
| 7 | SPI6_nRESET_EXT | 3.3V |
| 8 | GND | GND |

#### Flight Controller Debug - 6 Pin JST-SH
| Pin | Signal Name | Voltage |
|-----|-----------------|---------|
| 1 | 3V3_FMU | 3.3V |
| 2 | USART4_TX_DEBUG | 3.3V |
| 3 | USART4_RX_DEBUG | 3.3V |
| 4 | FMU_SWDIO | 3.3V |
| 5 | FMU_SWCLK | 3.3V |
| 6 | GND | GND |


## UART Mapping

|Name|Function|
|:-|:-|
|SERIAL0|USB|
|SERIAL1|UART7 (Telem)|
|SERIAL2|UART5 (VTX - DJI Air Unit, RX/TXT)|
|SERIAL3|USART1 (GPS1)|
|SERIAL4|USART2 (VTX - DJI Air Unit, RX only)|
|SERIAL5|UART4 (ESC Telem, RX only)|
|SERIAL6|USART6 (RC Input)|
|SERIAL7|OTG2 (SLCAN)|

All UARTS support DMA.

## OSD Support

This flight controller has an MSP-DisplayPort output on a 6-pin DJI-compatible JST SH.

## Motor Output

Motors 1-8 are capable of Bidirectional-DSHOT and PWM. All outputs in the motor groups below must be either PWM or DShot:
- Motors 1-4 Group1 (TIM5)
- Motors 5-8 Group2 (TIM8)
32 changes: 32 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/ARK_FPV/common.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# MCU class and specific type
MCU STM32H7xx STM32H743xx

# board ID for firmware load
APJ_BOARD_ID 59

# crystal frequency
OSCILLATOR_HZ 16000000

# 480Hz is only value support on H7
# MCU_CLOCKRATE_MHZ 320

# flash size
FLASH_SIZE_KB 2048

# enable DFU reboot for installing bootloader
# note that if firmware is build with --secure-bl then DFU is
# disabled
ENABLE_DFU_BOOT 1

# USB
PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1
PA9 VBUS INPUT OPENDRAIN

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

# debug uart
PD8 USART3_TX USART3
PD9 USART3_RX USART3
6 changes: 6 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/ARK_FPV/defaults.parm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# CAN
CAN_P1_DRIVER 1 # Enables the use of CAN

# Onboard OSD
OSD_TYPE 5 # MSP
OSD_CELL_COUNT 0 # auto based on voltage at start
35 changes: 35 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/ARK_FPV/hwdef-bl.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Processed by chibios_hwdef.py

include common.inc

# Bootloader is installed at zero offset
FLASH_RESERVE_START_KB 0

# Location where the bootloader will put the firmware
FLASH_BOOTLOADER_LOAD_KB 128

SERIAL_ORDER OTG1 UART7 USART1 USART3

PI9 IMU1_CS CS # SPI1 CS - IIM42653
PI10 EXT1_CS CS # SPI6 CS - external

# Telem1 - Telem
PE8 UART7_TX UART7
PF6 UART7_RX UART7
PF8 UART7_RTS UART7
PE10 UART7_CTS UART7

# GPS
PB6 USART1_TX USART1
PB7 USART1_RX USART1

# Armed indication
PE6 nARMED OUTPUT HIGH

# 12V peripheral enable
PG4 nVDD_5V_PERIPH_EN OUTPUT HIGH

# LEDs
PE3 LED_ACTIVITY OUTPUT OPENDRAIN HIGH # red
PE5 LED_BOOTLOADER OUTPUT OPENDRAIN HIGH # blue
define HAL_LED_ON 0
Loading
Loading