c273b23940
this moves the key MCU config variables related to memory to the python MCU database, allowing the hwdef.dat to be considerably simpler
165 lines
3.5 KiB
Plaintext
165 lines
3.5 KiB
Plaintext
# hw definition file for MatekF405 hardware
|
|
# tested on the MatekF405-OSD board
|
|
# with thanks to betaflight for pinout
|
|
|
|
# STATUS:
|
|
# This port is mostly complete. Main missing feature are OSD,
|
|
# dataflash
|
|
|
|
# MCU class and specific type
|
|
MCU STM32F4xx STM32F405xx
|
|
|
|
define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_MATEKF405
|
|
|
|
# board ID for firmware load
|
|
APJ_BOARD_ID 70
|
|
|
|
# crystal frequency
|
|
OSCILLATOR_HZ 8000000
|
|
STM32_PLLM_VALUE 8
|
|
|
|
define STM32_ST_USE_TIMER 4
|
|
define CH_CFG_ST_RESOLUTION 16
|
|
|
|
FLASH_SIZE_KB 1024
|
|
|
|
# board voltage
|
|
STM32_VDD 330U
|
|
|
|
# only one I2C bus
|
|
I2C_ORDER I2C1
|
|
|
|
# order of UARTs (and USB)
|
|
UART_ORDER OTG1 USART1 USART3 UART4 UART5
|
|
|
|
# LEDs
|
|
PB9 LED_BLUE OUTPUT LOW GPIO(0)
|
|
PA14 LED_GREEN OUTPUT LOW GPIO(1)
|
|
|
|
define HAL_GPIO_A_LED_PIN 0
|
|
define HAL_GPIO_B_LED_PIN 1
|
|
|
|
# buzzer
|
|
PC13 BUZZER OUTPUT GPIO(80) LOW
|
|
define HAL_BUZZER_PIN 80
|
|
define HAL_BUZZER_ON 1
|
|
define HAL_BUZZER_OFF 0
|
|
|
|
# spi1 bus for IMU
|
|
PA5 SPI1_SCK SPI1
|
|
PA6 SPI1_MISO SPI1
|
|
PA7 SPI1_MOSI SPI1
|
|
|
|
# spi2 for OSD
|
|
PB13 SPI2_SCK SPI2
|
|
PB14 SPI2_MISO SPI2
|
|
PB15 SPI2_MOSI SPI2
|
|
PB10 MAX7456_CS CS
|
|
|
|
# spi3 for sdcard and onboard flash
|
|
PB3 SPI3_SCK SPI3
|
|
PB4 SPI3_MISO SPI3
|
|
PB5 SPI3_MOSI SPI3
|
|
PC1 SDCARD_CS CS
|
|
PC0 M25P16_CS CS
|
|
|
|
PC2 MPU6000_CS CS
|
|
|
|
# only one I2C bus in normal config
|
|
PB6 I2C1_SCL I2C1
|
|
PB7 I2C1_SDA I2C1
|
|
|
|
# analog pins
|
|
PC5 BATT_VOLTAGE_SENS ADC1 SCALE(1)
|
|
PC4 BATT_CURRENT_SENS ADC1 SCALE(1)
|
|
PB1 RSSI_ADC_PIN ADC1 SCALE(1)
|
|
|
|
# define default battery setup
|
|
define HAL_BATT_VOLT_PIN 13
|
|
define HAL_BATT_CURR_PIN 12
|
|
define HAL_BATT_VOLT_SCALE 10.1
|
|
define HAL_BATT_CURR_SCALE 17.0
|
|
|
|
# USART1
|
|
PA9 USART1_TX USART1
|
|
PA10 USART1_RX USART1
|
|
|
|
# USART2 (RCIN)
|
|
#PA2 USART3_TX USART3
|
|
#PA3 USART3_RX USART3
|
|
|
|
# rcinput
|
|
PA3 TIM9_CH2 TIM2 RCININT FLOAT LOW
|
|
|
|
# USART3
|
|
PC10 USART3_TX USART3
|
|
PC11 USART3_RX USART3
|
|
|
|
# UART4
|
|
PA0 UART4_TX UART4
|
|
PA1 UART4_RX UART4
|
|
|
|
# UART5
|
|
PD2 UART5_RX UART5
|
|
PC12 UART5_TX UART5
|
|
|
|
# PA10 IO-debug-console
|
|
PA11 OTG_FS_DM OTG1
|
|
PA12 OTG_FS_DP OTG1
|
|
|
|
# USB detection
|
|
PB12 VBUS INPUT OPENDRAIN
|
|
|
|
# debug (disabled out to allow for both LEDs)
|
|
#PA13 JTMS-SWDIO SWD
|
|
#PA14 JTCK-SWCLK SWD
|
|
|
|
# PWM out pins. Note that channel order follows the ArduPilot motor
|
|
# order conventions
|
|
PC6 TIM3_CH1 TIM3 PWM(1) GPIO(50)
|
|
PC7 TIM8_CH2 TIM8 PWM(2) GPIO(51)
|
|
PC8 TIM8_CH3 TIM8 PWM(3) GPIO(52)
|
|
PC9 TIM8_CH4 TIM8 PWM(4) GPIO(53)
|
|
PA15 TIM2_CH1 TIM2 PWM(5) GPIO(54)
|
|
PA8 TIM1_CH1 TIM1 PWM(6) GPIO(55)
|
|
|
|
define HAL_STORAGE_SIZE 8192
|
|
define STORAGE_FLASH_PAGE 1
|
|
|
|
# reserve 16k for bootloader, 16k for OSD and 32k for flash storage
|
|
FLASH_RESERVE_START_KB 64
|
|
|
|
define HAL_INS_DEFAULT HAL_INS_MPU60XX_SPI
|
|
define HAL_INS_DEFAULT_ROTATION ROTATION_YAW_180
|
|
|
|
# there is no compass fitted by default
|
|
define ALLOW_ARM_NO_COMPASS
|
|
|
|
define HAL_COMPASS_DEFAULT HAL_COMPASS_HMC5843
|
|
define HAL_COMPASS_HMC5843_I2C_BUS 0
|
|
define HAL_COMPASS_HMC5843_I2C_ADDR 0x1E
|
|
define HAL_COMPASS_HMC5843_ROTATION ROTATION_YAW_90
|
|
|
|
define HAL_BARO_DEFAULT HAL_BARO_BMP280_I2C
|
|
define HAL_BARO_BMP280_BUS 0
|
|
define HAL_BARO_BMP280_I2C_ADDR 0x76
|
|
|
|
# SPI devices
|
|
SPIDEV mpu6000 SPI1 DEVID1 MPU6000_CS MODE3 1*MHZ 8*MHZ
|
|
SPIDEV sdcard SPI3 DEVID1 SDCARD_CS MODE0 400*KHZ 25*MHZ
|
|
|
|
# filesystem setup on sdcard
|
|
define HAL_OS_FATFS_IO 1
|
|
define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
|
|
define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
|
|
|
|
# 8 PWM available by default
|
|
define BOARD_PWM_COUNT_DEFAULT 8
|
|
|
|
# uncomment the lines below to enable strict API
|
|
# checking in ChibiOS
|
|
#define CH_DBG_ENABLE_ASSERTS TRUE
|
|
#define CH_DBG_ENABLE_CHECKS TRUE
|
|
#define CH_DBG_SYSTEM_STATE_CHECK TRUE
|
|
#define CH_DBG_ENABLE_STACK_CHECK TRUE
|