From cd74dd28911353674e599744c1acce8bf3a6a7a7 Mon Sep 17 00:00:00 2001 From: Paul Fertser Date: Fri, 23 May 2014 15:17:31 +0400 Subject: [PATCH] target: reexamine after polling succeeds again 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 Tested-by: Tim Sander Change-Id: I5b067c18d9276d4e86cc59739f196ae7d0931622 Signed-off-by: Paul Fertser Reviewed-on: http://openocd.zylin.com/2151 Tested-by: jenkins Reviewed-by: Tim Sander Reviewed-by: Spencer Oliver --- src/target/target.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/target/target.c b/src/target/target.c index 9416b25b..4d277c69 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -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; } } -- 2.39.5