Skip to content

Commit bc8b983

Browse files
committed
Correct exporting with cortex-M23 and M33
1 parent b81c0e5 commit bc8b983

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

tools/test_api.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2077,8 +2077,9 @@ def find_tests(base_dir, target_name, toolchain_name, app_config=None):
20772077
commons = []
20782078

20792079
# Prepare the toolchain
2080-
toolchain = prepare_toolchain([base_dir], None, target_name, toolchain_name,
2081-
silent=True, app_config=app_config)
2080+
toolchain = prepare_toolchain(
2081+
[base_dir], base_dir, target_name, toolchain_name, silent=True,
2082+
app_config=app_config)
20822083

20832084
# Scan the directory for paths to probe for 'TESTS' folders
20842085
base_resources = scan_resources([base_dir], toolchain)

tools/toolchains/arm.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,6 @@ def link(self, output, objects, libraries, lib_dirs, scatter_file):
233233
cmd_pre = self.ld + args
234234
cmd = self.hook.get_cmdline_linker(cmd_pre)
235235

236-
# Create Secure library
237-
if self.target.core == "Cortex-M23" or self.target.core == "Cortex-M33":
238-
secure_file = join(dirname(output), "cmse_lib.o")
239-
cmd.extend(["--import_cmse_lib_out=%s" % secure_file])
240-
241236
if self.RESPONSE_FILES:
242237
cmd_linker = cmd[0]
243238
link_files = self.get_link_file(cmd[1:])
@@ -363,12 +358,17 @@ def __init__(self, target, *args, **kwargs):
363358

364359
if target.core == "Cortex-M23" or target.core == "Cortex-M33":
365360
self.flags['common'].append("-mcmse")
366-
361+
362+
# Create Secure library
363+
if target.core == "Cortex-M23" or self.target.core == "Cortex-M33":
364+
build_dir = kwargs['build_dir']
365+
secure_file = join(build_dir, "cmse_lib.o")
366+
self.flags["ld"] += ["--import_cmse_lib_out=%s" % secure_file]
367367
# Add linking time preprocessor macro __DOMAIN_NS
368368
if target.core == "Cortex-M23-NS" or self.target.core == "Cortex-M33-NS":
369369
define_string = self.make_ld_define("__DOMAIN_NS", 1)
370370
self.flags["ld"].append(define_string)
371-
371+
372372
asm_cpu = {
373373
"Cortex-M0+": "Cortex-M0",
374374
"Cortex-M4F": "Cortex-M4.fp",

0 commit comments

Comments
 (0)