Skip to content

Commit 4f61cfd

Browse files
committed
[BEETLE] Add support for GCC ARM exporter
This patch adds support for GCC ARM exporter to the Beetle Target. Signed-off-by: Vincenzo Frascino <[email protected]>
1 parent c144213 commit 4f61cfd

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "gcc_arm_common.tmpl" %}

tools/export/gccarm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ class GccArm(Exporter):
115115
'SAMD21G18A',
116116
'SAML21J18A',
117117
'SAMG55J19',
118+
'ARM_BEETLE_SOC',
118119
]
119120

120121
DOT_IN_RELATIVE_PATH = True

tools/toolchains/gcc.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def compile(self, cc, source, object, includes):
175175
cmd.extend(self.get_dep_option(object))
176176

177177
cmd.extend(["-o", object, source])
178-
178+
179179
# Call cmdline hook
180180
cmd = self.hook.get_cmdline_compiler(cmd)
181181

@@ -194,13 +194,13 @@ def link(self, output, objects, libraries, lib_dirs, mem_map):
194194
name, _ = splitext(basename(l))
195195
libs.append("-l%s" % name[3:])
196196
libs.extend(["-l%s" % l for l in self.sys_libs])
197-
197+
198198
# Build linker command
199199
map_file = splitext(output)[0] + ".map"
200200
cmd = self.ld + ["-o", output, "-Wl,-Map=%s" % map_file] + objects + ["-Wl,--start-group"] + libs + ["-Wl,--end-group"]
201201
if mem_map:
202202
cmd.extend(['-T', mem_map])
203-
203+
204204
for L in lib_dirs:
205205
cmd.extend(['-L', L])
206206
cmd.extend(libs)
@@ -215,7 +215,7 @@ def link(self, output, objects, libraries, lib_dirs, mem_map):
215215
cmd_list = []
216216
for c in cmd[1:]:
217217
if c:
218-
cmd_list.append(('"%s"' % c) if not c.startswith('-') else c)
218+
cmd_list.append(('"%s"' % c) if not c.startswith('-') else c)
219219
string = " ".join(cmd_list).replace("\\", "/")
220220
f.write(string)
221221

@@ -228,7 +228,7 @@ def archive(self, objects, lib_path):
228228
with open(archive_files, "wb") as f:
229229
o_list = []
230230
for o in objects:
231-
o_list.append('"%s"' % o)
231+
o_list.append('"%s"' % o)
232232
string = " ".join(o_list).replace("\\", "/")
233233
f.write(string)
234234

@@ -268,7 +268,7 @@ def __init__(self, target, options=None, notify=None, macros=None, silent=False,
268268
self.cc += ["-DMBED_RTOS_SINGLE_THREAD"]
269269
self.cppc += ["-DMBED_RTOS_SINGLE_THREAD"]
270270

271-
if target.name in ["LPC1768", "LPC4088", "LPC4088_DM", "LPC4330", "UBLOX_C027", "LPC2368"]:
271+
if target.name in ["LPC1768", "LPC4088", "LPC4088_DM", "LPC4330", "UBLOX_C027", "LPC2368", "ARM_BEETLE_SOC"]:
272272
self.ld.extend(["-u _printf_float", "-u _scanf_float"])
273273
elif target.name in ["RZ_A1H", "VK_RZ_A1H", "ARCH_MAX", "DISCO_F407VG", "DISCO_F429ZI", "DISCO_F469NI", "NUCLEO_F401RE", "NUCLEO_F410RB", "NUCLEO_F411RE", "NUCLEO_F446RE", "ELMO_F411RE", "MTS_MDOT_F411RE", "MTS_DRAGONFLY_F411RE", "DISCO_F746NG"]:
274274
self.ld.extend(["-u_printf_float", "-u_scanf_float"])
@@ -291,4 +291,3 @@ def __init__(self, target, options=None, notify=None, macros=None, silent=False,
291291
if target.name in ["LPC1768", "LPC4088", "LPC4088_DM", "LPC4330", "UBLOX_C027", "LPC2368"]:
292292
self.ld.extend(["-u _printf_float", "-u _scanf_float"])
293293
self.ld += ["-nostdlib"]
294-

0 commit comments

Comments
 (0)