target: clear running_alg flag after reset 12/1512/2
authorPaul Fertser <fercerpav@gmail.com>
Wed, 17 Jul 2013 05:47:43 +0000 (09:47 +0400)
committerSpencer Oliver <spen@spen-soft.co.uk>
Wed, 7 Aug 2013 21:03:27 +0000 (21:03 +0000)
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>
src/target/target.c

index 1fe89eb40d70126a808e784b8d93818d92cb7c40..e4235ed26ab5d2e4c52f55e488826be24a52b519 100644 (file)
@@ -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;
 }

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)