aboutsummaryrefslogtreecommitdiff
path: root/stmhal/boards
diff options
context:
space:
mode:
authorChristopher Arndt <chris@chrisarndt.de>2016-03-08 11:29:22 +0100
committerDamien George <damien.p.george@gmail.com>2016-03-09 23:00:17 +0000
commit9b5e05a7c793ae0f3817af3ecba63f7b02713dea (patch)
tree5fff38df95c7d4a4808bcc385d620840d72d7bee /stmhal/boards
parentad725a6661b2672cff5cdb7332dd01128505d3d9 (diff)
stmhal: Add makefile target and configuration to deploy via OpenOCD.
Diffstat (limited to 'stmhal/boards')
-rw-r--r--stmhal/boards/openocd_stm32f4.cfg42
1 files changed, 42 insertions, 0 deletions
diff --git a/stmhal/boards/openocd_stm32f4.cfg b/stmhal/boards/openocd_stm32f4.cfg
new file mode 100644
index 000000000..e03ea87a1
--- /dev/null
+++ b/stmhal/boards/openocd_stm32f4.cfg
@@ -0,0 +1,42 @@
+# This script configures OpenOCD for use with an ST-Link V2 programmer/debugger
+# and an STM32F4 target microcontroller.
+#
+# To flash your firmware:
+#
+# $ openocd -f openocd_stm32f4.cfg \
+# -c "stm_flash build-BOARD/firmware0.bin build-BOARD/firmware1.bin"
+#
+# For a gdb server on port 3333:
+#
+# $ openocd -f openocd_stm32f4.cfg
+
+
+source [find interface/stlink-v2.cfg]
+transport select hla_swd
+source [find target/stm32f4x.cfg]
+reset_config srst_only
+init
+
+proc stm_flash { BIN0 BIN1 } {
+ reset halt
+ sleep 100
+ wait_halt 2
+ flash write_image erase $BIN0 0x08000000
+ sleep 100
+ verify_image $BIN0 0x08000000
+ sleep 100
+ flash write_image erase $BIN1 0x08020000
+ sleep 100
+ verify_image $BIN1 0x08020000
+ sleep 100
+ reset run
+ shutdown
+}
+
+proc stm_erase {} {
+ reset halt
+ sleep 100
+ stm32f4x mass_erase 0
+ sleep 100
+ shutdown
+}