Alessandro Angelino / mbed-tools

Fork of mbed-tools by Morpheus

Files at this revision

API Documentation at this revision

Comitter:
Alessandro Angelino
Date:
Tue Apr 05 17:23:39 2016 +0100
Parent:
11:072037a91709
Commit message:
Disable the FPU only if UVISOR_PRESENT=1 is defined

Changed in this revision

toolchains/__init__.py Show annotated file Show diff for this revision Revisions of this file
toolchains/gcc.py Show annotated file Show diff for this revision Revisions of this file
--- a/toolchains/__init__.py	Tue Apr 05 00:21:13 2016 +0100
+++ b/toolchains/__init__.py	Tue Apr 05 17:23:39 2016 +0100
@@ -305,6 +305,10 @@
             if hasattr(self.target, 'supported_form_factors'):
                 self.symbols.extend(["TARGET_FF_%s" % t for t in self.target.supported_form_factors])
 
+            # uVisor-specific symbols
+            if "UVISOR_PRESENT=1" in self.symbols and "__FPU_PRESENT=1" in self.symbols:
+                self.symbols.remove("__FPU_PRESENT=1")
+
         return list(set(self.symbols))  # Return only unique symbols
 
     def get_labels(self):
--- a/toolchains/gcc.py	Tue Apr 05 00:21:13 2016 +0100
+++ b/toolchains/gcc.py	Tue Apr 05 17:23:39 2016 +0100
@@ -46,7 +46,7 @@
         if target.core.startswith("Cortex"):
             self.cpu.append("-mthumb")
 
-        if target.core == "Cortex-M4F":
+        if target.core == "Cortex-M4F" and "UVISOR_PRESENT=1" not in self.get_symbols():
             self.cpu.append("-mfpu=fpv4-sp-d16")
             self.cpu.append("-mfloat-abi=softfp")
         elif target.core == "Cortex-M7F":