From 0df44e205ba5c4e82ad47f2b9b7442fa5fd98ed9 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Tue, 16 Feb 2021 20:17:07 +0100 Subject: [PATCH] ADIv5: Abort Romtable scan also if CIDR0 is invalid after halting #832 STM32WLE5 has the same dual core chip as STM32WL5. For the second core, the additional AP can be see, but access to e.g. CIDR0 for that Romtable fails. Aborting the scan too if again the second read of CIDR0 fails makes sense anyways! --- src/target/adiv5.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/target/adiv5.c b/src/target/adiv5.c index a45bb1d..7a6f28d 100644 --- a/src/target/adiv5.c +++ b/src/target/adiv5.c @@ -416,6 +416,8 @@ static void adiv5_component_probe(ADIv5_AP_t *ap, uint32_t addr, int recursion, return; /* Halting failed! */ /* CPU now halted, read cidr again. */ cidr = adiv5_ap_read_id(ap, addr + CIDR0_OFFSET); + if ((cidr & ~CID_CLASS_MASK) != CID_PREAMBLE) + return; } } #if defined(ENABLE_DEBUG)