summaryrefslogtreecommitdiff
path: root/bsp
diff options
context:
space:
mode:
authorSummerGift <[email protected]>2018-12-13 10:56:09 +0800
committerSummerGift <[email protected]>2018-12-13 12:05:40 +0800
commit968110ffd61dcc30a48c98308b034fcaf532cdb7 (patch)
tree4efa463a1f8822effc6b003771ac0c7445ed3f63 /bsp
parentdcf7bce2cc5d04bcb006b84a27a5498f42268184 (diff)
[bsp][stm32] add scons --dist function
Diffstat (limited to 'bsp')
-rw-r--r--bsp/stm32/libraries/templates/stm32f10x/SConstruct14
-rw-r--r--bsp/stm32/libraries/templates/stm32f10x/board/SConscript23
-rw-r--r--bsp/stm32/libraries/templates/stm32f10x/rtconfig.py3
-rw-r--r--bsp/stm32/libraries/templates/stm32f4xx/SConstruct14
-rw-r--r--bsp/stm32/libraries/templates/stm32f4xx/board/SConscript18
-rw-r--r--bsp/stm32/libraries/templates/stm32f4xx/rtconfig.py3
-rw-r--r--bsp/stm32/libraries/templates/stm32l4xx/SConstruct14
-rw-r--r--bsp/stm32/libraries/templates/stm32l4xx/board/SConscript18
-rw-r--r--bsp/stm32/libraries/templates/stm32l4xx/rtconfig.py3
-rw-r--r--bsp/stm32/stm32f103-atk-nano/SConstruct14
-rw-r--r--bsp/stm32/stm32f103-atk-nano/board/SConscript17
-rw-r--r--bsp/stm32/stm32f103-atk-nano/rtconfig.py3
-rw-r--r--bsp/stm32/stm32f103-fire-arbitrary/SConstruct14
-rw-r--r--bsp/stm32/stm32f103-fire-arbitrary/board/SConscript15
-rw-r--r--bsp/stm32/stm32f103-fire-arbitrary/rtconfig.py3
-rw-r--r--bsp/stm32/stm32f407-atk-explorer/SConstruct14
-rw-r--r--bsp/stm32/stm32f407-atk-explorer/board/SConscript16
-rw-r--r--bsp/stm32/stm32f407-atk-explorer/rtconfig.py3
-rw-r--r--bsp/stm32/stm32f429-atk-apollo/SConstruct14
-rw-r--r--bsp/stm32/stm32f429-atk-apollo/board/SConscript18
-rw-r--r--bsp/stm32/stm32f429-atk-apollo/rtconfig.py3
-rw-r--r--bsp/stm32/stm32f429-fire-challenger/SConstruct14
-rw-r--r--bsp/stm32/stm32f429-fire-challenger/board/SConscript19
-rw-r--r--bsp/stm32/stm32f429-fire-challenger/rtconfig.py3
24 files changed, 205 insertions, 75 deletions
diff --git a/bsp/stm32/libraries/templates/stm32f10x/SConstruct b/bsp/stm32/libraries/templates/stm32f10x/SConstruct
index b541737671..5514659688 100644
--- a/bsp/stm32/libraries/templates/stm32f10x/SConstruct
+++ b/bsp/stm32/libraries/templates/stm32f10x/SConstruct
@@ -38,11 +38,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
SDK_ROOT = os.path.abspath('./')
bsp_vdir = 'build'
-# include drivers
-objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/STM32F1xx_HAL/SConscript'))
+if os.path.exists(SDK_ROOT + '/libraries'):
+ libraries_path_prefix = SDK_ROOT + '/libraries/'
+else:
+ libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries/'
+
+stm32_library = 'STM32F1xx_HAL'
+rtconfig.BSP_LIBRARY_TYPE = stm32_library
# include libraries
-objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/HAL_Drivers/SConscript'))
+objs.extend(SConscript(libraries_path_prefix + stm32_library + '/SConscript'))
+
+# include drivers
+objs.extend(SConscript(libraries_path_prefix + '/HAL_Drivers/SConscript'))
# make a building
DoBuilding(TARGET, objs)
diff --git a/bsp/stm32/libraries/templates/stm32f10x/board/SConscript b/bsp/stm32/libraries/templates/stm32f10x/board/SConscript
index a0011e100f..1ddc236ef5 100644
--- a/bsp/stm32/libraries/templates/stm32f10x/board/SConscript
+++ b/bsp/stm32/libraries/templates/stm32f10x/board/SConscript
@@ -1,23 +1,28 @@
+import os
import rtconfig
from building import *
cwd = GetCurrentDir()
-# add the general drivers.
-src = Glob('board.c')
+# add general drivers
+src = Glob('board.c')
src += Glob('CubeMX_Config/Src/stm32f1xx_hal_msp.c')
-path = [cwd]
+path = [cwd]
path += [cwd + '/CubeMX_Config/Inc']
+if os.path.exists(cwd + '/../libraries'):
+ startup_path_prefix = cwd + '/../libraries'
+else:
+ startup_path_prefix = cwd + '/../../libraries'
+
if rtconfig.CROSS_TOOL == 'gcc':
- src += [cwd + '/../../libraries/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f103xb.s']
+ src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f103xb.s']
elif rtconfig.CROSS_TOOL == 'keil':
- src += [cwd + '/../../libraries/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/arm/startup_stm32f103xb.s']
+ src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/arm/startup_stm32f103xb.s']
elif rtconfig.CROSS_TOOL == 'iar':
- src += [cwd + '/../../libraries/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xb.s']
-
+ src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xb.s']
+
CPPDEFINES = ['STM32F103xB']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
-
-Return('group') \ No newline at end of file
+Return('group')
diff --git a/bsp/stm32/libraries/templates/stm32f10x/rtconfig.py b/bsp/stm32/libraries/templates/stm32f10x/rtconfig.py
index 7906918058..79904118e5 100644
--- a/bsp/stm32/libraries/templates/stm32f10x/rtconfig.py
+++ b/bsp/stm32/libraries/templates/stm32f10x/rtconfig.py
@@ -5,6 +5,9 @@ ARCH='arm'
CPU='cortex-m3'
CROSS_TOOL='gcc'
+# bsp lib config
+BSP_LIBRARY_TYPE = None
+
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
diff --git a/bsp/stm32/libraries/templates/stm32f4xx/SConstruct b/bsp/stm32/libraries/templates/stm32f4xx/SConstruct
index f9b3d33a62..bcfdc31e22 100644
--- a/bsp/stm32/libraries/templates/stm32f4xx/SConstruct
+++ b/bsp/stm32/libraries/templates/stm32f4xx/SConstruct
@@ -37,11 +37,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
SDK_ROOT = os.path.abspath('./')
-# include drivers
-objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/STM32F4xx_HAL/SConscript'))
+if os.path.exists(SDK_ROOT + '/libraries'):
+ libraries_path_prefix = SDK_ROOT + '/libraries/'
+else:
+ libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries/'
+
+stm32_library = 'STM32F4xx_HAL'
+rtconfig.BSP_LIBRARY_TYPE = stm32_library
# include libraries
-objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/HAL_Drivers/SConscript'))
+objs.extend(SConscript(libraries_path_prefix + stm32_library + '/SConscript'))
+
+# include drivers
+objs.extend(SConscript(libraries_path_prefix + '/HAL_Drivers/SConscript'))
# make a building
DoBuilding(TARGET, objs)
diff --git a/bsp/stm32/libraries/templates/stm32f4xx/board/SConscript b/bsp/stm32/libraries/templates/stm32f4xx/board/SConscript
index 5709200ba1..e7b053a70a 100644
--- a/bsp/stm32/libraries/templates/stm32f4xx/board/SConscript
+++ b/bsp/stm32/libraries/templates/stm32f4xx/board/SConscript
@@ -1,21 +1,27 @@
+import os
import rtconfig
from building import *
cwd = GetCurrentDir()
-# add the general drivers.
-src = Glob('board.c')
+# add general drivers
+src = Glob('board.c')
src += Glob('CubeMX_Config/Src/stm32f4xx_hal_msp.c')
-path = [cwd]
+path = [cwd]
path += [cwd + '/CubeMX_Config/Inc']
+if os.path.exists(cwd + '/../libraries'):
+ startup_path_prefix = cwd + '/../libraries'
+else:
+ startup_path_prefix = cwd + '/../../libraries'
+
if rtconfig.CROSS_TOOL == 'gcc':
- src += [cwd + '/../../libraries/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s']
+ src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s']
elif rtconfig.CROSS_TOOL == 'keil':
- src += [cwd + '/../../libraries/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f407xx.s']
+ src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f407xx.s']
elif rtconfig.CROSS_TOOL == 'iar':
- src += [cwd + '/../../libraries/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f407xx.s']
+ src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f407xx.s']
CPPDEFINES = ['STM32F407xx']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
diff --git a/bsp/stm32/libraries/templates/stm32f4xx/rtconfig.py b/bsp/stm32/libraries/templates/stm32f4xx/rtconfig.py
index ce04832ca5..2e3b7cf492 100644
--- a/bsp/stm32/libraries/templates/stm32f4xx/rtconfig.py
+++ b/bsp/stm32/libraries/templates/stm32f4xx/rtconfig.py
@@ -5,6 +5,9 @@ ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='gcc'
+# bsp lib config
+BSP_LIBRARY_TYPE = None
+
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
diff --git a/bsp/stm32/libraries/templates/stm32l4xx/SConstruct b/bsp/stm32/libraries/templates/stm32l4xx/SConstruct
index 23a8f6755c..c8abfbd6ec 100644
--- a/bsp/stm32/libraries/templates/stm32l4xx/SConstruct
+++ b/bsp/stm32/libraries/templates/stm32l4xx/SConstruct
@@ -37,11 +37,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
SDK_ROOT = os.path.abspath('./')
-# include drivers
-objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/STM32L4xx_HAL/SConscript'))
+if os.path.exists(SDK_ROOT + '/libraries'):
+ libraries_path_prefix = SDK_ROOT + '/libraries/'
+else:
+ libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries/'
+
+stm32_library = 'STM32FL4xx_HAL'
+rtconfig.BSP_LIBRARY_TYPE = stm32_library
# include libraries
-objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/HAL_Drivers/SConscript'))
+objs.extend(SConscript(libraries_path_prefix + stm32_library + '/SConscript'))
+
+# include drivers
+objs.extend(SConscript(libraries_path_prefix + '/HAL_Drivers/SConscript'))
# make a building
DoBuilding(TARGET, objs)
diff --git a/bsp/stm32/libraries/templates/stm32l4xx/board/SConscript b/bsp/stm32/libraries/templates/stm32l4xx/board/SConscript
index a0bf277556..eaa002ca9a 100644
--- a/bsp/stm32/libraries/templates/stm32l4xx/board/SConscript
+++ b/bsp/stm32/libraries/templates/stm32l4xx/board/SConscript
@@ -1,21 +1,27 @@
+import os
import rtconfig
from building import *
cwd = GetCurrentDir()
-# add the general drivers.
-src = Glob('board.c')
+# add general drivers
+src = Glob('board.c')
src += Glob('CubeMX_Config/Src/stm32l4xx_hal_msp.c')
-path = [cwd]
+path = [cwd]
path += [cwd + '/CubeMX_Config/Inc']
+if os.path.exists(cwd + '/../libraries'):
+ startup_path_prefix = cwd + '/../libraries'
+else:
+ startup_path_prefix = cwd + '/../../libraries'
+
if rtconfig.CROSS_TOOL == 'gcc':
- src += [cwd + '/../../libraries/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l475xx.s']
+ src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l475xx.s']
elif rtconfig.CROSS_TOOL == 'keil':
- src += [cwd + '/../../libraries/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/arm/startup_stm32l475xx.s']
+ src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/arm/startup_stm32l475xx.s']
elif rtconfig.CROSS_TOOL == 'iar':
- src += [cwd + '/../../libraries/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/iar/startup_stm32l475xx.s']
+ src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/iar/startup_stm32l475xx.s']
CPPDEFINES = ['STM32L475xx']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
diff --git a/bsp/stm32/libraries/templates/stm32l4xx/rtconfig.py b/bsp/stm32/libraries/templates/stm32l4xx/rtconfig.py
index 53f5cd79bc..50c1d8a0f7 100644
--- a/bsp/stm32/libraries/templates/stm32l4xx/rtconfig.py
+++ b/bsp/stm32/libraries/templates/stm32l4xx/rtconfig.py
@@ -5,6 +5,9 @@ ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='gcc'
+# bsp lib config
+BSP_LIBRARY_TYPE = None
+
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
diff --git a/bsp/stm32/stm32f103-atk-nano/SConstruct b/bsp/stm32/stm32f103-atk-nano/SConstruct
index b541737671..5514659688 100644
--- a/bsp/stm32/stm32f103-atk-nano/SConstruct
+++ b/bsp/stm32/stm32f103-atk-nano/SConstruct
@@ -38,11 +38,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
SDK_ROOT = os.path.abspath('./')
bsp_vdir = 'build'
-# include drivers
-objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/STM32F1xx_HAL/SConscript'))
+if os.path.exists(SDK_ROOT + '/libraries'):
+ libraries_path_prefix = SDK_ROOT + '/libraries/'
+else:
+ libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries/'
+
+stm32_library = 'STM32F1xx_HAL'
+rtconfig.BSP_LIBRARY_TYPE = stm32_library
# include libraries
-objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/HAL_Drivers/SConscript'))
+objs.extend(SConscript(libraries_path_prefix + stm32_library + '/SConscript'))
+
+# include drivers
+objs.extend(SConscript(libraries_path_prefix + '/HAL_Drivers/SConscript'))
# make a building
DoBuilding(TARGET, objs)
diff --git a/bsp/stm32/stm32f103-atk-nano/board/SConscript b/bsp/stm32/stm32f103-atk-nano/board/SConscript
index 16ac2f078b..fe2f1bb3f5 100644
--- a/bsp/stm32/stm32f103-atk-nano/board/SConscript
+++ b/bsp/stm32/stm32f103-atk-nano/board/SConscript
@@ -1,24 +1,31 @@
+import os
import rtconfig
from building import *
cwd = GetCurrentDir()
-src = Glob('board.c')
+# add general drivers
+src = Glob('board.c')
src += Glob('CubeMX_Config/Src/stm32f1xx_hal_msp.c')
if GetDepend(['BSP_USING_SPI_FLASH']):
src += Glob('ports/spi_flash_init.c')
-path = [cwd]
+path = [cwd]
path += [cwd + '/CubeMX_Config/Inc']
path += [cwd + '/ports']
+if os.path.exists(cwd + '/../libraries'):
+ startup_path_prefix = cwd + '/../libraries'
+else:
+ startup_path_prefix = cwd + '/../../libraries'
+
if rtconfig.CROSS_TOOL == 'gcc':
- src += [cwd + '/../../libraries/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f103xb.s']
+ src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f103xb.s']
elif rtconfig.CROSS_TOOL == 'keil':
- src += [cwd + '/../../libraries/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/arm/startup_stm32f103xb.s']
+ src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/arm/startup_stm32f103xb.s']
elif rtconfig.CROSS_TOOL == 'iar':
- src += [cwd + '/../../libraries/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xb.s']
+ src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xb.s']
CPPDEFINES = ['STM32F103xB']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
diff --git a/bsp/stm32/stm32f103-atk-nano/rtconfig.py b/bsp/stm32/stm32f103-atk-nano/rtconfig.py
index 7906918058..79904118e5 100644
--- a/bsp/stm32/stm32f103-atk-nano/rtconfig.py
+++ b/bsp/stm32/stm32f103-atk-nano/rtconfig.py
@@ -5,6 +5,9 @@ ARCH='arm'
CPU='cortex-m3'
CROSS_TOOL='gcc'
+# bsp lib config
+BSP_LIBRARY_TYPE = None
+
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
diff --git a/bsp/stm32/stm32f103-fire-arbitrary/SConstruct b/bsp/stm32/stm32f103-fire-arbitrary/SConstruct
index b541737671..5514659688 100644
--- a/bsp/stm32/stm32f103-fire-arbitrary/SConstruct
+++ b/bsp/stm32/stm32f103-fire-arbitrary/SConstruct
@@ -38,11 +38,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
SDK_ROOT = os.path.abspath('./')
bsp_vdir = 'build'
-# include drivers
-objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/STM32F1xx_HAL/SConscript'))
+if os.path.exists(SDK_ROOT + '/libraries'):
+ libraries_path_prefix = SDK_ROOT + '/libraries/'
+else:
+ libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries/'
+
+stm32_library = 'STM32F1xx_HAL'
+rtconfig.BSP_LIBRARY_TYPE = stm32_library
# include libraries
-objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/HAL_Drivers/SConscript'))
+objs.extend(SConscript(libraries_path_prefix + stm32_library + '/SConscript'))
+
+# include drivers
+objs.extend(SConscript(libraries_path_prefix + '/HAL_Drivers/SConscript'))
# make a building
DoBuilding(TARGET, objs)
diff --git a/bsp/stm32/stm32f103-fire-arbitrary/board/SConscript b/bsp/stm32/stm32f103-fire-arbitrary/board/SConscript
index 892d5d6fec..868e5b8a48 100644
--- a/bsp/stm32/stm32f103-fire-arbitrary/board/SConscript
+++ b/bsp/stm32/stm32f103-fire-arbitrary/board/SConscript
@@ -1,9 +1,11 @@
+import os
import rtconfig
from building import *
cwd = GetCurrentDir()
-src = Glob('board.c')
+# add general drivers
+src = Glob('board.c')
src += Glob('CubeMX_Config/Src/stm32f1xx_hal_msp.c')
if GetDepend(['BSP_USING_ETH']):
@@ -16,12 +18,17 @@ path = [cwd]
path += [cwd + '/CubeMX_Config/Inc']
path += [cwd + '/ports']
+if os.path.exists(cwd + '/../libraries'):
+ startup_path_prefix = cwd + '/../libraries'
+else:
+ startup_path_prefix = cwd + '/../../libraries'
+
if rtconfig.CROSS_TOOL == 'gcc':
- src += [cwd + '/../../libraries/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f103xe.s']
+ src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f103xe.s']
elif rtconfig.CROSS_TOOL == 'keil':
- src += [cwd + '/../../libraries/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/arm/startup_stm32f103xe.s']
+ src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/arm/startup_stm32f103xe.s']
elif rtconfig.CROSS_TOOL == 'iar':
- src += [cwd + '/../../libraries/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xe.s']
+ src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xe.s']
CPPDEFINES = ['STM32F103xE']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
diff --git a/bsp/stm32/stm32f103-fire-arbitrary/rtconfig.py b/bsp/stm32/stm32f103-fire-arbitrary/rtconfig.py
index 7906918058..79904118e5 100644
--- a/bsp/stm32/stm32f103-fire-arbitrary/rtconfig.py
+++ b/bsp/stm32/stm32f103-fire-arbitrary/rtconfig.py
@@ -5,6 +5,9 @@ ARCH='arm'
CPU='cortex-m3'
CROSS_TOOL='gcc'
+# bsp lib config
+BSP_LIBRARY_TYPE = None
+
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
diff --git a/bsp/stm32/stm32f407-atk-explorer/SConstruct b/bsp/stm32/stm32f407-atk-explorer/SConstruct
index f9b3d33a62..bcfdc31e22 100644
--- a/bsp/stm32/stm32f407-atk-explorer/SConstruct
+++ b/bsp/stm32/stm32f407-atk-explorer/SConstruct
@@ -37,11 +37,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
SDK_ROOT = os.path.abspath('./')
-# include drivers
-objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/STM32F4xx_HAL/SConscript'))
+if os.path.exists(SDK_ROOT + '/libraries'):
+ libraries_path_prefix = SDK_ROOT + '/libraries/'
+else:
+ libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries/'
+
+stm32_library = 'STM32F4xx_HAL'
+rtconfig.BSP_LIBRARY_TYPE = stm32_library
# include libraries
-objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/HAL_Drivers/SConscript'))
+objs.extend(SConscript(libraries_path_prefix + stm32_library + '/SConscript'))
+
+# include drivers
+objs.extend(SConscript(libraries_path_prefix + '/HAL_Drivers/SConscript'))
# make a building
DoBuilding(TARGET, objs)
diff --git a/bsp/stm32/stm32f407-atk-explorer/board/SConscript b/bsp/stm32/stm32f407-atk-explorer/board/SConscript
index bcaf10e784..861030d80f 100644
--- a/bsp/stm32/stm32f407-atk-explorer/board/SConscript
+++ b/bsp/stm32/stm32f407-atk-explorer/board/SConscript
@@ -1,10 +1,11 @@
+import os
import rtconfig
from building import *
cwd = GetCurrentDir()
-# add the general drivers.
-src = Glob('board.c')
+# add general drivers
+src = Glob('board.c')
src += Glob('CubeMX_Config/Src/stm32f4xx_hal_msp.c')
if GetDepend(['BSP_USING_ETH']):
@@ -17,12 +18,17 @@ path = [cwd]
path += [cwd + '/CubeMX_Config/Inc']
path += [cwd + '/ports']
+if os.path.exists(cwd + '/../libraries'):
+ startup_path_prefix = cwd + '/../libraries'
+else:
+ startup_path_prefix = cwd + '/../../libraries'
+
if rtconfig.CROSS_TOOL == 'gcc':
- src += [cwd + '/../../libraries/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s']
+ src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s']
elif rtconfig.CROSS_TOOL == 'keil':
- src += [cwd + '/../../libraries/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f407xx.s']
+ src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f407xx.s']
elif rtconfig.CROSS_TOOL == 'iar':
- src += [cwd + '/../../libraries/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f407xx.s']
+ src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f407xx.s']
CPPDEFINES = ['STM32F407xx']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
diff --git a/bsp/stm32/stm32f407-atk-explorer/rtconfig.py b/bsp/stm32/stm32f407-atk-explorer/rtconfig.py
index ce04832ca5..2e3b7cf492 100644
--- a/bsp/stm32/stm32f407-atk-explorer/rtconfig.py
+++ b/bsp/stm32/stm32f407-atk-explorer/rtconfig.py
@@ -5,6 +5,9 @@ ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='gcc'
+# bsp lib config
+BSP_LIBRARY_TYPE = None
+
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
diff --git a/bsp/stm32/stm32f429-atk-apollo/SConstruct b/bsp/stm32/stm32f429-atk-apollo/SConstruct
index f9b3d33a62..bcfdc31e22 100644
--- a/bsp/stm32/stm32f429-atk-apollo/SConstruct
+++ b/bsp/stm32/stm32f429-atk-apollo/SConstruct
@@ -37,11 +37,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
SDK_ROOT = os.path.abspath('./')
-# include drivers
-objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/STM32F4xx_HAL/SConscript'))
+if os.path.exists(SDK_ROOT + '/libraries'):
+ libraries_path_prefix = SDK_ROOT + '/libraries/'
+else:
+ libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries/'
+
+stm32_library = 'STM32F4xx_HAL'
+rtconfig.BSP_LIBRARY_TYPE = stm32_library
# include libraries
-objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/HAL_Drivers/SConscript'))
+objs.extend(SConscript(libraries_path_prefix + stm32_library + '/SConscript'))
+
+# include drivers
+objs.extend(SConscript(libraries_path_prefix + '/HAL_Drivers/SConscript'))
# make a building
DoBuilding(TARGET, objs)
diff --git a/bsp/stm32/stm32f429-atk-apollo/board/SConscript b/bsp/stm32/stm32f429-atk-apollo/board/SConscript
index f58944ccbf..9e38a44209 100644
--- a/bsp/stm32/stm32f429-atk-apollo/board/SConscript
+++ b/bsp/stm32/stm32f429-atk-apollo/board/SConscript
@@ -1,9 +1,10 @@
+import os
import rtconfig
from building import *
cwd = GetCurrentDir()
-# add the general drivers.
+# add general drivers
src = Glob('board.c')
src += Glob('CubeMX_Config/Src/stm32f4xx_hal_msp.c')
@@ -16,17 +17,18 @@ if GetDepend(['BSP_USING_SPI_FLASH']):
path = [cwd]
path += [cwd + '/CubeMX_Config/Inc']
path += [cwd + '/ports']
-
-
-if GetDepend(['BSP_USING_SDRAM']):
- path += [cwd + '/ports']
+
+if os.path.exists(cwd + '/../libraries'):
+ startup_path_prefix = cwd + '/../libraries'
+else:
+ startup_path_prefix = cwd + '/../../libraries'
if rtconfig.CROSS_TOOL == 'gcc':
- src += [cwd + '/../../libraries/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f429xx.s']
+ src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f429xx.s']
elif rtconfig.CROSS_TOOL == 'keil':
- src += [cwd + '/../../libraries/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f429xx.s']
+ src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f429xx.s']
elif rtconfig.CROSS_TOOL == 'iar':
- src += [cwd + '/../../libraries/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f429xx.s']
+ src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f429xx.s']
CPPDEFINES = ['STM32F429xx']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
diff --git a/bsp/stm32/stm32f429-atk-apollo/rtconfig.py b/bsp/stm32/stm32f429-atk-apollo/rtconfig.py
index ce04832ca5..2e3b7cf492 100644
--- a/bsp/stm32/stm32f429-atk-apollo/rtconfig.py
+++ b/bsp/stm32/stm32f429-atk-apollo/rtconfig.py
@@ -5,6 +5,9 @@ ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='gcc'
+# bsp lib config
+BSP_LIBRARY_TYPE = None
+
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
diff --git a/bsp/stm32/stm32f429-fire-challenger/SConstruct b/bsp/stm32/stm32f429-fire-challenger/SConstruct
index f9b3d33a62..bcfdc31e22 100644
--- a/bsp/stm32/stm32f429-fire-challenger/SConstruct
+++ b/bsp/stm32/stm32f429-fire-challenger/SConstruct
@@ -37,11 +37,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
SDK_ROOT = os.path.abspath('./')
-# include drivers
-objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/STM32F4xx_HAL/SConscript'))
+if os.path.exists(SDK_ROOT + '/libraries'):
+ libraries_path_prefix = SDK_ROOT + '/libraries/'
+else:
+ libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries/'
+
+stm32_library = 'STM32F4xx_HAL'
+rtconfig.BSP_LIBRARY_TYPE = stm32_library
# include libraries
-objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/HAL_Drivers/SConscript'))
+objs.extend(SConscript(libraries_path_prefix + stm32_library + '/SConscript'))
+
+# include drivers
+objs.extend(SConscript(libraries_path_prefix + '/HAL_Drivers/SConscript'))
# make a building
DoBuilding(TARGET, objs)
diff --git a/bsp/stm32/stm32f429-fire-challenger/board/SConscript b/bsp/stm32/stm32f429-fire-challenger/board/SConscript
index b42904e35d..00d86f2c33 100644
--- a/bsp/stm32/stm32f429-fire-challenger/board/SConscript
+++ b/bsp/stm32/stm32f429-fire-challenger/board/SConscript
@@ -1,10 +1,11 @@
+import os
import rtconfig
from building import *
cwd = GetCurrentDir()
-# add the general drivers.
-src = Glob('board.c')
+# add general drivers
+src = Glob('board.c')
src += Glob('CubeMX_Config/Src/stm32f4xx_hal_msp.c')
if GetDepend(['BSP_USING_ETH']):
@@ -13,19 +14,21 @@ if GetDepend(['BSP_USING_ETH']):
if GetDepend(['BSP_USING_SPI_FLASH']):
src += Glob('ports/spi_flash_init.c')
-path = [cwd]
+path = [cwd]
path += [cwd + '/CubeMX_Config/Inc']
path += [cwd + '/ports']
-if GetDepend(['BSP_USING_SDRAM']):
- path += [cwd + '/ports']
+if os.path.exists(cwd + '/../libraries'):
+ startup_path_prefix = cwd + '/../libraries'
+else:
+ startup_path_prefix = cwd + '/../../libraries'
if rtconfig.CROSS_TOOL == 'gcc':
- src += [cwd + '/../../libraries/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f429xx.s']
+ src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f429xx.s']
elif rtconfig.CROSS_TOOL == 'keil':
- src += [cwd + '/../../libraries/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f429xx.s']
+ src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f429xx.s']
elif rtconfig.CROSS_TOOL == 'iar':
- src += [cwd + '/../../libraries/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f429xx.s']
+ src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f429xx.s']
CPPDEFINES = ['STM32F429xx']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
diff --git a/bsp/stm32/stm32f429-fire-challenger/rtconfig.py b/bsp/stm32/stm32f429-fire-challenger/rtconfig.py
index ce04832ca5..2e3b7cf492 100644
--- a/bsp/stm32/stm32f429-fire-challenger/rtconfig.py
+++ b/bsp/stm32/stm32f429-fire-challenger/rtconfig.py
@@ -5,6 +5,9 @@ ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='gcc'
+# bsp lib config
+BSP_LIBRARY_TYPE = None
+
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):