Add files via upload

This commit is contained in:
Stepan Potapov 2024-11-20 10:28:29 +03:00 committed by GitHub
parent 8bb1fa6c94
commit 19db87ffd8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 156 additions and 0 deletions

View File

@ -0,0 +1,65 @@
# hw definition file for processing by chibios_pins.py
# CSKY-PMU Bootloader
# MCU class and specific type
MCU STM32F4xx STM32F412Rx
# bootloader loads at start of flash
FLASH_RESERVE_START_KB 0
# location of application code
FLASH_BOOTLOADER_LOAD_KB 64
# board ID for firmware load
APJ_BOARD_ID 1212
# crystal frequency
OSCILLATOR_HZ 8000000
# setup build for a peripheral firmware
env AP_PERIPH 1
define CH_CFG_ST_FREQUENCY 1000000
# Flash available
FLASH_SIZE_KB 512
# order of UARTs
SERIAL_ORDER
PB14 LED_BOOTLOADER OUTPUT HIGH
define HAL_LED_ON 1
# USART1
PB6 USART1_TX USART1
PB7 USART1_RX USART1
# SWD debugging
PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD
define HAL_USE_SERIAL TRUE
define STM32_SERIAL_USE_USART1 TRUE
define STM32_SERIAL_USE_USART2 FALSE
define STM32_SERIAL_USE_USART3 FALSE
define HAL_NO_GPIO_IRQ
define HAL_USE_EMPTY_IO TRUE
# avoid timer thread to save memory
define HAL_NO_TIMER_THREAD
define DMA_RESERVE_SIZE 0
# enable CAN support
PB8 CAN1_RX CAN1
PB9 CAN1_TX CAN1
PB5 GPIO_CAN1_SILENT OUTPUT PUSHPULL SPEED_LOW LOW
# make bl baudrate match debug baudrate for easier debugging
define BOOTLOADER_BAUDRATE 57600
# use a small bootloader timeout
define HAL_BOOTLOADER_TIMEOUT 1000

View File

@ -0,0 +1,91 @@
# hw definition file for processing by chibios_pins.py
# 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
STORAGE_FLASH_PAGE 2
define HAL_STORAGE_SIZE 8192
# board ID for firmware load
APJ_BOARD_ID 1212
# setup build for a peripheral firmware
env AP_PERIPH 1
# ChibiOS system timer
STM32_ST_USE_TIMER 5
# crystal frequency
OSCILLATOR_HZ 8000000
define CH_CFG_ST_FREQUENCY 1000000
# assume 512k flash part
FLASH_SIZE_KB 512
define HAL_NO_GPIO_IRQ
define SERIAL_BUFFERS_SIZE 512
define PORT_INT_REQUIRED_STACK 64
define DMA_RESERVE_SIZE 0
define HAL_NO_MONITOR_THREAD
# setup a small defaults.parm
define AP_PARAM_MAX_EMBEDDED_PARAM 512
# order of UARTs
SERIAL_ORDER USART1 EMPTY EMPTY EMPTY
# USART1 for debug
PB6 USART1_TX USART1 NODMA
PB7 USART1_RX USART1 NODMA
define DEFAULT_SERIAL0_BAUD 57600
# debugger support
PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD
# activity LED
PB14 LED OUTPUT HIGH
define HAL_LED_ON 1
#CAN bus
CAN_ORDER 1
PB8 CAN1_RX CAN1
PB9 CAN1_TX CAN1
PB5 GPIO_CAN1_SILENT OUTPUT PUSHPULL SPEED_LOW LOW
define CAN_APP_NODE_NAME "org.csky.pmu"
define HAL_CAN_POOL_SIZE 6000
# SPI1 RM3100
PA5 SPI1_SCK SPI1
PA6 SPI1_MISO SPI1
PA7 SPI1_MOSI SPI1
PA4 SPARE_CS CS
SPIDEV INA23X SPI1 DEVID1 SPARE_CS MODE1 10*MHZ 10*MHZ
# enable temperature
define AP_TEMPERATURE_SENSOR_ENABLED 1
define AP_TEMPERATURE_SENSOR_MAX_INSTANCES 1
define HAL_PERIPH_ENABLE_DEVICE_TEMPERATURE
# ADC
define HAL_USE_ADC TRUE
define STM32_ADC_USE_ADC1 TRUE
PA3 BATT_TEMP_SENS ADC1 SCALE(1)
# enable battery monitor
define HAL_PERIPH_ENABLE_BATTERY
define AP_BATTERY_INA239_ENABLED 1
define AP_BATTERY_INA239_SPI_DEVICE "INA23X"
define HAL_BATT_MONITOR_DEFAULT 26
# bootloader embedding / bootloader flashing not available
define AP_BOOTLOADER_FLASHING_ENABLED 0