Skip to content

Commit f05e7b7

Browse files
deepikabhavnanimmahadevan108
authored andcommitted
Add core option for Cortex-M33 with DSP enabled
Signed-off-by: Deepika Bhavnani <[email protected]> Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent 54f53e0 commit f05e7b7

File tree

3 files changed

+34
-9
lines changed

3 files changed

+34
-9
lines changed

tools/targets/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
"Cortex-M33": ["M33", "CORTEX_M", "LIKE_CORTEX_M33", "CORTEX"],
5252
"Cortex-M33-NS": ["M33", "M33_NS", "CORTEX_M", "LIKE_CORTEX_M33", "CORTEX"],
5353
"Cortex-M33F": ["M33", "CORTEX_M", "LIKE_CORTEX_M33", "CORTEX"],
54-
"Cortex-M33F-NS": ["M33", "M33_NS", "CORTEX_M", "LIKE_CORTEX_M33", "CORTEX"]
54+
"Cortex-M33F-NS": ["M33", "M33_NS", "CORTEX_M", "LIKE_CORTEX_M33", "CORTEX"],
55+
"Cortex-M33FD": ["M33", "CORTEX_M", "LIKE_CORTEX_M33", "CORTEX"],
56+
"Cortex-M33FD-NS": ["M33", "M33_NS", "CORTEX_M", "LIKE_CORTEX_M33", "CORTEX"]
5557
}
5658

5759
CORE_ARCH = {
@@ -71,6 +73,8 @@
7173
"Cortex-M33F": 8,
7274
"Cortex-M33-NS": 8,
7375
"Cortex-M33F-NS": 8,
76+
"Cortex-M33FD": 8,
77+
"Cortex-M33FD-NS": 8,
7478
}
7579

7680
################################################################################

tools/toolchains/arm.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def parse_output(self, output):
166166
msg = None
167167
else:
168168
msg['text'] += line+"\n"
169-
169+
170170
if msg is not None:
171171
self.notify.cc_info(msg)
172172

@@ -304,7 +304,7 @@ def archive(self, objects, lib_path):
304304
@hook_tool
305305
def binary(self, resources, elf, bin):
306306
_, fmt = splitext(bin)
307-
# On .hex format, combine multiple .hex files (for multiple load regions) into one
307+
# On .hex format, combine multiple .hex files (for multiple load regions) into one
308308
bin_arg = {".bin": "--bin", ".hex": "--i32combined"}[fmt]
309309
cmd = [self.elf2bin, bin_arg, '-o', bin, elf]
310310
cmd = self.hook.get_cmdline_binary(cmd)
@@ -364,7 +364,8 @@ class ARMC6(ARM_STD):
364364
SUPPORTED_CORES = ["Cortex-M0", "Cortex-M0+", "Cortex-M3", "Cortex-M4",
365365
"Cortex-M4F", "Cortex-M7", "Cortex-M7F", "Cortex-M7FD",
366366
"Cortex-M23", "Cortex-M23-NS", "Cortex-M33", "Cortex-M33F",
367-
"Cortex-M33-NS", "Cortex-M33F-NS", "Cortex-A9"]
367+
"Cortex-M33-NS", "Cortex-M33F-NS", "Cortex-M33FD-NS", "Cortex-M33FD",
368+
"Cortex-A9"]
368369
ARMCC_RANGE = (LooseVersion("6.10"), LooseVersion("7.0"))
369370

370371
@staticmethod
@@ -392,6 +393,10 @@ def __init__(self, target, *args, **kwargs):
392393
self.flags['common'].append("-mcpu=%s" % target.core.lower()[:-2])
393394
self.flags['ld'].append("--cpu=%s" % target.core.lower()[:-2])
394395
self.SHEBANG += " -mcpu=%s" % target.core.lower()[:-2]
396+
elif target.core.lower().endswith("fd-ns"):
397+
self.flags['common'].append("-mcpu=%s" % target.core.lower()[:-5])
398+
self.flags['ld'].append("--cpu=%s" % target.core.lower()[:-5])
399+
self.SHEBANG += " -mcpu=%s" % target.core.lower()[:-5]
395400
elif target.core.lower().endswith("f"):
396401
self.flags['common'].append("-mcpu=%s" % target.core.lower()[:-1])
397402
self.flags['ld'].append("--cpu=%s" % target.core.lower()[:-1])
@@ -420,18 +425,25 @@ def __init__(self, target, *args, **kwargs):
420425
self.flags['common'].append("-mfpu=fpv5-sp-d16")
421426
self.flags['common'].append("-mfloat-abi=softfp")
422427

423-
if target.core == "Cortex-M23" or target.core == "Cortex-M33":
428+
if ((target.core.startswith("Cortex-M23") or
429+
target.core.startswith("Cortex-M33")) and
430+
not target.core.endswith("-NS")):
424431
self.flags['cxx'].append("-mcmse")
425432
self.flags['c'].append("-mcmse")
426433

427434
# Create Secure library
428-
if ((target.core == "Cortex-M23" or self.target.core == "Cortex-M33") and
435+
if ((target.core.startswith("Cortex-M23") or
436+
target.core.startswith("Cortex-M33")) and
437+
not target.core.endswith("-NS") and
429438
kwargs.get('build_dir', False)):
430439
build_dir = kwargs['build_dir']
431440
secure_file = join(build_dir, "cmse_lib.o")
432441
self.flags["ld"] += ["--import_cmse_lib_out=%s" % secure_file]
442+
433443
# Add linking time preprocessor macro DOMAIN_NS
434-
if target.core == "Cortex-M23-NS" or self.target.core == "Cortex-M33-NS":
444+
if ((target.core.startswith("Cortex-M23") or
445+
target.core.startswith("Cortex-M33")) and
446+
target.core.endswith("-NS")):
435447
define_string = self.make_ld_define("DOMAIN_NS", "0x1")
436448
self.flags["ld"].append(define_string)
437449

tools/toolchains/gcc.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ def __init__(self, target, notify=None, macros=None, build_profile=None,
6060
self.cpu = ["-mcpu=cortex-m7"]
6161
elif target.core.startswith("Cortex-M23"):
6262
self.cpu = ["-mcpu=cortex-m23"]
63+
elif target.core.startswith("Cortex-M33FD"):
64+
self.cpu = ["-mcpu=cortex-m33"]
6365
elif target.core.startswith("Cortex-M33F"):
6466
self.cpu = ["-mcpu=cortex-m33+nodsp"]
6567
elif target.core.startswith("Cortex-M33"):
@@ -80,6 +82,9 @@ def __init__(self, target, notify=None, macros=None, build_profile=None,
8082
elif target.core == "Cortex-M7FD":
8183
self.cpu.append("-mfpu=fpv5-d16")
8284
self.cpu.append("-mfloat-abi=softfp")
85+
elif target.core.startswith("Cortex-M33F"):
86+
self.cpu.append("-mfpu=fpv5-sp-d16")
87+
self.cpu.append("-mfloat-abi=softfp")
8388

8489
if target.core == "Cortex-A9":
8590
self.cpu.append("-mthumb-interwork")
@@ -97,8 +102,12 @@ def __init__(self, target, notify=None, macros=None, build_profile=None,
97102
"-Wl,--cmse-implib",
98103
"-Wl,--out-implib=%s" % join(build_dir, "cmse_lib.o")
99104
])
100-
elif target.core == "Cortex-M23-NS" or target.core == "Cortex-M33-NS" or target.core == "Cortex-M33F-NS":
101-
self.flags["ld"].append("-DDOMAIN_NS=1")
105+
106+
# Add linking time preprocessor macro DOMAIN_NS
107+
if ((target.core.startswith("Cortex-M23") or
108+
target.core.startswith("Cortex-M33")) and
109+
target.core.endswith("-NS")):
110+
self.flags["ld"].append("-DDOMAIN_NS=1")
102111

103112
self.flags["common"] += self.cpu
104113

0 commit comments

Comments
 (0)