aboutsummaryrefslogtreecommitdiff
path: root/stmhal/Makefile
diff options
context:
space:
mode:
authorChristopher Arndt2016-03-08 08:42:30 +0100
committerDamien George2016-03-09 13:26:23 +0000
commit07554486eeb73665b1bf61ee9af32e4a6e7e458a (patch)
treedec1d52f1570fc6aed6abc6581c3de2348a37693 /stmhal/Makefile
parent6b80ebe32ef57cc3bef1b6309433354181867611 (diff)
stmhal: Add makefile target to deploy stmhal build via ST-LINK.
Diffstat (limited to 'stmhal/Makefile')
-rw-r--r--stmhal/Makefile7
1 files changed, 7 insertions, 0 deletions
diff --git a/stmhal/Makefile b/stmhal/Makefile
index 7e001bc30..93ff92bc8 100644
--- a/stmhal/Makefile
+++ b/stmhal/Makefile
@@ -29,6 +29,7 @@ USE_PYDFU ?= 1
PYDFU ?= ../tools/pydfu.py
DFU_UTIL ?= dfu-util
DEVICE=0483:df11
+STFLASH ?= st-flash
CROSS_COMPILE = arm-none-eabi-
@@ -286,6 +287,12 @@ else
$(Q)$(DFU_UTIL) -a 0 -d $(DEVICE) -D $<
endif
+deploy-stlink: $(BUILD)/firmware.dfu
+ $(ECHO) "Writing $(BUILD)/firmware0.bin to the board via ST-LINK"
+ $(Q)$(STFLASH) write $(BUILD)/firmware0.bin 0x08000000
+ $(ECHO) "Writing $(BUILD)/firmware1.bin to the board via ST-LINK"
+ $(Q)$(STFLASH) --reset write $(BUILD)/firmware1.bin 0x08020000
+
$(BUILD)/firmware.dfu: $(BUILD)/firmware.elf
$(ECHO) "Create $@"
$(Q)$(OBJCOPY) -O binary -j .isr_vector $^ $(BUILD)/firmware0.bin