mirror of https://github.com/ARMmbed/mbed-os.git
Add 8.3 naming support for ST HDK limitations
parent
bbbd869960
commit
281fcc76b6
|
@ -271,6 +271,8 @@ class NUCLEO_F103RB(Target):
|
||||||
|
|
||||||
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
|
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
|
||||||
|
|
||||||
|
self.binary_naming = "8.3"
|
||||||
|
|
||||||
|
|
||||||
class NUCLEO_L152RE(Target):
|
class NUCLEO_L152RE(Target):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -282,6 +284,8 @@ class NUCLEO_L152RE(Target):
|
||||||
|
|
||||||
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
|
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
|
||||||
|
|
||||||
|
self.binary_naming = "8.3"
|
||||||
|
|
||||||
|
|
||||||
class NUCLEO_F401RE(Target):
|
class NUCLEO_F401RE(Target):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -293,6 +297,8 @@ class NUCLEO_F401RE(Target):
|
||||||
|
|
||||||
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
|
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
|
||||||
|
|
||||||
|
self.binary_naming = "8.3"
|
||||||
|
|
||||||
|
|
||||||
class NUCLEO_F030R8(Target):
|
class NUCLEO_F030R8(Target):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -304,6 +310,8 @@ class NUCLEO_F030R8(Target):
|
||||||
|
|
||||||
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
|
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
|
||||||
|
|
||||||
|
self.binary_naming = "8.3"
|
||||||
|
|
||||||
|
|
||||||
class MBED_MCU(Target):
|
class MBED_MCU(Target):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
|
@ -426,8 +426,20 @@ class mbedToolchain:
|
||||||
self.archive(objects, fout)
|
self.archive(objects, fout)
|
||||||
|
|
||||||
def link_program(self, r, tmp_path, name):
|
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')
|
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]):
|
if self.need_update(elf, r.objects + r.libraries + [r.linker_script]):
|
||||||
self.progress("link", name)
|
self.progress("link", name)
|
||||||
|
@ -438,11 +450,13 @@ class mbedToolchain:
|
||||||
self.binary(elf, bin)
|
self.binary(elf, bin)
|
||||||
|
|
||||||
if self.target.name.startswith('LPC'):
|
if self.target.name.startswith('LPC'):
|
||||||
self.debug("LPC Patch %s" % (name + '.bin'))
|
self.debug("LPC Patch %s" % filename)
|
||||||
patch(bin)
|
patch(bin)
|
||||||
|
|
||||||
self.var("compile_succeded", True)
|
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
|
return bin
|
||||||
|
|
||||||
|
|
|
@ -114,16 +114,27 @@ class ARM(mbedToolchain):
|
||||||
self.default_cmd([self.ar, '-r', lib_path] + objects)
|
self.default_cmd([self.ar, '-r', lib_path] + objects)
|
||||||
|
|
||||||
def link(self, output, objects, libraries, lib_dirs, mem_map):
|
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"]
|
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:
|
if mem_map:
|
||||||
args.extend(["--scatter", 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
|
@hook_tool
|
||||||
def binary(self, elf, bin):
|
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):
|
class ARM_STD(ARM):
|
||||||
def __init__(self, target, options=None, notify=None, macros=None):
|
def __init__(self, target, options=None, notify=None, macros=None):
|
||||||
|
|
Loading…
Reference in New Issue