aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Serpell2012-08-22 00:05:09 -0400
committerNicolas Schodet2012-09-27 23:12:18 +0200
commit584052c28cdfe5c383f13471deb891ba9438843a (patch)
treee4383f21d2f17b2991e6acbf5c88e27db0db73b0
parentc9ab75878f3f039399cec4cf62604f86c927dff7 (diff)
Compile stm32-f4 library with floating point support.
This enables hard-float in the compilation of library and examples for the stm32f40* chips.
-rw-r--r--examples/stm32/f4/Makefile.include5
-rw-r--r--lib/stm32/f4/Makefile3
2 files changed, 5 insertions, 3 deletions
diff --git a/examples/stm32/f4/Makefile.include b/examples/stm32/f4/Makefile.include
index b735aa6..9dfe9d0 100644
--- a/examples/stm32/f4/Makefile.include
+++ b/examples/stm32/f4/Makefile.include
@@ -36,12 +36,13 @@ endif
TOOLCHAIN_DIR := ../../../../..
endif
CFLAGS += -Os -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include \
- -fno-common -mcpu=cortex-m4 -mthumb -msoft-float -MD -DSTM32F4
+ -fno-common -mcpu=cortex-m4 -mthumb \
+ -mfloat-abi=hard -mfpu=fpv4-sp-d16 -MD -DSTM32F4
LDSCRIPT ?= $(BINARY).ld
LDFLAGS += -lc -lnosys -L$(TOOLCHAIN_DIR)/lib \
-L$(TOOLCHAIN_DIR)/lib/stm32/f4 \
-T$(LDSCRIPT) -nostartfiles -Wl,--gc-sections \
- -mthumb -mcpu=cortex-m4 -march=armv7 -mfix-cortex-m3-ldrd -msoft-float
+ -mthumb -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16
OBJS += $(BINARY).o
OOCD ?= openocd
diff --git a/lib/stm32/f4/Makefile b/lib/stm32/f4/Makefile
index 5760d29..881ef5d 100644
--- a/lib/stm32/f4/Makefile
+++ b/lib/stm32/f4/Makefile
@@ -24,7 +24,8 @@ PREFIX ?= arm-none-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CFLAGS = -Os -g -Wall -Wextra -I../../../include -fno-common \
- -mcpu=cortex-m3 -mthumb -Wstrict-prototypes \
+ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 \
+ -Wstrict-prototypes \
-ffunction-sections -fdata-sections -MD -DSTM32F4
# ARFLAGS = rcsv
ARFLAGS = rcs