tcl: introduce init_target_events and use it for gdb flashing events
commit207237b92005d604b75ff5280042a6c286a685f8
authorPaul Fertser <fercerpav@gmail.com>
Sat, 22 Mar 2014 12:47:37 +0000 (22 16:47 +0400)
committerPaul Fertser <fercerpav@gmail.com>
Sat, 29 Mar 2014 08:40:03 +0000 (29 08:40 +0000)
treedbe5dbb408ac7470a8b6f1c06f57defef8d79a5a
parentde9ebc5ce6432830d473aba769c34ae38794c947
tcl: introduce init_target_events and use it for gdb flashing events

This introduces a new global Tcl procedure that is run just after
init_targets and before init_boards.

Its default behaviour is to assign gdb-flash-erase-start and
gdb-flash-write-end to reasonable defaults.

The rationale for doing "reset init" before gdb erases and flashes
memory is that all flash drivers are written in assumption that they
can safely be used only after chip reset (plus chip-specific
configuration in the init handler if any). The need to use "reset
halt" after flashing is because a user expects running firmware after
loading to be the same as running it from power-on-reset.

Change-Id: I9ddc4047611904ca4ca779b73376d2739611948a
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2062
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
doc/openocd.texi
src/target/startup.tcl
src/target/target.c