This is an automated email from Gerrit.

Paul Fertser (fercer...@gmail.com) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/2721

-- gerrit

commit 3d0b46b2c4029ba98f08ff55e57e611df25549ee
Author: Paul Fertser <fercer...@gmail.com>
Date:   Fri Apr 17 13:36:28 2015 +0300

    target: try to reexamine even when polling fails
    
    After intermittent connection failures or target power failures it
    might be necessary to try reexamination even when polling fails. This
    should make communication with Cortex-A targets more reliable.
    
    This was runtime tested with stlink attached to an stm32l1 and an FTDI JTAG
    adapter attached to an stm32f1 target.
    
    Change-Id: I38c4db8124b7f4bbf53ddda53c13273449f49c15
    Signed-off-by: Paul Fertser <fercer...@gmail.com>

diff --git a/src/target/target.c b/src/target/target.c
index 8a7547b..27f8839 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -2522,29 +2522,27 @@ static int handle_target(void *priv)
                                        target->backoff.times *= 2;
                                        target->backoff.times++;
                                }
-                               LOG_USER("Polling target %s failed, GDB will be 
halted. Polling again in %dms",
-                                               target_name(target),
-                                               target->backoff.times * 
polling_interval);
 
                                /* Tell GDB to halt the debugger. This allows 
the user to
                                 * run monitor commands to handle the situation.
                                 */
                                target_call_event_callbacks(target, 
TARGET_EVENT_GDB_HALT);
-                               return retval;
                        }
-                       /* Since we succeeded, we reset backoff count */
                        if (target->backoff.times > 0) {
-                               LOG_USER("Polling target %s succeeded again, 
trying to reexamine", target_name(target));
+                               LOG_USER("Polling target %s failed, trying to 
reexamine", target_name(target));
                                target_reset_examined(target);
                                retval = target_examine_one(target);
                                /* Target examination could have failed due to 
unstable connection,
                                 * but we set the examined flag anyway to 
repoll it later */
                                if (retval != ERROR_OK) {
                                        target->examined = true;
+                                       LOG_USER("Examination failed, GDB will 
be halted. Polling again in %dms",
+                                                target->backoff.times * 
polling_interval);
                                        return retval;
                                }
                        }
 
+                       /* Since we succeeded, we reset backoff count */
                        target->backoff.times = 0;
                }
        }

-- 

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to