AP_HAL_ChibiOS: CB Unmanned Stamp H743

This commit is contained in:
Andy Piper 2024-02-12 21:52:45 +00:00 committed by Andrew Tridgell
parent b7330c3238
commit 75978f9d6f
5 changed files with 464 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 MiB

View File

@ -0,0 +1,139 @@
# CBUnmanned H743 Stamp
The [CBUnmanned H743 Stamp](https://cbunmanned.com/store) is a flight controller loosely based on the FMUv6 standards & is designed for low volume OEMs as a drop in way to add ArduPilot to their custom hardware builds. It is a part of CBUnmanned's wider ["Stamp" Eco-System](https://wiki.cbunmanned.com/wiki/cbunmanned-stamp-eco-system), which brings together all the typical avionics hardware into a neat custom carrier PCB. Mounting footprints and symbols are available along with examples of basic usage on the [Wiki](https://wiki.cbunmanned.com/wiki/cbunmanned-stamp-eco-system/h743-flight-controller).
![H743StampFront&Back](H743StampFront&Back.png "H743FB")
## Features
- Class leading H7 SOC.
- Triple IMU sensors for extra redundancy.
- Based on the FMU-V6 standards.
- Micro SD Card for Logging/LUA Scripting.
- Direct solder mounting or optional 1.27mm header.
- x1 Ethernet and x2 CAN for easy integration with the next generation of UAV accessories.
- All complicated/supporting circuitry is on-board, just power with 5v.
- Just 22mm x 24.25mm & 1.9g.
## Specifications
- Processor
- STM32H743IIK6 microcontroller
- 480MHz
- 2Mb Flash
- 1Mb RAM
- Sensors
- x2 Ivensense ICM-42688 IMU
- x1 Ivensense ICM-42670 IMU
- x1 Infineon DPS310 Barometer
- x1 Bosch BMM150 Magnetometer
- Power
- 5v Main Power in
- x6 Independent Power Regulators
- x2 ADC Inputs for Voltage and Current Sense
- Interfaces
- x1 MicroSD card slot
- x8 UARTs inc RC, x3 with flow control
- x10 PWM outputs
- x2 I2C
- x2 CAN
- x1 External SPI
- x1 Ethernet
- External Buzzer
- External Safety Switch
- External USB connectors
## Pinout
![H743 Stamp Pinout](H743Pinout.png "H743")
### UART Mapping (Yellow Fade)
Ardupilot -> STM32
- SERIAL0 -> USB
- SERIAL1 -> USART1
- SERIAL2 -> USART2 (With RTS/CTS, DMA-enabled)
- SERIAL3 -> USART3 (GPS1, DMA-enabled)
- SERIAL4 -> UART4 (GPS2, DMA-enabled)
- SERIAL5 -> UART5 (With RTS/CTS, DMA-enabled)
- SERIAL6 -> USART6 (RCIN / IO coprocessor if fitted, DMA-enabled)
- SERIAL7 -> UART7 (With RTS/CTS, DMA-enabled)
- SERIAL8 -> UART8
Serial 2, 5 & 7 have RTS/CTS pins, the other UARTs do not have RTS/CTS.
GPS 1 & 2 are on Serial 3 & 4 respectively.
### RC Input
RC input is configured on the USART 6 Rx Pin. This pin allows all RC protocols compatible with direct connection to a H7 IC (SBus requires setting the bitmask for hardware inversion, CRSF etc), PPM is NOT supported.
USART 6 Tx is available for use with bi directional protocols.
An optional IOMCU can be connected to this serial port, a compatible custom build of the firmware required.
### CAN Ports (Light Green Fade)
2 CAN buses are available, each with a built in 120 ohm termination resistor.
### I2C (Maroon Fade)
I2C 1 - Internal for BMM150 Compass.
I2C 2 - Internal for DPS310 Barometer.
I2C 3 - External With internal 2.2k Pull Up.
I2C 4 - External With internal 2.2k Pull Up.
### SPI (Cyan Fade)
SPI 4 is available for use with external sensors alongside a Chip Select and Data Ready pin, compatible custom build of the firmware required.
### PWM Output (Blue Fade)
The Stamp supports up to 10 PWM outputs with D-Shot.
The PWM outputs are in 3 groups:
- PWM 1 - 4 in group 1 (Timer 5)
- PWM 5 - 8 in group 2 (Timer 4)
- PWM 9 & 10 in group 3 (Timer 2)
Channels within the same group need to use the same output rate. If any channel in a group uses D-Shot then all channels in the group need to use D-Shot.
BiDirectional DShot available on the first 8 outputs.
A buzzer alarm signal is available on Timer 14.
### Analog Inputs (Purple Fade)
The board has two ADC input channels for Voltage (0-3.3v) and Current (0-3.3v) measurement. Settings are dependent on the external hardware used.
### Ethernet (Green Fade)
Ethernet is available on 4 output pads and has internal magnetics supporting direct connection to external equipment, no need for a large RJ45 connector.
### Compass
The H743 Stamp has a built in compass, the BMM150. Due to potential interference the board is usually used with an external I2C or CAN compass as part of a GPS/Compass combination.
### USB
USB Signals D+ & D- are available to route to a suitable connector for your project.
### Safety Button
Optional, if it is not fitted remove the check from arming mask. To activate short this pad to 3.3v with a momentary push button (Press & Hold).
### Power
A regulated 3.3v output is available from the stamp for use with the safety button. WARNING! This is shared with the main IC - Do NOT use for accessories. Keep current draw under 0.1A!
The Stamp requires a stable 5v supply input of at least 1.5A. This directly powers the 5v components and supplies the 3.3v LDOs with power. Typical idle usage is 0.35A @ 5v.
## 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.
Firmware Taget = CBU-H7-Stamp
A built in button can be used to activate DFU Mode by being pressed during power up. The DFU Activate pin is broken out to allow remote mounting of this button if required.

View File

@ -0,0 +1,93 @@
# hw definition file for processing by chibios_hwdef.py
# for the CBUnmanned H743 Stamp hardware
# default to all pins low to avoid ESD issues
#DEFAULTGPIO OUTPUT LOW PULLDOWN
# MCU class and specific type
MCU STM32H7xx STM32H743xx
# crystal frequency
OSCILLATOR_HZ 16000000
# board ID for firmware load
APJ_BOARD_ID AP_HW_CBU_StampH743
# 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
# flash size
FLASH_SIZE_KB 2048
env OPTIMIZE -Os
# order of UARTs (and USB)
SERIAL_ORDER OTG1 UART1 UART2
# USB
PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1
PA9 VBUS INPUT OPENDRAIN
# pins for SWD debugging
PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD
# CS pins
PI9 IMU1_CS CS
PH5 IMU2_CS CS
PI4 IMU3_CS CS
PE4 SP4_CS1 CS
PA3 USART2_RX USART2
PD5 USART2_TX USART2
PB6 USART1_TX USART1
PB7 USART1_RX USART1
PE3 LED_ACTIVITY OUTPUT HIGH
define HAL_LED_ON 1
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 16384
# enable DFU by default
ENABLE_DFU_BOOT 1
# support flashing from SD card:
# power enable pins
PC13 VDD_3V3_SD_CARD_EN OUTPUT HIGH
PI11 IMU1_PWR_EN OUTPUT HIGH
PF4 IMU2_PWR_EN OUTPUT HIGH
PE7 IMU3_PWR_EN OUTPUT HIGH
PG8 MAG_PWR_EN OUTPUT HIGH
PG15 Ethernet_PWR_EN OUTPUT HIGH
# FATFS support:
define CH_CFG_USE_MEMCORE 1
define CH_CFG_USE_HEAP 1
define CH_CFG_USE_SEMAPHORES 0
define CH_CFG_USE_MUTEXES 1
define CH_CFG_USE_DYNAMIC 1
define CH_CFG_USE_WAITEXIT 1
define CH_CFG_USE_REGISTRY 1
# microSD support
PD6 SDMMC2_CK SDMMC2
PD7 SDMMC2_CMD SDMMC2
PB14 SDMMC2_D0 SDMMC2
PB15 SDMMC2_D1 SDMMC2
PG11 SDMMC2_D2 SDMMC2
PB4 SDMMC2_D3 SDMMC2
define FATFS_HAL_DEVICE SDCD2
DMA_PRIORITY SDMMC* ADC* UART* USART* SPI* TIM*
# enable FAT filesystem support (needs a microSD defined via SDMMC)
define HAL_OS_FATFS_IO 1
define AP_BOOTLOADER_FLASH_FROM_SD_ENABLED 1

View File

@ -0,0 +1,232 @@
# hw definition file for processing by chibios_hwdef.py
# for the CBUnmanned H743 Stamp hardware
# default to all pins low to avoid ESD issues
#DEFAULTGPIO OUTPUT LOW PULLDOWN
# MCU class and specific type
MCU STM32H7xx STM32H743xx
# crystal frequency
OSCILLATOR_HZ 16000000
# ChibiOS system timer
STM32_ST_USE_TIMER 12
define CH_CFG_ST_RESOLUTION 16
MCU_CLOCKRATE_MHZ 480
# board ID for firmware load
APJ_BOARD_ID AP_HW_CBU_StampH743
FLASH_RESERVE_START_KB 128
# flash size
FLASH_SIZE_KB 2048
env OPTIMIZE -Os
# order of UARTs (and USB)
SERIAL_ORDER OTG1 USART1 USART2 USART3 UART4 UART5 USART6 UART7 UART8 OTG2
# USB
PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1
PA9 VBUS INPUT OPENDRAIN
# pins for SWD debugging
PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD
PB6 USART1_TX USART1 NODMA
PB7 USART1_RX USART1 NODMA
PA3 USART2_RX USART2
PD5 USART2_TX USART2
PD3 USART2_CTS USART2
PD4 USART2_RTS USART2
# GPS 1
PD8 USART3_TX USART3
PD9 USART3_RX USART3
# GPS 2
PH13 UART4_TX UART4
PH14 UART4_RX UART4
PC8 UART5_RTS UART5
PC9 UART5_CTS UART5
PC12 UART5_TX UART5
PD2 UART5_RX UART5
# RCIN
PC6 USART6_TX USART6
PC7 USART6_RX USART6
define DEFAULT_SERIAL6_PROTOCOL SerialProtocol_RCIN
define DEFAULT_SERIAL6_BAUD 115
PE8 UART7_TX UART7
PF6 UART7_RX UART7
PF8 UART7_RTS UART7
PE10 UART7_CTS UART7
PE1 UART8_TX UART8 NODMA
PE0 UART8_RX UART8 NODMA
PC1 ETH_MDC ETH1
PA2 ETH_MDIO ETH1
PC4 ETH_RMII_RXD0 ETH1
PC5 ETH_RMII_RXD1 ETH1
PG13 ETH_RMII_TXD0 ETH1
PG12 ETH_RMII_TXD1 ETH1
PB11 ETH_RMII_TX_EN ETH1
PA7 ETH_RMII_CRS_DV ETH1
PA1 ETH_RMII_REF_CLK ETH1
# PHY DP83825IRMQR
define BOARD_PHY_ID MII_DP83825I_ID
define BOARD_PHY_RMII
# ADC
PA0 BATT_CURRENT_SENS ADC1 SCALE(1) # Current
PA4 BATT_VOLTAGE_SENS ADC1 SCALE(1) # Voltage
PB1 SPARE_SENS ADC1 SCALE(1) # Spare
# define default battery setup
define HAL_BATT_MONITOR_DEFAULT 4
define HAL_BATT_VOLT_PIN 18
define HAL_BATT_CURR_PIN 16
define HAL_BATT_VOLT_SCALE 11.1
define HAL_BATT_CURR_SCALE 64
# IMU1 ICM-42760-P
PI9 IMU1_CS CS
PF2 IMU1_DRDY INPUT
# IMU2 ICM-42688-P
PH5 IMU2_CS CS
PA10 IMU2_DRDY INPUT
# IMU3 ICM-42688-P
PI4 IMU3_CS CS
PI6 IMU3_DRDY INPUT
# SPI4 - External
PE2 SPI4_SCK SPI4
PE5 SPI4_MISO SPI4
PE6 SPI4_MOSI SPI4
PI7 SP4_DRDY INPUT
PE4 SP4_CS1 CS
# SPI6 - IMUs
PA5 SPI6_SCK SPI6
PA6 SPI6_MISO SPI6
PG14 SPI6_MOSI SPI6
# PWM output pins
PH10 TIM5_CH1 TIM5 PWM(1) GPIO(50) BIDIR
PH11 TIM5_CH2 TIM5 PWM(2) GPIO(51)
PH12 TIM5_CH3 TIM5 PWM(3) GPIO(52) BIDIR
PI0 TIM5_CH4 TIM5 PWM(4) GPIO(53)
PD12 TIM4_CH1 TIM4 PWM(5) GPIO(54) BIDIR
PD13 TIM4_CH2 TIM4 PWM(6) GPIO(55)
PD14 TIM4_CH3 TIM4 PWM(7) GPIO(56) BIDIR
PD15 TIM4_CH4 TIM4 PWM(8) GPIO(57)
PA15 TIM2_CH1 TIM2 PWM(9) GPIO(58)
PB3 TIM2_CH2 TIM2 PWM(10) GPIO(59)
PF9 TIM14_CH1 TIM14 GPIO(61) ALARM
# CAN bus
PD0 CAN1_RX CAN1
PD1 CAN1_TX CAN1
PB12 CAN2_RX CAN2
PB13 CAN2_TX CAN2
# I2C buses
# I2C1 - BMM150
PB9 I2C1_SDA I2C1
PB8 I2C1_SCL I2C1
# I2C2 - DPS310
PF1 I2C2_SCL I2C2
PF0 I2C2_SDA I2C2
# I2C3 - GPS1 external compass
PA8 I2C3_SCL I2C3
PH8 I2C3_SDA I2C3
# I2C4 - GPS2 external compass
PF14 I2C4_SCL I2C4
PF15 I2C4_SDA I2C4
# order of I2C buses
I2C_ORDER I2C1 I2C2 I2C3 I2C4
define HAL_I2C_INTERNAL_MASK 3
# power enable pins
PI11 IMU1_PWR_EN OUTPUT HIGH
PF4 IMU2_PWR_EN OUTPUT HIGH
PE7 IMU3_PWR_EN OUTPUT HIGH
PG8 MAG_PWR_EN OUTPUT HIGH
PC13 SD_PWR_EN OUTPUT HIGH
PG15 Ethernet_PWR_EN OUTPUT HIGH
# microSD support
PD6 SDMMC2_CK SDMMC2
PD7 SDMMC2_CMD SDMMC2
PB14 SDMMC2_D0 SDMMC2
PB15 SDMMC2_D1 SDMMC2
PG11 SDMMC2_D2 SDMMC2
PB4 SDMMC2_D3 SDMMC2
define FATFS_HAL_DEVICE SDCD2
# safety
PF5 SAFETY_IN INPUT PULLDOWN
# LED
PE3 LED_RED OUTPUT HIGH GPIO(90)
define HAL_GPIO_A_LED_PIN 90
define HAL_GPIO_LED_ON 1
# barometers
BARO DPS310 I2C:1:0x77
# compass
COMPASS BMM150 I2C:0:0x10 false ROTATION_YAW_180
define HAL_PROBE_EXTERNAL_I2C_COMPASSES
# IMUs
SPIDEV icm42688 SPI6 DEVID1 IMU2_CS MODE3 2*MHZ 16*MHZ
SPIDEV icm42688_2 SPI6 DEVID2 IMU3_CS MODE3 2*MHZ 16*MHZ
SPIDEV icm42670 SPI6 DEVID3 IMU1_CS MODE3 2*MHZ 8*MHZ
IMU Invensensev3 SPI:icm42688 ROTATION_PITCH_180
IMU Invensensev3 SPI:icm42688_2 ROTATION_ROLL_180
IMU Invensensev3 SPI:icm42670 ROTATION_PITCH_180_YAW_90
define HAL_DEFAULT_INS_FAST_SAMPLE 7
# use last 2 pages for flash storage
# H743 has 16 pages of 128k each
define HAL_STORAGE_SIZE 32768
STORAGE_FLASH_PAGE 14
DMA_PRIORITY SDMMC* TIM* SPI6*
DMA_NOSHARE TIM2* TIM4* TIM5*
# enable FAT filesystem support (needs a microSD defined via SDMMC)
define HAL_OS_FATFS_IO 1
# enable DFU reboot for installing bootloader
# note that if firmware is build with --secure-bl then DFU is
# disabled
ENABLE_DFU_BOOT 1
# build ABIN for flash-from-bootloader support:
env BUILD_ABIN True
# ethernet consumes a big chunk of flash
define AP_BATTERY_SCRIPTING_ENABLED 1