aboutsummaryrefslogtreecommitdiff
path: root/ports/stm32/boards/openocd_stm32f7.cfg
diff options
context:
space:
mode:
Diffstat (limited to 'ports/stm32/boards/openocd_stm32f7.cfg')
-rw-r--r--ports/stm32/boards/openocd_stm32f7.cfg42
1 files changed, 42 insertions, 0 deletions
diff --git a/ports/stm32/boards/openocd_stm32f7.cfg b/ports/stm32/boards/openocd_stm32f7.cfg
new file mode 100644
index 000000000..55b632650
--- /dev/null
+++ b/ports/stm32/boards/openocd_stm32f7.cfg
@@ -0,0 +1,42 @@
+# This script configures OpenOCD for use with an ST-Link V2 programmer/debugger
+# and an STM32F7 target microcontroller.
+#
+# To flash your firmware:
+#
+# $ openocd -f openocd_stm32f7.cfg \
+# -c "stm_flash build-BOARD/firmware0.bin 0x08000000 build-BOARD/firmware1.bin 0x08020000"
+#
+# For a gdb server on port 3333:
+#
+# $ openocd -f openocd_stm32f7.cfg
+
+
+source [find interface/stlink-v2-1.cfg]
+transport select hla_swd
+source [find target/stm32f7x.cfg]
+reset_config srst_only
+init
+
+proc stm_flash { BIN0 ADDR0 BIN1 ADDR1 } {
+ reset halt
+ sleep 100
+ wait_halt 2
+ flash write_image erase $BIN0 $ADDR0
+ sleep 100
+ verify_image $BIN0 $ADDR0
+ sleep 100
+ flash write_image erase $BIN1 $ADDR1
+ sleep 100
+ verify_image $BIN1 $ADDR1
+ sleep 100
+ reset run
+ shutdown
+}
+
+proc stm_erase {} {
+ reset halt
+ sleep 100
+ stm32f7x mass_erase 0
+ sleep 100
+ shutdown
+}