2022-02-23 04:32:54 -04:00
|
|
|
# hw definition file for processing by chibios_pins.py
|
|
|
|
# MCU class and specific type
|
|
|
|
|
|
|
|
# MCU class and specific type
|
|
|
|
MCU STM32G4xx STM32G474xx
|
|
|
|
|
|
|
|
FLASH_RESERVE_START_KB 36
|
|
|
|
|
|
|
|
STORAGE_FLASH_PAGE 16
|
|
|
|
define HAL_STORAGE_SIZE 800
|
|
|
|
|
|
|
|
# board ID for firmware load
|
|
|
|
APJ_BOARD_ID 1053
|
|
|
|
|
|
|
|
# setup build for a peripheral firmware
|
|
|
|
env AP_PERIPH 1
|
|
|
|
|
|
|
|
# crystal frequency
|
|
|
|
OSCILLATOR_HZ 16000000
|
|
|
|
|
|
|
|
define CH_CFG_ST_FREQUENCY 1000000
|
|
|
|
|
|
|
|
# assume 512k flash part
|
|
|
|
FLASH_SIZE_KB 512
|
|
|
|
|
2023-06-25 06:50:29 -03:00
|
|
|
# ensure NRST_MODE is set to "Reset input only". This fixes
|
|
|
|
# an issue with resetting the CAN node and firmware update
|
|
|
|
define HAL_FLASH_SET_NRST_MODE 0x01
|
|
|
|
|
2022-02-23 04:32:54 -04:00
|
|
|
# debug on USART2
|
|
|
|
STDOUT_SERIAL SD2
|
|
|
|
STDOUT_BAUDRATE 57600
|
|
|
|
|
|
|
|
# order of UARTs
|
|
|
|
SERIAL_ORDER USART2 USART3
|
|
|
|
|
|
|
|
# sensor power control
|
|
|
|
PC11 VDD_3V3_SENSORS_EN OUTPUT HIGH
|
|
|
|
|
|
|
|
# LEDs
|
|
|
|
PC10 LED OUTPUT HIGH GPIO(2) # blue
|
|
|
|
PB15 LED_R OUTPUT HIGH GPIO(0)
|
|
|
|
PC6 LED_G OUTPUT HIGH GPIO(1)
|
|
|
|
|
2024-07-09 00:19:56 -03:00
|
|
|
define AP_NOTIFY_GPIO_LED_RGB_RED_PIN 0
|
|
|
|
define AP_NOTIFY_GPIO_LED_RGB_GREEN_PIN 1
|
|
|
|
define AP_NOTIFY_GPIO_LED_RGB_BLUE_PIN 2
|
2022-02-23 04:32:54 -04:00
|
|
|
|
2024-07-09 00:19:56 -03:00
|
|
|
define AP_NOTIFY_GPIO_LED_RGB_ENABLED 1
|
2022-02-23 04:32:54 -04:00
|
|
|
|
|
|
|
# USART3, GPS
|
|
|
|
PB10 USART3_TX USART3
|
|
|
|
PB11 USART3_RX USART3
|
|
|
|
|
|
|
|
# USART2, debug
|
2023-07-10 06:56:17 -03:00
|
|
|
PA2 USART2_TX USART2 NODMA
|
|
|
|
PA3 USART2_RX USART2 NODMA
|
2022-02-23 04:32:54 -04:00
|
|
|
|
|
|
|
# SWD debugging
|
|
|
|
PA13 JTMS-SWDIO SWD
|
|
|
|
PA14 JTCK-SWCLK SWD
|
|
|
|
|
|
|
|
# I2C1 bus
|
|
|
|
PB7 I2C1_SDA I2C1
|
|
|
|
PB8 I2C1_SCL I2C1
|
|
|
|
|
2023-08-30 02:59:33 -03:00
|
|
|
# I2C2 bus (LED Driver)
|
|
|
|
PA8 I2C2_SDA I2C2
|
|
|
|
PA9 I2C2_SCL I2C2
|
2022-02-23 04:32:54 -04:00
|
|
|
|
|
|
|
define HAL_I2C_INTERNAL_MASK 3
|
|
|
|
|
|
|
|
# I2C buses
|
2023-08-30 02:59:33 -03:00
|
|
|
I2C_ORDER I2C1 I2C2
|
2022-02-23 04:32:54 -04:00
|
|
|
|
2023-08-15 06:48:46 -03:00
|
|
|
# one SPI bus (for IMU, unused)
|
|
|
|
#PA5 SPI1_SCK SPI1
|
|
|
|
#PA6 SPI1_MISO SPI1
|
|
|
|
#PA7 SPI1_MOSI SPI1
|
2022-02-23 04:32:54 -04:00
|
|
|
|
|
|
|
# SPI CS
|
|
|
|
PC4 GYR_CS CS
|
|
|
|
PB1 ACC_CS CS
|
2023-08-15 06:48:46 -03:00
|
|
|
PC14 ICM_CS CS
|
2022-02-23 04:32:54 -04:00
|
|
|
|
|
|
|
# GPS PPS
|
|
|
|
PA15 GPS_PPS_IN INPUT
|
|
|
|
|
|
|
|
# compass
|
|
|
|
COMPASS BMM150 I2C:0:0x10 false ROTATION_YAW_90
|
|
|
|
|
|
|
|
define HAL_USE_ADC FALSE
|
|
|
|
define STM32_ADC_USE_ADC1 FALSE
|
|
|
|
define HAL_DISABLE_ADC_DRIVER TRUE
|
|
|
|
|
|
|
|
define HAL_NO_GPIO_IRQ
|
|
|
|
|
|
|
|
define HAL_USE_RTC FALSE
|
|
|
|
|
|
|
|
define DMA_RESERVE_SIZE 0
|
|
|
|
|
|
|
|
# enable CAN support
|
|
|
|
|
|
|
|
PA11 CAN1_RX CAN1
|
|
|
|
PA12 CAN1_TX CAN1
|
|
|
|
PC13 GPIO_CAN1_SILENT OUTPUT PUSHPULL SPEED_LOW LOW
|
|
|
|
|
2023-08-15 06:48:46 -03:00
|
|
|
PB12 CAN2_RX CAN2
|
|
|
|
PB13 CAN2_TX CAN2
|
|
|
|
PB14 GPIO_CAN2_SILENT OUTPUT PUSHPULL SPEED_LOW LOW
|
2022-02-23 04:32:54 -04:00
|
|
|
|
|
|
|
define HAL_NO_MONITOR_THREAD
|
|
|
|
|
|
|
|
define HAL_DEVICE_THREAD_STACK 768
|
|
|
|
|
|
|
|
# we setup a small defaults.parm
|
|
|
|
define AP_PARAM_MAX_EMBEDDED_PARAM 256
|
|
|
|
|
|
|
|
# disable dual GPS and GPS blending to save flash space
|
|
|
|
define GPS_MAX_RECEIVERS 1
|
|
|
|
define GPS_MAX_INSTANCES 1
|
|
|
|
define HAL_COMPASS_MAX_SENSORS 1
|
|
|
|
|
2023-07-10 06:56:17 -03:00
|
|
|
DMA_NOSHARE USART3*
|
|
|
|
|
2022-07-14 05:49:27 -03:00
|
|
|
# add support for moving baseline yaw
|
|
|
|
define GPS_MOVING_BASELINE 1
|
|
|
|
|
2023-08-15 06:48:46 -03:00
|
|
|
# GPS+MAG+LEDs
|
2022-02-23 04:32:54 -04:00
|
|
|
define HAL_PERIPH_ENABLE_GPS
|
|
|
|
define HAL_PERIPH_ENABLE_MAG
|
|
|
|
define HAL_PERIPH_ENABLE_NOTIFY
|
|
|
|
define HAL_PERIPH_ENABLE_RC_OUT
|
|
|
|
|
|
|
|
# GPS on 2nd port
|
|
|
|
define HAL_PERIPH_GPS_PORT_DEFAULT 1
|
2022-04-27 01:05:12 -03:00
|
|
|
|
|
|
|
# keep ROMFS uncompressed as we don't have enough RAM
|
|
|
|
# to uncompress the bootloader at runtime
|
|
|
|
env ROMFS_UNCOMPRESSED True
|