From 3ebf0494244fb19707818f2611d122d44968113b Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Mon, 10 Sep 2018 22:18:27 +0200 Subject: [PATCH] cortexm: Only force halt before probe if idcode is unknown and ROM TABLE unreadable. --- src/target/cortexm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/target/cortexm.c b/src/target/cortexm.c index 891b2bd..5c7502f 100644 --- a/src/target/cortexm.c +++ b/src/target/cortexm.c @@ -323,7 +323,11 @@ bool cortexm_probe(ADIv5_AP_t *ap, bool forced) target_check_error(t); } - if (forced) + /* Only force halt if read ROM Table failed and there is no DPv2 + * targetid! + * So long, only STM32L0 is expected to enter this cause. + */ + if (forced && !ap->dp->targetid) if (!cortexm_forced_halt(t)) return false;