Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Mozi
rt-thread
提交
830387f0
R
rt-thread
项目概览
Mozi
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
830387f0
编写于
12月 13, 2018
作者:
B
Bernard Xiong
提交者:
GitHub
12月 13, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2069 from SummerGGift/add_stm32_new_framework
[bsp][stm32] optimize scons --dist function
上级
b75a809d
c692e194
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
303 addition
and
103 deletion
+303
-103
bsp/stm32/libraries/templates/stm32f10x/SConstruct
bsp/stm32/libraries/templates/stm32f10x/SConstruct
+16
-6
bsp/stm32/libraries/templates/stm32f10x/board/SConscript
bsp/stm32/libraries/templates/stm32f10x/board/SConscript
+16
-10
bsp/stm32/libraries/templates/stm32f10x/rtconfig.py
bsp/stm32/libraries/templates/stm32f10x/rtconfig.py
+3
-0
bsp/stm32/libraries/templates/stm32f4xx/SConstruct
bsp/stm32/libraries/templates/stm32f4xx/SConstruct
+16
-5
bsp/stm32/libraries/templates/stm32f4xx/board/SConscript
bsp/stm32/libraries/templates/stm32f4xx/board/SConscript
+14
-7
bsp/stm32/libraries/templates/stm32f4xx/rtconfig.py
bsp/stm32/libraries/templates/stm32f4xx/rtconfig.py
+3
-0
bsp/stm32/libraries/templates/stm32l4xx/SConstruct
bsp/stm32/libraries/templates/stm32l4xx/SConstruct
+16
-5
bsp/stm32/libraries/templates/stm32l4xx/board/SConscript
bsp/stm32/libraries/templates/stm32l4xx/board/SConscript
+14
-7
bsp/stm32/libraries/templates/stm32l4xx/rtconfig.py
bsp/stm32/libraries/templates/stm32l4xx/rtconfig.py
+3
-0
bsp/stm32/stm32f103-atk-nano/SConstruct
bsp/stm32/stm32f103-atk-nano/SConstruct
+16
-6
bsp/stm32/stm32f103-atk-nano/board/SConscript
bsp/stm32/stm32f103-atk-nano/board/SConscript
+14
-6
bsp/stm32/stm32f103-atk-nano/rtconfig.py
bsp/stm32/stm32f103-atk-nano/rtconfig.py
+3
-0
bsp/stm32/stm32f103-fire-arbitrary/SConstruct
bsp/stm32/stm32f103-fire-arbitrary/SConstruct
+16
-6
bsp/stm32/stm32f103-fire-arbitrary/board/SConscript
bsp/stm32/stm32f103-fire-arbitrary/board/SConscript
+13
-5
bsp/stm32/stm32f103-fire-arbitrary/rtconfig.py
bsp/stm32/stm32f103-fire-arbitrary/rtconfig.py
+3
-0
bsp/stm32/stm32f407-atk-explorer/SConstruct
bsp/stm32/stm32f407-atk-explorer/SConstruct
+16
-5
bsp/stm32/stm32f407-atk-explorer/board/SConscript
bsp/stm32/stm32f407-atk-explorer/board/SConscript
+13
-6
bsp/stm32/stm32f407-atk-explorer/rtconfig.py
bsp/stm32/stm32f407-atk-explorer/rtconfig.py
+3
-0
bsp/stm32/stm32f429-atk-apollo/SConstruct
bsp/stm32/stm32f429-atk-apollo/SConstruct
+16
-5
bsp/stm32/stm32f429-atk-apollo/board/SConscript
bsp/stm32/stm32f429-atk-apollo/board/SConscript
+13
-10
bsp/stm32/stm32f429-atk-apollo/rtconfig.py
bsp/stm32/stm32f429-atk-apollo/rtconfig.py
+3
-0
bsp/stm32/stm32f429-fire-challenger/SConstruct
bsp/stm32/stm32f429-fire-challenger/SConstruct
+16
-5
bsp/stm32/stm32f429-fire-challenger/board/SConscript
bsp/stm32/stm32f429-fire-challenger/board/SConscript
+13
-9
bsp/stm32/stm32f429-fire-challenger/rtconfig.py
bsp/stm32/stm32f429-fire-challenger/rtconfig.py
+3
-0
tools/building.py
tools/building.py
+3
-0
tools/mkdist.py
tools/mkdist.py
+38
-0
未找到文件。
bsp/stm32/libraries/templates/stm32f10x/SConstruct
浏览文件 @
830387f0
...
@@ -32,17 +32,27 @@ if rtconfig.PLATFORM == 'iar':
...
@@ -32,17 +32,27 @@ if rtconfig.PLATFORM == 'iar':
Export
(
'RTT_ROOT'
)
Export
(
'RTT_ROOT'
)
Export
(
'rtconfig'
)
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
# prepare building environment
objs
=
PrepareBuilding
(
env
,
RTT_ROOT
,
has_libcpu
=
False
)
objs
=
PrepareBuilding
(
env
,
RTT_ROOT
,
has_libcpu
=
False
)
SDK_ROOT
=
os
.
path
.
abspath
(
'./'
)
stm32_library
=
'STM32F1xx_HAL'
bsp_vdir
=
'build'
rtconfig
.
BSP_LIBRARY_TYPE
=
stm32_library
# include drivers
objs
.
extend
(
SConscript
(
os
.
path
.
dirname
(
SDK_ROOT
)
+
'/libraries/STM32F1xx_HAL/SConscript'
))
# include libraries
# include libraries
objs
.
extend
(
SConscript
(
os
.
path
.
dirname
(
SDK_ROOT
)
+
'/libraries/HAL_Drivers/SConscript'
))
objs
.
extend
(
SConscript
(
os
.
path
.
join
(
libraries_path_prefix
,
stm32_library
,
'SConscript'
)))
# include drivers
objs
.
extend
(
SConscript
(
os
.
path
.
join
(
libraries_path_prefix
,
'HAL_Drivers'
,
'SConscript'
)))
# make a building
# make a building
DoBuilding
(
TARGET
,
objs
)
DoBuilding
(
TARGET
,
objs
)
bsp/stm32/libraries/templates/stm32f10x/board/SConscript
浏览文件 @
830387f0
import
os
import
rtconfig
import
rtconfig
from
building
import
*
from
building
import
*
Import
(
'SDK_LIB'
)
cwd
=
GetCurrentDir
()
cwd
=
GetCurrentDir
()
# add the general drivers.
# add general drivers
src
=
Glob
(
'board.c'
)
src
=
Split
(
'''
src
+=
Glob
(
'CubeMX_Config/Src/stm32f1xx_hal_msp.c'
)
board.c
CubeMX_Config/Src/stm32f1xx_hal_msp.c
'''
)
path
=
[
cwd
]
path
=
[
cwd
]
path
+=
[
cwd
+
'/CubeMX_Config/Inc'
]
path
+=
[
cwd
+
'/CubeMX_Config/Inc'
]
startup_path_prefix
=
SDK_LIB
if
rtconfig
.
CROSS_TOOL
==
'gcc'
:
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'
:
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'
:
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'
]
CPPDEFINES
=
[
'STM32F103xB'
]
group
=
DefineGroup
(
'Drivers'
,
src
,
depend
=
[
''
],
CPPPATH
=
path
,
CPPDEFINES
=
CPPDEFINES
)
group
=
DefineGroup
(
'Drivers'
,
src
,
depend
=
[
''
],
CPPPATH
=
path
,
CPPDEFINES
=
CPPDEFINES
)
Return
(
'group'
)
Return
(
'group'
)
\ No newline at end of file
bsp/stm32/libraries/templates/stm32f10x/rtconfig.py
浏览文件 @
830387f0
...
@@ -5,6 +5,9 @@ ARCH='arm'
...
@@ -5,6 +5,9 @@ ARCH='arm'
CPU
=
'cortex-m3'
CPU
=
'cortex-m3'
CROSS_TOOL
=
'gcc'
CROSS_TOOL
=
'gcc'
# bsp lib config
BSP_LIBRARY_TYPE
=
None
if
os
.
getenv
(
'RTT_CC'
):
if
os
.
getenv
(
'RTT_CC'
):
CROSS_TOOL
=
os
.
getenv
(
'RTT_CC'
)
CROSS_TOOL
=
os
.
getenv
(
'RTT_CC'
)
if
os
.
getenv
(
'RTT_ROOT'
):
if
os
.
getenv
(
'RTT_ROOT'
):
...
...
bsp/stm32/libraries/templates/stm32f4xx/SConstruct
浏览文件 @
830387f0
...
@@ -32,16 +32,27 @@ if rtconfig.PLATFORM == 'iar':
...
@@ -32,16 +32,27 @@ if rtconfig.PLATFORM == 'iar':
Export
(
'RTT_ROOT'
)
Export
(
'RTT_ROOT'
)
Export
(
'rtconfig'
)
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
# prepare building environment
objs
=
PrepareBuilding
(
env
,
RTT_ROOT
,
has_libcpu
=
False
)
objs
=
PrepareBuilding
(
env
,
RTT_ROOT
,
has_libcpu
=
False
)
SDK_ROOT
=
os
.
path
.
abspath
(
'./'
)
stm32_library
=
'STM32F4xx_HAL'
rtconfig
.
BSP_LIBRARY_TYPE
=
stm32_library
# include drivers
objs
.
extend
(
SConscript
(
os
.
path
.
dirname
(
SDK_ROOT
)
+
'/libraries/STM32F4xx_HAL/SConscript'
))
# include libraries
# include libraries
objs
.
extend
(
SConscript
(
os
.
path
.
dirname
(
SDK_ROOT
)
+
'/libraries/HAL_Drivers/SConscript'
))
objs
.
extend
(
SConscript
(
os
.
path
.
join
(
libraries_path_prefix
,
stm32_library
,
'SConscript'
)))
# include drivers
objs
.
extend
(
SConscript
(
os
.
path
.
join
(
libraries_path_prefix
,
'HAL_Drivers'
,
'SConscript'
)))
# make a building
# make a building
DoBuilding
(
TARGET
,
objs
)
DoBuilding
(
TARGET
,
objs
)
bsp/stm32/libraries/templates/stm32f4xx/board/SConscript
浏览文件 @
830387f0
import
os
import
rtconfig
import
rtconfig
from
building
import
*
from
building
import
*
Import
(
'SDK_LIB'
)
cwd
=
GetCurrentDir
()
cwd
=
GetCurrentDir
()
# add the general drivers.
# add general drivers
src
=
Glob
(
'board.c'
)
src
=
Split
(
'''
src
+=
Glob
(
'CubeMX_Config/Src/stm32f4xx_hal_msp.c'
)
board.c
CubeMX_Config/Src/stm32f4xx_hal_msp.c
'''
)
path
=
[
cwd
]
path
=
[
cwd
]
path
+=
[
cwd
+
'/CubeMX_Config/Inc'
]
path
+=
[
cwd
+
'/CubeMX_Config/Inc'
]
startup_path_prefix
=
SDK_LIB
if
rtconfig
.
CROSS_TOOL
==
'gcc'
:
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'
:
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'
:
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'
]
CPPDEFINES
=
[
'STM32F407xx'
]
group
=
DefineGroup
(
'Drivers'
,
src
,
depend
=
[
''
],
CPPPATH
=
path
,
CPPDEFINES
=
CPPDEFINES
)
group
=
DefineGroup
(
'Drivers'
,
src
,
depend
=
[
''
],
CPPPATH
=
path
,
CPPDEFINES
=
CPPDEFINES
)
...
...
bsp/stm32/libraries/templates/stm32f4xx/rtconfig.py
浏览文件 @
830387f0
...
@@ -5,6 +5,9 @@ ARCH='arm'
...
@@ -5,6 +5,9 @@ ARCH='arm'
CPU
=
'cortex-m4'
CPU
=
'cortex-m4'
CROSS_TOOL
=
'gcc'
CROSS_TOOL
=
'gcc'
# bsp lib config
BSP_LIBRARY_TYPE
=
None
if
os
.
getenv
(
'RTT_CC'
):
if
os
.
getenv
(
'RTT_CC'
):
CROSS_TOOL
=
os
.
getenv
(
'RTT_CC'
)
CROSS_TOOL
=
os
.
getenv
(
'RTT_CC'
)
if
os
.
getenv
(
'RTT_ROOT'
):
if
os
.
getenv
(
'RTT_ROOT'
):
...
...
bsp/stm32/libraries/templates/stm32l4xx/SConstruct
浏览文件 @
830387f0
...
@@ -32,16 +32,27 @@ if rtconfig.PLATFORM == 'iar':
...
@@ -32,16 +32,27 @@ if rtconfig.PLATFORM == 'iar':
Export
(
'RTT_ROOT'
)
Export
(
'RTT_ROOT'
)
Export
(
'rtconfig'
)
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
# prepare building environment
objs
=
PrepareBuilding
(
env
,
RTT_ROOT
,
has_libcpu
=
False
)
objs
=
PrepareBuilding
(
env
,
RTT_ROOT
,
has_libcpu
=
False
)
SDK_ROOT
=
os
.
path
.
abspath
(
'./'
)
stm32_library
=
'STM32L4xx_HAL'
rtconfig
.
BSP_LIBRARY_TYPE
=
stm32_library
# include drivers
objs
.
extend
(
SConscript
(
os
.
path
.
dirname
(
SDK_ROOT
)
+
'/libraries/STM32L4xx_HAL/SConscript'
))
# include libraries
# include libraries
objs
.
extend
(
SConscript
(
os
.
path
.
dirname
(
SDK_ROOT
)
+
'/libraries/HAL_Drivers/SConscript'
))
objs
.
extend
(
SConscript
(
os
.
path
.
join
(
libraries_path_prefix
,
stm32_library
,
'SConscript'
)))
# include drivers
objs
.
extend
(
SConscript
(
os
.
path
.
join
(
libraries_path_prefix
,
'HAL_Drivers'
,
'SConscript'
)))
# make a building
# make a building
DoBuilding
(
TARGET
,
objs
)
DoBuilding
(
TARGET
,
objs
)
bsp/stm32/libraries/templates/stm32l4xx/board/SConscript
浏览文件 @
830387f0
import
os
import
rtconfig
import
rtconfig
from
building
import
*
from
building
import
*
Import
(
'SDK_LIB'
)
cwd
=
GetCurrentDir
()
cwd
=
GetCurrentDir
()
# add the general drivers.
# add general drivers
src
=
Glob
(
'board.c'
)
src
=
Split
(
'''
src
+=
Glob
(
'CubeMX_Config/Src/stm32l4xx_hal_msp.c'
)
board.c
CubeMX_Config/Src/stm32l4xx_hal_msp.c
'''
)
path
=
[
cwd
]
path
=
[
cwd
]
path
+=
[
cwd
+
'/CubeMX_Config/Inc'
]
path
+=
[
cwd
+
'/CubeMX_Config/Inc'
]
startup_path_prefix
=
SDK_LIB
if
rtconfig
.
CROSS_TOOL
==
'gcc'
:
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'
:
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'
:
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'
]
CPPDEFINES
=
[
'STM32L475xx'
]
group
=
DefineGroup
(
'Drivers'
,
src
,
depend
=
[
''
],
CPPPATH
=
path
,
CPPDEFINES
=
CPPDEFINES
)
group
=
DefineGroup
(
'Drivers'
,
src
,
depend
=
[
''
],
CPPPATH
=
path
,
CPPDEFINES
=
CPPDEFINES
)
...
...
bsp/stm32/libraries/templates/stm32l4xx/rtconfig.py
浏览文件 @
830387f0
...
@@ -5,6 +5,9 @@ ARCH='arm'
...
@@ -5,6 +5,9 @@ ARCH='arm'
CPU
=
'cortex-m4'
CPU
=
'cortex-m4'
CROSS_TOOL
=
'gcc'
CROSS_TOOL
=
'gcc'
# bsp lib config
BSP_LIBRARY_TYPE
=
None
if
os
.
getenv
(
'RTT_CC'
):
if
os
.
getenv
(
'RTT_CC'
):
CROSS_TOOL
=
os
.
getenv
(
'RTT_CC'
)
CROSS_TOOL
=
os
.
getenv
(
'RTT_CC'
)
if
os
.
getenv
(
'RTT_ROOT'
):
if
os
.
getenv
(
'RTT_ROOT'
):
...
...
bsp/stm32/stm32f103-atk-nano/SConstruct
浏览文件 @
830387f0
...
@@ -32,17 +32,27 @@ if rtconfig.PLATFORM == 'iar':
...
@@ -32,17 +32,27 @@ if rtconfig.PLATFORM == 'iar':
Export
(
'RTT_ROOT'
)
Export
(
'RTT_ROOT'
)
Export
(
'rtconfig'
)
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
# prepare building environment
objs
=
PrepareBuilding
(
env
,
RTT_ROOT
,
has_libcpu
=
False
)
objs
=
PrepareBuilding
(
env
,
RTT_ROOT
,
has_libcpu
=
False
)
SDK_ROOT
=
os
.
path
.
abspath
(
'./'
)
stm32_library
=
'STM32F1xx_HAL'
bsp_vdir
=
'build'
rtconfig
.
BSP_LIBRARY_TYPE
=
stm32_library
# include drivers
objs
.
extend
(
SConscript
(
os
.
path
.
dirname
(
SDK_ROOT
)
+
'/libraries/STM32F1xx_HAL/SConscript'
))
# include libraries
# include libraries
objs
.
extend
(
SConscript
(
os
.
path
.
dirname
(
SDK_ROOT
)
+
'/libraries/HAL_Drivers/SConscript'
))
objs
.
extend
(
SConscript
(
os
.
path
.
join
(
libraries_path_prefix
,
stm32_library
,
'SConscript'
)))
# include drivers
objs
.
extend
(
SConscript
(
os
.
path
.
join
(
libraries_path_prefix
,
'HAL_Drivers'
,
'SConscript'
)))
# make a building
# make a building
DoBuilding
(
TARGET
,
objs
)
DoBuilding
(
TARGET
,
objs
)
bsp/stm32/stm32f103-atk-nano/board/SConscript
浏览文件 @
830387f0
import
os
import
rtconfig
import
rtconfig
from
building
import
*
from
building
import
*
Import
(
'SDK_LIB'
)
cwd
=
GetCurrentDir
()
cwd
=
GetCurrentDir
()
src
=
Glob
(
'board.c'
)
# add general drivers
src
+=
Glob
(
'CubeMX_Config/Src/stm32f1xx_hal_msp.c'
)
src
=
Split
(
'''
board.c
CubeMX_Config/Src/stm32f1xx_hal_msp.c
'''
)
if
GetDepend
([
'BSP_USING_SPI_FLASH'
]):
if
GetDepend
([
'BSP_USING_SPI_FLASH'
]):
src
+=
Glob
(
'ports/spi_flash_init.c'
)
src
+=
Glob
(
'ports/spi_flash_init.c'
)
path
=
[
cwd
]
path
=
[
cwd
]
path
+=
[
cwd
+
'/CubeMX_Config/Inc'
]
path
+=
[
cwd
+
'/CubeMX_Config/Inc'
]
path
+=
[
cwd
+
'/ports'
]
path
+=
[
cwd
+
'/ports'
]
startup_path_prefix
=
SDK_LIB
if
rtconfig
.
CROSS_TOOL
==
'gcc'
:
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'
:
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'
:
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'
]
CPPDEFINES
=
[
'STM32F103xB'
]
group
=
DefineGroup
(
'Drivers'
,
src
,
depend
=
[
''
],
CPPPATH
=
path
,
CPPDEFINES
=
CPPDEFINES
)
group
=
DefineGroup
(
'Drivers'
,
src
,
depend
=
[
''
],
CPPPATH
=
path
,
CPPDEFINES
=
CPPDEFINES
)
...
...
bsp/stm32/stm32f103-atk-nano/rtconfig.py
浏览文件 @
830387f0
...
@@ -5,6 +5,9 @@ ARCH='arm'
...
@@ -5,6 +5,9 @@ ARCH='arm'
CPU
=
'cortex-m3'
CPU
=
'cortex-m3'
CROSS_TOOL
=
'gcc'
CROSS_TOOL
=
'gcc'
# bsp lib config
BSP_LIBRARY_TYPE
=
None
if
os
.
getenv
(
'RTT_CC'
):
if
os
.
getenv
(
'RTT_CC'
):
CROSS_TOOL
=
os
.
getenv
(
'RTT_CC'
)
CROSS_TOOL
=
os
.
getenv
(
'RTT_CC'
)
if
os
.
getenv
(
'RTT_ROOT'
):
if
os
.
getenv
(
'RTT_ROOT'
):
...
...
bsp/stm32/stm32f103-fire-arbitrary/SConstruct
浏览文件 @
830387f0
...
@@ -32,17 +32,27 @@ if rtconfig.PLATFORM == 'iar':
...
@@ -32,17 +32,27 @@ if rtconfig.PLATFORM == 'iar':
Export
(
'RTT_ROOT'
)
Export
(
'RTT_ROOT'
)
Export
(
'rtconfig'
)
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
# prepare building environment
objs
=
PrepareBuilding
(
env
,
RTT_ROOT
,
has_libcpu
=
False
)
objs
=
PrepareBuilding
(
env
,
RTT_ROOT
,
has_libcpu
=
False
)
SDK_ROOT
=
os
.
path
.
abspath
(
'./'
)
stm32_library
=
'STM32F1xx_HAL'
bsp_vdir
=
'build'
rtconfig
.
BSP_LIBRARY_TYPE
=
stm32_library
# include drivers
objs
.
extend
(
SConscript
(
os
.
path
.
dirname
(
SDK_ROOT
)
+
'/libraries/STM32F1xx_HAL/SConscript'
))
# include libraries
# include libraries
objs
.
extend
(
SConscript
(
os
.
path
.
dirname
(
SDK_ROOT
)
+
'/libraries/HAL_Drivers/SConscript'
))
objs
.
extend
(
SConscript
(
os
.
path
.
join
(
libraries_path_prefix
,
stm32_library
,
'SConscript'
)))
# include drivers
objs
.
extend
(
SConscript
(
os
.
path
.
join
(
libraries_path_prefix
,
'HAL_Drivers'
,
'SConscript'
)))
# make a building
# make a building
DoBuilding
(
TARGET
,
objs
)
DoBuilding
(
TARGET
,
objs
)
bsp/stm32/stm32f103-fire-arbitrary/board/SConscript
浏览文件 @
830387f0
import
os
import
rtconfig
import
rtconfig
from
building
import
*
from
building
import
*
Import
(
'SDK_LIB'
)
cwd
=
GetCurrentDir
()
cwd
=
GetCurrentDir
()
src
=
Glob
(
'board.c'
)
# add general drivers
src
+=
Glob
(
'CubeMX_Config/Src/stm32f1xx_hal_msp.c'
)
src
=
Split
(
'''
board.c
CubeMX_Config/Src/stm32f1xx_hal_msp.c
'''
)
if
GetDepend
([
'BSP_USING_ETH'
]):
if
GetDepend
([
'BSP_USING_ETH'
]):
src
+=
Glob
(
'ports/w5500_device.c'
)
src
+=
Glob
(
'ports/w5500_device.c'
)
...
@@ -16,12 +22,14 @@ path = [cwd]
...
@@ -16,12 +22,14 @@ path = [cwd]
path
+=
[
cwd
+
'/CubeMX_Config/Inc'
]
path
+=
[
cwd
+
'/CubeMX_Config/Inc'
]
path
+=
[
cwd
+
'/ports'
]
path
+=
[
cwd
+
'/ports'
]
startup_path_prefix
=
SDK_LIB
if
rtconfig
.
CROSS_TOOL
==
'gcc'
:
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'
:
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'
:
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'
]
CPPDEFINES
=
[
'STM32F103xE'
]
group
=
DefineGroup
(
'Drivers'
,
src
,
depend
=
[
''
],
CPPPATH
=
path
,
CPPDEFINES
=
CPPDEFINES
)
group
=
DefineGroup
(
'Drivers'
,
src
,
depend
=
[
''
],
CPPPATH
=
path
,
CPPDEFINES
=
CPPDEFINES
)
...
...
bsp/stm32/stm32f103-fire-arbitrary/rtconfig.py
浏览文件 @
830387f0
...
@@ -5,6 +5,9 @@ ARCH='arm'
...
@@ -5,6 +5,9 @@ ARCH='arm'
CPU
=
'cortex-m3'
CPU
=
'cortex-m3'
CROSS_TOOL
=
'gcc'
CROSS_TOOL
=
'gcc'
# bsp lib config
BSP_LIBRARY_TYPE
=
None
if
os
.
getenv
(
'RTT_CC'
):
if
os
.
getenv
(
'RTT_CC'
):
CROSS_TOOL
=
os
.
getenv
(
'RTT_CC'
)
CROSS_TOOL
=
os
.
getenv
(
'RTT_CC'
)
if
os
.
getenv
(
'RTT_ROOT'
):
if
os
.
getenv
(
'RTT_ROOT'
):
...
...
bsp/stm32/stm32f407-atk-explorer/SConstruct
浏览文件 @
830387f0
...
@@ -32,16 +32,27 @@ if rtconfig.PLATFORM == 'iar':
...
@@ -32,16 +32,27 @@ if rtconfig.PLATFORM == 'iar':
Export
(
'RTT_ROOT'
)
Export
(
'RTT_ROOT'
)
Export
(
'rtconfig'
)
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
# prepare building environment
objs
=
PrepareBuilding
(
env
,
RTT_ROOT
,
has_libcpu
=
False
)
objs
=
PrepareBuilding
(
env
,
RTT_ROOT
,
has_libcpu
=
False
)
SDK_ROOT
=
os
.
path
.
abspath
(
'./'
)
stm32_library
=
'STM32F4xx_HAL'
rtconfig
.
BSP_LIBRARY_TYPE
=
stm32_library
# include drivers
objs
.
extend
(
SConscript
(
os
.
path
.
dirname
(
SDK_ROOT
)
+
'/libraries/STM32F4xx_HAL/SConscript'
))
# include libraries
# include libraries
objs
.
extend
(
SConscript
(
os
.
path
.
dirname
(
SDK_ROOT
)
+
'/libraries/HAL_Drivers/SConscript'
))
objs
.
extend
(
SConscript
(
os
.
path
.
join
(
libraries_path_prefix
,
stm32_library
,
'SConscript'
)))
# include drivers
objs
.
extend
(
SConscript
(
os
.
path
.
join
(
libraries_path_prefix
,
'HAL_Drivers'
,
'SConscript'
)))
# make a building
# make a building
DoBuilding
(
TARGET
,
objs
)
DoBuilding
(
TARGET
,
objs
)
bsp/stm32/stm32f407-atk-explorer/board/SConscript
浏览文件 @
830387f0
import
os
import
rtconfig
import
rtconfig
from
building
import
*
from
building
import
*
Import
(
'SDK_LIB'
)
cwd
=
GetCurrentDir
()
cwd
=
GetCurrentDir
()
# add the general drivers.
# add general drivers
src
=
Glob
(
'board.c'
)
src
=
Split
(
'''
src
+=
Glob
(
'CubeMX_Config/Src/stm32f4xx_hal_msp.c'
)
board.c
CubeMX_Config/Src/stm32f4xx_hal_msp.c
'''
)
if
GetDepend
([
'BSP_USING_ETH'
]):
if
GetDepend
([
'BSP_USING_ETH'
]):
src
+=
Glob
(
'ports/phy_reset.c'
)
src
+=
Glob
(
'ports/phy_reset.c'
)
...
@@ -17,12 +22,14 @@ path = [cwd]
...
@@ -17,12 +22,14 @@ path = [cwd]
path
+=
[
cwd
+
'/CubeMX_Config/Inc'
]
path
+=
[
cwd
+
'/CubeMX_Config/Inc'
]
path
+=
[
cwd
+
'/ports'
]
path
+=
[
cwd
+
'/ports'
]
startup_path_prefix
=
SDK_LIB
if
rtconfig
.
CROSS_TOOL
==
'gcc'
:
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'
:
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'
:
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'
]
CPPDEFINES
=
[
'STM32F407xx'
]
group
=
DefineGroup
(
'Drivers'
,
src
,
depend
=
[
''
],
CPPPATH
=
path
,
CPPDEFINES
=
CPPDEFINES
)
group
=
DefineGroup
(
'Drivers'
,
src
,
depend
=
[
''
],
CPPPATH
=
path
,
CPPDEFINES
=
CPPDEFINES
)
...
...
bsp/stm32/stm32f407-atk-explorer/rtconfig.py
浏览文件 @
830387f0
...
@@ -5,6 +5,9 @@ ARCH='arm'
...
@@ -5,6 +5,9 @@ ARCH='arm'
CPU
=
'cortex-m4'
CPU
=
'cortex-m4'
CROSS_TOOL
=
'gcc'
CROSS_TOOL
=
'gcc'
# bsp lib config
BSP_LIBRARY_TYPE
=
None
if
os
.
getenv
(
'RTT_CC'
):
if
os
.
getenv
(
'RTT_CC'
):
CROSS_TOOL
=
os
.
getenv
(
'RTT_CC'
)
CROSS_TOOL
=
os
.
getenv
(
'RTT_CC'
)
if
os
.
getenv
(
'RTT_ROOT'
):
if
os
.
getenv
(
'RTT_ROOT'
):
...
...
bsp/stm32/stm32f429-atk-apollo/SConstruct
浏览文件 @
830387f0
...
@@ -32,16 +32,27 @@ if rtconfig.PLATFORM == 'iar':
...
@@ -32,16 +32,27 @@ if rtconfig.PLATFORM == 'iar':
Export
(
'RTT_ROOT'
)
Export
(
'RTT_ROOT'
)
Export
(
'rtconfig'
)
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
# prepare building environment
objs
=
PrepareBuilding
(
env
,
RTT_ROOT
,
has_libcpu
=
False
)
objs
=
PrepareBuilding
(
env
,
RTT_ROOT
,
has_libcpu
=
False
)
SDK_ROOT
=
os
.
path
.
abspath
(
'./'
)
stm32_library
=
'STM32F4xx_HAL'
rtconfig
.
BSP_LIBRARY_TYPE
=
stm32_library
# include drivers
objs
.
extend
(
SConscript
(
os
.
path
.
dirname
(
SDK_ROOT
)
+
'/libraries/STM32F4xx_HAL/SConscript'
))
# include libraries
# include libraries
objs
.
extend
(
SConscript
(
os
.
path
.
dirname
(
SDK_ROOT
)
+
'/libraries/HAL_Drivers/SConscript'
))
objs
.
extend
(
SConscript
(
os
.
path
.
join
(
libraries_path_prefix
,
stm32_library
,
'SConscript'
)))
# include drivers
objs
.
extend
(
SConscript
(
os
.
path
.
join
(
libraries_path_prefix
,
'HAL_Drivers'
,
'SConscript'
)))
# make a building
# make a building
DoBuilding
(
TARGET
,
objs
)
DoBuilding
(
TARGET
,
objs
)
bsp/stm32/stm32f429-atk-apollo/board/SConscript
浏览文件 @
830387f0
import
os
import
rtconfig
import
rtconfig
from
building
import
*
from
building
import
*
Import
(
'SDK_LIB'
)
cwd
=
GetCurrentDir
()
cwd
=
GetCurrentDir
()
# add the general drivers.
# add general drivers
src
=
Glob
(
'board.c'
)
src
=
Split
(
'''
src
+=
Glob
(
'CubeMX_Config/Src/stm32f4xx_hal_msp.c'
)
board.c
CubeMX_Config/Src/stm32f4xx_hal_msp.c
'''
)
if
GetDepend
([
'BSP_USING_ETH'
]):
if
GetDepend
([
'BSP_USING_ETH'
]):
src
+=
Glob
(
'ports/phy_reset.c'
)
src
+=
Glob
(
'ports/phy_reset.c'
)
...
@@ -16,17 +21,15 @@ if GetDepend(['BSP_USING_SPI_FLASH']):
...
@@ -16,17 +21,15 @@ if GetDepend(['BSP_USING_SPI_FLASH']):
path
=
[
cwd
]
path
=
[
cwd
]
path
+=
[
cwd
+
'/CubeMX_Config/Inc'
]
path
+=
[
cwd
+
'/CubeMX_Config/Inc'
]
path
+=
[
cwd
+
'/ports'
]
path
+=
[
cwd
+
'/ports'
]
startup_path_prefix
=
SDK_LIB
if
GetDepend
([
'BSP_USING_SDRAM'
]):
path
+=
[
cwd
+
'/ports'
]
if
rtconfig
.
CROSS_TOOL
==
'gcc'
:
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'
:
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'
:
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'
]
CPPDEFINES
=
[
'STM32F429xx'
]
group
=
DefineGroup
(
'Drivers'
,
src
,
depend
=
[
''
],
CPPPATH
=
path
,
CPPDEFINES
=
CPPDEFINES
)
group
=
DefineGroup
(
'Drivers'
,
src
,
depend
=
[
''
],
CPPPATH
=
path
,
CPPDEFINES
=
CPPDEFINES
)
...
...
bsp/stm32/stm32f429-atk-apollo/rtconfig.py
浏览文件 @
830387f0
...
@@ -5,6 +5,9 @@ ARCH='arm'
...
@@ -5,6 +5,9 @@ ARCH='arm'
CPU
=
'cortex-m4'
CPU
=
'cortex-m4'
CROSS_TOOL
=
'gcc'
CROSS_TOOL
=
'gcc'
# bsp lib config
BSP_LIBRARY_TYPE
=
None
if
os
.
getenv
(
'RTT_CC'
):
if
os
.
getenv
(
'RTT_CC'
):
CROSS_TOOL
=
os
.
getenv
(
'RTT_CC'
)
CROSS_TOOL
=
os
.
getenv
(
'RTT_CC'
)
if
os
.
getenv
(
'RTT_ROOT'
):
if
os
.
getenv
(
'RTT_ROOT'
):
...
...
bsp/stm32/stm32f429-fire-challenger/SConstruct
浏览文件 @
830387f0
...
@@ -32,16 +32,27 @@ if rtconfig.PLATFORM == 'iar':
...
@@ -32,16 +32,27 @@ if rtconfig.PLATFORM == 'iar':
Export
(
'RTT_ROOT'
)
Export
(
'RTT_ROOT'
)
Export
(
'rtconfig'
)
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
# prepare building environment
objs
=
PrepareBuilding
(
env
,
RTT_ROOT
,
has_libcpu
=
False
)
objs
=
PrepareBuilding
(
env
,
RTT_ROOT
,
has_libcpu
=
False
)
SDK_ROOT
=
os
.
path
.
abspath
(
'./'
)
stm32_library
=
'STM32F4xx_HAL'
rtconfig
.
BSP_LIBRARY_TYPE
=
stm32_library
# include drivers
objs
.
extend
(
SConscript
(
os
.
path
.
dirname
(
SDK_ROOT
)
+
'/libraries/STM32F4xx_HAL/SConscript'
))
# include libraries
# include libraries
objs
.
extend
(
SConscript
(
os
.
path
.
dirname
(
SDK_ROOT
)
+
'/libraries/HAL_Drivers/SConscript'
))
objs
.
extend
(
SConscript
(
os
.
path
.
join
(
libraries_path_prefix
,
stm32_library
,
'SConscript'
)))
# include drivers
objs
.
extend
(
SConscript
(
os
.
path
.
join
(
libraries_path_prefix
,
'HAL_Drivers'
,
'SConscript'
)))
# make a building
# make a building
DoBuilding
(
TARGET
,
objs
)
DoBuilding
(
TARGET
,
objs
)
bsp/stm32/stm32f429-fire-challenger/board/SConscript
浏览文件 @
830387f0
import
os
import
rtconfig
import
rtconfig
from
building
import
*
from
building
import
*
Import
(
'SDK_LIB'
)
cwd
=
GetCurrentDir
()
cwd
=
GetCurrentDir
()
# add the general drivers.
# add general drivers
src
=
Glob
(
'board.c'
)
src
=
Split
(
'''
src
+=
Glob
(
'CubeMX_Config/Src/stm32f4xx_hal_msp.c'
)
board.c
CubeMX_Config/Src/stm32f4xx_hal_msp.c
'''
)
if
GetDepend
([
'BSP_USING_ETH'
]):
if
GetDepend
([
'BSP_USING_ETH'
]):
src
+=
Glob
(
'ports/phy_reset.c'
)
src
+=
Glob
(
'ports/phy_reset.c'
)
...
@@ -13,19 +18,18 @@ if GetDepend(['BSP_USING_ETH']):
...
@@ -13,19 +18,18 @@ if GetDepend(['BSP_USING_ETH']):
if
GetDepend
([
'BSP_USING_SPI_FLASH'
]):
if
GetDepend
([
'BSP_USING_SPI_FLASH'
]):
src
+=
Glob
(
'ports/spi_flash_init.c'
)
src
+=
Glob
(
'ports/spi_flash_init.c'
)
path
=
[
cwd
]
path
=
[
cwd
]
path
+=
[
cwd
+
'/CubeMX_Config/Inc'
]
path
+=
[
cwd
+
'/CubeMX_Config/Inc'
]
path
+=
[
cwd
+
'/ports'
]
path
+=
[
cwd
+
'/ports'
]
if
GetDepend
([
'BSP_USING_SDRAM'
]):
startup_path_prefix
=
SDK_LIB
path
+=
[
cwd
+
'/ports'
]
if
rtconfig
.
CROSS_TOOL
==
'gcc'
:
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'
:
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'
:
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'
]
CPPDEFINES
=
[
'STM32F429xx'
]
group
=
DefineGroup
(
'Drivers'
,
src
,
depend
=
[
''
],
CPPPATH
=
path
,
CPPDEFINES
=
CPPDEFINES
)
group
=
DefineGroup
(
'Drivers'
,
src
,
depend
=
[
''
],
CPPPATH
=
path
,
CPPDEFINES
=
CPPDEFINES
)
...
...
bsp/stm32/stm32f429-fire-challenger/rtconfig.py
浏览文件 @
830387f0
...
@@ -5,6 +5,9 @@ ARCH='arm'
...
@@ -5,6 +5,9 @@ ARCH='arm'
CPU
=
'cortex-m4'
CPU
=
'cortex-m4'
CROSS_TOOL
=
'gcc'
CROSS_TOOL
=
'gcc'
# bsp lib config
BSP_LIBRARY_TYPE
=
None
if
os
.
getenv
(
'RTT_CC'
):
if
os
.
getenv
(
'RTT_CC'
):
CROSS_TOOL
=
os
.
getenv
(
'RTT_CC'
)
CROSS_TOOL
=
os
.
getenv
(
'RTT_CC'
)
if
os
.
getenv
(
'RTT_ROOT'
):
if
os
.
getenv
(
'RTT_ROOT'
):
...
...
tools/building.py
浏览文件 @
830387f0
...
@@ -810,6 +810,9 @@ def EndBuilding(target, program = None):
...
@@ -810,6 +810,9 @@ def EndBuilding(target, program = None):
Env
[
'target'
]
=
program
Env
[
'target'
]
=
program
Env
[
'project'
]
=
Projects
Env
[
'project'
]
=
Projects
if
hasattr
(
rtconfig
,
'BSP_LIBRARY_TYPE'
):
Env
[
'bsp_lib_type'
]
=
rtconfig
.
BSP_LIBRARY_TYPE
Env
.
AddPostAction
(
target
,
rtconfig
.
POST_ACTION
)
Env
.
AddPostAction
(
target
,
rtconfig
.
POST_ACTION
)
# Add addition clean files
# Add addition clean files
Clean
(
target
,
'cconfig.h'
)
Clean
(
target
,
'cconfig.h'
)
...
...
tools/mkdist.py
浏览文件 @
830387f0
...
@@ -122,6 +122,24 @@ def bsp_update_kconfig(dist_dir):
...
@@ -122,6 +122,24 @@ def bsp_update_kconfig(dist_dir):
line
=
line
[
0
:
position
]
+
'default: "rt-thread"
\n
'
line
=
line
[
0
:
position
]
+
'default: "rt-thread"
\n
'
found
=
0
found
=
0
f
.
write
(
line
)
f
.
write
(
line
)
def
bsp_update_kconfig_library
(
dist_dir
):
# change RTT_ROOT in Kconfig
if
not
os
.
path
.
isfile
(
os
.
path
.
join
(
dist_dir
,
'Kconfig'
)):
return
with
open
(
os
.
path
.
join
(
dist_dir
,
'Kconfig'
),
'r'
)
as
f
:
data
=
f
.
readlines
()
with
open
(
os
.
path
.
join
(
dist_dir
,
'Kconfig'
),
'w'
)
as
f
:
found
=
0
for
line
in
data
:
if
line
.
find
(
'RTT_ROOT'
)
!=
-
1
:
found
=
1
if
line
.
find
(
'../libraries'
)
!=
-
1
and
found
:
position
=
line
.
find
(
'../libraries'
)
line
=
line
[
0
:
position
]
+
'libraries/Kconfig"
\n
'
found
=
0
f
.
write
(
line
)
def
bs_update_ide_project
(
bsp_root
,
rtt_root
):
def
bs_update_ide_project
(
bsp_root
,
rtt_root
):
import
subprocess
import
subprocess
...
@@ -169,6 +187,15 @@ def MkDist_Strip(program, BSP_ROOT, RTT_ROOT, Env):
...
@@ -169,6 +187,15 @@ def MkDist_Strip(program, BSP_ROOT, RTT_ROOT, Env):
print
(
'=> %s'
%
os
.
path
.
basename
(
BSP_ROOT
))
print
(
'=> %s'
%
os
.
path
.
basename
(
BSP_ROOT
))
bsp_copy_files
(
BSP_ROOT
,
dist_dir
)
bsp_copy_files
(
BSP_ROOT
,
dist_dir
)
# copy stm32 bsp libiary files
if
os
.
path
.
basename
(
os
.
path
.
dirname
(
BSP_ROOT
))
==
'stm32'
:
print
(
"=> copy stm32 bsp library"
)
library_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
BSP_ROOT
),
'libraries'
)
library_dir
=
os
.
path
.
join
(
dist_dir
,
'libraries'
)
bsp_copy_files
(
os
.
path
.
join
(
library_path
,
'HAL_Drivers'
),
os
.
path
.
join
(
library_dir
,
'HAL_Drivers'
))
bsp_copy_files
(
os
.
path
.
join
(
library_path
,
Env
[
'bsp_lib_type'
]),
os
.
path
.
join
(
library_dir
,
Env
[
'bsp_lib_type'
]))
shutil
.
copyfile
(
os
.
path
.
join
(
library_path
,
'Kconfig'
),
os
.
path
.
join
(
library_dir
,
'Kconfig'
))
# get all source files from program
# get all source files from program
for
item
in
program
:
for
item
in
program
:
walk_children
(
item
)
walk_children
(
item
)
...
@@ -260,6 +287,7 @@ def MkDist_Strip(program, BSP_ROOT, RTT_ROOT, Env):
...
@@ -260,6 +287,7 @@ def MkDist_Strip(program, BSP_ROOT, RTT_ROOT, Env):
bsp_update_sconstruct
(
dist_dir
)
bsp_update_sconstruct
(
dist_dir
)
# change RTT_ROOT in Kconfig
# change RTT_ROOT in Kconfig
bsp_update_kconfig
(
dist_dir
)
bsp_update_kconfig
(
dist_dir
)
bsp_update_kconfig_library
(
dist_dir
)
# update all project files
# update all project files
bs_update_ide_project
(
dist_dir
,
target_path
)
bs_update_ide_project
(
dist_dir
,
target_path
)
...
@@ -280,6 +308,15 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env):
...
@@ -280,6 +308,15 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env):
print
(
'=> %s'
%
os
.
path
.
basename
(
BSP_ROOT
))
print
(
'=> %s'
%
os
.
path
.
basename
(
BSP_ROOT
))
bsp_copy_files
(
BSP_ROOT
,
dist_dir
)
bsp_copy_files
(
BSP_ROOT
,
dist_dir
)
# copy stm32 bsp libiary files
if
os
.
path
.
basename
(
os
.
path
.
dirname
(
BSP_ROOT
))
==
'stm32'
:
print
(
"=> copy stm32 bsp library"
)
library_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
BSP_ROOT
),
'libraries'
)
library_dir
=
os
.
path
.
join
(
dist_dir
,
'libraries'
)
bsp_copy_files
(
os
.
path
.
join
(
library_path
,
'HAL_Drivers'
),
os
.
path
.
join
(
library_dir
,
'HAL_Drivers'
))
bsp_copy_files
(
os
.
path
.
join
(
library_path
,
Env
[
'bsp_lib_type'
]),
os
.
path
.
join
(
library_dir
,
Env
[
'bsp_lib_type'
]))
shutil
.
copyfile
(
os
.
path
.
join
(
library_path
,
'Kconfig'
),
os
.
path
.
join
(
library_dir
,
'Kconfig'
))
# copy tools directory
# copy tools directory
print
(
'=> components'
)
print
(
'=> components'
)
do_copy_folder
(
os
.
path
.
join
(
RTT_ROOT
,
'components'
),
os
.
path
.
join
(
target_path
,
'components'
))
do_copy_folder
(
os
.
path
.
join
(
RTT_ROOT
,
'components'
),
os
.
path
.
join
(
target_path
,
'components'
))
...
@@ -316,6 +353,7 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env):
...
@@ -316,6 +353,7 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env):
bsp_update_sconstruct
(
dist_dir
)
bsp_update_sconstruct
(
dist_dir
)
# change RTT_ROOT in Kconfig
# change RTT_ROOT in Kconfig
bsp_update_kconfig
(
dist_dir
)
bsp_update_kconfig
(
dist_dir
)
bsp_update_kconfig_library
(
dist_dir
)
# update all project files
# update all project files
bs_update_ide_project
(
dist_dir
,
target_path
)
bs_update_ide_project
(
dist_dir
,
target_path
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录