aboutsummaryrefslogtreecommitdiff
path: root/stmhal/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'stmhal/Makefile')
-rw-r--r--stmhal/Makefile6
1 files changed, 6 insertions, 0 deletions
diff --git a/stmhal/Makefile b/stmhal/Makefile
index 93ff92bc8..847cb4e8b 100644
--- a/stmhal/Makefile
+++ b/stmhal/Makefile
@@ -30,6 +30,8 @@ PYDFU ?= ../tools/pydfu.py
DFU_UTIL ?= dfu-util
DEVICE=0483:df11
STFLASH ?= st-flash
+OPENOCD ?= openocd
+OPENOCD_CONFIG ?= boards/openocd_stm32f4.cfg
CROSS_COMPILE = arm-none-eabi-
@@ -293,6 +295,10 @@ deploy-stlink: $(BUILD)/firmware.dfu
$(ECHO) "Writing $(BUILD)/firmware1.bin to the board via ST-LINK"
$(Q)$(STFLASH) --reset write $(BUILD)/firmware1.bin 0x08020000
+deploy-openocd: $(BUILD)/firmware.dfu
+ $(ECHO) "Writing $(BUILD)/firmware{0,1}.bin to the board via ST-LINK using OpenOCD"
+ $(Q)$(OPENOCD) -f $(OPENOCD_CONFIG) -c "stm_flash $(BUILD)/firmware0.bin $(BUILD)/firmware1.bin"
+
$(BUILD)/firmware.dfu: $(BUILD)/firmware.elf
$(ECHO) "Create $@"
$(Q)$(OBJCOPY) -O binary -j .isr_vector $^ $(BUILD)/firmware0.bin