aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Fertser <fercerpav@gmail.com>2013-07-17 09:47:43 +0400
committerSpencer Oliver <spen@spen-soft.co.uk>2013-08-07 21:03:27 +0000
commit01dde68a4b4c362f64b7b5f2223ee08029bcc019 (patch)
tree9c5ad15fe74f198254684fad3a8c095b7d77f4ca
parentfccc55225a7f874ee9d795286e9d92dc051b5b9d (diff)
target: clear running_alg flag after reset
After the target was reset we can be sure it's not running any algorithm. This fixes the following failure scenario: On my STM32F103 board after I start the firmware and then stop and try to "load" in gdb (before doing mon reset halt), I get Error: timeout waiting for algorithm, a target reset is recommended However, target reset doesn't help as the flag is still there ("Error: Target is already running an algorithm"), so I have no choice but to restart the OpenOCD process. I'm not sure yet what exactly prevents load from working after my firmware is initialised, most probably some interrupt is firing and my handler produces a fault due to garbled RAM. Change-Id: Idd977f2780a64d84800e3abd412cffc1ab6801b0 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1512 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
-rw-r--r--src/target/target.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/target/target.c b/src/target/target.c
index 1fe89eb4..e4235ed2 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -583,8 +583,10 @@ static int target_process_reset(struct command_context *cmd_ctx, enum target_res
retval = target_call_timer_callbacks_now();
struct target *target;
- for (target = all_targets; target; target = target->next)
+ for (target = all_targets; target; target = target->next) {
target->type->check_reset(target);
+ target->running_alg = false;
+ }
return retval;
}