diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index 2cea203a2..9314d6675 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -1849,11 +1849,13 @@ static int cortex_m_deassert_reset(struct target *target) target_state_name(target), target_was_examined(target) ? "" : " not"); - /* deassert reset lines */ - adapter_deassert_reset(); - enum reset_types jtag_reset_config = jtag_get_reset_config(); + /* deassert reset lines */ + if (jtag_reset_config & RESET_HAS_SRST) + adapter_deassert_reset(); + + if ((jtag_reset_config & RESET_HAS_SRST) && !(jtag_reset_config & RESET_SRST_NO_GATING) && armv7m->debug_ap) {