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-10-20 07:50:04 -03:00
|
|
|
# enable watchdog
|
|
|
|
define HAL_WATCHDOG_ENABLED_DEFAULT true
|
|
|
|
|
2019-07-25 18:46:28 -03:00
|
|
|
# crystal frequency
|
|
|
|
OSCILLATOR_HZ 16000000
|
|
|
|
|
|
|
|
define CH_CFG_ST_FREQUENCY 1000000
|
|
|
|
|
|
|
|
# assume 512k flash part
|
|
|
|
FLASH_SIZE_KB 512
|
|
|
|
|
|
|
|
STDOUT_SERIAL SD1
|
|
|
|
STDOUT_BAUDRATE 57600
|
|
|
|
|
|
|
|
# order of UARTs
|
2020-05-11 02:55:16 -03:00
|
|
|
SERIAL_ORDER USART1 EMPTY EMPTY USART2
|
2019-07-25 18:46:28 -03:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2020-05-11 02:55:16 -03:00
|
|
|
# only one SPI bus in normal config
|
|
|
|
PA5 SPI1_SCK SPI1
|
|
|
|
PA6 SPI1_MISO SPI1
|
|
|
|
PA7 SPI1_MOSI SPI1
|
|
|
|
|
|
|
|
# SPI CS
|
|
|
|
PA4 MAG_CS CS
|
|
|
|
PA10 MS5611_CS CS
|
|
|
|
|
|
|
|
# SPI devices
|
|
|
|
SPIDEV rm3100 SPI1 DEVID1 MAG_CS MODE0 1*MHZ 1*MHZ
|
|
|
|
SPIDEV ms5611 SPI1 DEVID2 MS5611_CS MODE3 20*MHZ 20*MHZ
|
|
|
|
|
|
|
|
# compass
|
2019-09-04 04:14:27 -03:00
|
|
|
COMPASS IST8310 I2C:0:0x0E false ROTATION_ROLL_180_YAW_90
|
2020-05-11 02:55:16 -03:00
|
|
|
COMPASS RM3100 SPI:rm3100 false ROTATION_PITCH_180
|
2019-07-26 03:57:26 -03:00
|
|
|
|
2020-05-11 02:55:16 -03:00
|
|
|
# baro
|
2019-07-26 03:57:26 -03:00
|
|
|
BARO BMP388 I2C:0:0x76
|
2020-05-11 02:55:16 -03:00
|
|
|
BARO MS56XX SPI:ms5611
|
2019-07-26 03:57:26 -03:00
|
|
|
|
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
|
|
|
|
|
2020-05-11 02:55:16 -03:00
|
|
|
# use DNA
|
|
|
|
define HAL_CAN_DEFAULT_NODE_ID 0
|
2019-07-25 18:46:28 -03:00
|
|
|
|
|
|
|
define CAN_APP_NODE_NAME "org.ardupilot.cuav_gps"
|
|
|
|
|
|
|
|
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-10-10 00:19:43 -03:00
|
|
|
define HAL_COMPASS_MAX_SENSORS 1
|
2019-07-25 18:46:28 -03:00
|
|
|
|
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
|
2019-10-18 21:28:26 -03:00
|
|
|
define AP_PERIPH_LED_BRIGHT_DEFAULT 50
|
2019-10-20 23:36:57 -03:00
|
|
|
|
|
|
|
# use the app descriptor needed by MissionPlanner for CAN upload
|
|
|
|
env APP_DESCRIPTOR MissionPlanner
|
2019-10-21 00:48:39 -03:00
|
|
|
|
|
|
|
# reserve 256 bytes for comms between app and bootloader
|
|
|
|
RAM_RESERVE_START 256
|