Skip to content

Commit ca1f24c

Browse files
author
Deepika
committed
Add -mcmse flag for GCC and improved logic for cpu core
1 parent 9422c35 commit ca1f24c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

tools/toolchains/gcc.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,14 @@ def __init__(self, target, notify=None, macros=None,
8686
self.cpu.append("-mfloat-abi=hard")
8787
self.cpu.append("-mno-unaligned-access")
8888

89-
if target.core == "Cortex-M23" or target.core == "Cortex-M23-NS":
89+
if target.core.startswith("Cortex-M23"):
9090
self.cpu.append("-march=armv8-m.base")
91-
elif target.core == "Cortex-M33" or target.core == "Cortex-M33-NS":
91+
elif target.core.startswith("Cortex-M33"):
9292
self.cpu.append("-march=armv8-m.main")
9393

94+
if target.core == "Cortex-M23" or target.core == "Cortex-M33":
95+
self.cpu.append("-mcmse")
96+
9497
self.flags["common"] += self.cpu
9598

9699
main_cc = join(tool_path, "arm-none-eabi-gcc")

tools/toolchains/iar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ def __init__(self, target, notify=None, macros=None,
4545
build_profile=build_profile)
4646
if target.core == "Cortex-M7F" or target.core == "Cortex-M7FD":
4747
cpuchoice = "Cortex-M7"
48-
elif target.core == "Cortex-M23-NS" or target.core == "Cortex-M23":
48+
elif target.core.startswith("Cortex-M23"):
4949
cpuchoice = "8-M.baseline"
50-
elif target.core == "Cortex-M33-NS" or target.core == "Cortex-M33":
50+
elif target.core.startswith("Cortex-M33"):
5151
cpuchoice = "8-M.mainline"
5252
else:
5353
cpuchoice = target.core

0 commit comments

Comments
 (0)