scripts: west_commands: openocd: Use 'reset init' by default

Instead of 'reset halt', default the command to reset and halt the target
to 'reset init'.

OpenOCD strictly requires 'reset init' to halt and prepare the device
before flash programming.
See https://openocd.org/doc/html/Flash-Commands.html chapter
"12.2 Preparing a Target before Flash Programming."

For targets implementing the init hook, it will allows to perform some
target specific init improvements (such as speed flash improvements).
Targets not implementing this hook will end up executing the usual and
previous 'halt'.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
Erwan Gouriou 2022-10-03 11:54:48 +02:00 committed by Marti Bolivar
parent 03c8deb599
commit 7b31b0e23c

View file

@ -20,7 +20,7 @@ from runners.core import ZephyrBinaryRunner
DEFAULT_OPENOCD_TCL_PORT = 6333
DEFAULT_OPENOCD_TELNET_PORT = 4444
DEFAULT_OPENOCD_GDB_PORT = 3333
DEFAULT_OPENOCD_RESET_HALT_CMD = 'reset halt'
DEFAULT_OPENOCD_RESET_HALT_CMD = 'reset init'
DEFAULT_OPENOCD_TARGET_HANDLE = "_TARGETNAME"
class OpenOcdBinaryRunner(ZephyrBinaryRunner):