cortex_m: do not perform soft_reset_halt on targets without VECTRESET
[fw/openocd] / src / target / cortex_m.c
index e35cdbe2f1bfa29f2e73067591a13909c6805458..245490c08f344f3d7765a28f3ffd9a88d3b24a23 100644 (file)
@@ -727,6 +727,11 @@ static int cortex_m_soft_reset_halt(struct target *target)
         * core, not the peripherals */
        LOG_DEBUG("soft_reset_halt is discouraged, please use 'reset halt' instead.");
 
+       if (!cortex_m->vectreset_supported) {
+               LOG_ERROR("VECTRESET is not supported on this Cortex-M core");
+               return ERROR_FAIL;
+       }
+
        /* Set C_DEBUGEN */
        retval = cortex_m_write_debug_halt_mask(target, 0, C_STEP | C_MASKINTS);
        if (retval != ERROR_OK)