diff --git a/src/target/adiv5.c b/src/target/adiv5.c index 334a665..9b74c87 100644 --- a/src/target/adiv5.c +++ b/src/target/adiv5.c @@ -489,11 +489,13 @@ void adiv5_dp_init(ADIv5_DP_t *dp) } /* Probe for APs on this DP */ uint32_t last_base = 0; - for(int i = 0; i < 256; i++) { + int void_aps = 0; + for(int i = 0; (i < 256) && (void_aps < 8); i++) { ADIv5_AP_t *ap = NULL; if (adiv5_ap_setup(i)) ap = adiv5_new_ap(dp, i); if (ap == NULL) { + void_aps++; adiv5_ap_cleanup(i); if (i == 0) return;