summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSummerGift <[email protected]>2020-02-25 20:18:50 +0800
committerSummerGift <[email protected]>2020-02-25 20:19:26 +0800
commitabde5170dd4362460c5bdfeb93f9964e43de6ae3 (patch)
treee52596f2ecfcd180ddf27ff3a0d587d37507d097
parentd9a9b90b33501ec715021715cb98819dd88d786b (diff)
[update] stm32/stm32f767-st-nucleo/SConstruct
-rw-r--r--bsp/stm32/stm32f767-st-nucleo/SConstruct18
-rw-r--r--bsp/stm32/stm32f767-st-nucleo/board/SConscript1
2 files changed, 14 insertions, 5 deletions
diff --git a/bsp/stm32/stm32f767-st-nucleo/SConstruct b/bsp/stm32/stm32f767-st-nucleo/SConstruct
index 147d9a0e4a..050835a35a 100644
--- a/bsp/stm32/stm32f767-st-nucleo/SConstruct
+++ b/bsp/stm32/stm32f767-st-nucleo/SConstruct
@@ -34,19 +34,27 @@ if rtconfig.PLATFORM == 'iar':
Export('RTT_ROOT')
Export('rtconfig')
+SDK_ROOT = os.path.abspath('./')
+
+if os.path.exists(SDK_ROOT + '/libraries'):
+ libraries_path_prefix = SDK_ROOT + '/libraries'
+else:
+ libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries'
+
+SDK_LIB = libraries_path_prefix
+Export('SDK_LIB')
+
# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
stm32_library = 'STM32F7xx_HAL'
rtconfig.BSP_LIBRARY_TYPE = stm32_library
-SDK_ROOT = os.path.abspath('./')
+# include libraries
+objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript')))
# include drivers
-objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/STM32F7xx_HAL/SConscript'))
-
-# include libraries
-objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/HAL_Drivers/SConscript'))
+objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript')))
# make a building
DoBuilding(TARGET, objs)
diff --git a/bsp/stm32/stm32f767-st-nucleo/board/SConscript b/bsp/stm32/stm32f767-st-nucleo/board/SConscript
index f51624eb28..d8f26bb030 100644
--- a/bsp/stm32/stm32f767-st-nucleo/board/SConscript
+++ b/bsp/stm32/stm32f767-st-nucleo/board/SConscript
@@ -1,3 +1,4 @@
+import os
import rtconfig
from building import *