Skip to content

Commit 2897644

Browse files
committed
Merge pull request #115 from 0xc0170/dev_issue#110
Cortex-M4 split to M4 and M4F
2 parents 72a9529 + ba7b4c3 commit 2897644

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

workspace_tools/targets.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"Cortex-M0" : "M0",
2121
"Cortex-M0+": "M0P",
2222
"Cortex-M3" : "M3",
23-
"Cortex-M4" : "M4"
23+
"Cortex-M4" : "M4",
24+
"Cortex-M4F" : "M4F"
2425
}
2526

2627
import os
@@ -165,7 +166,7 @@ class LPC4088(Target):
165166
def __init__(self):
166167
Target.__init__(self)
167168

168-
self.core = "Cortex-M4"
169+
self.core = "Cortex-M4F"
169170

170171
self.extra_labels = ['NXP', 'LPC408X']
171172

@@ -208,7 +209,7 @@ class LPC4330_M4(Target):
208209
def __init__(self):
209210
Target.__init__(self)
210211

211-
self.core = "Cortex-M4"
212+
self.core = "Cortex-M4F"
212213

213214
self.extra_labels = ['NXP', 'LPC43XX']
214215

@@ -241,7 +242,7 @@ class STM32F407(Target):
241242
def __init__(self):
242243
Target.__init__(self)
243244

244-
self.core = "Cortex-M4"
245+
self.core = "Cortex-M4F"
245246

246247
self.extra_labels = ['STM', 'STM32F4XX']
247248

workspace_tools/toolchains/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ class mbedToolchain:
151151
"Cortex-M3" : ["__CORTEX_M3", "ARM_MATH_CM3"],
152152
"Cortex-M0" : ["__CORTEX_M0", "ARM_MATH_CM0"],
153153
"Cortex-M0+": ["__CORTEX_M0PLUS", "ARM_MATH_CM0PLUS"],
154-
"Cortex-M4" : ["__CORTEX_M4", "ARM_MATH_CM4", "__FPU_PRESENT=1"],
154+
"Cortex-M4" : ["__CORTEX_M4", "ARM_MATH_CM4"],
155+
"Cortex-M4F" : ["__CORTEX_M4", "ARM_MATH_CM4", "__FPU_PRESENT=1"],
155156
}
156157

157158
GOANNA_FORMAT = "[Goanna] warning [%FILENAME%:%LINENO%] - [%CHECKNAME%(%SEVERITY%)] %MESSAGE%"

workspace_tools/toolchains/arm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(self, target, options=None, notify=None, macros=None):
3535

3636
if target.core == "Cortex-M0+":
3737
cpu = "Cortex-M0"
38-
elif target.core == "Cortex-M4":
38+
elif target.core == "Cortex-M4F":
3939
cpu = "Cortex-M4.fp"
4040
else:
4141
cpu = target.core

workspace_tools/toolchains/gcc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,16 @@ def __init__(self, target, options=None, notify=None, macros=None, tool_path="")
3434

3535
if target.core == "Cortex-M0+":
3636
cpu = "cortex-m0"
37+
elif target.core == "Cortex-M4F":
38+
cpu = "cortex-m4"
3739
else:
3840
cpu = target.core.lower()
3941

4042
self.cpu = ["-mcpu=%s" % cpu]
4143
if target.core.startswith("Cortex"):
4244
self.cpu.append("-mthumb")
4345

44-
if target.core == "Cortex-M4":
46+
if target.core == "Cortex-M4F":
4547
self.cpu.append("-mfpu=fpv4-sp-d16")
4648
self.cpu.append("-mfloat-abi=softfp")
4749

0 commit comments

Comments
 (0)