Add 8.3 naming support for ST HDK limitations

pull/159/merge
Mihail Stoyanov 2014-02-06 16:02:37 +00:00
parent bbbd869960
commit 281fcc76b6
3 changed files with 42 additions and 9 deletions

View File

@ -271,6 +271,8 @@ class NUCLEO_F103RB(Target):
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
self.binary_naming = "8.3"
class NUCLEO_L152RE(Target):
def __init__(self):
@ -282,6 +284,8 @@ class NUCLEO_L152RE(Target):
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
self.binary_naming = "8.3"
class NUCLEO_F401RE(Target):
def __init__(self):
@ -293,6 +297,8 @@ class NUCLEO_F401RE(Target):
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
self.binary_naming = "8.3"
class NUCLEO_F030R8(Target):
def __init__(self):
@ -304,6 +310,8 @@ class NUCLEO_F030R8(Target):
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
self.binary_naming = "8.3"
class MBED_MCU(Target):
def __init__(self):

View File

@ -426,8 +426,20 @@ class mbedToolchain:
self.archive(objects, fout)
def link_program(self, r, tmp_path, name):
if hasattr(self.target, 'binary_format'):
ext = self.target.binary_format
else:
ext = 'bin'
if hasattr(self.target, 'binary_naming'):
if self.target.binary_naming == "8.3":
name = name[0:8]
ext = ext[0:3]
filename = name+'.'+ext
elf = join(tmp_path, name + '.elf')
bin = join(tmp_path, name + '.bin')
bin = join(tmp_path, filename)
if self.need_update(elf, r.objects + r.libraries + [r.linker_script]):
self.progress("link", name)
@ -438,11 +450,13 @@ class mbedToolchain:
self.binary(elf, bin)
if self.target.name.startswith('LPC'):
self.debug("LPC Patch %s" % (name + '.bin'))
self.debug("LPC Patch %s" % filename)
patch(bin)
self.var("compile_succeded", True)
self.var("binary", name+'.bin')
self.var("binary", filename)
if hasattr(self.target, 'binary_naming'):
self.var("binary_naming", self.target.binary_naming)
return bin

View File

@ -114,16 +114,27 @@ class ARM(mbedToolchain):
self.default_cmd([self.ar, '-r', lib_path] + objects)
def link(self, output, objects, libraries, lib_dirs, mem_map):
if len(lib_dirs):
args = ["-o", output, "--userlibpath", ",".join(lib_dirs), "--info=totals", "--list=.link_totals.txt"]
else:
args = ["-o", output, "--info=totals", "--list=.link_totals.txt"]
if mem_map:
args.extend(["--scatter", mem_map])
self.default_cmd(self.hook.get_cmdline_linker(self.ld + args + objects + libraries + self.sys_libs))
if hasattr(self.target, "link_cmdline_hook"):
args = self.target.link_cmdline_hook(self.__class__.__name__, args)
self.default_cmd(self.ld + args + objects + libraries + self.sys_libs)
@hook_tool
def binary(self, elf, bin):
self.default_cmd(self.hook.get_cmdline_binary([self.elf2bin, '--bin', '-o', bin, elf]))
args = [self.elf2bin, '--bin', '-o', bin, elf]
if hasattr(self.target, "binary_cmdline_hook"):
args = self.target.binary_cmdline_hook(self.__class__.__name__, args)
self.default_cmd(args)
class ARM_STD(ARM):
def __init__(self, target, options=None, notify=None, macros=None):