summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorNicolas Schodet2016-01-20 14:55:50 +0100
committerNicolas Schodet2019-10-07 00:44:57 +0200
commit0750809ea4feed01996ff4344047b5eb36a0dfc4 (patch)
treeacc1649096de74a7eeeca25dbd1e347eac33fdae /build
parent20b319ab3dc6ec5a627c8e088d88a99cc30a87c4 (diff)
build: add support for several programming tools
Diffstat (limited to 'build')
-rw-r--r--build/stm32.mk11
1 files changed, 9 insertions, 2 deletions
diff --git a/build/stm32.mk b/build/stm32.mk
index 0109f61..3a3311b 100644
--- a/build/stm32.mk
+++ b/build/stm32.mk
@@ -55,9 +55,16 @@ ifeq ($$(words $$($1_PROGS)),1)
program.$1: $$($1_PROGS:%=%.$1.program)
endif
-%.$1.program: %.$1.bin
+$1_PROGRAM_TOOL ?= stflash
+$1_PROGRAM_FILE_stflash = bin
+$1_PROGRAM_stflash = st-flash $(STFLASH_FLAGS) write $$< \
+ $$(if $$($1_START_ADDRESS),$$($1_START_ADDRESS),0x8000000)
+$1_PROGRAM_FILE_bmflash = hex
+$1_PROGRAM_bmflash = bm-flash $(BMFLASH_FLAGS) $$<
+
+%.$1.program: %.$1.$$($1_PROGRAM_FILE_$$($1_PROGRAM_TOOL))
@echo "PROG [$1] $$<"
- $$Qst-flash write $$< $$(if $$($1_START_ADDRESS),$$($1_START_ADDRESS),0x8000000)
+ $$Q$$($1_PROGRAM_$$($1_PROGRAM_TOOL))
endef