From c5b923d38defc535828e3b5399f03f1350e0dc54 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Mon, 18 Jun 2012 21:56:52 +0000 Subject: lm4f: update JTAG scripts for openOCD 0.5.0 The flash commands syntax has slightly evolved and the watchdog needs to be switched off even though we are doing a reset halt. Signed-off-by: Vincent Palatin BUG=chrome-os-partner:7420 TEST=flash Link EC using OpenOCD inside the chroot: sudo USE="ftdi" emerge openocd sudo openocd -f chip/lm4/servo_v2.cfg flash_link Change-Id: Ieef5df682a945646525267a7b702e953796f3f00 Reviewed-on: https://gerrit.chromium.org/gerrit/25561 Reviewed-by: Randall Spangler Commit-Ready: Vincent Palatin Tested-by: Vincent Palatin --- chip/lm4/openocd/lm4x.cfg | 10 +++++++++- chip/lm4/openocd/lm4x_cmds.tcl | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/chip/lm4/openocd/lm4x.cfg b/chip/lm4/openocd/lm4x.cfg index 3619320c57..e9df0ad8d6 100644 --- a/chip/lm4/openocd/lm4x.cfg +++ b/chip/lm4/openocd/lm4x.cfg @@ -27,8 +27,16 @@ 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 +# Ensure that the watchdog is properly disabled when doing flashing +$_TARGETNAME configure -event reset-init { + # Unlock watchdog0 + mww 0x40000c00 0x1ACCE551 + # Disable Watchdog0 + mww 0x40000008 0 +} + #flash configuration -flash bank stellaris 0 0 0 0 $_TARGETNAME +flash bank internal stellaris 0 0 0 0 $_TARGETNAME # useful command definitions for software loading source [find lm4x_cmds.tcl] diff --git a/chip/lm4/openocd/lm4x_cmds.tcl b/chip/lm4/openocd/lm4x_cmds.tcl index ea81c4c81c..59b6cb765d 100644 --- a/chip/lm4/openocd/lm4x_cmds.tcl +++ b/chip/lm4/openocd/lm4x_cmds.tcl @@ -9,8 +9,8 @@ proc flash_lm4 {path offset size} { set firstsect [expr {$offset / 1024}]; set lastsect [expr {($offset + $size) / 1024 - 1}]; - reset halt; - flash erase_sector 0 $firstsect $lastsect; + 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 -- cgit v1.2.1