cortex_m, hla_target: do not try asserting SRST if it's not present
[fw/openocd] / src / target / hla_target.c
index 65e056863fe530354b59f795ec590cd6b7050214..4564d46c9effb9ca2a978c7227a1a4c0af27cdec 100644 (file)
@@ -428,7 +428,8 @@ static int adapter_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)) {
                jtag_add_reset(0, 1);
                res = adapter->layout->api->assert_srst(adapter->fd, 0);
                srst_asserted = true;