diff options
-rw-r--r-- | Makefile | 7 | ||||
-rw-r--r-- | support/make/target-config.mk | 12 |
2 files changed, 14 insertions, 5 deletions
@@ -52,12 +52,11 @@ include $(MAKEDIR)/build-templates.mk # It slows compilation noticeably; remove after 1 release. TARGET_FLAGS += -I$(LIBMAPLE_PATH)/include/libmaple \ -I$(WIRISH_PATH)/include/wirish -GLOBAL_CFLAGS := -Os -g3 -gdwarf-2 -mcpu=cortex-m3 -mthumb -march=armv7-m \ - -nostdlib -ffunction-sections -fdata-sections \ +GLOBAL_CFLAGS := -Os -g3 -gdwarf-2 -nostdlib \ + -ffunction-sections -fdata-sections \ -Wl,--gc-sections $(TARGET_FLAGS) GLOBAL_CXXFLAGS := -fno-rtti -fno-exceptions -Wall $(TARGET_FLAGS) -GLOBAL_ASFLAGS := -mcpu=cortex-m3 -march=armv7-m -mthumb \ - -x assembler-with-cpp $(TARGET_FLAGS) +GLOBAL_ASFLAGS := -x assembler-with-cpp $(TARGET_FLAGS) LDFLAGS = $(TARGET_LDFLAGS) $(TOOLCHAIN_LDFLAGS) -mcpu=cortex-m3 -mthumb \ -Xlinker --gc-sections \ -Xassembler --march=armv7-m -Wall diff --git a/support/make/target-config.mk b/support/make/target-config.mk index b79c720..0e3a2c2 100644 --- a/support/make/target-config.mk +++ b/support/make/target-config.mk @@ -32,11 +32,21 @@ ifeq ($(MCU_SERIES), stm32f1) LD_SERIES_PATH := $(LD_SERIES_PATH)/$(MCU_F1_LINE) endif +ifeq ($(MCU_SERIES), stm32f1) +TARGET_FLAGS += -mcpu=cortex-m3 -march=armv7-m +endif +ifeq ($(MCU_SERIES), stm32f2) +TARGET_FLAGS += -mcpu=cortex-m3 -march=armv7-m +endif +ifeq ($(MCU_SERIES), stm32f4) +TARGET_FLAGS += -mcpu=cortex-m4 -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 +endif + TARGET_LDFLAGS += -Xlinker -T$(LD_SCRIPT_PATH) \ -L $(LD_SERIES_PATH) \ -L $(LD_MEM_PATH) \ -L $(LDDIR) -TARGET_FLAGS += -DBOARD_$(BOARD) -DMCU_$(MCU) \ +TARGET_FLAGS += -mthumb -DBOARD_$(BOARD) -DMCU_$(MCU) \ -DERROR_LED_PORT=$(ERROR_LED_PORT) \ -DERROR_LED_PIN=$(ERROR_LED_PIN) \ -D$(VECT_BASE_ADDR) |