From 2c1702116d1bd4d39fdde3ded710ed8e2a55dba3 Mon Sep 17 00:00:00 2001 From: Tomek CEDRO Date: Sun, 6 Nov 2011 02:40:56 +0000 Subject: target/arm_adi_v5: ahbap_debugport_init() returns error when both CDBGPWRUPACK|CSYSPWRUPACK flags are not set after read retries - this may indicate communication failure. --- src/target/arm_adi_v5.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 88a5d3b8..b6c66b85 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -1150,9 +1150,12 @@ int ahbap_debugport_init(struct adiv5_dap *dap) alive_sleep(10); } - //TC: Here CDBGPWRUPACK|CSYSPWRUPACK still may not be set! - //TODO: Should we proceed anyway? - if (cnt>=10) LOG_ERROR("CDBGPWRUPACK|CSYSPWRUPACK FLAGS NOT SET IN RESPONSE!"); + //TC: At this point CDBGPWRUPACK|CSYSPWRUPACK still may not be set! + // We should not proceed, it may indicate target failure... + if (cnt>=10) { + LOG_ERROR("CDBGPWRUPACK|CSYSPWRUPACK FLAGS NOT SET IN RESPONSE!"); + return(ERROR_FAIL); + } retval = dap_queue_dp_read(dap, DP_CTRL_STAT, NULL); if (retval != ERROR_OK) -- cgit v1.2.3