From 46001d6915fa8c00a4c663d991c364cad6692a3d Mon Sep 17 00:00:00 2001 From: pkocmoud Date: Tue, 16 Feb 2021 16:29:46 -0600 Subject: [PATCH] hwdef: Back Port updated hwdefs for mRo boards --- .../hwdef/mRoControlZeroClassic/hwdef-bl.dat | 64 ++++ .../hwdef/mRoControlZeroClassic/hwdef.dat | 299 ++++++++++++++++++ .../hwdef/mRoControlZeroF7/defaults.parm | 7 + .../hwdef/mRoControlZeroF7/hwdef-bl.dat | 24 +- .../hwdef/mRoControlZeroF7/hwdef.dat | 109 ++++--- .../hwdef/mRoControlZeroH7/defaults.parm | 7 + .../hwdef/mRoControlZeroH7/hwdef-bl.dat | 65 ++++ .../hwdef/mRoControlZeroH7/hwdef.dat | 265 ++++++++++++++++ .../hwdef/mRoControlZeroOEMH7/defaults.parm | 8 + .../hwdef/mRoControlZeroOEMH7/hwdef-bl.dat | 66 ++++ .../hwdef/mRoControlZeroOEMH7/hwdef.dat | 279 ++++++++++++++++ .../hwdef/mRoPixracerPro/defaults.parm | 7 + .../hwdef/mRoPixracerPro/hwdef-bl.dat | 23 +- .../hwdef/mRoPixracerPro/hwdef.dat | 44 +-- 14 files changed, 1174 insertions(+), 93 deletions(-) create mode 100644 libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroClassic/hwdef-bl.dat create mode 100644 libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroClassic/hwdef.dat create mode 100644 libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroF7/defaults.parm create mode 100644 libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroH7/defaults.parm create mode 100644 libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroH7/hwdef-bl.dat create mode 100644 libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroH7/hwdef.dat create mode 100644 libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroOEMH7/defaults.parm create mode 100644 libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroOEMH7/hwdef-bl.dat create mode 100644 libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroOEMH7/hwdef.dat create mode 100644 libraries/AP_HAL_ChibiOS/hwdef/mRoPixracerPro/defaults.parm diff --git a/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroClassic/hwdef-bl.dat b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroClassic/hwdef-bl.dat new file mode 100644 index 0000000000..9f42a53fda --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroClassic/hwdef-bl.dat @@ -0,0 +1,64 @@ +########################################################################################################################################################### +# hw definition file for processing by chibios_hwdef.py +# STM32H743ZIT6 +# mRo Control Zero Classic flight controller +# 12x PWM / IO - DMA capable and switchable 3.3v (default) / 5v Logic +# A Dual CAN based flight controller +# 3x IMUs (BMI088 6DOF, ICM20602 6DOF, ICM20948 9DOF) +# Baro, FRAM (256kb), SDCARD Socket, JTAG +# 5x UARTs (2x with hardware flow control), 2x CAN, 1x SPI, 2x I2C +# Onboard 3 color LED and buzzer +# Identical case and connector layout to the original 3DR / mRo Pixhawk +# M10048B - Initial Release +########################################################################################################################################################### + +# MCU class and specific type +MCU STM32H7xx STM32H743xx + +# USB setup +USB_STRING_MANUFACTURER "mRo" + +# crystal frequency +OSCILLATOR_HZ 24000000 + +# board ID for firmware load +APJ_BOARD_ID 1022 + +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 + +PB4 LED_BOOTLOADER OUTPUT + +# define all 3 to make LED output White. +PB1 LED_ACTIVITY OUTPUT +PB3 LED_ACTIVITY2 OUTPUT +# PB11 LED_ACTIVITY3 OUTPUT + +define HAL_LED_ON 0 + +# order of UARTs (and USB) +SERIAL_ORDER OTG1 + +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 16384 + +# Add CS pins to ensure they are high in bootloader +PD7 BARO_CS CS +PD10 FRAM_CS CS SPEED_VERYLOW +PE15 ICM_20948_CS CS +PF0 BMI088_ACCEL_CS CS +PF10 BMI088_GYRO_CS CS +PG3 ICM_20602_CS CS +PG9 EXT_SPI_CS CS +#PG10 EXT_SPI_CS CS diff --git a/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroClassic/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroClassic/hwdef.dat new file mode 100644 index 0000000000..5ca6b99473 --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroClassic/hwdef.dat @@ -0,0 +1,299 @@ +########################################################################################################################################################### +# hw definition file for processing by chibios_hwdef.py +# STM32H743ZIT6 +# mRo Control Zero Classic flight controller +# 12x PWM / IO - DMA capable and switchable 3.3v (default) / 5v Logic +# A Dual CAN based flight controller +# 3x IMUs (BMI088 6DOF, ICM20602 6DOF, ICM20948 9DOF) +# Baro, FRAM (256kb), SDCARD Socket, JTAG +# 5x UARTs (2x with hardware flow control), 2x CAN, 1x SPI, 2x I2C +# Onboard 3 color LED and buzzer +# Identical case and connector layout to the original 3DR / mRo Pixhawk +# M10048B - Initial Release +########################################################################################################################################################### + +# MCU class and specific type +MCU STM32H7xx STM32H743xx + +# USB setup +USB_STRING_MANUFACTURER "mRo" + +# board ID for firmware load +APJ_BOARD_ID 1022 + +# crystal frequency +OSCILLATOR_HZ 24000000 + +FLASH_SIZE_KB 2048 + +# with 2M flash we can afford to optimize for speed +env OPTIMIZE -O2 + +# start on 2th sector (1st sector for bootloader) +FLASH_RESERVE_START_KB 128 + +# use FRAM for storage +define HAL_STORAGE_SIZE 16384 + +# Enable RAMTROM parameter storage. +define HAL_WITH_RAMTRON 1 + +# RC Input set for Interrupt not DMA +PC7 TIM3_CH2 TIM3 RCININT FLOAT LOW + +# also USART6_RX for serial RC + +# Control of Spektrum power pin +PE4 SPEKTRUM_PWR OUTPUT LOW GPIO(70) +define HAL_GPIO_SPEKTRUM_PWR 70 + +# Spektrum Power is Active Low +define HAL_SPEKTRUM_PWR_ENABLED 0 + +# Spektrum RC Input pin, used as GPIO for bind for Satellite Receivers +PG0 SPEKTRUM_RC INPUT PULLUP GPIO(71) +define HAL_GPIO_SPEKTRUM_RC 71 + +# Order of I2C buses +I2C_ORDER I2C1 I2C4 + +# Now the first I2C bus. The pin speeds are automatically setup +# correctly, but can be overridden here if needed. +PB8 I2C1_SCL I2C1 +PB9 I2C1_SDA I2C1 + +# Now the first I2C bus. The pin speeds are automatically setup +# correctly, but can be overridden here if needed. +PF14 I2C4_SCL I2C4 +PF15 I2C4_SDA I2C4 + +# this board has no internal I2C busses +define HAL_I2C_INTERNAL_MASK 0 + +# order of UARTs (and USB) and suggested usage +# USART2 Telem 1 (Flow Control) +# USART3 Telem 2 (Flow Control) +# UART4 GPS with I2C1 +# UART7 GPS2 with I2C4 +# UART8 FRSKY Telem +# USART1 Additional UART + +# UART6 RC input (Only RX pin is connected) + +SERIAL_ORDER OTG1 USART2 USART3 UART4 UART7 UART8 USART1 OTG2 + +# default the 2nd interface to MAVLink2 until MissionPlanner updates drivers +define HAL_OTG2_PROTOCOL SerialProtocol_MAVLink2 + +# Another USART, this one for telem1. This one has RTS and CTS lines. +# USART2 telem1 +PD3 USART2_CTS USART2 +PD4 USART2_RTS USART2 +PD5 USART2_TX USART2 +PD6 USART2_RX USART2 + +# The telem2 USART, this one for telem2. This one has RTS and CTS lines. +# USART3 telem2 +PD8 USART3_TX USART3 +PD9 USART3_RX USART3 +PD11 USART3_CTS USART3 +PD12 USART3_RTS USART3 + +# UART4 GPS +PA0 UART4_TX UART4 +PA1 UART4_RX UART4 + +# UART7 GPS2 +PE7 UART7_RX UART7 +PE8 UART7_TX UART7 + +# UART8 FrSky Telemetry +PE0 UART8_RX UART8 +PE1 UART8_TX UART8 + +# USART1 Spektrum RX +PB6 USART1_TX USART1 +PB7 USART1_RX USART1 + +# This is the pin to enable the 3.3v sensors rail. It can be used to power +# cycle sensors to recover them in case there are problems with power on +# timing affecting sensor stability. We pull it high by default. +PE3 VDD_3V3_SENSORS_EN OUTPUT HIGH GPIO(72) + +# This is the pin to enable the 1.8v sensors rail. It can be used to power +# cycle sensors to recover them in case there are problems with power on +# timing affecting sensor stability. We pull it high by default. +PC13 VDD_1V8_SENSORS_EN OUTPUT HIGH GPIO(73) + +# This defines more ADC inputs. +PB0 AUX_ADC1 ADC1 SCALE(1) +PB1 AUX_ADC2 ADC1 SCALE(1) + +# And the analog input for airspeed (rarely used these days). +PC5 PRESSURE_SENS ADC1 SCALE(2) + +# RSSI Analog Input +PC0 RSSI_IN ADC1 + +# Safety Switch Input +PA10 SAFETY_IN INPUT + +PE6 LED_SAFETY OUTPUT + +PC4 BATT_VOLTAGE_SENS ADC1 SCALE(1) +PA3 BATT_CURRENT_SENS ADC1 SCALE(1) + +# Now the VDD sense pin. This is used to sense primary board voltage. +PA4 VDD_5V_SENS ADC1 SCALE(2) + +# Now setup the default battery pins driver analog pins and default +# scaling for the power brick. +define HAL_BATT_VOLT_PIN 4 +define HAL_BATT_CURR_PIN 15 +define HAL_BATT_VOLT_SCALE 10.1 +define HAL_BATT_CURR_SCALE 17.0 + +#SPI1 ICM_20602 / ICM_20948 +PA5 SPI1_SCK SPI1 +PA6 SPI1_MISO SPI1 +PA7 SPI1_MOSI SPI1 + +#SPI2 FRAM / DPS310 +PB10 SPI2_SCK SPI2 +PB14 SPI2_MISO SPI2 +PB15 SPI2_MOSI SPI2 + +#SPI5 BMI088 +PF7 SPI5_SCK SPI5 +PF8 SPI5_MISO SPI5 +PF9 SPI5_MOSI SPI5 + +#SPI6 EXTERNAL +PG13 SPI6_SCK SPI6 +PG12 SPI6_MISO SPI6 +PG14 SPI6_MOSI SPI6 + +# This is the pin that senses USB being connected. It is an input pin +# setup as OPENDRAIN. +PA9 VBUS INPUT OPENDRAIN + +# Pins that USB is connected to. +PA11 OTG_FS_DM OTG1 +PA12 OTG_FS_DP OTG1 + +# These are the pins for SWD debugging with a STlinkv2 or black-magic probe. +PA13 JTMS-SWDIO SWD +PA14 JTCK-SWCLK SWD + +# PWM output for buzzer +# PF6 TIM16_CH1 TIM16 GPIO(74) ALARM + +# Now setup the pins for the microSD card, if available. +PC8 SDMMC1_D0 SDMMC1 +PC9 SDMMC1_D1 SDMMC1 +PC10 SDMMC1_D2 SDMMC1 +PC11 SDMMC1_D3 SDMMC1 +PC12 SDMMC1_CK SDMMC1 +PD2 SDMMC1_CMD SDMMC1 + +# More CS pins for more sensors. The labels for all CS pins need to +# match the SPI device table later in this file. +PD7 BARO_CS CS +PD10 FRAM_CS CS SPEED_VERYLOW +PE15 ICM_20948_CS CS +PF0 BMI088_ACCEL_CS CS +PF10 BMI088_GYRO_CS CS +PG3 ICM_20602_CS CS +PG9 EXT_SPI_CS CS +PG10 EXT2_SPI_CS CS + +# the first CAN bus +PD0 CAN1_RX CAN1 +PD1 CAN1_TX CAN1 + +PF11 GPIO_CAN1_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(75) + +# the second CAN bus +PB12 CAN2_RX CAN2 +PB13 CAN2_TX CAN2 + +PF12 GPIO_CAN2_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(76) + +# Now we start defining some PWM pins. We also map these pins to GPIO +# values, so users can set BRD_PWM_COUNT to choose how many of the PWM +# outputs on the primary MCU are setup as PWM and how many as +# GPIOs. To match HAL_PX4 we number the GPIOs for the PWM outputs +# starting at 50. +PE14 TIM1_CH4 TIM1 PWM(1) GPIO(50) +PE13 TIM1_CH3 TIM1 PWM(2) GPIO(51) +PE11 TIM1_CH2 TIM1 PWM(3) GPIO(52) +PE9 TIM1_CH1 TIM1 PWM(4) GPIO(53) +PD13 TIM4_CH2 TIM4 PWM(5) GPIO(54) +PD14 TIM4_CH3 TIM4 PWM(6) GPIO(55) +PA2 TIM2_CH3 TIM2 PWM(7) GPIO(56) +PA15 TIM2_CH1 TIM2 PWM(8) GPIO(57) +PB11 TIM2_CH4 TIM2 PWM(9) GPIO(58) +PE5 TIM15_CH1 TIM15 PWM(10) GPIO(59) +PC6 TIM8_CH1 TIM8 PWM(11) GPIO(60) +PD15 TIM4_CH4 TIM4 PWM(12) GPIO(61) + +define BOARD_PWM_COUNT_DEFAULT 12 + +# This is the invensense data-ready pin. We don't use it in the +# default driver. +PG2 MPU_DRDY INPUT + +# Pin for PWM Voltage Selection, 0 means 3.3v, 1 means 5v +PG6 PWM_VOLT_SEL OUTPUT LOW GPIO(77) +define HAL_GPIO_PWM_VOLT_PIN 77 +define HAL_GPIO_PWM_VOLT_3v3 0 + +# Power flag pins: these tell the MCU the status of the various power +# supplies that are available. The pin names need to exactly match the +# names used in AnalogIn.cpp. +PC1 VDD_BRICK_nVALID INPUT PULLUP + +SPIDEV bmi088_g SPI5 DEVID1 BMI088_GYRO_CS MODE3 10*MHZ 10*MHZ +SPIDEV bmi088_a SPI5 DEVID2 BMI088_ACCEL_CS MODE3 10*MHZ 10*MHZ +SPIDEV icm20608 SPI1 DEVID2 ICM_20602_CS MODE3 2*MHZ 8*MHZ +SPIDEV icm20948 SPI1 DEVID1 ICM_20948_CS MODE3 2*MHZ 4*MHZ +SPIDEV dps280 SPI2 DEVID3 BARO_CS MODE3 5*MHZ 5*MHZ +SPIDEV ramtron SPI2 DEVID10 FRAM_CS MODE3 8*MHZ 8*MHZ + +# Now some defines for logging and terrain data files. +define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS" +define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN" + +# allow to have have a dedicated safety switch pin +define HAL_HAVE_SAFETY_SWITCH 1 + +# Enable FAT filesystem support (needs a microSD defined via SDMMC). +define HAL_OS_FATFS_IO 1 + +# Control Zero has a TriColor LED, Red, Green, Blue +define HAL_HAVE_PIXRACER_LED + +define HAL_GPIO_LED_ON 0 +define HAL_GPIO_LED_OFF 1 + +# LED setup for PixracerLED driver +PB4 LED_R OUTPUT HIGH GPIO(0) +PB5 LED_G OUTPUT HIGH GPIO(1) +PB3 LED_B OUTPUT HIGH GPIO(2) + +define HAL_GPIO_A_LED_PIN 0 +define HAL_GPIO_B_LED_PIN 1 +define HAL_GPIO_C_LED_PIN 2 + +# 3 IMUs +IMU BMI088 SPI:bmi088_a SPI:bmi088_g ROTATION_NONE +IMU Invensense SPI:icm20608 ROTATION_ROLL_180_YAW_90 +IMU Invensensev2 SPI:icm20948 ROTATION_ROLL_180_YAW_90 + +# 1 baro +BARO DPS280 SPI:dps280 + +# 1 compass +COMPASS AK09916:probe_ICM20948 0 ROTATION_ROLL_180 + +define HAL_PROBE_EXTERNAL_I2C_COMPASSES diff --git a/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroF7/defaults.parm b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroF7/defaults.parm new file mode 100644 index 0000000000..8e0cdc620d --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroF7/defaults.parm @@ -0,0 +1,7 @@ +#Default Parameters for the mRo Control Zero F7 + +CAN_P1_DRIVER 1 +CAN_SLCAN_CPORT 1 +SERIAL6_PROTOCOL 22 + + diff --git a/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroF7/hwdef-bl.dat b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroF7/hwdef-bl.dat index 2c44887684..e9432613fb 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroF7/hwdef-bl.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroF7/hwdef-bl.dat @@ -1,5 +1,18 @@ -# hw definition file for processing by chibios_hwdef.py -# for F777 bootloader +########################################################################################################################################################### +# mRo Control Zero F7 Flight Controller +# STM32F777IIK6 +# 8x PWM / IO - DMA capable, buffered and level shiftable - 3.3v (default) / 5v Logic +# Front and Rear Connectors: 30pin Molex PicoClasp +# 3x IMUs (BMI088 6DOF, ICM20602 6DOF, ICM20948 9DOF) +# DPS310 Baro, FRAM (256Bb), SDCARD Socket, TC2030 JTAG +# 5x UARTs (2x with hardware flow control), 2x CAN, 1x SPI, 1x I2C +# Onboard 3 color LED and buzzer +# Uncased Weight and Dimensions: +# Weight: 5.3g (.19oz) +# Width: 20mm (.79in) +# Length: 32mm (1.26in) +# M10058 - Initial Release +########################################################################################################################################################### # MCU class and specific type MCU STM32F7xx STM32F777xx @@ -30,13 +43,8 @@ PB3 LED_ACTIVITY2 OUTPUT define HAL_LED_ON 0 - # order of UARTs (and USB) -SERIAL_ORDER OTG1 UART7 - -# UART7 maps to uartF in the HAL (serial5 in SERIALn_ parameters). -PE7 UART7_RX UART7 -PE8 UART7_TX UART7 +SERIAL_ORDER OTG1 PA11 OTG_FS_DM OTG1 PA12 OTG_FS_DP OTG1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroF7/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroF7/hwdef.dat index 6268dec4fa..5e444fbadf 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroF7/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroF7/hwdef.dat @@ -1,8 +1,29 @@ -# hw definition file for processing by chibios_hwdef.py +########################################################################################################################################################### +# mRo Control Zero F7 Flight Controller +# STM32F777IIK6 +# 8x PWM / IO - DMA capable, buffered and level shiftable - 3.3v (default) / 5v Logic +# Front and Rear Connectors: 30pin Molex PicoClasp +# 3x IMUs (BMI088 6DOF, ICM20602 6DOF, ICM20948 9DOF) +# DPS310 Baro, FRAM (256Bb), SDCARD Socket, TC2030 JTAG +# 5x UARTs (2x with hardware flow control), 2x CAN, 1x SPI, 1x I2C +# Onboard 3 color LED and buzzer +# Uncased Weight and Dimensions: +# Weight: 5.3g (.19oz) +# Width: 20mm (.79in) +# Length: 32mm (1.26in) +# M10058 - Initial Release +########################################################################################################################################################### # MCU class and specific type MCU STM32F7xx STM32F777xx +# ChibiOS system timer +# this is the STM32 timer that ChibiOS will use for the low level +# driver. This must be a 32 bit timer, so Timers 2 or 5 on the STM32F777. +# See hal_st_lld.c in ChibiOS for details + +STM32_ST_USE_TIMER 5 + # board ID for firmware load APJ_BOARD_ID 141 @@ -17,23 +38,18 @@ env OPTIMIZE -O2 # start on 4th sector (1st sector for bootloader, 2 for extra storage) FLASH_RESERVE_START_KB 96 +# use FRAM for storage +define HAL_STORAGE_SIZE 16384 +define HAL_WITH_RAMTRON 1 + # fallback storage in case FRAM is not populated define STORAGE_FLASH_PAGE 1 -# this is the STM32 timer that ChibiOS will use for the low level -# driver. This must be a 32 bit timer, so Timers 2 or 5 on the STM32F777. -# See hal_st_lld.c in ChibiOS for details - -# ChibiOS system timer -STM32_ST_USE_TIMER 5 - -define HAL_STORAGE_SIZE 32768 - # USB setup USB_STRING_MANUFACTURER "mRo" -# RC Input set for Interrupt not DMA -PC7 TIM3_CH2 TIM3 RCININT FLOAT LOW # also USART6_RX for serial RC +# RC Input set for Interrupt not DMA also USART6_RX for serial RC +PC7 TIM3_CH2 TIM3 RCININT FLOAT LOW # Control of Spektrum power pin PE4 SPEKTRUM_PWR OUTPUT LOW GPIO(70) @@ -52,21 +68,15 @@ I2C_ORDER I2C1 # this board only has a single I2C bus so make it external define HAL_I2C_INTERNAL_MASK 0 -# OEM Only -# I2C_ORDER I2C1, I2C2, I2C3 - # order of UARTs (and USB) # UART4 GPS -# USART2 FC -# USART3 FC +# USART2 Telem 1 (Flow Control) +# USART3 Telem 2 (Flow Control) # UART8 FRSKY Telem -# USART6 FC -# UART7 DEBUG +# USART6 RC input (Only RX pin is connected) +# UART7 Additional UART -SERIAL_ORDER OTG1 USART2 USART3 UART4 UART8 USART6 UART7 OTG2 - -# default the 2nd interface to MAVLink2 until MissionPlanner updates drivers -define HAL_OTG2_PROTOCOL SerialProtocol_MAVLink2 +SERIAL_ORDER OTG1 USART2 USART3 UART4 UART8 UART7 OTG2 # Another USART, this one for telem1. This one has RTS and CTS lines. # USART2 telem1 @@ -86,11 +96,7 @@ PD12 USART3_RTS USART3 PA0 UART4_TX UART4 PA1 UART4_RX UART4 NODMA -# USART6 Spare or can be configured as SPI6 -PG14 USART6_TX USART6 NODMA -PG9 USART6_RX USART6 NODMA - -# UART7 maps to uartF in the HAL (serial5 in SERIALn_ parameters). Debug Console +# UART7 Spare or Debug Console PE7 UART7_RX UART7 NODMA PE8 UART7_TX UART7 NODMA @@ -125,12 +131,20 @@ PF7 SPI5_SCK SPI5 PF8 SPI5_MISO SPI5 PF9 SPI5_MOSI SPI5 +# GPIOs +# This defines general purpose outputs, mapped to GPIO +# numbers 1 thru 4 for users. +PG9 EXTERN_GPIO1 GPIO(1) +PG13 EXTERN_GPIO2 GPIO(2) +PG12 EXTERN_GPIO3 GPIO(3) +PG14 EXTERN_GPIO4 GPIO(4) + # This is the pin that senses USB being connected. It is an input pin # setup as OPENDRAIN. PA9 VBUS INPUT OPENDRAIN # This input pin is used to detect that power is valid on USB. -PC0 VBUS_VALID INPUT +PC0 VBUS_VALID INPUT PULLDOWN # Now we define the pins that USB is connected on. PA11 OTG_FS_DM OTG1 @@ -148,14 +162,6 @@ PA15 TIM2_CH1 TIM2 GPIO(77) ALARM PB8 I2C1_SCL I2C1 PB9 I2C1_SDA I2C1 -# the 2nd I2C bus, OEM Only -# PB10 I2C2_SCL I2C2 -# PB11 I2C2_SDA I2C2 - -# the 3nd I2C bus, OEM Only -# PB6 I2C4_SCL I2C4 -# PB7 I2C4_SDA I2C4 - # Now setup the pins for the microSD card, if available. PC8 SDMMC_D0 SDMMC1 PC9 SDMMC_D1 SDMMC1 @@ -168,8 +174,6 @@ PD2 SDMMC_CMD SDMMC1 # match the SPI device table later in this file. PC2 ICM_20602_CS CS PD7 BARO_CS CS -# The CS pin for FRAM (ramtron). This one is marked as using -# SPEED_VERYLOW, which matches the HAL_PX4 setup. PD10 FRAM_CS CS SPEED_VERYLOW NODMA PE15 ICM_20948_CS CS PF10 BMI088_GYRO_CS CS @@ -181,10 +185,6 @@ PD1 CAN1_TX CAN1 PF5 GPIO_CAN1_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(72) -# This defines the pins for the 2nd CAN interface, OEM Only. -# PB6 CAN2_TX CAN2 -# PB4 CAN2_RX CAN2 - # Now we start defining some PWM pins. We also map these pins to GPIO # values, so users can set BRD_PWM_COUNT to choose how many of the PWM # outputs on the primary MCU are setup as PWM and how many as @@ -213,14 +213,14 @@ PE3 VDD_3V3_SENSORS_EN OUTPUT HIGH # Power flag pins: these tell the MCU the status of the various power # supplies that are available. The pin names need to exactly match the # names used in AnalogIn.cpp. -PB5 VDD_BRICK_VALID INPUT PULLUP +PB5 VDD_BRICK_nVALID INPUT PULLUP -SPIDEV dps310 SPI2 DEVID3 BARO_CS MODE3 5*MHZ 5*MHZ +SPIDEV dps280 SPI2 DEVID3 BARO_CS MODE3 5*MHZ 5*MHZ SPIDEV ramtron SPI2 DEVID10 FRAM_CS MODE3 8*MHZ 8*MHZ +SPIDEV bmi088_g SPI5 DEVID1 BMI088_GYRO_CS MODE3 5*MHZ 5*MHZ +SPIDEV bmi088_a SPI5 DEVID2 BMI088_ACCEL_CS MODE3 5*MHZ 5*MHZ +SPIDEV icm20608 SPI1 DEVID2 ICM_20602_CS MODE3 2*MHZ 4*MHZ SPIDEV icm20948 SPI1 DEVID1 ICM_20948_CS MODE3 2*MHZ 4*MHZ -SPIDEV icm20608 SPI1 DEVID2 ICM_20602_CS MODE3 2*MHZ 8*MHZ -SPIDEV bmi088_g SPI5 DEVID1 BMI088_GYRO_CS MODE3 10*MHZ 10*MHZ -SPIDEV bmi088_a SPI5 DEVID2 BMI088_ACCEL_CS MODE3 10*MHZ 10*MHZ # Now some defines for logging and terrain data files. define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS" @@ -229,9 +229,6 @@ define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN" # allow to have have a dedicated safety switch pin define HAL_HAVE_SAFETY_SWITCH 1 -# Enable RAMTROM parameter storage. -define HAL_WITH_RAMTRON 1 - # Enable FAT filesystem support (needs a microSD defined via SDMMC). define HAL_OS_FATFS_IO 1 @@ -258,16 +255,16 @@ define HAL_GPIO_B_LED_PIN 1 define HAL_GPIO_C_LED_PIN 2 DMA_PRIORITY SDMMC* -#DMA_NOSHARE SPI1* * -#DMA_NOSHARE SPI5* * # 3 IMUs -IMU Invensensev2 SPI:icm20948 ROTATION_ROLL_180_YAW_90 -IMU Invensense SPI:icm20608 ROTATION_ROLL_180_YAW_90 IMU BMI088 SPI:bmi088_a SPI:bmi088_g ROTATION_NONE +IMU Invensense SPI:icm20608 ROTATION_ROLL_180_YAW_90 +IMU Invensensev2 SPI:icm20948 ROTATION_ROLL_180_YAW_90 + +define HAL_DEFAULT_INS_FAST_SAMPLE 7 # 1 baro -BARO DPS280 SPI:dps310 +BARO DPS280 SPI:dps280 # 1 compass COMPASS AK09916:probe_ICM20948 0 ROTATION_ROLL_180 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroH7/defaults.parm b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroH7/defaults.parm new file mode 100644 index 0000000000..fa6580aa1d --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroH7/defaults.parm @@ -0,0 +1,7 @@ +#Default Parameters for the mRo Control Zero H7 + +CAN_P1_DRIVER 1 +CAN_SLCAN_CPORT 1 +SERIAL6_PROTOCOL 22 + + diff --git a/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroH7/hwdef-bl.dat b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroH7/hwdef-bl.dat new file mode 100644 index 0000000000..d165118b00 --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroH7/hwdef-bl.dat @@ -0,0 +1,65 @@ +########################################################################################################################################################### +# mRo Control Zero H7 Flight Controller +# STM32H743IIK6 +# 8x PWM / IO - DMA capable, buffered and level shiftable - 3.3v (default) / 5v Logic +# Front and Rear Connectors: 30pin Molex PicoClasp +# 3x IMUs (BMI088 6DOF, ICM20602 6DOF, ICM20948 9DOF) +# DPS310 Baro, FRAM (256Bb), SDCARD Socket, TC2030 JTAG +# 5x UARTs (2x with hardware flow control), 1x CAN, 1x SPI, 1x I2C +# Onboard 3 color LED and buzzer +# Uncased Weight and Dimensions: +# Weight: 5.3g (.19oz) +# Width: 20mm (.79in) +# Length: 32mm (1.26in) +# M10058 - Initial Release +########################################################################################################################################################### + +# MCU class and specific type +MCU STM32H7xx STM32H743xx + +# USB setup +USB_STRING_MANUFACTURER "mRo" + +# crystal frequency +OSCILLATOR_HZ 24000000 + +# board ID for firmware load +APJ_BOARD_ID 1023 + +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 + +PB11 LED_BOOTLOADER OUTPUT + +# define all 3 to make LED output White. +PB1 LED_ACTIVITY OUTPUT +PB3 LED_ACTIVITY2 OUTPUT +# PB11 LED_ACTIVITY3 OUTPUT + +define HAL_LED_ON 0 + +# order of UARTs (and USB) +SERIAL_ORDER OTG1 + +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 16384 + +# Add CS pins to ensure they are high in bootloader +PC2 ICM_20602_CS CS +PD7 BARO_CS CS +PD10 FRAM_CS CS SPEED_VERYLOW NODMA +PE15 ICM_20948_CS CS +PF6 BMI088_ACCEL_CS CS +PF10 BMI088_GYRO_CS CS +PG9 EXTERNAL CS diff --git a/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroH7/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroH7/hwdef.dat new file mode 100644 index 0000000000..9971298317 --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroH7/hwdef.dat @@ -0,0 +1,265 @@ +########################################################################################################################################################### +# mRo Control Zero H7 Flight Controller +# STM32H743IIK6 +# 8x PWM / IO - DMA capable, buffered and level shiftable - 3.3v (default) / 5v Logic +# Front and Rear Connectors: 30pin Molex PicoClasp +# 3x IMUs (BMI088 6DOF, ICM20602 6DOF, ICM20948 9DOF) +# DPS310 Baro, FRAM (256Bb), SDCARD Socket, TC2030 JTAG +# 5x UARTs (2x with hardware flow control), 1x CAN, 1x SPI, 1x I2C +# Onboard 3 color LED and buzzer +# Uncased Weight and Dimensions: +# Weight: 5.3g (.19oz) +# Width: 20mm (.79in) +# Length: 32mm (1.26in) +# M10058 - Initial Release +########################################################################################################################################################### + +# MCU class and specific type +MCU STM32H7xx STM32H743xx + +# board ID for firmware load +APJ_BOARD_ID 1023 + +# crystal frequency +OSCILLATOR_HZ 24000000 + +FLASH_SIZE_KB 2048 + +# with 2M flash we can afford to optimize for speed +env OPTIMIZE -O2 + +# start on 2th sector (1st sector for bootloader) +FLASH_RESERVE_START_KB 128 + +define HAL_STORAGE_SIZE 32768 + +# USB setup +USB_STRING_MANUFACTURER "mRo" + +# RC Input set for Interrupt not DMA +PC7 TIM3_CH2 TIM3 RCININT FLOAT LOW + +# GPIO(70) # also USART6_RX for serial RC + +# Control of Spektrum power pin +PE4 SPEKTRUM_PWR OUTPUT LOW GPIO(70) +define HAL_GPIO_SPEKTRUM_PWR 70 + +# Spektrum Power is Active High +define HAL_SPEKTRUM_PWR_ENABLED 0 + +# Spektrum RC Input pin, used as GPIO for bind for Satellite Receivers +PB0 SPEKTRUM_RC INPUT PULLUP GPIO(71) +define HAL_GPIO_SPEKTRUM_RC 71 + +# Order of I2C buses +I2C_ORDER I2C1 + +# this board has no internal I2C buses so them all external +define HAL_I2C_INTERNAL_MASK 0 + +# order of UARTs and suggested uses +# USART2 TELEM1 +# USART3 TELEM2 +# UART4 GPS +# UART8 FRSKY Telem +# UART7 DEBUG + +# USART6 RC input (Only RX pin is connected) + +# OTG1 and OTG2 are USB devices (1x physical USB connection enumerated as 2x logical ports) + +SERIAL_ORDER OTG1 USART2 USART3 UART4 UART8 UART7 OTG2 + +# default the 2nd interface to MAVLink2 until MissionPlanner updates drivers +define HAL_OTG2_PROTOCOL SerialProtocol_MAVLink2 + +# Another USART, this one for telem1. This one has RTS and CTS lines. +# USART2 telem1 +PD5 USART2_TX USART2 +PD6 USART2_RX USART2 +PD3 USART2_CTS USART2 +PD4 USART2_RTS USART2 + +# The telem2 USART, this one for telem2. This one has RTS and CTS lines. +# USART3 telem2 +PD8 USART3_TX USART3 +PD9 USART3_RX USART3 +PD11 USART3_CTS USART3 +PD12 USART3_RTS USART3 + +# UART4 GPS +PA0 UART4_TX UART4 +PA1 UART4_RX UART4 + +# UART7 +PE8 UART7_TX UART7 +PE7 UART7_RX UART7 + +# UART8 FrSky Telemetry (Single wire serial connects to the TX pin only) +PE1 UART8_TX UART8 +PE0 UART8_RX UART8 + +# RSSI Analog Input +PC1 RSSI_IN ADC1 + +# Safety Switch Input +PC4 SAFETY_IN INPUT PULLDOWN +define HAL_HAVE_SAFETY_SWITCH 1 + +# Battery Analog Sense Pins +PA2 BATT_VOLTAGE_SENS ADC1 SCALE(1) +PA3 BATT_CURRENT_SENS ADC1 SCALE(1) + +# Now the VDD sense pin. This is used to sense primary board voltage. +PA4 VDD_5V_SENS ADC1 SCALE(2) + +# Now setup the default battery pins driver analog pins and default +# scaling for the power brick. +define HAL_BATT_VOLT_PIN 14 +define HAL_BATT_CURR_PIN 15 +define HAL_BATT_VOLT_SCALE 10.1 +define HAL_BATT_CURR_SCALE 17.0 + +#SPI1 ICM_20602 / ICM_20948 +PA5 SPI1_SCK SPI1 +PA6 SPI1_MISO SPI1 +PA7 SPI1_MOSI SPI1 + +#SPI2 FRAM / DPS310 +PB10 SPI2_SCK SPI2 +PB14 SPI2_MISO SPI2 +PB15 SPI2_MOSI SPI2 + +#SPI5 BMI088 +PF7 SPI5_SCK SPI5 +PF8 SPI5_MISO SPI5 +PF9 SPI5_MOSI SPI5 + +#SPI6 External +PG13 SPI6_SCK SPI6 +PG12 SPI6_MISO SPI6 +PG14 SPI6_MOSI SPI6 + +# This is the pin that senses USB being connected. It is an input pin +# setup as OPENDRAIN. +PA9 VBUS INPUT OPENDRAIN + +# This input pin is used to detect that power is valid on USB. +PC0 VBUS_VALID INPUT PULLDOWN + +# Now we define the pins that USB is connected on. +PA11 OTG_FS_DM OTG1 +PA12 OTG_FS_DP OTG1 + +# These are the pins for SWD debugging with a STlinkv2 or black-magic probe. +PA13 JTMS-SWDIO SWD +PA14 JTCK-SWCLK SWD + +# PWM output for buzzer +PA15 TIM2_CH1 TIM2 GPIO(77) ALARM + +# First I2C bus. +PB8 I2C1_SCL I2C1 +PB9 I2C1_SDA I2C1 + +# microSD card +PC8 SDMMC1_D0 SDMMC1 +PC9 SDMMC1_D1 SDMMC1 +PC10 SDMMC1_D2 SDMMC1 +PC11 SDMMC1_D3 SDMMC1 +PC12 SDMMC1_CK SDMMC1 +PD2 SDMMC1_CMD SDMMC1 + +# CS pins for SPI sensors. The labels for all CS pins need to +# match the SPI device table later in this file. +PC2 ICM_20602_CS CS +PD7 BARO_CS CS +PD10 FRAM_CS CS SPEED_VERYLOW NODMA +PE15 ICM_20948_CS CS +PF6 BMI088_ACCEL_CS CS +PF10 BMI088_GYRO_CS CS +PG9 EXTERNAL CS + +# CAN Busses +PD0 CAN1_RX CAN1 +PD1 CAN1_TX CAN1 + +# CAN Silent Pin LOW Enable +PF5 GPIO_CAN_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(72) + +# Now we start defining some PWM pins. We also map these pins to GPIO +# values, so users can set BRD_PWM_COUNT to choose how many of the PWM +# outputs on the primary MCU are setup as PWM and how many as +# GPIOs. To match HAL_PX4 we number the GPIOs for the PWM outputs +# starting at 50. +PE14 TIM1_CH4 TIM1 PWM(1) GPIO(50) +PE13 TIM1_CH3 TIM1 PWM(2) GPIO(51) +PE11 TIM1_CH2 TIM1 PWM(3) GPIO(52) +PE9 TIM1_CH1 TIM1 PWM(4) GPIO(53) +PD13 TIM4_CH2 TIM4 PWM(5) GPIO(54) +PD14 TIM4_CH3 TIM4 PWM(6) GPIO(55) +PI5 TIM8_CH1 TIM8 PWM(7) GPIO(56) +PI6 TIM8_CH2 TIM8 PWM(8) GPIO(57) + +define BOARD_PWM_COUNT_DEFAULT 8 + +# This is the invensense 20602 data-ready pin. +PD15 MPU_DRDY INPUT + +# Power Supply Enable +PE3 VDD_1V8_3V3_SENSORS_EN OUTPUT HIGH + +# Power Supply Enable 3.3v Periph/Spektrum +PC5 VDD_3V3_PERIPH_EN OUTPUT HIGH + +# Power flag pins: these tell the MCU the status of the various power +# supplies that are available. The pin names need to exactly match the +# names used in AnalogIn.cpp. +PB5 VDD_BRICK_VALID INPUT PULLDOWN + +SPIDEV dps280 SPI2 DEVID3 BARO_CS MODE3 5*MHZ 5*MHZ +SPIDEV ramtron SPI2 DEVID10 FRAM_CS MODE3 8*MHZ 8*MHZ +SPIDEV bmi088_g SPI5 DEVID1 BMI088_GYRO_CS MODE3 5*MHZ 5*MHZ +SPIDEV bmi088_a SPI5 DEVID2 BMI088_ACCEL_CS MODE3 5*MHZ 5*MHZ +SPIDEV icm20608 SPI1 DEVID2 ICM_20602_CS MODE3 2*MHZ 4*MHZ +SPIDEV icm20948 SPI1 DEVID1 ICM_20948_CS MODE3 2*MHZ 4*MHZ + +# Now some defines for logging and terrain data files. +define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS" +define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN" + +# Enable RAMTROM parameter storage. +define HAL_WITH_RAMTRON 1 + +# Enable FAT filesystem support (needs a microSD defined via SDMMC). +define HAL_OS_FATFS_IO 1 + +# Control Zero has a TriColor LED, Red, Green, Blue +define HAL_HAVE_PIXRACER_LED + +define HAL_GPIO_LED_ON 0 +define HAL_GPIO_LED_OFF 1 + +# LED setup for PixracerLED driver +PB11 LED_R OUTPUT HIGH GPIO(0) +PB1 LED_G OUTPUT HIGH GPIO(1) +PB3 LED_B OUTPUT HIGH GPIO(2) + +define HAL_GPIO_A_LED_PIN 0 +define HAL_GPIO_B_LED_PIN 1 +define HAL_GPIO_C_LED_PIN 2 + +# 3 IMUs +IMU BMI088 SPI:bmi088_a SPI:bmi088_g ROTATION_NONE +IMU Invensense SPI:icm20608 ROTATION_ROLL_180_YAW_90 +IMU Invensensev2 SPI:icm20948 ROTATION_ROLL_180_YAW_90 + +define HAL_DEFAULT_INS_FAST_SAMPLE 7 + +# 1 baro +BARO DPS280 SPI:dps280 + +# 1 compass +COMPASS AK09916:probe_ICM20948 0 ROTATION_ROLL_180 +define HAL_PROBE_EXTERNAL_I2C_COMPASSES diff --git a/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroOEMH7/defaults.parm b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroOEMH7/defaults.parm new file mode 100644 index 0000000000..7aba9fb30a --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroOEMH7/defaults.parm @@ -0,0 +1,8 @@ +#Default Parameters for the mRo Control Zero OEM H7 + +CAN_P1_DRIVER 1 +CAN_P2_DRIVER 2 +CAN_SLCAN_CPORT 1 +SERIAL6_PROTOCOL 22 + + diff --git a/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroOEMH7/hwdef-bl.dat b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroOEMH7/hwdef-bl.dat new file mode 100644 index 0000000000..09f6099bf9 --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroOEMH7/hwdef-bl.dat @@ -0,0 +1,66 @@ +########################################################################################################################################################### +# mRo Control Zero OEM H7 Flight Controller +# STM32H743IIK6 +# 8x PWM / IO - DMA capable and hardware and/or software switchable 3.3v / 5v Logic (hardware default) +# Logic level set in hardware: No Solder for 5v, Solder 1-2 for 3.3v, Solder 2-3 for 3.3v / 5v software switchable +# Bottom Connectors: 36pin front and 40pin back Samtec FTM-118-02-F-DV 1.00 mm Surface Mount Micro Low Profile Terminal Strip +# 3x IMUs (BMI088 6DOF, ICM20602 6DOF, ICM20948 9DOF) +# DPS310 Baro, FRAM (256Bb), SDCARD Socket, TC2030 JTAG +# 5x UARTs (2x with hardware flow control), 2x CAN, 1x SPI, 3x I2C +# Onboard 3 color LED and buzzer +# Uncased Weight and Dimensions: +# Weight: 3.66g (13.oz) +# Width: 20mm (.79in) +# Length: 34mm (1.34in) +# M10059C - Initial Release +########################################################################################################################################################### + +# MCU class and specific type +MCU STM32H7xx STM32H743xx + +# USB setup +USB_STRING_MANUFACTURER "mRo" + +# crystal frequency +OSCILLATOR_HZ 24000000 + +# board ID for firmware load +APJ_BOARD_ID 1024 + +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 + +PB11 LED_BOOTLOADER OUTPUT + +# define all 3 to make LED output White. +PB1 LED_ACTIVITY OUTPUT +PB3 LED_ACTIVITY2 OUTPUT +# PB11 LED_ACTIVITY3 OUTPUT + +define HAL_LED_ON 0 + +# order of UARTs (and USB) +SERIAL_ORDER OTG1 + +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 16384 + +# Add CS pins to ensure they are high in bootloader +PC2 ICM_20602_CS CS +PD7 BARO_CS CS +PD10 FRAM_CS CS SPEED_VERYLOW NODMA +PE15 ICM_20948_CS CS +PF6 BMI088_ACCEL_CS CS +PF10 BMI088_GYRO_CS CS +PG9 EXTERNAL CS diff --git a/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroOEMH7/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroOEMH7/hwdef.dat new file mode 100644 index 0000000000..0139ef6d8a --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/mRoControlZeroOEMH7/hwdef.dat @@ -0,0 +1,279 @@ +########################################################################################################################################################### +# mRo Control Zero OEM H7 Flight Controller +# STM32H743IIK6 +# 8x PWM / IO - DMA capable and hardware and/or software switchable 3.3v / 5v Logic (hardware default) +# Logic level set in hardware: No Solder for 5v, Solder 1-2 for 3.3v, Solder 2-3 for 3.3v / 5v software switchable +# Bottom Connectors: 36pin front and 40pin back Samtec FTM-118-02-F-DV 1.00 mm Surface Mount Micro Low Profile Terminal Strip +# 3x IMUs (BMI088 6DOF, ICM20602 6DOF, ICM20948 9DOF) +# DPS310 Baro, FRAM (256Bb), SDCARD Socket, TC2030 JTAG +# 5x UARTs (2x with hardware flow control), 2x CAN, 1x SPI, 3x I2C +# Onboard 3 color LED and buzzer +# Uncased Weight and Dimensions: +# Weight: 3.66g (13.oz) +# Width: 20mm (.79in) +# Length: 34mm (1.34in) +# M10059C - Initial Release +########################################################################################################################################################### + +# MCU class and specific type +MCU STM32H7xx STM32H743xx + +# board ID for firmware load +APJ_BOARD_ID 1024 + +# crystal frequency +OSCILLATOR_HZ 24000000 + +FLASH_SIZE_KB 2048 + +# with 2M flash we can afford to optimize for speed +env OPTIMIZE -O2 + +# start on 2th sector (1st sector for bootloader) +FLASH_RESERVE_START_KB 128 + +define HAL_STORAGE_SIZE 16384 + +# USB setup +USB_STRING_MANUFACTURER "mRo" + +# RC Input set for Interrupt not DMA +PC7 TIM3_CH2 TIM3 RCININT FLOAT LOW + +# GPIO(70) # also USART6_RX for serial RC + +# Control of Spektrum power pin +PE4 SPEKTRUM_PWR OUTPUT LOW GPIO(70) +define HAL_GPIO_SPEKTRUM_PWR 70 + +# Spektrum Power is Active High +define HAL_SPEKTRUM_PWR_ENABLED 0 + +# Spektrum RC Input pin, used as GPIO for bind for Satellite Receivers +PB0 SPEKTRUM_RC INPUT PULLUP GPIO(71) +define HAL_GPIO_SPEKTRUM_RC 71 + +# Order of I2C buses +I2C_ORDER I2C1 I2C3 I2C4 + +# this board has no internal I2C buses so them all external +define HAL_I2C_INTERNAL_MASK 0 + +# order of UARTs and suggested uses +# USART2 TELEM1 +# USART3 TELEM2 +# UART4 GPS +# UART8 FRSKY Telem +# UART7 DEBUG + +# USART6 RC input (Only RX pin is connected) + +# OTG1 and OTG2 are USB devices (1x physical USB connection enumerated as 2x logical ports) + +SERIAL_ORDER OTG1 USART2 USART3 UART4 UART8 UART7 OTG2 + +# default the 2nd interface to MAVLink2 until MissionPlanner updates drivers +define HAL_OTG2_PROTOCOL SerialProtocol_MAVLink2 + +# Another USART, this one for telem1. This one has RTS and CTS lines. +# USART2 telem1 +PD5 USART2_TX USART2 +PD6 USART2_RX USART2 +PD3 USART2_CTS USART2 +PD4 USART2_RTS USART2 + +# The telem2 USART, this one for telem2. This one has RTS and CTS lines. +# USART3 telem2 +PD8 USART3_TX USART3 +PD9 USART3_RX USART3 +PD11 USART3_CTS USART3 +PD12 USART3_RTS USART3 + +# UART4 GPS +PA0 UART4_TX UART4 +PA1 UART4_RX UART4 + +# UART7 +PE8 UART7_TX UART7 +PE7 UART7_RX UART7 + +# UART8 FrSky Telemetry (Single wire serial connects to the TX pin only) +PE1 UART8_TX UART8 +PE0 UART8_RX UART8 + +# RSSI Analog Input +PC1 RSSI_IN ADC1 + +# Safety Switch Input +PC4 SAFETY_IN INPUT PULLDOWN +define HAL_HAVE_SAFETY_SWITCH 1 + +# Battery Analog Sense Pins +PA2 BATT_VOLTAGE_SENS ADC1 SCALE(1) +PA3 BATT_CURRENT_SENS ADC1 SCALE(1) + +# Now the VDD sense pin. This is used to sense primary board voltage. +PA4 VDD_5V_SENS ADC1 SCALE(2) + +# Now setup the default battery pins driver analog pins and default +# scaling for the power brick. +define HAL_BATT_VOLT_PIN 14 +define HAL_BATT_CURR_PIN 15 +define HAL_BATT_VOLT_SCALE 10.1 +define HAL_BATT_CURR_SCALE 17.0 + +#SPI1 ICM_20602 / ICM_20948 +PA5 SPI1_SCK SPI1 +PA6 SPI1_MISO SPI1 +PA7 SPI1_MOSI SPI1 + +#SPI2 FRAM / DPS310 +PB10 SPI2_SCK SPI2 +PB14 SPI2_MISO SPI2 +PB15 SPI2_MOSI SPI2 + +#SPI5 BMI088 +PF7 SPI5_SCK SPI5 +PF8 SPI5_MISO SPI5 +PF9 SPI5_MOSI SPI5 + +#SPI6 External +PG13 SPI6_SCK SPI6 +PG12 SPI6_MISO SPI6 +PG14 SPI6_MOSI SPI6 + +# This is the pin that senses USB being connected. It is an input pin +# setup as OPENDRAIN. +PA9 VBUS INPUT OPENDRAIN + +# This input pin is used to detect that power is valid on USB. +PC0 VBUS_VALID INPUT PULLDOWN + +# Now we define the pins that USB is connected on. +PA11 OTG_FS_DM OTG1 +PA12 OTG_FS_DP OTG1 + +# These are the pins for SWD debugging with a STlinkv2 or black-magic probe. +PA13 JTMS-SWDIO SWD +PA14 JTCK-SWCLK SWD + +# PWM output for buzzer +PA15 TIM2_CH1 TIM2 GPIO(77) ALARM + +# First I2C bus. +PB8 I2C1_SCL I2C1 +PB9 I2C1_SDA I2C1 + +# Second I2C bus. +PH7 I2C3_SCL I2C3 +PH8 I2C3_SDA I2C3 + +# Third I2C bus. +PB6 I2C4_SCL I2C4 +PB7 I2C4_SDA I2C4 + +# microSD card +PC8 SDMMC1_D0 SDMMC1 +PC9 SDMMC1_D1 SDMMC1 +PC10 SDMMC1_D2 SDMMC1 +PC11 SDMMC1_D3 SDMMC1 +PC12 SDMMC1_CK SDMMC1 +PD2 SDMMC1_CMD SDMMC1 + +# CS pins for SPI sensors. The labels for all CS pins need to +# match the SPI device table later in this file. +PC2 ICM_20602_CS CS +PD7 BARO_CS CS +PD10 FRAM_CS CS SPEED_VERYLOW NODMA +PE15 ICM_20948_CS CS +PF6 BMI088_ACCEL_CS CS +PF10 BMI088_GYRO_CS CS +PG9 EXTERNAL CS + +# CAN Busses +PD0 CAN1_RX CAN1 +PD1 CAN1_TX CAN1 + +PB13 CAN2_TX CAN2 +PB12 CAN2_RX CAN2 + +# CAN Silent Pins LOW Enable +PF5 GPIO_CAN_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(72) + +# Now we start defining some PWM pins. We also map these pins to GPIO +# values, so users can set BRD_PWM_COUNT to choose how many of the PWM +# outputs on the primary MCU are setup as PWM and how many as +# GPIOs. To match HAL_PX4 we number the GPIOs for the PWM outputs +# starting at 50. +PE14 TIM1_CH4 TIM1 PWM(1) GPIO(50) +PE13 TIM1_CH3 TIM1 PWM(2) GPIO(51) +PE11 TIM1_CH2 TIM1 PWM(3) GPIO(52) +PE9 TIM1_CH1 TIM1 PWM(4) GPIO(53) +PD13 TIM4_CH2 TIM4 PWM(5) GPIO(54) +PD14 TIM4_CH3 TIM4 PWM(6) GPIO(55) +PI5 TIM8_CH1 TIM8 PWM(7) GPIO(56) +PI6 TIM8_CH2 TIM8 PWM(8) GPIO(57) + +define BOARD_PWM_COUNT_DEFAULT 8 + +# This is the invensense 20602 data-ready pin. +PD15 MPU_DRDY INPUT + +# Power Supply Enable +PE3 VDD_1V8_3V3_SENSORS_EN OUTPUT HIGH + +# Power Supply Enable 3.3v Periph/Spektrum +PC5 VDD_3V3_PERIPH_EN OUTPUT HIGH + +# Power flag pins: these tell the MCU the status of the various power +# supplies that are available. The pin names need to exactly match the +# names used in AnalogIn.cpp. +PB5 VDD_BRICK_VALID INPUT PULLDOWN + +SPIDEV dps280 SPI2 DEVID3 BARO_CS MODE3 5*MHZ 5*MHZ +SPIDEV ramtron SPI2 DEVID10 FRAM_CS MODE3 8*MHZ 8*MHZ +SPIDEV bmi088_g SPI5 DEVID1 BMI088_GYRO_CS MODE3 5*MHZ 5*MHZ +SPIDEV bmi088_a SPI5 DEVID2 BMI088_ACCEL_CS MODE3 5*MHZ 5*MHZ +SPIDEV icm20608 SPI1 DEVID2 ICM_20602_CS MODE3 2*MHZ 4*MHZ +SPIDEV icm20948 SPI1 DEVID1 ICM_20948_CS MODE3 2*MHZ 4*MHZ + +# Now some defines for logging and terrain data files. +define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS" +define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN" + +# Enable RAMTROM parameter storage. +define HAL_WITH_RAMTRON 1 + +# Enable FAT filesystem support (needs a microSD defined via SDMMC). +define HAL_OS_FATFS_IO 1 + +# Control Zero has a TriColor LED, Red, Green, Blue +define HAL_HAVE_PIXRACER_LED + +define HAL_GPIO_LED_ON 0 +define HAL_GPIO_LED_OFF 1 + +# LED setup for PixracerLED driver +PB11 LED_R OUTPUT HIGH GPIO(0) +PB1 LED_G OUTPUT HIGH GPIO(1) +PB3 LED_B OUTPUT HIGH GPIO(2) + +define HAL_GPIO_A_LED_PIN 0 +define HAL_GPIO_B_LED_PIN 1 +define HAL_GPIO_C_LED_PIN 2 + +# DMA_PRIORITY SDMMC* + +# 3 IMUs +IMU BMI088 SPI:bmi088_a SPI:bmi088_g ROTATION_NONE +IMU Invensense SPI:icm20608 ROTATION_ROLL_180_YAW_90 +IMU Invensensev2 SPI:icm20948 ROTATION_ROLL_180_YAW_90 + +define HAL_DEFAULT_INS_FAST_SAMPLE 7 + +# 1 baro +BARO DPS280 SPI:dps280 + +# 1 compass +COMPASS AK09916:probe_ICM20948 0 ROTATION_ROLL_180 +define HAL_PROBE_EXTERNAL_I2C_COMPASSES diff --git a/libraries/AP_HAL_ChibiOS/hwdef/mRoPixracerPro/defaults.parm b/libraries/AP_HAL_ChibiOS/hwdef/mRoPixracerPro/defaults.parm new file mode 100644 index 0000000000..3f37627939 --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/mRoPixracerPro/defaults.parm @@ -0,0 +1,7 @@ +#Default Parameters for the mRo Pixracer Pro + +CAN_P1_DRIVER 1 +CAN_P2_DRIVER 2 +CAN_SLCAN_CPORT 1 +SERIAL6_PROTOCOL 22 + diff --git a/libraries/AP_HAL_ChibiOS/hwdef/mRoPixracerPro/hwdef-bl.dat b/libraries/AP_HAL_ChibiOS/hwdef/mRoPixracerPro/hwdef-bl.dat index 587cbf2e13..bb91ff51c9 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/mRoPixracerPro/hwdef-bl.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/mRoPixracerPro/hwdef-bl.dat @@ -1,13 +1,18 @@ ########################################################################################################################################################### # mRo Pixracer Pro Flight Controller -# STM32H753IIK6 -# 8 PWM / IO - DMA capable and switchable 3.3v (default) / 5v Logic -# Exposed JST GH Connectors: GPS UART+I2C connector, 5 Available UARTS (2 with Flow Control), 2 FDCAN, SPI, Power with analog current and voltage sense +# STM32H743IIK6 +# 8 PWM / IO - DMA capable and hardware and/or software switchable 3.3v / 5v Logic (hardware default) +# Logic level set in hardware: No Solder for 5v, Solder 1-2 for 3.3v, Solder 2-3 for 3.3v / 5v software switchable +# Exposed JST GH Connectors: GPS UART+I2C connector, 6 Available UARTS (2 with Flow Control), 2 FDCAN, SPI, I2C, Power with analog current and voltage sense # 3 IMUs (ICM20602 6DOF, ICM20948 9DOF, BMI088 6DOF) -# Baro, FRAM (256kb), SDCARD Socket, TC2030 JTAG +# Baro, FRAM (256kb), SDCARD Socket, TC2030 JTAG, USB-C # Onboard 3 color LED and buzzer -# 36mm x 36mm, 31.5mm x 31.5mm 4mm grommeted mounting holes for 3mm fasteners -# M10064B - Initial Release +# Uncased weight and dimensions: +# Weight (with headers): 11.3g (.40oz) +# Length: 36mm (1.42in) +# Width: 36mm (1.42in) +# Mounting holes: 31.5mm x 31.5mm 4mm grommeted mounting holes for 3mm fasteners +# M10064C - Initial Release ########################################################################################################################################################### # MCU class and specific type @@ -40,11 +45,7 @@ PB3 LED_ACTIVITY2 OUTPUT define HAL_LED_ON 0 # order of UARTs (and USB) -SERIAL_ORDER OTG1 UART7 - -# UART7 maps to uartF in the HAL (serial5 in SERIALn_ parameters). -PE7 UART7_RX UART7 -PE8 UART7_TX UART7 +SERIAL_ORDER OTG1 PA11 OTG_FS_DM OTG1 PA12 OTG_FS_DP OTG1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/mRoPixracerPro/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/mRoPixracerPro/hwdef.dat index deea05526c..82fae0387a 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/mRoPixracerPro/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/mRoPixracerPro/hwdef.dat @@ -1,15 +1,23 @@ ########################################################################################################################################################### # mRo Pixracer Pro Flight Controller -# STM32H753IIK6 -# 8 PWM / IO - DMA capable and switchable 3.3v (default) / 5v Logic -# Exposed JST GH Connectors: GPS UART+I2C connector, 5 Available UARTS (2 with Flow Control), 2 FDCAN, SPI, Power with analog current and voltage sense +# STM32H743IIK6 +# 8 PWM / IO - DMA capable and hardware and/or software switchable 3.3v / 5v Logic (hardware default) +# Logic level set in hardware: No Solder for 5v, Solder 1-2 for 3.3v, Solder 2-3 for 3.3v / 5v software switchable +# Exposed JST GH Connectors: GPS UART+I2C connector, 6 Available UARTS (2 with Flow Control), 2 FDCAN, SPI, I2C, Power with analog current and voltage sense # 3 IMUs (ICM20602 6DOF, ICM20948 9DOF, BMI088 6DOF) -# Baro, FRAM (256kb), SDCARD Socket, TC2030 JTAG +# Baro, FRAM (256kb), SDCARD Socket, TC2030 JTAG, USB-C # Onboard 3 color LED and buzzer -# 36mm x 36mm, 31.5mm x 31.5mm 4mm grommeted mounting holes for 3mm fasteners -# M10064B - Initial Release +# Uncased weight and dimensions: +# Weight (with headers): 11.3g (.40oz) +# Length: 36mm (1.42in) +# Width: 36mm (1.42in) +# Mounting holes: 31.5mm x 31.5mm 4mm grommeted mounting holes for 3mm fasteners +# M10064C - Initial Release ########################################################################################################################################################### +# default to all pins low to avoid ESD issues +DEFAULTGPIO OUTPUT LOW PULLDOWN + # MCU class and specific type MCU STM32H7xx STM32H743xx @@ -34,8 +42,8 @@ define HAL_WITH_RAMTRON 1 # USB setup USB_STRING_MANUFACTURER "mRo" -# RC Input set for Interrupt not DMA -PC7 TIM3_CH2 TIM3 RCININT FLOAT LOW # also USART6_RX for serial RC +# RC Input set for Interrupt also USART6_RX for serial RC +PC7 TIM3_CH2 TIM3 RCININT FLOAT LOW # Control of Spektrum power pin PE4 SPEKTRUM_PWR OUTPUT LOW GPIO(70) @@ -55,14 +63,15 @@ I2C_ORDER I2C1 define HAL_I2C_INTERNAL_MASK 0 # order of UARTs (and USB) and suggested usage -# UART4 GPS # USART2 Telem 1 (Flow Control) # USART3 Telem 2 (Flow Control) +# UART4 GPS # UART8 FRSKY Telem -# USART6 RC input (Only RX pin is connected) # USART1 Additional UART # UART7 Additional UART +# USART6 RC input (Only RX pin is connected) + SERIAL_ORDER OTG1 USART2 USART3 UART4 UART8 USART1 UART7 OTG2 # default the 2nd interface to MAVLink2 @@ -209,8 +218,10 @@ PE3 VDD_3V3_SENSORS_EN OUTPUT HIGH # 1.8V Sensor Level Shifter Output Enable. We pull it high by default. PI3 VDD_1V8_SENSORS_EN OUTPUT HIGH -# Set Output Logic Level, Default is 3.3v -PG6 nSERVO_OUTPUT_3v3 OUTPUT LOW GPIO(74) +# Pin for PWM Voltage Selection, 0 means 3.3v, 1 means 5v +PG6 PWM_VOLT_SEL OUTPUT LOW GPIO(74) +define HAL_GPIO_PWM_VOLT_PIN 74 +define HAL_GPIO_PWM_VOLT_3v3 0 # Power flag pins: these tell the MCU the status of the various power # supplies that are available. The pin names need to exactly match the @@ -219,7 +230,7 @@ PB5 VDD_BRICK_VALID INPUT PULLUP SPIDEV icm20948 SPI1 DEVID1 ICM_20948_CS MODE3 2*MHZ 4*MHZ SPIDEV icm20608 SPI1 DEVID2 ICM_20602_CS MODE3 2*MHZ 8*MHZ -SPIDEV dps310 SPI2 DEVID3 BARO_CS MODE3 5*MHZ 5*MHZ +SPIDEV dps280 SPI2 DEVID3 BARO_CS MODE3 5*MHZ 5*MHZ SPIDEV ramtron SPI2 DEVID10 FRAM_CS MODE3 8*MHZ 8*MHZ SPIDEV bmi088_g SPI5 DEVID1 BMI088_GYRO_CS MODE3 10*MHZ 10*MHZ SPIDEV bmi088_a SPI5 DEVID2 BMI088_ACCEL_CS MODE3 10*MHZ 10*MHZ @@ -256,18 +267,15 @@ define HAL_GPIO_A_LED_PIN 0 define HAL_GPIO_B_LED_PIN 1 define HAL_GPIO_C_LED_PIN 2 -# DMA_PRIORITY SDMMC* -# DMA_NOSHARE SPI1* SPI2* SPI3* - # 3 IMUs IMU BMI088 SPI:bmi088_a SPI:bmi088_g ROTATION_NONE IMU Invensense SPI:icm20608 ROTATION_ROLL_180_YAW_90 IMU Invensensev2 SPI:icm20948 ROTATION_ROLL_180_YAW_90 -define HAL_DEFAULT_INS_FAST_SAMPLE 5 +define HAL_DEFAULT_INS_FAST_SAMPLE 7 # 1 baro -BARO DPS280 SPI:dps310 +BARO DPS280 SPI:dps280 # 1 compass COMPASS AK09916:probe_ICM20948 0 ROTATION_ROLL_180