|
From: openocd-gerrit <ope...@us...> - 2025-10-11 15:52:37
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 2abf8daa80d31dc78877943ad580af7a6fbbbe3f (commit)
from e5888bda38f4952e2ae92f7dc5b25fc9a2d1c2b3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2abf8daa80d31dc78877943ad580af7a6fbbbe3f
Author: Marc Schink <de...@za...>
Date: Mon Apr 15 07:48:31 2024 +0200
target/cortex_m: Remove echo of 'reset_config' command
Do not echo the selected reset config. This is one of many changes to
make the behavior of Tcl commands more consistent.
This also avoids stray and confusing messages in the output of OpenOCD.
For example, the "reset_config" line here:
Open On-Chip Debugger 0.12.0+dev-00802-gb7f0145fc-dirty
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
cortex_m reset_config sysresetreq
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
While at it, fix some coding style and command handling issues.
Change-Id: I3b3d8687af1d23a2dc1764f29b52dc607b80cb59
Signed-off-by: Marc Schink <de...@za...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8638
Reviewed-by: Antonio Borneo <bor...@gm...>
Tested-by: jenkins
diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c
index c5d668a4d..047a1d38e 100644
--- a/src/target/cortex_m.c
+++ b/src/target/cortex_m.c
@@ -3194,43 +3194,46 @@ COMMAND_HANDLER(handle_cortex_m_reset_config_command)
{
struct target *target = get_current_target(CMD_CTX);
struct cortex_m_common *cortex_m = target_to_cm(target);
- int retval;
- char *reset_config;
- retval = cortex_m_verify_pointer(CMD, cortex_m);
+ int retval = cortex_m_verify_pointer(CMD, cortex_m);
if (retval != ERROR_OK)
return retval;
- if (CMD_ARGC > 0) {
- if (strcmp(*CMD_ARGV, "sysresetreq") == 0)
- cortex_m->soft_reset_config = CORTEX_M_RESET_SYSRESETREQ;
-
- else if (strcmp(*CMD_ARGV, "vectreset") == 0) {
- 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;
+ if (!CMD_ARGC) {
+ char *reset_config;
- } else
- return ERROR_COMMAND_SYNTAX_ERROR;
- }
+ switch (cortex_m->soft_reset_config) {
+ case CORTEX_M_RESET_SYSRESETREQ:
+ reset_config = "sysresetreq";
+ break;
- switch (cortex_m->soft_reset_config) {
- case CORTEX_M_RESET_SYSRESETREQ:
- reset_config = "sysresetreq";
- break;
+ case CORTEX_M_RESET_VECTRESET:
+ reset_config = "vectreset";
+ break;
- case CORTEX_M_RESET_VECTRESET:
- reset_config = "vectreset";
- break;
+ default:
+ reset_config = "unknown";
+ break;
+ }
- default:
- reset_config = "unknown";
- break;
+ command_print(CMD, "%s", reset_config);
+ return ERROR_OK;
+ } else if (CMD_ARGC != 1) {
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
- command_print(CMD, "cortex_m reset_config %s", reset_config);
+ if (!strcmp(CMD_ARGV[0], "sysresetreq")) {
+ 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;
+ } else {
+ command_print(CMD, "invalid reset config '%s'", CMD_ARGV[0]);
+ return ERROR_COMMAND_ARGUMENT_INVALID;
+ }
return ERROR_OK;
}
-----------------------------------------------------------------------
Summary of changes:
src/target/cortex_m.c | 57 +++++++++++++++++++++++++++------------------------
1 file changed, 30 insertions(+), 27 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|