Browse Source

Added a Makefile rule to flash with OpenOCD

Clara Hobbs 6 years ago
parent
commit
32cd013a50
2 changed files with 8 additions and 2 deletions
  1. 5
    0
      Makefile
  2. 3
    2
      README.md

+ 5
- 0
Makefile View File

@@ -211,3 +211,8 @@ ULIBS =
211 211
 
212 212
 RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC
213 213
 include $(RULESPATH)/rules.mk
214
+
215
+# Special rules follow
216
+
217
+flash-openocd-stlink: $(BUILDDIR)/$(PROJECT).elf
218
+	openocd -f interface/stlink-v2.cfg -c "transport select hla_swd" -f target/stm32f0x.cfg -c "program $(BUILDDIR)/$(PROJECT).elf verify reset exit"

+ 3
- 2
README.md View File

@@ -86,9 +86,10 @@ follows:
86 86
 
87 87
 ### OpenOCD
88 88
 
89
-OpenOCD can also be used to flash the firmware.  For example:
89
+OpenOCD can also be used to flash the firmware.  If your debug probe is an
90
+ST-LINK/V2, you can easily do this as follows:
90 91
 
91
-    $ openocd -f interface/stlink-v2.cfg -f target/stm32f0x.cfg -c "program build/pd-buddy-firmware.elf verify reset exit"
92
+    $ make flash-openocd-stlink
92 93
 
93 94
 ## Usage
94 95
 

Loading…
Cancel
Save