Skip to content

Commit b607427

Browse files
AP_HAL_ChibiOS: Add AsterodynH743 hwdef
1 parent ca35793 commit b607427

3 files changed

Lines changed: 228 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Set relay 1 as cam switch
2+
RELAY1_PIN 70
3+
RELAY1_FUNCTION 1
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# hw definition file for processing by chibios_hwdef.py
2+
# for AsterodynH743 bootloader
3+
4+
# MCU class and specific type
5+
MCU STM32H7xx STM32H743xx
6+
7+
# board ID. See Tools/AP_Bootloader/board_types.txt
8+
APJ_BOARD_ID AP_HW_AsterodynH743
9+
10+
# crystal frequency
11+
OSCILLATOR_HZ 8000000
12+
13+
FLASH_SIZE_KB 2048
14+
15+
# bootloader starts at zero offset
16+
FLASH_RESERVE_START_KB 0
17+
18+
# the location where the bootloader will put the firmware
19+
# the H743 has 128k sectors
20+
FLASH_BOOTLOADER_LOAD_KB 128
21+
22+
# order of UARTs (and USB). Allow bootloading on USB and USART1
23+
SERIAL_ORDER OTG1 USART1
24+
25+
# USB
26+
PA11 OTG_FS_DM OTG1
27+
PA12 OTG_FS_DP OTG1
28+
29+
# USART1 for firmware upload
30+
PA9 USART1_TX USART1 NODMA
31+
PA10 USART1_RX USART1 NODMA
32+
33+
PA13 JTMS-SWDIO SWD
34+
PA14 JTCK-SWCLK SWD
35+
36+
# LED - active low
37+
PE3 LED_BOOTLOADER OUTPUT LOW
38+
define HAL_LED_ON 0
39+
40+
# CS pins held high during bootloader
41+
PD5 ICM42688_1_CS CS
42+
PA15 ICM42688_2_CS CS
43+
PB12 AT7456E_CS CS
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
# hw definition file for processing by chibios_hwdef.py
2+
# for the asterodynH743 hardware
3+
4+
# MCU class and specific type
5+
MCU STM32H7xx STM32H743xx
6+
7+
# board ID. See Tools/AP_Bootloader/board_types.txt
8+
APJ_BOARD_ID AP_HW_AsterodynH743
9+
10+
# crystal frequency
11+
OSCILLATOR_HZ 8000000
12+
13+
# ChibiOS system timer
14+
STM32_ST_USE_TIMER 12
15+
define CH_CFG_ST_RESOLUTION 16
16+
17+
# flash size
18+
FLASH_SIZE_KB 2048
19+
FLASH_RESERVE_START_KB 128
20+
21+
define HAL_STORAGE_SIZE 32768
22+
STORAGE_FLASH_PAGE 14
23+
24+
# default to all pins low to avoid ESD issues
25+
DEFAULTGPIO OUTPUT LOW PULLDOWN
26+
27+
# order of UARTs (and USB)
28+
SERIAL_ORDER OTG1 USART1 USART2 USART3 UART4 UART5 USART6 UART7 UART8
29+
30+
# USB
31+
PA11 OTG_FS_DM OTG1
32+
PA12 OTG_FS_DP OTG1
33+
34+
# UARTs
35+
PA9 USART1_TX USART1
36+
PA10 USART1_RX USART1
37+
PA2 USART2_TX USART2
38+
PA3 USART2_RX USART2
39+
PD8 USART3_TX USART3
40+
PD9 USART3_RX USART3
41+
PA0 UART4_TX UART4
42+
PA1 UART4_RX UART4
43+
PB6 UART5_TX UART5
44+
PB5 UART5_RX UART5
45+
PC6 USART6_TX USART6
46+
PC7 USART6_RX USART6
47+
PE8 UART7_TX UART7
48+
PE7 UART7_RX UART7
49+
PE1 UART8_TX UART8
50+
PE0 UART8_RX UART8
51+
52+
# SWD
53+
PA13 JTMS-SWDIO SWD
54+
PA14 JTCK-SWCLK SWD
55+
56+
# order of I2C
57+
I2C_ORDER I2C2 I2C1
58+
59+
# I2C
60+
PB8 I2C1_SCL I2C1
61+
PB9 I2C1_SDA I2C1
62+
PB10 I2C2_SCL I2C2
63+
PB11 I2C2_SDA I2C2
64+
65+
# PWM
66+
PE9 TIM1_CH1 TIM1 PWM(1) GPIO(50)
67+
PE11 TIM1_CH2 TIM1 PWM(2) GPIO(51) BIDIR
68+
PE13 TIM1_CH3 TIM1 PWM(3) GPIO(52)
69+
PE14 TIM1_CH4 TIM1 PWM(4) GPIO(53) BIDIR
70+
PB1 TIM3_CH4 TIM3 PWM(5) GPIO(54) BIDIR
71+
PB0 TIM3_CH3 TIM3 PWM(6) GPIO(55)
72+
PD12 TIM4_CH1 TIM4 PWM(7) GPIO(56) BIDIR
73+
PD13 TIM4_CH2 TIM4 PWM(8) GPIO(57)
74+
75+
# LED-pad
76+
PD14 TIM4_CH3 TIM4 PWM(11) GPIO(60) #M11
77+
78+
# BUZZER
79+
PD15 BUZZER OUTPUT GPIO(61) LOW
80+
define HAL_BUZZER_PIN 61
81+
82+
# LEDs
83+
PE3 LED_RED OUTPUT LOW GPIO(0)
84+
PE2 LED_GREEN OUTPUT LOW GPIO(1)
85+
PE4 LED_BLUE OUTPUT LOW GPIO(2)
86+
87+
define AP_NOTIFY_GPIO_LED_RGB_RED_PIN 0
88+
define AP_NOTIFY_GPIO_LED_RGB_GREEN_PIN 1
89+
define AP_NOTIFY_GPIO_LED_RGB_BLUE_PIN 2
90+
91+
define AP_NOTIFY_GPIO_LED_RGB_ENABLED 1
92+
93+
# ADC for Power
94+
PC1 BATT_VOLTAGE_SENS ADC1 SCALE(1)
95+
PC0 BATT_CURRENT_SENS ADC1 SCALE(1)
96+
97+
# setup for battery
98+
define HAL_BATT_MONITOR_DEFAULT 4
99+
define HAL_BATT_VOLT_PIN 10
100+
define HAL_BATT_CURR_PIN 11
101+
define HAL_BATT_VOLT_SCALE 21.12
102+
define HAL_BATT_CURR_SCALE 40.2
103+
104+
# compass
105+
define HAL_COMPASS_DISABLE_QMC5883L_INTERNAL_PROBE
106+
define AP_COMPASS_PROBING_ENABLED 1
107+
COMPASS QMC5883L I2C:ALL_EXTERNAL:0x0D true ROTATION_NONE
108+
COMPASS QMC5883L I2C:ALL_INTERNAL:0x0D false ROTATION_NONE
109+
110+
# microSD support
111+
PC12 SDMMC1_CK SDMMC1
112+
PD2 SDMMC1_CMD SDMMC1
113+
PC8 SDMMC1_D0 SDMMC1
114+
PC9 SDMMC1_D1 SDMMC1
115+
PC10 SDMMC1_D2 SDMMC1
116+
PC11 SDMMC1_D3 SDMMC1
117+
define FATFS_HAL_DEVICE SDCD1
118+
119+
# SPI1 - OSD
120+
PA5 SPI1_SCK SPI1
121+
PA6 SPI1_MISO SPI1
122+
PA7 SPI1_MOSI SPI1
123+
PB12 AT7456E_CS CS
124+
125+
# SPI2 - ICM-42688P (IMU1)
126+
PD3 SPI2_SCK SPI2
127+
PC2 SPI2_MISO SPI2
128+
PC3 SPI2_MOSI SPI2
129+
PD5 ICM42688_1_CS CS
130+
PC15 DRDY1_ICM42688 INPUT
131+
132+
# SPI3 - ICM-42688P (IMU2)
133+
PB3 SPI3_SCK SPI3
134+
PB4 SPI3_MISO SPI3
135+
PD6 SPI3_MOSI SPI3
136+
PA15 ICM42688_2_CS CS
137+
PB7 DRDY2_ICM42688 INPUT
138+
139+
# SPI devices
140+
SPIDEV icm42688_1 SPI2 DEVID1 ICM42688_1_CS MODE3 1*MHZ 24*MHZ
141+
SPIDEV icm42688_2 SPI3 DEVID2 ICM42688_2_CS MODE3 1*MHZ 24*MHZ
142+
SPIDEV osd SPI1 DEVID4 AT7456E_CS MODE0 10*MHZ 10*MHZ
143+
144+
# 2 IMUs - ICM-42688P
145+
# ROTATION_ROLL_180_YAW_90 matches typical FC mounting; adjust per board layout
146+
IMU Invensensev3 SPI:icm42688_1 ROTATION_ROLL_180_YAW_90
147+
IMU Invensensev3 SPI:icm42688_2 ROTATION_ROLL_180
148+
149+
# barometer - BMP390 on I2C bus 0 (I2C2), default address 0x77
150+
# SDO pin low = 0x76, SDO pin high = 0x77
151+
BARO BMP390 I2C:0:0x77
152+
153+
# PINIO - camera/VTX control pads
154+
PE5 PINIO1 OUTPUT GPIO(70) LOW
155+
PE6 PINIO2 OUTPUT GPIO(71) LOW
156+
define HAL_PINIO_PIN_COUNT 2
157+
define HAL_PINIO1_PIN 70
158+
define HAL_PINIO1_PARAMS 0
159+
define HAL_PINIO2_PIN 71
160+
define HAL_PINIO2_PARAMS 0
161+
162+
# Camera switch
163+
PD4 CAM_SW OUTPUT GPIO(72) LOW
164+
165+
# enable FAT filesystem support (needs a microSD defined via SDMMC)
166+
define HAL_OS_FATFS_IO 1
167+
168+
# setup for serial ports
169+
define DEFAULT_SERIAL2_PROTOCOL SerialProtocol_MSP_DisplayPort
170+
define DEFAULT_SERIAL4_PROTOCOL SerialProtocol_MAVLink2
171+
define DEFAULT_SERIAL6_PROTOCOL SerialProtocol_RCIN
172+
define DEFAULT_SERIAL7_PROTOCOL SerialProtocol_ESCTelemetry
173+
define DEFAULT_SERIAL8_PROTOCOL SerialProtocol_MAVLink2
174+
define DEFAULT_SERIAL8_BAUD 115
175+
176+
# setup for OSD
177+
define OSD_ENABLED 1
178+
define HAL_OSD_TYPE_DEFAULT 1
179+
ROMFS_WILDCARD libraries/AP_OSD/fonts/font*.bin
180+
181+
# setup for BF migration
182+
define HAL_FRAME_TYPE 12

0 commit comments

Comments
 (0)