Skip to content

Commit

Permalink
Merge pull request #115 from 0xc0170/dev_issue#110
Browse files Browse the repository at this point in the history
Cortex-M4 split to M4 and M4F
  • Loading branch information
bogdanm committed Nov 28, 2013
2 parents 72a9529 + ba7b4c3 commit 2897644
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
9 changes: 5 additions & 4 deletions workspace_tools/targets.py
Expand Up @@ -20,7 +20,8 @@
"Cortex-M0" : "M0",
"Cortex-M0+": "M0P",
"Cortex-M3" : "M3",
"Cortex-M4" : "M4"
"Cortex-M4" : "M4",
"Cortex-M4F" : "M4F"
}

import os
Expand Down Expand Up @@ -165,7 +166,7 @@ class LPC4088(Target):
def __init__(self):
Target.__init__(self)

self.core = "Cortex-M4"
self.core = "Cortex-M4F"

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

Expand Down Expand Up @@ -208,7 +209,7 @@ class LPC4330_M4(Target):
def __init__(self):
Target.__init__(self)

self.core = "Cortex-M4"
self.core = "Cortex-M4F"

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

Expand Down Expand Up @@ -241,7 +242,7 @@ class STM32F407(Target):
def __init__(self):
Target.__init__(self)

self.core = "Cortex-M4"
self.core = "Cortex-M4F"

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

Expand Down
3 changes: 2 additions & 1 deletion workspace_tools/toolchains/__init__.py
Expand Up @@ -151,7 +151,8 @@ class mbedToolchain:
"Cortex-M3" : ["__CORTEX_M3", "ARM_MATH_CM3"],
"Cortex-M0" : ["__CORTEX_M0", "ARM_MATH_CM0"],
"Cortex-M0+": ["__CORTEX_M0PLUS", "ARM_MATH_CM0PLUS"],
"Cortex-M4" : ["__CORTEX_M4", "ARM_MATH_CM4", "__FPU_PRESENT=1"],
"Cortex-M4" : ["__CORTEX_M4", "ARM_MATH_CM4"],
"Cortex-M4F" : ["__CORTEX_M4", "ARM_MATH_CM4", "__FPU_PRESENT=1"],
}

GOANNA_FORMAT = "[Goanna] warning [%FILENAME%:%LINENO%] - [%CHECKNAME%(%SEVERITY%)] %MESSAGE%"
Expand Down
2 changes: 1 addition & 1 deletion workspace_tools/toolchains/arm.py
Expand Up @@ -35,7 +35,7 @@ def __init__(self, target, options=None, notify=None, macros=None):

if target.core == "Cortex-M0+":
cpu = "Cortex-M0"
elif target.core == "Cortex-M4":
elif target.core == "Cortex-M4F":
cpu = "Cortex-M4.fp"
else:
cpu = target.core
Expand Down
4 changes: 3 additions & 1 deletion workspace_tools/toolchains/gcc.py
Expand Up @@ -34,14 +34,16 @@ def __init__(self, target, options=None, notify=None, macros=None, tool_path="")

if target.core == "Cortex-M0+":
cpu = "cortex-m0"
elif target.core == "Cortex-M4F":
cpu = "cortex-m4"
else:
cpu = target.core.lower()

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

if target.core == "Cortex-M4":
if target.core == "Cortex-M4F":
self.cpu.append("-mfpu=fpv4-sp-d16")
self.cpu.append("-mfloat-abi=softfp")

Expand Down

0 comments on commit 2897644

Please sign in to comment.