]> git.sur5r.net Git - openocd/commitdiff
target: reexamine after polling succeeds again
authorPaul Fertser <fercerpav@gmail.com>
Fri, 23 May 2014 11:17:31 +0000 (15:17 +0400)
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>
Sun, 1 Jun 2014 17:28:18 +0000 (17:28 +0000)
If polling was failing, it likely meant that either the target was
disconnected or rebooted. In the latter case it needs to be reexamined
to be properly configured for the debug session, so do it just in
case.

Reported-by: Tim Sander <tim@krieglstein.org>
Tested-by: Tim Sander <tim@krieglstein.org>
Change-Id: I5b067c18d9276d4e86cc59739f196ae7d0931622
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2151
Tested-by: jenkins
Reviewed-by: Tim Sander <tim@krieglstein.org>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/target/target.c

index 9416b25ba6bcd9c8a05bc910b28cd2fd4b27231d..4d277c694b85412d0be46d1ee36f920cf0b22609 100644 (file)
@@ -2418,8 +2418,12 @@ static int handle_target(void *priv)
                                return retval;
                        }
                        /* Since we succeeded, we reset backoff count */
-                       if (target->backoff.times > 0)
-                               LOG_USER("Polling target %s succeeded again", target_name(target));
+                       if (target->backoff.times > 0) {
+                               LOG_USER("Polling target %s succeeded again, trying to reexamine", target_name(target));
+                               target_reset_examined(target);
+                               target_examine_one(target);
+                       }
+
                        target->backoff.times = 0;
                }
        }