Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Keyboard Man_俊
rt-thread
提交
8ea5b770
R
rt-thread
项目概览
Keyboard Man_俊
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
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,发现更多精彩内容 >>
未验证
提交
8ea5b770
编写于
11月 21, 2018
作者:
B
Bernard Xiong
提交者:
GitHub
11月 21, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1989 from RT-Thread/tools_ses
[Tools] Add a draft project generator for SES.
上级
25ee668f
27ec671e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
144 addition
and
2 deletion
+144
-2
bsp/stm32f411-nucleo/template.emProject
bsp/stm32f411-nucleo/template.emProject
+45
-0
tools/building.py
tools/building.py
+7
-2
tools/ses.py
tools/ses.py
+92
-0
未找到文件。
bsp/stm32f411-nucleo/template.emProject
0 → 100644
浏览文件 @
8ea5b770
<!DOCTYPE CrossStudio_Project_File>
<solution
Name=
"RT-Thread"
target=
"8"
version=
"2"
>
<project
Name=
"rtthread"
>
<configuration
Name=
"Common"
arm_architecture=
"v7M"
arm_core_type=
"Cortex-M3"
arm_endian=
"Little"
arm_fp_abi=
"Soft"
arm_fpu_type=
"None"
arm_linker_heap_size=
"1024"
arm_linker_process_stack_size=
"0"
arm_linker_stack_size=
"1024"
arm_linker_variant=
"SEGGER"
arm_simulator_memory_simulation_parameter=
"RWX 00000000,00100000,FFFFFFFF;RWX 20000000,00010000,CDCDCDCD"
arm_target_device_name=
"Cortex-M3"
arm_target_interface_type=
"SWD"
debug_target_connection=
"Simulator"
link_linker_script_file=
"$(StudioDir)/samples/SEGGER_Flash.icf"
linker_output_format=
"hex"
linker_section_placements_segments=
"FLASH RX 0x00000000 0x00100000;RAM RWX 0x20000000 0x00010000"
project_directory=
""
project_type=
"Executable"
/>
<configuration
Name=
"Debug"
arm_linker_variant=
"GNU"
c_preprocessor_definitions=
"RT_USING_NEWLIB"
c_user_include_directories=
"."
gcc_entry_point=
"Reset_Handler"
link_linker_script_file=
"$(ProjectDir)/stm32_rom.ld"
link_use_linker_script_file=
"Yes"
linker_output_format=
"bin"
/>
</project>
<configuration
Name=
"Debug"
c_preprocessor_definitions=
"DEBUG"
gcc_debugging_level=
"Level 3"
gcc_optimization_level=
"None"
/>
<configuration
Name=
"Release"
c_preprocessor_definitions=
"NDEBUG"
gcc_debugging_level=
"None"
gcc_omit_frame_pointer=
"Yes"
gcc_optimization_level=
"Level 1"
/>
</solution>
tools/building.py
浏览文件 @
8ea5b770
...
...
@@ -184,7 +184,7 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
AddOption
(
'--target'
,
dest
=
'target'
,
type
=
'string'
,
help
=
'set target project: mdk/mdk4/mdk5/iar/vs/vsc/ua/cdk'
)
help
=
'set target project: mdk/mdk4/mdk5/iar/vs/vsc/ua/cdk
/ses
'
)
AddOption
(
'--genconfig'
,
dest
=
'genconfig'
,
action
=
'store_true'
,
...
...
@@ -224,7 +224,8 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
'vsc'
:
(
'gcc'
,
'gcc'
),
'cb'
:(
'keil'
,
'armcc'
),
'ua'
:(
'gcc'
,
'gcc'
),
'cdk'
:(
'gcc'
,
'gcc'
)}
'cdk'
:(
'gcc'
,
'gcc'
),
'ses'
:
(
'gcc'
,
'gcc'
)}
tgt_name
=
GetOption
(
'target'
)
if
tgt_name
:
...
...
@@ -797,6 +798,10 @@ def GenTargetProject(program = None):
from
cdk
import
CDKProject
CDKProject
(
'project.cdkproj'
,
Projects
)
if
GetOption
(
'target'
)
==
'ses'
:
from
ses
import
SESProject
SESProject
(
Env
)
def
EndBuilding
(
target
,
program
=
None
):
import
rtconfig
...
...
tools/ses.py
0 → 100644
浏览文件 @
8ea5b770
# SEGGER Embedded Studio Project Generator
import
os
import
sys
import
xml.etree.ElementTree
as
etree
from
xml.etree.ElementTree
import
SubElement
from
utils
import
_make_path_relative
from
utils
import
xml_indent
from
utils
import
ProjectInfo
def
SDKAddGroup
(
parent
,
name
,
files
,
project_path
):
# don't add an empty group
if
len
(
files
)
==
0
:
return
group
=
SubElement
(
parent
,
'folder'
,
attrib
=
{
'Name'
:
name
})
for
f
in
files
:
fn
=
f
.
rfile
()
name
=
fn
.
name
path
=
os
.
path
.
dirname
(
fn
.
abspath
)
basename
=
os
.
path
.
basename
(
path
)
path
=
_make_path_relative
(
project_path
,
path
)
elm_attr_name
=
os
.
path
.
join
(
path
,
name
)
file
=
SubElement
(
group
,
'file'
,
attrib
=
{
'file_name'
:
elm_attr_name
})
return
group
def
SESProject
(
env
)
:
target
=
'project.emProject'
tree
=
etree
.
parse
(
'template.emProject'
)
# print(etree.dump(tree.getroot()))
# etree.dump(tree.getroot())
project
=
ProjectInfo
(
env
)
# print(project)
# return
project_path
=
os
.
path
.
abspath
(
env
[
'BSP_ROOT'
])
script
=
env
[
'project'
]
root
=
tree
.
getroot
()
out
=
file
(
target
,
'w'
)
out
.
write
(
'<!DOCTYPE CrossStudio_Project_File>
\n
'
)
CPPPATH
=
[]
CPPDEFINES
=
[]
LINKFLAGS
=
''
CCFLAGS
=
''
project_node
=
tree
.
find
(
'project'
)
for
group
in
script
:
# print(group)
group_tree
=
SDKAddGroup
(
project_node
,
group
[
'name'
],
group
[
'src'
],
project_path
)
# get each group's cc flags
if
group
.
has_key
(
'CCFLAGS'
)
and
group
[
'CCFLAGS'
]:
if
CCFLAGS
:
CCFLAGS
+=
' '
+
group
[
'CCFLAGS'
]
else
:
CCFLAGS
+=
group
[
'CCFLAGS'
]
# get each group's link flags
if
group
.
has_key
(
'LINKFLAGS'
)
and
group
[
'LINKFLAGS'
]:
if
LINKFLAGS
:
LINKFLAGS
+=
' '
+
group
[
'LINKFLAGS'
]
else
:
LINKFLAGS
+=
group
[
'LINKFLAGS'
]
# write include path, definitions and link flags
path
=
';'
.
join
([
_make_path_relative
(
project_path
,
os
.
path
.
normpath
(
i
))
for
i
in
project
[
'CPPPATH'
]])
path
=
path
.
replace
(
'
\\
'
,
'/'
)
defines
=
';'
.
join
(
set
(
project
[
'CPPDEFINES'
]))
node
=
tree
.
findall
(
'project/configuration'
)
for
item
in
node
:
if
item
.
get
(
'c_preprocessor_definitions'
):
item
.
set
(
'c_preprocessor_definitions'
,
defines
)
if
item
.
get
(
'c_user_include_directories'
):
item
.
set
(
'c_user_include_directories'
,
path
)
xml_indent
(
root
)
out
.
write
(
etree
.
tostring
(
root
,
encoding
=
'utf-8'
))
out
.
close
()
return
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录