Skip to content

Commit 2d61dff

Browse files
committed
[Nucleo_F103RB] exporter to gcc_arm and coide
1 parent df25f50 commit 2d61dff

File tree

4 files changed

+241
-0
lines changed

4 files changed

+241
-0
lines changed

workspace_tools/export/coide.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class CoIDE(Exporter):
3333
'NUCLEO_L152RE',
3434
'NUCLEO_F030R8',
3535
'NUCLEO_F072RB',
36+
'NUCLEO_F103RB',
3637
'NUCLEO_F302R8',
3738
'NUCLEO_F334R8',
3839
'NUCLEO_F401RE',
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<Project version="2G - 1.7.5" name="{{name}}">
3+
<Target name="Release" isCurrent="1">
4+
<Device manufacturerId="9" manufacturerName="ST" chipId="310" chipName="STM32F103RB" boardId="" boardName=""/>
5+
<BuildOption>
6+
<Compile>
7+
<Option name="OptimizationLevel" value="4"/>
8+
<Option name="UseFPU" value="0"/>
9+
<Option name="UserEditCompiler" value="-fno-common; -fmessage-length=0; -Wall; -fno-strict-aliasing; -fno-rtti; -fno-exceptions; -ffunction-sections; -fdata-sections; -std=gnu++98"/>
10+
<Option name="FPU" value="1"/>
11+
<Option name="SupportCPlusplus" value="1"/>
12+
<Includepaths>
13+
{% for path in include_paths %} <Includepath path="{{path}}"/> {% endfor %}
14+
</Includepaths>
15+
<DefinedSymbols>
16+
{% for s in symbols %} <Define name="{{s}}"/> {% endfor %}
17+
</DefinedSymbols>
18+
</Compile>
19+
<Link useDefault="0">
20+
<Option name="DiscardUnusedSection" value="1"/>
21+
<Option name="UserEditLinkder" value=""/>
22+
<Option name="UseMemoryLayout" value="0"/>
23+
<Option name="LTO" value="0"/>
24+
<Option name="IsNewStartupCode" value="1"/>
25+
<Option name="Library" value="Not use C Library"/>
26+
<Option name="nostartfiles" value="0"/>
27+
<Option name="UserEditLinker" value="-Wl,--wrap,main; --specs=nano.specs; -u _printf_float; -u _scanf_float; {% for file in object_files %}
28+
${project.path}/{{file}}; {% endfor %} {% for p in library_paths %}-L${project.path}/{{p}}; {% endfor %}"/>
29+
<LinkedLibraries>
30+
{% for lib in libraries %}
31+
<Libset dir="" libs="{{lib}}"/>
32+
{% endfor %}
33+
<Libset dir="" libs="stdc++"/>
34+
<Libset dir="" libs="supc++"/>
35+
<Libset dir="" libs="m"/>
36+
<Libset dir="" libs="gcc"/>
37+
<Libset dir="" libs="c"/>
38+
<Libset dir="" libs="nosys"/>
39+
</LinkedLibraries>
40+
<MemoryAreas debugInFlashNotRAM="1">
41+
<Memory name="IROM1" type="ReadOnly" size="0x00020000" startValue="0x08000000"/>
42+
<Memory name="IRAM1" type="ReadWrite" size="0x00004F14" startValue="0x200000EC"/>
43+
<Memory name="IROM2" type="ReadOnly" size="" startValue=""/>
44+
<Memory name="IRAM2" type="ReadWrite" size="" startValue=""/>
45+
</MemoryAreas>
46+
<LocateLinkFile path="{{scatter_file}}" type="0"/>
47+
</Link>
48+
<Output>
49+
<Option name="OutputFileType" value="0"/>
50+
<Option name="Path" value="./"/>
51+
<Option name="Name" value="{{name}}"/>
52+
<Option name="HEX" value="1"/>
53+
<Option name="BIN" value="1"/>
54+
</Output>
55+
<User>
56+
<UserRun name="Run#1" type="Before" checked="0" value=""/>
57+
<UserRun name="Run#1" type="After" checked="0" value=""/>
58+
</User>
59+
</BuildOption>
60+
<DebugOption>
61+
<Option name="org.coocox.codebugger.gdbjtag.core.adapter" value="ST-Link"/>
62+
<Option name="org.coocox.codebugger.gdbjtag.core.debugMode" value="SWD"/>
63+
<Option name="org.coocox.codebugger.gdbjtag.core.clockDiv" value="1M"/>
64+
<Option name="org.coocox.codebugger.gdbjtag.corerunToMain" value="1"/>
65+
<Option name="org.coocox.codebugger.gdbjtag.core.jlinkgdbserver" value=""/>
66+
<Option name="org.coocox.codebugger.gdbjtag.core.userDefineGDBScript" value=""/>
67+
<Option name="org.coocox.codebugger.gdbjtag.core.targetEndianess" value="0"/>
68+
<Option name="org.coocox.codebugger.gdbjtag.core.jlinkResetMode" value="Type 0: Normal"/>
69+
<Option name="org.coocox.codebugger.gdbjtag.core.resetMode" value="SYSRESETREQ"/>
70+
<Option name="org.coocox.codebugger.gdbjtag.core.ifSemihost" value="0"/>
71+
<Option name="org.coocox.codebugger.gdbjtag.core.ifCacheRom" value="1"/>
72+
<Option name="org.coocox.codebugger.gdbjtag.core.ipAddress" value="127.0.0.1"/>
73+
<Option name="org.coocox.codebugger.gdbjtag.core.portNumber" value="2009"/>
74+
<Option name="org.coocox.codebugger.gdbjtag.core.autoDownload" value="1"/>
75+
<Option name="org.coocox.codebugger.gdbjtag.core.verify" value="1"/>
76+
<Option name="org.coocox.codebugger.gdbjtag.core.downloadFuction" value="Erase Effected"/>
77+
<Option name="org.coocox.codebugger.gdbjtag.core.defaultAlgorithm" value="./STM32F10x_MD_128.elf"/>
78+
</DebugOption>
79+
<ExcludeFile/>
80+
</Target>
81+
<Target name="Debug" isCurrent="0">
82+
<Device manufacturerId="9" manufacturerName="ST" chipId="310" chipName="STM32F103RB" boardId="" boardName=""/>
83+
<BuildOption>
84+
<Compile>
85+
<Option name="OptimizationLevel" value="0"/>
86+
<Option name="UseFPU" value="0"/>
87+
<Option name="UserEditCompiler" value="-fno-common; -fmessage-length=0; -Wall; -fno-strict-aliasing; -fno-rtti; -fno-exceptions; -ffunction-sections; -fdata-sections; -std=gnu++98"/>
88+
<Option name="FPU" value="1"/>
89+
<Option name="SupportCPlusplus" value="1"/>
90+
<Includepaths>
91+
{% for path in include_paths %} <Includepath path="{{path}}"/> {% endfor %}
92+
</Includepaths>
93+
<DefinedSymbols>
94+
{% for s in symbols %} <Define name="{{s}}"/> {% endfor %}
95+
</DefinedSymbols>
96+
</Compile>
97+
<Link useDefault="0">
98+
<Option name="DiscardUnusedSection" value="1"/>
99+
<Option name="UserEditLinkder" value=""/>
100+
<Option name="UseMemoryLayout" value="0"/>
101+
<Option name="LTO" value="0"/>
102+
<Option name="IsNewStartupCode" value="1"/>
103+
<Option name="Library" value="Not use C Library"/>
104+
<Option name="nostartfiles" value="0"/>
105+
<Option name="UserEditLinker" value="-Wl,--wrap,main; --specs=nano.specs; -u _printf_float; -u _scanf_float; {% for file in object_files %}
106+
${project.path}/{{file}}; {% endfor %} {% for p in library_paths %}-L${project.path}/{{p}}; {% endfor %}"/>
107+
<LinkedLibraries>
108+
{% for lib in libraries %}
109+
<Libset dir="" libs="{{lib}}"/>
110+
{% endfor %}
111+
<Libset dir="" libs="stdc++"/>
112+
<Libset dir="" libs="supc++"/>
113+
<Libset dir="" libs="m"/>
114+
<Libset dir="" libs="gcc"/>
115+
<Libset dir="" libs="c"/>
116+
<Libset dir="" libs="nosys"/>
117+
</LinkedLibraries>
118+
<MemoryAreas debugInFlashNotRAM="1">
119+
<Memory name="IROM1" type="ReadOnly" size="0x00020000" startValue="0x08000000"/>
120+
<Memory name="IRAM1" type="ReadWrite" size="0x00004F14" startValue="0x200000EC"/>
121+
<Memory name="IROM2" type="ReadOnly" size="" startValue=""/>
122+
<Memory name="IRAM2" type="ReadWrite" size="" startValue=""/>
123+
</MemoryAreas>
124+
<LocateLinkFile path="{{scatter_file}}" type="0"/>
125+
</Link>
126+
<Output>
127+
<Option name="OutputFileType" value="0"/>
128+
<Option name="Path" value="./"/>
129+
<Option name="Name" value="{{name}}"/>
130+
<Option name="HEX" value="1"/>
131+
<Option name="BIN" value="1"/>
132+
</Output>
133+
<User>
134+
<UserRun name="Run#1" type="Before" checked="0" value=""/>
135+
<UserRun name="Run#1" type="After" checked="0" value=""/>
136+
</User>
137+
</BuildOption>
138+
<DebugOption>
139+
<Option name="org.coocox.codebugger.gdbjtag.core.adapter" value="ST-Link"/>
140+
<Option name="org.coocox.codebugger.gdbjtag.core.debugMode" value="SWD"/>
141+
<Option name="org.coocox.codebugger.gdbjtag.core.clockDiv" value="1M"/>
142+
<Option name="org.coocox.codebugger.gdbjtag.corerunToMain" value="1"/>
143+
<Option name="org.coocox.codebugger.gdbjtag.core.jlinkgdbserver" value=""/>
144+
<Option name="org.coocox.codebugger.gdbjtag.core.userDefineGDBScript" value=""/>
145+
<Option name="org.coocox.codebugger.gdbjtag.core.targetEndianess" value="0"/>
146+
<Option name="org.coocox.codebugger.gdbjtag.core.jlinkResetMode" value="Type 0: Normal"/>
147+
<Option name="org.coocox.codebugger.gdbjtag.core.resetMode" value="SYSRESETREQ"/>
148+
<Option name="org.coocox.codebugger.gdbjtag.core.ifSemihost" value="0"/>
149+
<Option name="org.coocox.codebugger.gdbjtag.core.ifCacheRom" value="1"/>
150+
<Option name="org.coocox.codebugger.gdbjtag.core.ipAddress" value="127.0.0.1"/>
151+
<Option name="org.coocox.codebugger.gdbjtag.core.portNumber" value="2009"/>
152+
<Option name="org.coocox.codebugger.gdbjtag.core.autoDownload" value="1"/>
153+
<Option name="org.coocox.codebugger.gdbjtag.core.verify" value="1"/>
154+
<Option name="org.coocox.codebugger.gdbjtag.core.downloadFuction" value="Erase Effected"/>
155+
<Option name="org.coocox.codebugger.gdbjtag.core.defaultAlgorithm" value="./STM32F10x_MD_128.elf"/>
156+
</DebugOption>
157+
<ExcludeFile/>
158+
</Target>
159+
<Components path="./"/>
160+
<Files>
161+
{% for file in source_files %}
162+
<File name="sources/{{file.path}}" path="{{file.path}}" type="{{file.type}}"/>
163+
{% endfor %}
164+
{% for file in header_files %}
165+
<File name="headers/{{file.path}}" path="{{file.path}}" type="{{file.type}}"/>
166+
{% endfor %}
167+
</Files>
168+
</Project>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# This file was automagically generated by mbed.org. For more information,
2+
# see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded
3+
4+
GCC_BIN =
5+
PROJECT = {{name}}
6+
OBJECTS = {% for f in to_be_compiled %}{{f}} {% endfor %}
7+
SYS_OBJECTS = {% for f in object_files %}{{f}} {% endfor %}
8+
INCLUDE_PATHS = {% for p in include_paths %}-I{{p}} {% endfor %}
9+
LIBRARY_PATHS = {% for p in library_paths %}-L{{p}} {% endfor %}
10+
LIBRARIES = {% for lib in libraries %}-l{{lib}} {% endfor %}
11+
LINKER_SCRIPT = {{linker_script}}
12+
13+
###############################################################################
14+
AS = $(GCC_BIN)arm-none-eabi-as
15+
CC = $(GCC_BIN)arm-none-eabi-gcc
16+
CPP = $(GCC_BIN)arm-none-eabi-g++
17+
LD = $(GCC_BIN)arm-none-eabi-gcc
18+
OBJCOPY = $(GCC_BIN)arm-none-eabi-objcopy
19+
OBJDUMP = $(GCC_BIN)arm-none-eabi-objdump
20+
SIZE = $(GCC_BIN)arm-none-eabi-size
21+
22+
CPU = -mcpu=cortex-m3 -mthumb
23+
CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections -fno-rtti
24+
CC_FLAGS += -MMD -MP
25+
CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
26+
27+
LD_FLAGS = $(CPU) -Wl,--gc-sections --specs=nano.specs -u _printf_float -u _scanf_float -Wl,--wrap,main
28+
LD_FLAGS += -Wl,-Map=$(PROJECT).map,--cref
29+
LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
30+
31+
ifeq ($(DEBUG), 1)
32+
CC_FLAGS += -DDEBUG -O0
33+
else
34+
CC_FLAGS += -DNDEBUG -Os
35+
endif
36+
37+
all: $(PROJECT).bin $(PROJECT).hex size
38+
39+
clean:
40+
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS)
41+
42+
.s.o:
43+
$(AS) $(CPU) -o $@ $<
44+
45+
.c.o:
46+
$(CC) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu99 $(INCLUDE_PATHS) -o $@ $<
47+
48+
.cpp.o:
49+
$(CPP) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu++98 $(INCLUDE_PATHS) -o $@ $<
50+
51+
52+
$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS)
53+
$(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS)
54+
55+
$(PROJECT).bin: $(PROJECT).elf
56+
@$(OBJCOPY) -O binary $< $@
57+
58+
$(PROJECT).hex: $(PROJECT).elf
59+
@$(OBJCOPY) -O ihex $< $@
60+
61+
$(PROJECT).lst: $(PROJECT).elf
62+
@$(OBJDUMP) -Sdh $< > $@
63+
64+
lst: $(PROJECT).lst
65+
66+
size:
67+
$(SIZE) $(PROJECT).elf
68+
69+
DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
70+
-include $(DEPS)
71+

workspace_tools/export/gccarm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class GccArm(Exporter):
5959
'NUCLEO_F030R8',
6060
'NUCLEO_F070RB',
6161
'NUCLEO_F072RB',
62+
'NUCLEO_F103RB',
6263
'NUCLEO_F302R8',
6364
'NUCLEO_F334R8',
6465
'DISCO_L053C8',

0 commit comments

Comments
 (0)