hwdef: add support for PixC4-Jetson

add support for building IOMCU with F103 and 8MHz clock
This commit is contained in:
Brad Stinson 2021-12-20 08:49:48 +11:00 committed by Andrew Tridgell
parent 0b7d7017e6
commit cd39110b68
4 changed files with 516 additions and 0 deletions

View File

@ -0,0 +1,8 @@
#Default Parameters for the Horizon31 PixC4-Jetson
#Default setup for comms with companion computer
SERIAL2_PROTOCOL 2
SERIAL2_BAUD 500

View File

@ -0,0 +1,46 @@
# hw definition file for processing by chibios_hwdef.py
# for H743 bootloader
# MCU class and specific type
MCU STM32H7xx STM32H743xx
# crystal frequency
OSCILLATOR_HZ 16000000
# board ID for firmware load
APJ_BOARD_ID 1032
FLASH_SIZE_KB 2048
# bootloader is installed at zero offset
FLASH_RESERVE_START_KB 0
# the location where the bootloader will put the firmware
# the H743 has 128k sectors
FLASH_BOOTLOADER_LOAD_KB 128
PB1 LED_RED OUTPUT LOW # red
PC6 LED_ACTIVITY OUTPUT LOW # green
PC7 LED_BOOTLOADER OUTPUT LOW # blue
define HAL_LED_ON 0
# board voltage
STM32_VDD 330U
# order of UARTs (and USB)
SERIAL_ORDER OTG1 UART7
# UART7 is debug
PF6 UART7_RX UART7 NODMA
PE8 UART7_TX UART7 NODMA
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

View File

@ -0,0 +1,317 @@
# HW Definition for Horizon31 PixC4-Jetson
# The PixC4-Jetson combines an FMUv5 with an Nvidia Jetson companion computer
# STM32H743 with STM32F103 IOMCU
# Horizon31, LLC
# MCU class and specific type
MCU STM32H7xx STM32H743xx
# crystal frequency
OSCILLATOR_HZ 16000000
define HAL_CHIBIOS_ARCH_FMUV5 1
# board ID for firmware load
APJ_BOARD_ID 1032
# bootloader takes first sector
FLASH_RESERVE_START_KB 128
# board voltage
STM32_VDD 330U
# flash size
FLASH_SIZE_KB 2048
env OPTIMIZE -O2
# order of UARTs (and USB)
SERIAL_ORDER OTG1 USART2 USART3 USART1 UART4 USART6 UART7
STDOUT_SERIAL SD7
STDOUT_BAUDRATE 57600
# USB setup
USB_STRING_MANUFACTURER "Horizon31"
# default the 2nd interface to MAVLink2 until MissionPlanner updates drivers
define HAL_OTG2_PROTOCOL SerialProtocol_MAVLink2
# 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
# SPI1 - Internal IMU sensors
PG11 SPI1_SCK SPI1
PA6 SPI1_MISO SPI1
PD7 SPI1_MOSI SPI1
# SPI2 - FRAM
PI1 SPI2_SCK SPI2
PI2 SPI2_MISO SPI2
PI3 SPI2_MOSI SPI2
# SPI4 - sensors2
PE2 SPI4_SCK SPI4
PE13 SPI4_MISO SPI4
PE6 SPI4_MOSI SPI4
# SPI5 - external1 (disabled to save DMA channels)
# PF7 SPI5_SCK SPI5
# PF8 SPI5_MISO SPI5
# PF9 SPI5_MOSI SPI5
# SPI6
PG13 SPI6_SCK SPI6
PG12 SPI6_MISO SPI6
PB5 SPI6_MOSI SPI6
# sensor CS
PF10 BARO_CS CS
PF2 ICM42688_CS CS SPEED_VERYLOW
PF3 ICM20602_CS CS SPEED_VERYLOW
PG10 ICM20602_CS2 CS SPEED_VERYLOW
PF5 FRAM_CS CS SPEED_VERYLOW
PI4 EXTERNAL1_CS1 CS
PI10 EXTERNAL1_CS2 CS
# unusued CS pins
PF4 SPARE_CS CS
PF11 SPARE_CS2 CS
PH5 SPARE_CS3 CS
PI11 SPARE_CS4 CS
PI6 SPARE_CS5 CS
PI7 SPARE_CS6 CS
PI8 SPARE_CS7 CS
# I2C buses
PB8 I2C1_SCL I2C1
PB9 I2C1_SDA I2C1
PF1 I2C2_SCL I2C2
PF0 I2C2_SDA I2C2
PH7 I2C3_SCL I2C3
PH8 I2C3_SDA I2C3
PF14 I2C4_SCL I2C4
PF15 I2C4_SDA I2C4
# order of I2C buses
I2C_ORDER I2C3 I2C1 I2C2 I2C4
# enable pins
PE3 VDD_3V3_SENSORS_EN OUTPUT HIGH
# start peripheral power off, then enable after init
# this prevents a problem with radios that use RTS for
# bootloader hold
PF12 nVDD_5V_HIPOWER_EN OUTPUT HIGH
PG4 nVDD_5V_PERIPH_EN OUTPUT HIGH
PG5 VDD_5V_RC_EN OUTPUT HIGH
PG6 VDD_5V_WIFI_EN OUTPUT HIGH
PG7 VDD_3V3_SD_CARD_EN OUTPUT HIGH
# drdy pins
PB4 DRDY1_ICM42688 INPUT
PB15 DRDY3_ICM20602_2 INPUT
PC5 DRDY4_ICM20602 INPUT
#unused drdy pins
PC13 DRDY_SPARE1 INPUT
PD10 DRDY_SPARE2 INPUT
PD15 DRDY_SPARE3 INPUT
# Spektrum Power is Active High
define HAL_SPEKTRUM_PWR_ENABLED 1
# UARTs
# USART2 is telem1
PD6 USART2_RX USART2
PD5 USART2_TX USART2
PD3 USART2_CTS USART2
PD4 USART2_RTS USART2
# USART1 is GPS1
PB7 USART1_RX USART1 NODMA
PB6 USART1_TX USART1 NODMA
# USART3 is telem2
PD9 USART3_RX USART3
PD8 USART3_TX USART3
PD11 USART3_CTS USART3
PD12 USART3_RTS USART3
# UART4 GPS2
PD0 UART4_RX UART4 NODMA
PD1 UART4_TX UART4 NODMA
# USART6 is telem3
PG9 USART6_RX USART6 NODMA
# we leave PG14 as an input to prevent it acting as a pullup
# on the IOMCU SBUS input
# PG14 USART6_TX USART6 NODMA
PG15 USART6_CTS USART6
PG8 USART6_RTS USART6
# UART7 is debug
PF6 UART7_RX UART7 NODMA
PE8 UART7_TX UART7 NODMA
# UART8 is for IOMCU
PE0 UART8_RX UART8
PE1 UART8_TX UART8
# UART for IOMCU
IOMCU_UART UART8
# enable RTSCTS support
define AP_FEATURE_RTSCTS 1
# enable SBUS_OUT on IOMCU (if you have an IOMCU)
define AP_FEATURE_SBUS_OUT 1
# PWM AUX channels
PE14 TIM1_CH4 TIM1 PWM(1) GPIO(50)
PA10 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)
# we need to disable DMA on the last 2 FMU channels
# as timer 12 doesn't have a TIMn_UP DMA option
PH6 TIM12_CH1 TIM12 PWM(7) GPIO(56) NODMA
PH9 TIM12_CH2 TIM12 PWM(8) GPIO(57) NODMA
define BOARD_PWM_COUNT_DEFAULT 8
# PWM output for buzzer
PE5 TIM15_CH1 TIM15 GPIO(77) ALARM
# analog in
PA0 BATT_VOLTAGE_SENS ADC1 SCALE(1)
PA1 BATT_CURRENT_SENS ADC1 SCALE(1)
PA2 BATT2_VOLTAGE_SENS ADC1 SCALE(1)
PA3 BATT2_CURRENT_SENS ADC1 SCALE(1)
PC4 SPARE1_ADC1 ADC1 SCALE(1)
PA4 SPARE2_ADC1 ADC1 SCALE(1)
PB0 RSSI_IN ADC1 SCALE(1)
PC0 VDD_5V_SENS ADC1 SCALE(2)
PC1 SCALED_V3V3 ADC1 SCALE(2)
# setup scaling defaults
define HAL_BATT_VOLT_SCALE 18.0
define HAL_BATT_CURR_SCALE 24.0
define HAL_BATT_VOLT_PIN 0
define HAL_BATT_CURR_PIN 1
define HAL_BATT2_VOLT_PIN 2
define HAL_BATT2_CURR_PIN 3
# CAN bus
PI9 CAN1_RX CAN1
PH13 CAN1_TX CAN1
PB12 CAN2_RX CAN2
PB13 CAN2_TX CAN2
PH2 GPIO_CAN1_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(70)
PH3 GPIO_CAN2_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(71)
PH4 GPIO_CAN3_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(72)
# GPIOs
PA7 HEATER_EN OUTPUT LOW GPIO(80)
define HAL_HEATER_GPIO_PIN 80
PG1 VDD_BRICK_VALID INPUT PULLUP
PG2 VDD_BRICK2_VALID INPUT PULLUP
PG3 nVBUS INPUT PULLDOWN
PA9 VBUS INPUT
PF13 VDD_5V_HIPOWER_OC INPUT PULLUP
PE15 VDD_5V_PERIPH_OC INPUT PULLUP
# capture pins
PA5 FMU_CAP1 INPUT GPIO(58)
PB3 FMU_CAP2 INPUT GPIO(59)
PB11 FMU_CAP3 INPUT GPIO(60)
PI0 FMU_SPARE_4 INPUT GPIO(61)
# SPI devices
SPIDEV ms5611 SPI4 DEVID5 BARO_CS MODE3 5*MHZ 5*MHZ
SPIDEV icm42688 SPI1 DEVID3 ICM42688_CS MODE3 2*MHZ 8*MHZ
SPIDEV icm20602 SPI1 DEVID1 ICM20602_CS MODE3 2*MHZ 8*MHZ
SPIDEV icm20602_2 SPI1 DEVID2 ICM20602_CS2 MODE3 2*MHZ 8*MHZ
SPIDEV ramtron SPI2 DEVID1 FRAM_CS MODE3 8*MHZ 8*MHZ
# 3 IMUs
IMU Invensensev3 SPI:icm42688 ROTATION_PITCH_180
IMU Invensense SPI:icm20602 ROTATION_YAW_90
IMU Invensense SPI:icm20602_2 ROTATION_YAW_90
define HAL_DEFAULT_INS_FAST_SAMPLE 7
# probe external I2C compasses plus some internal IST8310
# we also probe some external IST8310 with a non-standard orientation
define HAL_PROBE_EXTERNAL_I2C_COMPASSES
COMPASS RM3100 I2C:0:0x20 false ROTATION_NONE
# baro
BARO MS56XX SPI:ms5611
# microSD support
PC8 SDMMC1_D0 SDMMC1
PC9 SDMMC1_D1 SDMMC1
PC10 SDMMC1_D2 SDMMC1
PC11 SDMMC1_D3 SDMMC1
PC12 SDMMC1_CK SDMMC1
PD2 SDMMC1_CMD SDMMC1
# red LED marked as B/E
PB1 LED_RED OUTPUT OPENDRAIN GPIO(90)
# green LED of FMU RGB LED
PC6 LED_GREEN OUTPUT GPIO(91) LOW
# blue LED of FMU RGB LED
PC7 LED_BLUE OUTPUT GPIO(92) HIGH
# setup for Board LEDs
define HAL_GPIO_A_LED_PIN 90
define HAL_GPIO_B_LED_PIN 92
define HAL_GPIO_LED_ON 0
# enable RAMTROM parameter storage
define HAL_STORAGE_SIZE 32768
define HAL_WITH_RAMTRON 1
# allow to have have a dedicated safety switch pin
define HAL_HAVE_SAFETY_SWITCH 1
#define HAL_COMPASS_DEFAULT HAL_COMPASS_NONE
define HAL_COMPASS_AUTO_ROT_DEFAULT 2
# don't share IOMCU DMA
DMA_NOSHARE UART8* SPI1* TIM*UP*
DMA_PRIORITY SDMMC* UART8* ADC* SPI1* TIM*
# enable FAT filesystem support (needs a microSD defined via SDMMC)
define HAL_OS_FATFS_IO 1
define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
ROMFS io_firmware.bin Tools/IO_Firmware/iofirmware_f103_8MHz_lowpolh.bin

View File

@ -0,0 +1,145 @@
# hw definition file for processing by chibios_pins.py
# MCU class and specific type
MCU STM32F103 STM32F103xB
FLASH_RESERVE_START_KB 4
# board ID for firmware load
APJ_BOARD_ID 3
# crystal frequency
OSCILLATOR_HZ 8000000
define CH_CFG_ST_FREQUENCY 1000
FLASH_SIZE_KB 128
# ChibiOS system timer
# order of UARTs
SERIAL_ORDER EMPTY EMPTY EMPTY EMPTY
define HAL_USE_UART TRUE
# UART connected to FMU, uses DMA
PA2 USART2_TX USART2 SPEED_HIGH
PA3 USART2_RX USART2 SPEED_HIGH
define STM32_UART_USE_USART1 FALSE
define STM32_UART_USE_USART2 TRUE
define STM32_UART_USE_USART3 FALSE
# UART for SBUS out, and RC in, no DMA
define HAL_USE_SERIAL TRUE
PB4 SBUS_OUT_EN OUTPUT LOW GPIO(1)
PB10 USART3_TX USART3 SPEED_HIGH LOW
PB11 USART3_RX USART3
define STM32_SERIAL_USE_USART1 TRUE
define STM32_SERIAL_USE_USART2 FALSE
define STM32_SERIAL_USE_USART3 TRUE
PA0 TIM2_CH1 TIM2 PWM(1) GPIO(101)
PA1 TIM2_CH2 TIM2 PWM(2) GPIO(102)
PB8 TIM4_CH3 TIM4 PWM(3) GPIO(103)
PB9 TIM4_CH4 TIM4 PWM(4) GPIO(104)
PA6 TIM3_CH1 TIM3 PWM(5) GPIO(105)
PA7 TIM3_CH2 TIM3 PWM(6) GPIO(106)
PB0 TIM3_CH3 TIM3 PWM(7) GPIO(107)
PB1 TIM3_CH4 TIM3 PWM(8) GPIO(108)
# pins for detecting board type. On a pixhawk2 PC14 is pulled high,
# PC15 is pulled low. On a Pixhawk1 they are both floating
PC14 IO_HW_DETECT1 INPUT PULLDOWN
PC15 IO_HW_DETECT2 INPUT PULLUP
PB14 HEATER INPUT PULLUP GPIO(0)
# safety button and LED. These do not use the same names
# as those for FMU-only boards as we want to handle them specially
# inside the iofirmware
PB5 SAFETY_INPUT INPUT PULLDOWN
PB13 SAFETY_LED OUTPUT HIGH OPENDRAIN
# amber LED
PB15 AMBER_LED OUTPUT LOW OPENDRAIN
# green ring LED on cube
PA11 RING_LED OUTPUT LOW OPENDRAIN
# UART for DSM input
# TX side is for IO debug, and is unused
PA9 USART1_TX USART1 SPEED_HIGH
PA10 USART1_RX USART1 SPEED_HIGH
PC13 SPEKTRUM_PWR_EN OUTPUT LOW
define HAL_GPIO_PIN_SPEKTRUM_OUT PAL_LINE(GPIOA,10U)
PA8 RCIN INPUT SPEED_HIGH PULLDOWN # RC Input PPM
# analog inputs
PA4 VSERVO ADC1
PA5 VRSSI ADC1
define HAL_ADC_VSERVO_CHAN ADC_CHANNEL_IN4
define HAL_ADC_VRSSI_CHAN ADC_CHANNEL_IN5
define HAL_USE_ADC TRUE
define STM32_ADC_USE_ADC1 TRUE
define HAL_DISABLE_ADC_DRIVER TRUE
#Manually define ICU settings
define HAL_USE_ICU TRUE
define STM32_ICU_USE_TIM1 TRUE
define RCIN_ICU_TIMER ICUD1
define RCIN_ICU_CHANNEL ICU_CHANNEL_1
define STM32_RCIN_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
# only use pulse input for PPM, other protocols
# are on serial
define HAL_RCIN_PULSE_PPM_ONLY
#DMA Channel Not relevant for F1 series
define STM32_RCIN_DMA_CHANNEL 0
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 16384
define HAL_COMPASS_DEFAULT HAL_COMPASS_NONE
define HAL_INS_DEFAULT HAL_INS_NONE
define HAL_BARO_DEFAULT HAL_BARO_NONE
define HAL_NO_GPIO_IRQ
define CH_CFG_ST_TIMEDELTA 0
#define CH_CFG_USE_DYNAMIC FALSE
define SERIAL_BUFFERS_SIZE 32
define HAL_USE_EMPTY_IO TRUE
define PORT_INT_REQUIRED_STACK 64
# avoid timer and RCIN threads to save memory
define HAL_NO_TIMER_THREAD
define HAL_NO_RCIN_THREAD
define HAL_NO_MONITOR_THREAD
define HAL_NO_RCOUT_THREAD
define HAL_NO_SHARED_DMA
#defined to turn off undef warnings
define __FPU_PRESENT 0
define HAL_USE_RTC FALSE
define HAL_NO_FLASH_SUPPORT TRUE
define HAL_NO_UARTDRIVER TRUE
define DISABLE_SERIAL_ESC_COMM TRUE
define HAL_LOGGING_ENABLED 0
define DMA_RESERVE_SIZE 0
# reduce memory usage in RCInput
define SOFTSIG_MAX_SIGNAL_TRANSITIONS 128
define IOMCU_FW TRUE
define NO_FASTBOOT
IOMCU_FW 1
MAIN_STACK 0x200
PROCESS_STACK 0x250
define HAL_DISABLE_LOOP_DELAY
define HAL_WITH_DSP FALSE