cortex_m, hla_target: do not try asserting SRST if it's not present
[fw/openocd] / src / target / cortex_m.c
index 6fba9259b8fd65acc4f11a177e3cd3e1e1ba4bdd..9521085b1cc8724ae51e7abf5c59791fc03080f3 100644 (file)
@@ -989,7 +989,8 @@ static int cortex_m3_assert_reset(struct target *target)
 
        bool srst_asserted = false;
 
-       if (jtag_reset_config & RESET_SRST_NO_GATING) {
+       if ((jtag_reset_config & RESET_HAS_SRST) &&
+           (jtag_reset_config & RESET_SRST_NO_GATING)) {
                adapter_assert_reset();
                srst_asserted = true;
        }