summaryrefslogtreecommitdiff
path: root/build/stm32f4.mk
diff options
context:
space:
mode:
authorNicolas Schodet2015-05-04 11:57:31 +0200
committerNicolas Schodet2019-10-07 00:44:50 +0200
commitc5171a64652771c5c835754ef65f9cef7d78aa76 (patch)
tree7b114961d3dcd95cc23dd76c9aec4385f745d93d /build/stm32f4.mk
parent9fe68a0e7b216f8142d6b0423d5cf8fc08ec7091 (diff)
Add STM32F1 support
Diffstat (limited to 'build/stm32f4.mk')
-rw-r--r--build/stm32f4.mk41
1 files changed, 8 insertions, 33 deletions
diff --git a/build/stm32f4.mk b/build/stm32f4.mk
index 039b2c8..648bcab 100644
--- a/build/stm32f4.mk
+++ b/build/stm32f4.mk
@@ -2,33 +2,16 @@
#
# Rules for STM32F4.
-LIBOPENCM3_PATH ?= $(BASE)/lib/libopencm3
-ifneq ($(LIBOPENCM3_PATH),)
- LIBOPENCM3_LIB := $(LIBOPENCM3_PATH)/lib/libopencm3_stm32f4.a
- ifeq ($(wildcard $(LIBOPENCM3_LIB)),)
- $(error Can not find libopencm3 library, please run "make lib" in \
- $(LIBOPENCM3_PATH) or change LIBOPENCM3_PATH (you can set it to \
- empty string to use system library))
- endif
- LIBOPENCM3_CPPFLAGS := -I$(LIBOPENCM3_PATH)/include
- LIBOPENCM3_LDFLAGS := -L$(LIBOPENCM3_PATH)/lib
-endif
+include $(BASE)/build/stm32.mk
+
+$(eval $(call stm32_libopencm3,stm32f4))
stm32f4_SUBTARGETS := stm32 arm newlib
-stm32f4_CPPFLAGS := $(CPPFLAGS) $(stm32f4_DEFS) \
- -DSTM32F4 $(LIBOPENCM3_CPPFLAGS)
-stm32f4_CFLAGS := $(CFLAGS) \
- -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 \
- -Wl,--gc-sections -ffunction-sections
-stm32f4_CXXFLAGS := $(sort $(stm32f4_CFLAGS) $(CXXFLAGS))
-stm32f4_ASFLAGS := $(ASFLAGS)
-stm32f4_LDSCRIPT := stm32f4.ld
-stm32f4_LDFLAGS := $(LDFLAGS) -T$(stm32f4_LDSCRIPT) \
- -L$(BASE)/ucoo/arch/stm32f4 \
- $(LIBOPENCM3_LDFLAGS)
-stm32f4_LDLIBS := -nostartfiles $(LDLIBS) $(stm32f4_LIBS) \
- -lopencm3_stm32f4
+stm32f4_CPU := cortex-m4
+stm32f4_STM32_DEFS := -DSTM32F4
+
+$(eval $(call stm32_flags,stm32f4))
stm32f4_PREFIX := arm-none-eabi-
$(eval $(call arch_cmds,stm32f4))
@@ -42,12 +25,4 @@ $(eval $(call arch_lst_rules,stm32f4))
$(eval $(call arch_bin_rules,stm32f4))
$(eval $(call arch_size_rules,stm32f4))
$(eval $(call arch_misc_rules,stm32f4))
-
-.PHONY: program.stm32f4
-ifeq ($(words $(stm32f4_PROGS)),1)
-program.stm32f4: $(stm32f4_PROGS:%=%.stm32f4.program)
-endif
-
-%.stm32f4.program: %.stm32f4.bin
- @echo "PROG [stm32f4] $<"
- $Qst-flash write $< 0x8000000
+$(eval $(call stm32_program_rules,stm32f4))