summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chip/lm4/build.mk4
-rw-r--r--chip/stm32/build.mk2
-rw-r--r--core/cortex-m/build.mk2
3 files changed, 6 insertions, 2 deletions
diff --git a/chip/lm4/build.mk b/chip/lm4/build.mk
index f6472aae92..279f15c65d 100644
--- a/chip/lm4/build.mk
+++ b/chip/lm4/build.mk
@@ -6,8 +6,10 @@
# LM4 chip specific files build
#
-# LM4 SoC has a Cortex-M4 ARM core
+# LM4 SoC has a Cortex-M4F ARM core
CORE:=cortex-m
+# Allow the full Cortex-M4 instruction set
+CFLAGS_CPU+=-march=armv7e-m -mcpu=cortex-m4
# Required chip modules
chip-y=clock.o gpio.o hwtimer.o jtag.o system.o uart.o
diff --git a/chip/stm32/build.mk b/chip/stm32/build.mk
index 8db57f86bf..957478282c 100644
--- a/chip/stm32/build.mk
+++ b/chip/stm32/build.mk
@@ -8,6 +8,8 @@
# STM32 SoC family has a Cortex-M3 ARM core
CORE:=cortex-m
+# Force Cortex-M3 subset of instructions
+CFLAGS_CPU+=-march=armv7-m -mcpu=cortex-m3
chip-y=dma.o hwtimer.o system.o uart.o
chip-y+=jtag-$(CHIP_FAMILY).o clock-$(CHIP_FAMILY).o gpio-$(CHIP_FAMILY).o
diff --git a/core/cortex-m/build.mk b/core/cortex-m/build.mk
index 5f036bc522..c3ae55a521 100644
--- a/core/cortex-m/build.mk
+++ b/core/cortex-m/build.mk
@@ -10,7 +10,7 @@
CFLAGS_FPU-$(CONFIG_FPU)=-mfpu=fpv4-sp-d16 -mfloat-abi=hard
# CPU specific compilation flags
-CFLAGS_CPU=-mcpu=cortex-m4 -mthumb -Os -mno-sched-prolog
+CFLAGS_CPU+=-mthumb -Os -mno-sched-prolog
CFLAGS_CPU+=-mno-unaligned-access
CFLAGS_CPU+=$(CFLAGS_FPU-y)