summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.rules2
-rw-r--r--board/discovery-stm32f072/openocd-flash.cfg4
2 files changed, 5 insertions, 1 deletions
diff --git a/Makefile.rules b/Makefile.rules
index 1b27c23500..e5279d8097 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -195,7 +195,7 @@ xrefs: $(call targ_if_prog,etags,$(out)/TAGS) \
$(call targ_if_prog,ctags,$(out)/tags)
.PHONY: flash
-flash:
+flash: $(out)/ec.bin
openocd -c "set BOARD $(BOARD)"\
-c "set BUILD_DIR $(out)"\
-f board/$(BOARD)/openocd-flash.cfg
diff --git a/board/discovery-stm32f072/openocd-flash.cfg b/board/discovery-stm32f072/openocd-flash.cfg
index eed8d03f36..d1b847a741 100644
--- a/board/discovery-stm32f072/openocd-flash.cfg
+++ b/board/discovery-stm32f072/openocd-flash.cfg
@@ -4,6 +4,10 @@
source [find board/stm32f0discovery.cfg]
+# For flashing, force the board into reset on connect, this ensures that
+# code running on the core can't interfere with programming.
+reset_config connect_assert_srst
+
gdb_port 0
tcl_port 0
telnet_port 0