Skip to content

Commit bf32e2f

Browse files
committed
Merge pull request #6 from spectaclelabs/cortex-m4-float-options
Use correct setting for -mfpu when building for Cortex-M4 targets, and add a setting for using hard or soft floating point.
2 parents 90b614b + b211a33 commit bf32e2f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

workspace_tools/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@
7171
GCC_CW_PATH = "C:/Freescale/CW MCU v10.3/Cross_Tools/arm-none-eabi-gcc-4_6_2/bin"
7272
EWL_LIB_PATH = "C:/Freescale/CW MCU v10.3/MCU/ARM_GCC_Support/ewl/lib"
7373

74+
# GCC float ABI
75+
M4_FLOAT_ABI = "softfp"
76+
7477
try:
7578
# Allow to overwrite the default settings without the need to edit the
7679
# settings file stored in the repository

workspace_tools/toolchains.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,8 @@ def __init__(self, target, notify, tool_path):
556556
self.cpu.append("-mthumb")
557557

558558
if target.core == "Cortex-M4":
559-
self.cpu.append("-mfpu=vfp")
559+
self.cpu.append("-mfpu=fpv4-sp-d16")
560+
self.cpu.append("-mfloat-abi=%s" % M4_FLOAT_ABI)
560561

561562
# Note: We are using "-O2" instead of "-Os" to avoid this known GCC bug:
562563
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46762

0 commit comments

Comments
 (0)