aboutsummaryrefslogtreecommitdiffstats
path: root/support/openocd/flash_0.4.cfg
diff options
context:
space:
mode:
Diffstat (limited to 'support/openocd/flash_0.4.cfg')
-rw-r--r--support/openocd/flash_0.4.cfg14
1 files changed, 10 insertions, 4 deletions
diff --git a/support/openocd/flash_0.4.cfg b/support/openocd/flash_0.4.cfg
index e66d28d..32c06c6 100644
--- a/support/openocd/flash_0.4.cfg
+++ b/support/openocd/flash_0.4.cfg
@@ -24,7 +24,7 @@ jtag_nsrst_delay 100
jtag_ntrst_delay 100
#use combined on interfaces or targets that can't set TRST/SRST separately
-reset_config trst_and_srst
+reset_config srst_only
#jtag scan chain
if { [info exists CPUTAPID ] } {
@@ -70,17 +70,23 @@ flash bank bank0 stm32x 0x08000000 0x00020000 0 0 $_TARGETNAME
proc flash_chip {} {
echo "Halting..."
- halt
+ reset halt
+
+ echo "Unlocking flash..."
+ flash protect 0 0 last off
+
echo "Erasing..."
flash erase_address 0x08000000 0x20000
- # TODO: native
- #flash erase_address 0x08000000 0x80000
+
echo "Flashing image..."
flash write_bank 0 build/maple.bin 0
+
echo "Verifying image..."
verify_image build/maple.bin 0x08000000 bin
+
echo "Checksum verified, resetting chip"
reset run
+
echo "Daemon shutdown"
shutdown
}