aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--support/openocd/debug_0.4.cfg6
-rw-r--r--support/openocd/flash_0.4.cfg14
2 files changed, 13 insertions, 7 deletions
diff --git a/support/openocd/debug_0.4.cfg b/support/openocd/debug_0.4.cfg
index bbc8864..7d6982a 100644
--- a/support/openocd/debug_0.4.cfg
+++ b/support/openocd/debug_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 ] } {
@@ -67,8 +67,8 @@ $_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x20000000 -work-area-s
flash bank bank0 stm32x 0x08000000 0x00020000 0 0 $_TARGETNAME
proc nopforever {} {
- puts "Resetting the chip..."
- reset run
+ puts "Resetting the chip... Halting for debugger."
+ reset halt
}
init
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
}