This is an automated email from Gerrit.

"zapb <d...@zapb.de>" just uploaded a new patch set to Gerrit, which you can 
find at https://review.openocd.org/c/openocd/+/9114

-- gerrit

commit 18c226ebd6def6adfe89780e6487c565fbe7a823
Author: Marc Schink <d...@zapb.de>
Date:   Mon Sep 8 14:35:46 2025 +0200

    target/cortex_m: Fix error handling in 'reset_config'
    
    Raise an error message instead of a warning because the requested
    reset configuration cannot be applied. Also, use command_print() in
    order to provide the error message to the caller.
    
    Change-Id: Ib84225ca362258ad50a9cde230bd69a07429204e
    Signed-off-by: Marc Schink <d...@zapb.de>

diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c
index 047a1d38e7..65bb32a8ca 100644
--- a/src/target/cortex_m.c
+++ b/src/target/cortex_m.c
@@ -3226,10 +3226,12 @@ COMMAND_HANDLER(handle_cortex_m_reset_config_command)
                cortex_m->soft_reset_config = CORTEX_M_RESET_SYSRESETREQ;
        } else if (!strcmp(CMD_ARGV[0], "vectreset")) {
                if (target_was_examined(target)
-                               && !cortex_m->vectreset_supported)
-                       LOG_TARGET_WARNING(target, "VECTRESET is not supported 
on your Cortex-M core");
-               else
-                       cortex_m->soft_reset_config = CORTEX_M_RESET_VECTRESET;
+                               && !cortex_m->vectreset_supported) {
+                       command_print(CMD, "VECTRESET is not supported on your 
Cortex-M core");
+                       return ERROR_FAIL;
+               }
+
+               cortex_m->soft_reset_config = CORTEX_M_RESET_VECTRESET;
        } else {
                command_print(CMD, "invalid reset config '%s'", CMD_ARGV[0]);
                return ERROR_COMMAND_ARGUMENT_INVALID;

-- 

Reply via email to