2019-07-25 18:46:28 -03:00
|
|
|
# hw definition file for processing by chibios_pins.py
|
|
|
|
# MCU class and specific type
|
|
|
|
|
|
|
|
# MCU class and specific type
|
|
|
|
MCU STM32F4xx STM32F412Rx
|
|
|
|
|
|
|
|
# bootloader starts firmware at 64k
|
|
|
|
FLASH_RESERVE_START_KB 64
|
|
|
|
|
|
|
|
# store parameters in pages 2 and 3
|
|
|
|
define STORAGE_FLASH_PAGE 2
|
|
|
|
define HAL_STORAGE_SIZE 8192
|
|
|
|
|
|
|
|
# board ID for firmware load
|
2019-08-04 22:33:59 -03:00
|
|
|
APJ_BOARD_ID 1001
|
2019-07-25 18:46:28 -03:00
|
|
|
|
|
|
|
# setup build for a peripheral firmware
|
|
|
|
env AP_PERIPH 1
|
|
|
|
|
2019-08-31 00:37:07 -03:00
|
|
|
STM32_ST_USE_TIMER 5
|
|
|
|
|
2019-07-25 18:46:28 -03:00
|
|
|
# crystal frequency
|
|
|
|
OSCILLATOR_HZ 16000000
|
|
|
|
|
|
|
|
STM32_HSE_ENABLED TRUE
|
|
|
|
STM32_PLLM_VALUE 16
|
|
|
|
STM32_PLLN_VALUE 384
|
|
|
|
STM32_PLLP_VALUE 4
|
|
|
|
STM32_PLLQ_VALUE 8
|
|
|
|
STM32_PLLSRC STM32_PLLSRC_HSE
|
|
|
|
STM32_PREE1 STM32_PREE1_DIV1
|
|
|
|
STM32_PREE2 STM32_PREE2_DIV1
|
|
|
|
STM32_HPRE STM32_HPRE_DIV1
|
|
|
|
STM32_PPRE1 STM32_PPRE1_DIV2
|
|
|
|
STM32_PPRE2 STM32_PPRE2_DIV2
|
|
|
|
|
|
|
|
|
|
|
|
define CH_CFG_ST_FREQUENCY 1000000
|
|
|
|
|
|
|
|
# assume 512k flash part
|
|
|
|
FLASH_SIZE_KB 512
|
|
|
|
|
|
|
|
STDOUT_SERIAL SD1
|
|
|
|
STDOUT_BAUDRATE 57600
|
|
|
|
|
|
|
|
# board voltage
|
|
|
|
STM32_VDD 330U
|
|
|
|
|
|
|
|
# order of UARTs
|
|
|
|
UART_ORDER USART1 USART2
|
|
|
|
|
|
|
|
# a LED to flash
|
|
|
|
PB12 LED OUTPUT LOW
|
|
|
|
|
|
|
|
# USART1 for debug
|
|
|
|
PB6 USART1_TX USART1 NODMA
|
|
|
|
PB7 USART1_RX USART1 NODMA
|
|
|
|
define HAL_SERIAL0_BAUD_DEFAULT 57600
|
|
|
|
|
|
|
|
# USART2 for GPS
|
|
|
|
PA2 USART2_TX USART2 NODMA
|
|
|
|
PA3 USART2_RX USART2 NODMA
|
|
|
|
|
|
|
|
# SWD debugging
|
|
|
|
PA13 JTMS-SWDIO SWD
|
|
|
|
PA14 JTCK-SWCLK SWD
|
|
|
|
|
|
|
|
# only one I2C bus in normal config
|
|
|
|
PB4 I2C3_SDA I2C3
|
|
|
|
PA8 I2C3_SCL I2C3
|
|
|
|
|
|
|
|
define HAL_USE_I2C TRUE
|
|
|
|
define STM32_I2C_USE_I2C3 TRUE
|
|
|
|
|
|
|
|
define HAL_I2C_CLEAR_ON_TIMEOUT 0
|
|
|
|
|
|
|
|
define HAL_I2C_INTERNAL_MASK 0
|
|
|
|
|
|
|
|
# only one I2C bus
|
|
|
|
I2C_ORDER I2C3
|
|
|
|
|
|
|
|
# IST compass
|
2019-09-04 04:14:27 -03:00
|
|
|
COMPASS IST8310 I2C:0:0x0E false ROTATION_ROLL_180_YAW_90
|
2019-07-26 03:57:26 -03:00
|
|
|
|
|
|
|
# BMP388 baro
|
|
|
|
BARO BMP388 I2C:0:0x76
|
|
|
|
|
2019-08-31 00:37:07 -03:00
|
|
|
# PWM output for buzzer
|
|
|
|
PB10 TIM2_CH3 TIM2 GPIO(77) LOW ALARM
|
|
|
|
|
|
|
|
# safety LED, active low
|
|
|
|
PB1 SAFE_LED OUTPUT HIGH
|
2019-08-31 01:30:28 -03:00
|
|
|
define SAFE_LED_ON 0
|
2019-08-31 00:37:07 -03:00
|
|
|
|
2019-08-31 01:48:51 -03:00
|
|
|
# safety button
|
2019-09-10 00:36:03 -03:00
|
|
|
PB3 SAFE_BUTTON INPUT PULLDOWN
|
2019-08-31 01:48:51 -03:00
|
|
|
|
2019-09-09 18:38:02 -03:00
|
|
|
# WS2812 LED
|
|
|
|
PB0 TIM3_CH3 TIM3 PWM(1)
|
|
|
|
|
2019-07-26 03:57:26 -03:00
|
|
|
define HAL_BARO_ALLOW_INIT_NO_BARO
|
2019-07-25 18:46:28 -03:00
|
|
|
|
|
|
|
define HAL_USE_ADC FALSE
|
|
|
|
define STM32_ADC_USE_ADC1 FALSE
|
|
|
|
define HAL_DISABLE_ADC_DRIVER TRUE
|
|
|
|
|
|
|
|
define HAL_NO_GPIO_IRQ
|
|
|
|
|
2019-09-09 18:38:02 -03:00
|
|
|
# avoid RCIN thread to save memory
|
2019-07-25 18:46:28 -03:00
|
|
|
define HAL_NO_RCIN_THREAD
|
|
|
|
|
|
|
|
define HAL_USE_RTC FALSE
|
|
|
|
define DISABLE_SERIAL_ESC_COMM TRUE
|
|
|
|
define NO_DATAFLASH TRUE
|
|
|
|
|
|
|
|
define DMA_RESERVE_SIZE 0
|
|
|
|
|
|
|
|
define PERIPH_FW TRUE
|
|
|
|
|
|
|
|
define HAL_DISABLE_LOOP_DELAY
|
|
|
|
|
|
|
|
# enable CAN support
|
|
|
|
PB8 CAN1_RX CAN1
|
|
|
|
PB9 CAN1_TX CAN1
|
|
|
|
PB5 GPIO_CAN1_SILENT OUTPUT PUSHPULL SPEED_LOW LOW
|
|
|
|
define HAL_USE_CAN TRUE
|
|
|
|
define STM32_CAN_USE_CAN1 TRUE
|
|
|
|
|
|
|
|
# start with a fixed node ID so the board is usable without DNA
|
|
|
|
define HAL_CAN_DEFAULT_NODE_ID 116
|
|
|
|
|
|
|
|
define CAN_APP_VERSION_MAJOR 1
|
|
|
|
define CAN_APP_VERSION_MINOR 0
|
|
|
|
define CAN_APP_NODE_NAME "org.ardupilot.cuav_gps"
|
|
|
|
|
|
|
|
define HAL_NO_ROMFS_SUPPORT
|
|
|
|
|
|
|
|
define CH_DBG_ENABLE_STACK_CHECK TRUE
|
|
|
|
|
|
|
|
define HAL_NO_GCS
|
|
|
|
define HAL_NO_LOGGING
|
|
|
|
define HAL_NO_MONITOR_THREAD
|
|
|
|
|
|
|
|
define HAL_MINIMIZE_FEATURES 0
|
|
|
|
|
|
|
|
define HAL_BUILD_AP_PERIPH
|
|
|
|
|
|
|
|
define HAL_DEVICE_THREAD_STACK 768
|
|
|
|
|
|
|
|
define AP_PARAM_MAX_EMBEDDED_PARAM 0
|
|
|
|
|
|
|
|
# disable dual GPS and GPS blending to save flash space
|
|
|
|
define GPS_MAX_RECEIVERS 1
|
|
|
|
define GPS_MAX_INSTANCES 1
|
|
|
|
|
2019-09-09 18:38:02 -03:00
|
|
|
# GPS+MAG+BARO+Buzzer+NeoPixels
|
2019-07-25 18:46:28 -03:00
|
|
|
define HAL_PERIPH_ENABLE_GPS
|
|
|
|
define HAL_PERIPH_ENABLE_MAG
|
|
|
|
define HAL_PERIPH_ENABLE_BARO
|
2019-08-31 00:37:07 -03:00
|
|
|
define HAL_PERIPH_ENABLE_BUZZER
|
2019-09-09 18:38:02 -03:00
|
|
|
define HAL_PERIPH_NEOPIXEL_COUNT 8
|
|
|
|
define HAL_PERIPH_NEOPIXEL_CHAN 0
|