runners: openocd: Reset target before running Elf

In case of flashing (which is typically used with OpenOCD)
we do reset of the target after programming application binary
in the non-volatile memory.

In case of Elf execution we need to reset the target before
loading Elf sections so that we might be sure our target
is in sane & expected state before we start execution.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
This commit is contained in:
Alexey Brodkin 2020-04-21 16:24:01 +03:00 committed by Carles Cufí
commit 0d5416acc4

View file

@ -178,7 +178,7 @@ class OpenOcdBinaryRunner(ZephyrBinaryRunner):
cmd = (self.openocd_cmd + self.serial + self.cfg_cmd +
pre_init_cmd + ['-c', 'init',
'-c', 'targets',
'-c', 'halt',
'-c', 'reset halt',
'-c', 'load_image ' + self.elf_name,
'-c', 'resume ' + ep_addr,
'-c', 'shutdown'])