HAL_ChibiOS: simplify H7 hwdef.dat

This commit is contained in:
Andrew Tridgell 2019-02-04 12:41:00 +11:00
parent 84ac98622c
commit c2746ca9f9
5 changed files with 104 additions and 13 deletions

View File

@ -7,18 +7,12 @@ MCU STM32H7xx STM32H743xx
# crystal frequency
OSCILLATOR_HZ 8000000
define STM32_LSEDRV (3U << 3U)
define STM32_HSE_BYPASS
define STM32_LSECLK 32768
define STM32_PLL1_DIVM_VALUE 4
define STM32_PLL2_DIVM_VALUE 4
define STM32_PLL3_DIVM_VALUE 8
# board ID for firmware load
APJ_BOARD_ID 139
FLASH_SIZE_KB 2048
FLASH_SIZE_KB 1920
# bootloader is installed at zero offset
FLASH_RESERVE_START_KB 0

View File

@ -7,14 +7,8 @@ MCU STM32H7xx STM32H743xx
# crystal frequency
OSCILLATOR_HZ 8000000
define STM32_LSEDRV (3U << 3U)
define STM32_HSE_BYPASS
define STM32_LSECLK 32768
define STM32_PLL1_DIVM_VALUE 4
define STM32_PLL2_DIVM_VALUE 4
define STM32_PLL3_DIVM_VALUE 8
# board ID for firmware load
APJ_BOARD_ID 139

View File

@ -0,0 +1,41 @@
# hw definition file for processing by chibios_hwdef.py
# for F743 bootloader
# MCU class and specific type
MCU STM32H7xx STM32H743xx
# crystal frequency
OSCILLATOR_HZ 16000000
# board ID for firmware load
APJ_BOARD_ID 139
FLASH_SIZE_KB 2048
# bootloader is installed at zero offset
FLASH_RESERVE_START_KB 0
# the location where the bootloader will put the firmware
# the H743 has 128k sectors
define FLASH_BOOTLOADER_LOAD_KB 128
PB1 LED_RED OUTPUT LOW # red
PC6 LED_ACTIVITY OUTPUT LOW # green
PC7 LED_BOOTLOADER OUTPUT LOW # blue
define HAL_LED_ON 0
# board voltage
STM32_VDD 330U
# order of UARTs (and USB)
UART_ORDER OTG1
PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1
PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 16384

View File

@ -0,0 +1,41 @@
# hw definition file for processing by chibios_hwdef.py
# for F743 bootloader
# MCU class and specific type
MCU STM32H7xx STM32H743xx
# crystal frequency
OSCILLATOR_HZ 16000000
# board ID for firmware load
APJ_BOARD_ID 139
FLASH_SIZE_KB 2048
# bootloader is installed at zero offset
FLASH_RESERVE_START_KB 0
# the location where the bootloader will put the firmware
# the H743 has 128k sectors
define FLASH_BOOTLOADER_LOAD_KB 128
PB1 LED_RED OUTPUT LOW # red
PC6 LED_ACTIVITY OUTPUT HIGH # green
PC7 LED_BOOTLOADER OUTPUT HIGH # blue
define HAL_LED_ON 0
# board voltage
STM32_VDD 330U
# order of UARTs (and USB)
UART_ORDER OTG1
PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1
PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 16384

View File

@ -18,6 +18,27 @@
*/
#pragma once
#ifndef STM32_LSECLK
#define STM32_LSECLK 32768U
#endif
#ifndef STM32_LSEDRV
#define STM32_LSEDRV (3U << 3U)
#endif
#ifndef STM32_PLL1_DIVM_VALUE
#define STM32_PLL1_DIVM_VALUE (STM32_HSECLK / 2000000U)
#endif
#ifndef STM32_PLL2_DIVM_VALUE
#define STM32_PLL2_DIVM_VALUE (STM32_HSECLK / 2000000U)
#endif
#ifndef STM32_PLL3_DIVM_VALUE
#define STM32_PLL3_DIVM_VALUE (STM32_HSECLK / 1000000U)
#endif
/*
* General settings.
*/