flash/str7x: After reset init the flash is unlocked
[fw/openocd] / tcl / target / str710.cfg
index 9da69acad4982dd4c026c402650209c60a39b12b..028c6043d1a11110b467c15e627d1e5ff0d2674e 100644 (file)
@@ -30,7 +30,15 @@ set _TARGETNAME $_CHIPNAME.cpu
 target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi
 
 $_TARGETNAME configure -event reset-start { jtag_khz 10 }
-$_TARGETNAME configure -event reset-init { jtag_khz 6000 }
+$_TARGETNAME configure -event reset-init {
+       jtag_khz 6000
+
+# Because the hardware cannot be interrogated for the protection state
+# of sectors, initialize all the sectors to be unprotected. The initial
+# state is reflected by the driver, too.
+       flash protect 0 0 last off
+       flash protect 1 0 last off
+}
 $_TARGETNAME configure -event gdb-flash-erase-start {
        flash protect 0 0 7 off
        flash protect 1 0 1 off