From 79cb96bc9eb41b19b06555f72dcfb587251722b4 Mon Sep 17 00:00:00 2001 From: SummerGift Date: Wed, 26 Dec 2018 18:11:35 +0800 Subject: [PATCH] [bsp][stm32] update template --- .../templates/stm32f0xx/board/SConscript | 8 ++++++- .../templates/stm32f0xx/board/board.h | 4 ++++ .../templates/stm32f10x/board/SConscript | 8 ++++++- .../templates/stm32f10x/board/board.h | 4 ++++ .../templates/stm32f4xx/board/SConscript | 7 ++++++ .../templates/stm32f4xx/board/board.h | 4 ++++ .../templates/stm32f7xx/board/SConscript | 4 ++++ .../templates/stm32f7xx/board/board.h | 7 +++--- .../templates/stm32l4xx/board/SConscript | 9 ++++++++ .../templates/stm32l4xx/board/board.h | 22 ++++++++----------- 10 files changed, 59 insertions(+), 18 deletions(-) diff --git a/bsp/stm32/libraries/templates/stm32f0xx/board/SConscript b/bsp/stm32/libraries/templates/stm32f0xx/board/SConscript index 00d27d1c9b..032bad38b1 100644 --- a/bsp/stm32/libraries/templates/stm32f0xx/board/SConscript +++ b/bsp/stm32/libraries/templates/stm32f0xx/board/SConscript @@ -23,7 +23,13 @@ elif rtconfig.CROSS_TOOL == 'keil': src += [startup_path_prefix + '/STM32F0xx_HAL/CMSIS/Device/ST/STM32F0xx/Source/Templates/arm/startup_stm32f091xc.s'] elif rtconfig.CROSS_TOOL == 'iar': src += [startup_path_prefix + '/STM32F0xx_HAL/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/startup_stm32f091xc.s'] - + +# STM32F030x6 || STM32F030x8 || STM32F031x6 +# STM32F038xx || STM32F042x6 || STM32F048xx +# STM32F070x6 || STM32F051x8 || STM32F058xx +# STM32F071xB || STM32F072xB || STM32F078xx +# STM32F070xB || STM32F091xC || STM32F098xx || STM32F030xC +# You can select chips from the list above CPPDEFINES = ['STM32F091xC'] group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) Return('group') diff --git a/bsp/stm32/libraries/templates/stm32f0xx/board/board.h b/bsp/stm32/libraries/templates/stm32f0xx/board/board.h index 2faad681d6..7db811458f 100644 --- a/bsp/stm32/libraries/templates/stm32f0xx/board/board.h +++ b/bsp/stm32/libraries/templates/stm32f0xx/board/board.h @@ -15,6 +15,10 @@ #include #include "drv_common.h" +#define STM32_FLASH_START_ADRESS ((uint32_t)0x08000000) +#define STM32_FLASH_SIZE (256 * 1024) +#define STM32_FLASH_END_ADDRESS ((uint32_t)(STM32_FLASH_START_ADRESS + STM32_FLASH_SIZE)) + /* Internal SRAM memory size[Kbytes] <8-64>, Default: 64*/ #define STM32_SRAM_SIZE 32 #define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024) diff --git a/bsp/stm32/libraries/templates/stm32f10x/board/SConscript b/bsp/stm32/libraries/templates/stm32f10x/board/SConscript index a88ecd435d..713a0e4b8f 100644 --- a/bsp/stm32/libraries/templates/stm32f10x/board/SConscript +++ b/bsp/stm32/libraries/templates/stm32f10x/board/SConscript @@ -23,7 +23,13 @@ elif rtconfig.CROSS_TOOL == 'keil': src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/arm/startup_stm32f103xb.s'] elif rtconfig.CROSS_TOOL == 'iar': src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xb.s'] - + +# STM32F100xB || STM32F100xE || STM32F101x6 +# STM32F101xB || STM32F101xE || STM32F101xG +# STM32F102x6 || STM32F102xB || STM32F103x6 +# STM32F103xB || STM32F103xE || STM32F103xG +# STM32F105xC || STM32F107xC) +# You can select chips from the list above CPPDEFINES = ['STM32F103xB'] group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) Return('group') diff --git a/bsp/stm32/libraries/templates/stm32f10x/board/board.h b/bsp/stm32/libraries/templates/stm32f10x/board/board.h index cc564baf4f..cd68ba49a8 100644 --- a/bsp/stm32/libraries/templates/stm32f10x/board/board.h +++ b/bsp/stm32/libraries/templates/stm32f10x/board/board.h @@ -15,6 +15,10 @@ #include #include "drv_common.h" +#define STM32_FLASH_START_ADRESS ((uint32_t)0x08000000) +#define STM32_FLASH_SIZE (128 * 1024) +#define STM32_FLASH_END_ADDRESS ((uint32_t)(STM32_FLASH_START_ADRESS + STM32_FLASH_SIZE)) + /* Internal SRAM memory size[Kbytes] <8-64>, Default: 64*/ #define STM32_SRAM_SIZE 20 #define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024) diff --git a/bsp/stm32/libraries/templates/stm32f4xx/board/SConscript b/bsp/stm32/libraries/templates/stm32f4xx/board/SConscript index c62947164b..a7785d3ff5 100644 --- a/bsp/stm32/libraries/templates/stm32f4xx/board/SConscript +++ b/bsp/stm32/libraries/templates/stm32f4xx/board/SConscript @@ -24,6 +24,13 @@ elif rtconfig.CROSS_TOOL == 'keil': elif rtconfig.CROSS_TOOL == 'iar': src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f407xx.s'] +# STM32F405xx) || STM32F415xx) || STM32F407xx) || STM32F417xx) +# STM32F427xx) || STM32F437xx) || STM32F429xx) || STM32F439xx) +# STM32F401xC) || STM32F401xE) || STM32F410Tx) || STM32F410Cx) +# STM32F410Rx) || STM32F411xE) || STM32F446xx) || STM32F469xx) +# STM32F479xx) || STM32F412Cx) || STM32F412Rx) || STM32F412Vx) +# STM32F412Zx) || STM32F413xx) || STM32F423xx) +# You can select chips from the list above CPPDEFINES = ['STM32F407xx'] group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/templates/stm32f4xx/board/board.h b/bsp/stm32/libraries/templates/stm32f4xx/board/board.h index 47a4822cb5..1f1eedd20c 100644 --- a/bsp/stm32/libraries/templates/stm32f4xx/board/board.h +++ b/bsp/stm32/libraries/templates/stm32f4xx/board/board.h @@ -15,6 +15,10 @@ #include #include "drv_common.h" +#define STM32_FLASH_START_ADRESS ((uint32_t)0x08000000) +#define STM32_FLASH_SIZE (1024 * 1024) +#define STM32_FLASH_END_ADDRESS ((uint32_t)(STM32_FLASH_START_ADRESS + STM32_FLASH_SIZE)) + #define STM32_SRAM_SIZE 128 #define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024) diff --git a/bsp/stm32/libraries/templates/stm32f7xx/board/SConscript b/bsp/stm32/libraries/templates/stm32f7xx/board/SConscript index 9c967898f6..71989399ff 100644 --- a/bsp/stm32/libraries/templates/stm32f7xx/board/SConscript +++ b/bsp/stm32/libraries/templates/stm32f7xx/board/SConscript @@ -17,6 +17,10 @@ elif rtconfig.CROSS_TOOL == 'keil': elif rtconfig.CROSS_TOOL == 'iar': src += [cwd + '/../../libraries/STM32F7xx_HAL/CMSIS/Device/ST/STM32F7xx/Source/Templates/iar/startup_stm32f767xx.s'] +# STM32F756xx || STM32F746xx || STM32F745xx || STM32F767xx || +# STM32F769xx || STM32F777xx || STM32F779xx || STM32F722xx || +# STM32F723xx || STM32F732xx || STM32F733xx || STM32F730xx || STM32F750xx +# You can select chips from the list above CPPDEFINES = ['STM32F767xx'] group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/templates/stm32f7xx/board/board.h b/bsp/stm32/libraries/templates/stm32f7xx/board/board.h index e0e0ede564..9d28bc82cf 100644 --- a/bsp/stm32/libraries/templates/stm32f7xx/board/board.h +++ b/bsp/stm32/libraries/templates/stm32f7xx/board/board.h @@ -15,9 +15,11 @@ #include #include "drv_common.h" -#ifdef BSP_USING_GPIO +#define STM32_FLASH_START_ADRESS ((uint32_t)0x08000000) +#define STM32_FLASH_SIZE (1024 * 1024) +#define STM32_FLASH_END_ADDRESS ((uint32_t)(STM32_FLASH_START_ADRESS + STM32_FLASH_SIZE)) -#define STM32_SRAM_SIZE 256 +#define STM32_SRAM_SIZE (512) #define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024) #if defined(__CC_ARM) || defined(__CLANG_ARM) @@ -36,4 +38,3 @@ extern int __bss_end; void SystemClock_Config(void); #endif - diff --git a/bsp/stm32/libraries/templates/stm32l4xx/board/SConscript b/bsp/stm32/libraries/templates/stm32l4xx/board/SConscript index e826c7212d..e5741fc74d 100644 --- a/bsp/stm32/libraries/templates/stm32l4xx/board/SConscript +++ b/bsp/stm32/libraries/templates/stm32l4xx/board/SConscript @@ -24,6 +24,15 @@ elif rtconfig.CROSS_TOOL == 'keil': elif rtconfig.CROSS_TOOL == 'iar': src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/iar/startup_stm32l475xx.s'] +# STM32L412xx || STM32L422xx || STM32L431xx +# STM32L432xx || STM32L433xx || STM32L442xx +# STM32L443xx || STM32L451xx || STM32L452xx +# STM32L462xx || STM32L471xx || STM32L475xx +# STM32L476xx || STM32L485xx || STM32L486xx +# STM32L496xx || STM32L4A6xx || STM32L4R5xx +# STM32L4R7xx || STM32L4R9xx || STM32L4S5xx +# STM32L4S7xx || STM32L4S9xx +# You can select chips from the list above CPPDEFINES = ['STM32L475xx'] group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/templates/stm32l4xx/board/board.h b/bsp/stm32/libraries/templates/stm32l4xx/board/board.h index 9e1f66bf24..1596ff1b87 100644 --- a/bsp/stm32/libraries/templates/stm32l4xx/board/board.h +++ b/bsp/stm32/libraries/templates/stm32l4xx/board/board.h @@ -15,22 +15,18 @@ #include #include "drv_common.h" -#define STM32_SRAM_SIZE 96 -#define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024) +#define STM32_FLASH_START_ADRESS ((uint32_t)0x08000000) +#define STM32_FLASH_SIZE (512 * 1024) +#define STM32_FLASH_END_ADDRESS ((uint32_t)(STM32_FLASH_START_ADRESS + STM32_FLASH_SIZE)) -#if defined(__CC_ARM) || defined(__CLANG_ARM) -extern int Image$$RW_IRAM1$$ZI$$Limit; -#define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit) -#elif __ICCARM__ -#pragma section="CSTACK" -#define HEAP_BEGIN (__segment_end("CSTACK")) -#else -extern int __bss_end; -#define HEAP_BEGIN (&__bss_end) -#endif +#define STM32_SRAM1_SIZE (96) +#define STM32_SRAM1_START (0x20000000) +#define STM32_SRAM1_END (STM32_SRAM1_START + STM32_SRAM1_SIZE * 1024) -#define HEAP_END STM32_SRAM_END +#define HEAP_BEGIN STM32_SRAM1_START +#define HEAP_END STM32_SRAM1_END void SystemClock_Config(void); #endif +