target/cortex_m: fix cortex_m reset_config help and check for syntax error 95/4795/2
authorTomas Vanek <vanekt@fbl.cz>
Fri, 7 Dec 2018 16:51:49 +0000 (17:51 +0100)
committerTomas Vanek <vanekt@fbl.cz>
Wed, 19 Dec 2018 13:14:27 +0000 (13:14 +0000)
Remove option 'srst' which is not recognized from on-line help and texi.
Check parameter and return syntax error if wrong option is entered.

Change-Id: I87daa423a9f53193a0b015080594820b933628f5
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/4795
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
doc/openocd.texi
src/target/cortex_m.c

index bc24aedb62f0b4ef29a91441d332743ee9d3f7e8..aa901e6e49a874378d4ebfcbd76e948fabd67588 100644 (file)
@@ -3458,6 +3458,7 @@ How long (in milliseconds) OpenOCD should wait after deasserting
 nTRST (active-low JTAG TAP reset) before starting new JTAG operations.
 @end deffn
 
 nTRST (active-low JTAG TAP reset) before starting new JTAG operations.
 @end deffn
 
+@anchor {reset_config}
 @deffn {Command} reset_config mode_flag ...
 This command displays or modifies the reset configuration
 of your combination of JTAG board and target in target
 @deffn {Command} reset_config mode_flag ...
 This command displays or modifies the reset configuration
 of your combination of JTAG board and target in target
@@ -8994,13 +8995,13 @@ must also be explicitly enabled.
 This finishes by listing the current vector catch configuration.
 @end deffn
 
 This finishes by listing the current vector catch configuration.
 @end deffn
 
-@deffn Command {cortex_m reset_config} (@option{srst}|@option{sysresetreq}|@option{vectreset})
-Control reset handling. The default @option{srst} is to use srst if fitted,
-otherwise fallback to @option{vectreset}.
+@deffn Command {cortex_m reset_config} (@option{sysresetreq}|@option{vectreset})
+Control reset handling if hardware srst is not fitted
+@xref{reset_config,,reset_config}.
+
 @itemize @minus
 @itemize @minus
-@item @option{srst} use hardware srst if fitted otherwise fallback to @option{vectreset}.
-@item @option{sysresetreq} use NVIC SYSRESETREQ to reset system.
-@item @option{vectreset} use NVIC VECTRESET to reset system.
+@item @option{sysresetreq} use AIRCR SYSRESETREQ to reset system.
+@item @option{vectreset} use AIRCR VECTRESET to reset system (default).
 @end itemize
 
 Using @option{vectreset} is a safe option for Cortex-M3, M4 and M7 cores.
 @end itemize
 
 Using @option{vectreset} is a safe option for Cortex-M3, M4 and M7 cores.
index bb8c06d0f6dcdbb9c6e8e979d4bc8ebcc2a48159..4ce776cd0dd3193add842af303b82b34411cb7db 100644 (file)
@@ -2436,7 +2436,9 @@ COMMAND_HANDLER(handle_cortex_m_reset_config_command)
                                LOG_WARNING("VECTRESET is not supported on your Cortex-M core!");
                        else
                                cortex_m->soft_reset_config = CORTEX_M_RESET_VECTRESET;
                                LOG_WARNING("VECTRESET is not supported on your Cortex-M core!");
                        else
                                cortex_m->soft_reset_config = CORTEX_M_RESET_VECTRESET;
-               }
+
+               } else
+                       return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        switch (cortex_m->soft_reset_config) {
        }
 
        switch (cortex_m->soft_reset_config) {
@@ -2478,7 +2480,7 @@ static const struct command_registration cortex_m_exec_command_handlers[] = {
                .handler = handle_cortex_m_reset_config_command,
                .mode = COMMAND_ANY,
                .help = "configure software reset handling",
                .handler = handle_cortex_m_reset_config_command,
                .mode = COMMAND_ANY,
                .help = "configure software reset handling",
-               .usage = "['srst'|'sysresetreq'|'vectreset']",
+               .usage = "['sysresetreq'|'vectreset']",
        },
        COMMAND_REGISTRATION_DONE
 };
        },
        COMMAND_REGISTRATION_DONE
 };

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)