Cortexm: With connect under reset, keep the device halted until attach.

This commit is contained in:
Uwe Bonnes 2022-01-13 12:06:13 +01:00 committed by UweBonnes
parent d6440d716c
commit d594b42976
2 changed files with 9 additions and 5 deletions

View File

@ -834,9 +834,15 @@ void adiv5_dp_init(ADIv5_DP_t *dp)
adiv5_ap_unref(ap); adiv5_ap_unref(ap);
} }
/* We halted at least CortexM for Romtable scan. /* We halted at least CortexM for Romtable scan.
* Release the devices now. Attach() will halt them again.*/ * With connect under reset, keep the devices halted.
for (target *t = target_list; t; t = t->next) * Otherwise, release the devices now.
* Attach() will halt them again.
*/
for (target *t = target_list; t; t = t->next) {
if (!connect_assert_srst) {
target_halt_resume(t, false); target_halt_resume(t, false);
}
}
adiv5_dp_unref(dp); adiv5_dp_unref(dp);
} }

View File

@ -471,8 +471,6 @@ bool cortexm_probe(ADIv5_AP_t *ap)
PROBE(lpc17xx_probe); PROBE(lpc17xx_probe);
} }
#undef PROBE #undef PROBE
/* Restart the CortexM we stopped for Romtable scan. Allow pure debug.*/
target_halt_resume(t, 0);
return true; return true;
} }