diff --git a/chip/lm4/openocd/lm4x.cfg b/chip/lm4/openocd/lm4x.cfg index e9df0ad8d6..9c979c7dda 100644 --- a/chip/lm4/openocd/lm4x.cfg +++ b/chip/lm4/openocd/lm4x.cfg @@ -27,6 +27,9 @@ target create $_TARGETNAME cortex_m3 -chain-position $_CHIPNAME.cpu -variant lm3 # 12k working area at base of ram, not backed up $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size 0x3000 +# Use system reset request, since LM4 doesn't support vectreset +cortex_m3 reset_config sysresetreq + # Ensure that the watchdog is properly disabled when doing flashing $_TARGETNAME configure -event reset-init { # Unlock watchdog0 diff --git a/chip/lm4/openocd/lm4x_cmds.tcl b/chip/lm4/openocd/lm4x_cmds.tcl index 9a3630552d..3f1c93e29a 100644 --- a/chip/lm4/openocd/lm4x_cmds.tcl +++ b/chip/lm4/openocd/lm4x_cmds.tcl @@ -7,14 +7,10 @@ # Program internal flash proc flash_lm4 {path offset size} { - set firstsect [expr {$offset / 1024}]; - set lastsect [expr {($offset + $size) / 1024 - 1}]; - reset init; - flash erase_sector internal $firstsect $lastsect; - # Note erase_sector silently fails sometimes; see crosbug.com/p/8632 - # Dump a few words as a diagnostic for whether erase succeeded - mdw 0 16 - flash write_image $path $offset; + #set firstsect [expr {$offset / 1024}]; + #set lastsect [expr {($offset + $size) / 1024 - 1}]; + reset halt; + flash write_image erase $path $offset; reset }