Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build tool with ARMC6/ARMv8M #6644

Merged
merged 3 commits into from Apr 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions tools/toolchains/arm.py
Expand Up @@ -252,7 +252,8 @@ def archive(self, objects, lib_path):
@hook_tool
def binary(self, resources, elf, bin):
_, fmt = splitext(bin)
bin_arg = {".bin": "--bin", ".hex": "--i32"}[fmt]
# On .hex format, combine multiple .hex files (for multiple load regions) into one
bin_arg = {".bin": "--bin", ".hex": "--i32combined"}[fmt]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. This was always the indented behavior. I guess nobody combined multiple load regions with hex output before.

cmd = [self.elf2bin, bin_arg, '-o', bin, elf]
cmd = self.hook.get_cmdline_binary(cmd)

Expand Down Expand Up @@ -359,10 +360,15 @@ def __init__(self, target, *args, **kwargs):
self.flags['common'].append("-mcmse")

# Create Secure library
if target.core == "Cortex-M23" or self.target.core == "Cortex-M33":
if ((target.core == "Cortex-M23" or self.target.core == "Cortex-M33") and
kwargs.get('build_dir', False)):
build_dir = kwargs['build_dir']
secure_file = join(build_dir, "cmse_lib.o")
self.flags["ld"] += ["--import_cmse_lib_out=%s" % secure_file]
# Add linking time preprocessor macro __DOMAIN_NS
if target.core == "Cortex-M23-NS" or self.target.core == "Cortex-M33-NS":
define_string = self.make_ld_define("__DOMAIN_NS", 1)
self.flags["ld"].append(define_string)

asm_cpu = {
"Cortex-M0+": "Cortex-M0",
Expand Down