AP_HAL_ChibiOS: Sierra-F405 support
This commit is contained in:
parent
eb8cfea507
commit
3ff9b76b08
6
libraries/AP_HAL_ChibiOS/hwdef/Sierra-F405/defaults.parm
Normal file
6
libraries/AP_HAL_ChibiOS/hwdef/Sierra-F405/defaults.parm
Normal file
@ -0,0 +1,6 @@
|
||||
# setup for Neopixel
|
||||
OUT3_FUNCTION 120
|
||||
OUT4_FUNCTION 121
|
||||
NTF_LED_TYPES 455
|
||||
NTF_LED_BRIGHT 2
|
||||
NTF_LED_LEN 8
|
90
libraries/AP_HAL_ChibiOS/hwdef/Sierra-F405/hwdef-bl.dat
Normal file
90
libraries/AP_HAL_ChibiOS/hwdef/Sierra-F405/hwdef-bl.dat
Normal file
@ -0,0 +1,90 @@
|
||||
# hw definition for Sierra-F405 node
|
||||
|
||||
# Sierra-M9N Bootloader
|
||||
|
||||
# MCU class and specific type
|
||||
MCU STM32F4xx STM32F405xx
|
||||
|
||||
# crystal frequency
|
||||
OSCILLATOR_HZ 16000000
|
||||
|
||||
# hw definition file for processing by chibios_pins.py
|
||||
|
||||
FLASH_RESERVE_START_KB 0
|
||||
# two sectors for bootloader, two for storage
|
||||
FLASH_BOOTLOADER_LOAD_KB 64
|
||||
|
||||
# board ID for firmware load
|
||||
APJ_BOARD_ID 1052
|
||||
|
||||
# setup build for a peripheral firmware
|
||||
env AP_PERIPH 1
|
||||
|
||||
# crystal frequency
|
||||
OSCILLATOR_HZ 16000000
|
||||
|
||||
define CH_CFG_ST_FREQUENCY 1000000
|
||||
|
||||
# Flash available
|
||||
FLASH_SIZE_KB 1024
|
||||
|
||||
# Enable the sensor voltage pin
|
||||
PC13 VDD_3V3_SENSORS_EN OUTPUT HIGH
|
||||
|
||||
# order of UARTs
|
||||
SERIAL_ORDER
|
||||
|
||||
# USART1
|
||||
PA9 USART1_TX USART1
|
||||
PA10 USART1_RX USART1
|
||||
|
||||
# USART2
|
||||
PA2 USART2_TX USART2
|
||||
PA3 USART2_RX USART2
|
||||
|
||||
# SWD debugging
|
||||
PA13 JTMS-SWDIO SWD
|
||||
PA14 JTCK-SWCLK SWD
|
||||
|
||||
# enable CAN support
|
||||
PA11 CAN1_RX CAN1
|
||||
PA12 CAN1_TX CAN1
|
||||
|
||||
define HAL_USE_CAN TRUE
|
||||
define STM32_CAN_USE_CAN1 TRUE
|
||||
|
||||
define CAN_APP_NODE_NAME "org.ardupilot.Sierra-F405"
|
||||
|
||||
# use DNA
|
||||
define HAL_CAN_DEFAULT_NODE_ID 0
|
||||
|
||||
# reserve 256 bytes for comms between app and bootloader
|
||||
RAM_RESERVE_START 256
|
||||
|
||||
# Add CS pins to ensure they are high in bootloader
|
||||
PB12 MAG_CS CS
|
||||
PA8 BARO_CS CS
|
||||
|
||||
STDOUT_SERIAL SD1
|
||||
STDOUT_BAUDRATE 57600
|
||||
|
||||
define HAL_USE_SERIAL TRUE
|
||||
define STM32_SERIAL_USE_USART1 TRUE
|
||||
define STM32_SERIAL_USE_USART2 TRUE
|
||||
define STM32_SERIAL_USE_USART3 FALSE
|
||||
|
||||
define HAL_NO_GPIO_IRQ
|
||||
define HAL_USE_EMPTY_IO TRUE
|
||||
|
||||
# make bl baudrate match debug baudrate for easier debugging
|
||||
define BOOTLOADER_BAUDRATE 57600
|
||||
|
||||
# use a small bootloader timeout
|
||||
define HAL_BOOTLOADER_TIMEOUT 1000
|
||||
|
||||
define HAL_CUSTOM_CLOCK_TREE
|
||||
define STM32_PLLM_VALUE 8
|
||||
define STM32_PLLN_VALUE 168
|
||||
define STM32_PLLP_VALUE 2
|
||||
define STM32_PLLQ_VALUE 4
|
||||
|
137
libraries/AP_HAL_ChibiOS/hwdef/Sierra-F405/hwdef.dat
Normal file
137
libraries/AP_HAL_ChibiOS/hwdef/Sierra-F405/hwdef.dat
Normal file
@ -0,0 +1,137 @@
|
||||
# hw definition for Sierra-F405
|
||||
|
||||
# MCU class and specific type
|
||||
MCU STM32F4xx STM32F405xx
|
||||
|
||||
# bootloader starts firmware at 64k
|
||||
FLASH_RESERVE_START_KB 64
|
||||
FLASH_SIZE_KB 1024
|
||||
|
||||
# store parameters in pages 11 and 12
|
||||
STORAGE_FLASH_PAGE 1
|
||||
define HAL_STORAGE_SIZE 15360
|
||||
|
||||
# board ID for firmware load
|
||||
APJ_BOARD_ID 1052
|
||||
|
||||
env AP_PERIPH 1
|
||||
|
||||
define STM32_ST_USE_TIMER 5
|
||||
define CH_CFG_ST_RESOLUTION 32
|
||||
|
||||
# enable watchdog
|
||||
|
||||
# crystal frequency
|
||||
OSCILLATOR_HZ 16000000
|
||||
|
||||
STDOUT_SERIAL SD1
|
||||
STDOUT_BAUDRATE 57600
|
||||
|
||||
define HAL_NO_GPIO_IRQ
|
||||
|
||||
# avoid timer and RCIN threads to save memory
|
||||
define HAL_NO_RCIN_THREAD
|
||||
|
||||
define HAL_USE_RTC FALSE
|
||||
define NO_DATAFLASH TRUE
|
||||
|
||||
define DMA_RESERVE_SIZE 0
|
||||
|
||||
define HAL_DISABLE_LOOP_DELAY
|
||||
define HAL_NO_MONITOR_THREAD
|
||||
define HAL_NO_LOGGING
|
||||
define HAL_MINIMIZE_FEATURES 0
|
||||
define DISABLE_SERIAL_ESC_COMM TRUE
|
||||
|
||||
define HAL_DEVICE_THREAD_STACK 768
|
||||
|
||||
# we setup a small defaults.parm
|
||||
define AP_PARAM_MAX_EMBEDDED_PARAM 256
|
||||
|
||||
# keep ROMFS uncompressed as we don't have enough RAM
|
||||
# to uncompress the bootloader at runtime
|
||||
env ROMFS_UNCOMPRESSED True
|
||||
|
||||
|
||||
# --------------------- SPI2 RM3100 + DPS310 --------------------
|
||||
PA5 SPI1_SCK SPI1
|
||||
PA6 SPI1_MISO SPI1
|
||||
PA7 SPI1_MOSI SPI1
|
||||
PA8 BARO_CS CS
|
||||
PB12 MAG_CS CS
|
||||
|
||||
# ---------------------- CAN bus -------------------------
|
||||
PA11 CAN1_RX CAN1
|
||||
PA12 CAN1_TX CAN1
|
||||
|
||||
CAN_ORDER 1
|
||||
|
||||
# use DNA for node allocation
|
||||
|
||||
define CAN_APP_NODE_NAME "org.ardupilot.Sierra-F405"
|
||||
|
||||
# order of UARTs
|
||||
SERIAL_ORDER USART1 EMPTY EMPTY USART2
|
||||
|
||||
# USART1 for debug
|
||||
PA9 USART1_TX USART1
|
||||
PA10 USART1_RX USART1
|
||||
define HAL_SERIAL0_BAUD_DEFAULT 57600
|
||||
|
||||
# USART2 M9N
|
||||
PA2 USART2_TX USART2 SPEED_HIGH
|
||||
PA3 USART2_RX USART2 SPEED_HIGH
|
||||
|
||||
# --------------------- CAM Trigger + Feedback -----------------------
|
||||
PB8 TIM4_CH3 TIM4 PWM(1) GPIO(50)
|
||||
PB9 TIM4_CH4 TIM4 PWM(2) GPIO(51)
|
||||
|
||||
# WS2812 LED pin
|
||||
PA15 TIM2_CH1 TIM2 PWM(3) GPIO(52)
|
||||
PB4 TIM3_CH1 TIM3 PWM(4) GPIO(53)
|
||||
|
||||
# ----------------------- GPS ----------------------------
|
||||
define HAL_PERIPH_ENABLE_GPS
|
||||
define HAL_PERIPH_GPS_PORT_DEFAULT 3
|
||||
define GPS_MAX_RECEIVERS 1
|
||||
define GPS_MAX_INSTANCES 1
|
||||
|
||||
# ---------------------- COMPASS ---------------------------
|
||||
define HAL_PERIPH_ENABLE_MAG
|
||||
|
||||
SPIDEV rm3100 SPI1 DEVID1 MAG_CS MODE0 1*MHZ 1*MHZ
|
||||
COMPASS RM3100 SPI:rm3100 false ROTATION_PITCH_180
|
||||
define HAL_COMPASS_MAX_SENSORS 1
|
||||
|
||||
# --------------------- DPS310 ---------------------------
|
||||
define HAL_PERIPH_ENABLE_BARO
|
||||
SPIDEV dps310 SPI1 DEVID3 BARO_CS MODE3 5*MHZ 5*MHZ
|
||||
BARO DPS310 SPI:dps310
|
||||
|
||||
define HAL_USE_ADC TRUE
|
||||
define STM32_ADC_USE_ADC1 TRUE
|
||||
#define HAL_DISABLE_ADC_DRIVER TRUE
|
||||
PA0 VSENSE ADC1 SCALE(2)
|
||||
|
||||
# -------------------- Buzzer+NeoPixels --------------------
|
||||
define HAL_PERIPH_ENABLE_RC_OUT
|
||||
define HAL_PERIPH_ENABLE_NOTIFY
|
||||
|
||||
# Enable the sensor voltage pin
|
||||
PC13 VDD_3V3_SENSORS_EN OUTPUT HIGH
|
||||
|
||||
define HAL_CUSTOM_CLOCK_TREE
|
||||
define STM32_PLLM_VALUE 8
|
||||
define STM32_PLLN_VALUE 168
|
||||
define STM32_PLLP_VALUE 2
|
||||
define STM32_PLLQ_VALUE 4
|
||||
|
||||
#GPS M9N
|
||||
PC11 M9EXTINT INPUT
|
||||
PC10 M9RST INPUT
|
||||
PC8 GPS_PPS_IN INPUT
|
||||
PC7 M9SB INPUT
|
||||
|
||||
# allow for reboot command for faster development
|
||||
define HAL_PERIPH_LISTEN_FOR_SERIAL_UART_REBOOT_CMD_PORT 0
|
||||
|
Loading…
Reference in New Issue
Block a user