From eb17a279a5ef0bc702ef1861f8127c4378db56a5 Mon Sep 17 00:00:00 2001 From: James Turton Date: Fri, 2 Sep 2022 10:44:24 +0200 Subject: [PATCH] adiv5: Add comment to ap probe loop --- src/target/adiv5.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/target/adiv5.c b/src/target/adiv5.c index cdbd1fa..8b2a356 100644 --- a/src/target/adiv5.c +++ b/src/target/adiv5.c @@ -811,7 +811,7 @@ void adiv5_dp_init(ADIv5_DP_t *dp, const uint32_t idcode) * correctly on STM32. CDBGRSTACK is never asserted, and we * just wait forever. This scenario is described in B2.4.1 * so we have a timeout mechanism in addition to the sensing one. */ - platform_timeout_set(&timeout, 201); + platform_timeout_set(&timeout, 200); /* Write request for debug reset */ adiv5_dp_write(dp, ADIV5_DP_CTRLSTAT, ctrlstat |= ADIV5_DP_CTRLSTAT_CDBGRSTREQ); /* Wait for acknowledge */ @@ -845,9 +845,12 @@ void adiv5_dp_init(ADIv5_DP_t *dp, const uint32_t idcode) if (dp->ap_cleanup) dp->ap_cleanup(i); #endif - if (++invalid_aps == 8) { + /* We have probably found all APs on this DP so no need to keep looking. + * Continue with rest of init function down below. + */ + if (++invalid_aps == 8) break; - } + continue; }