jtag: enable connect under reset 71/971/4
authorSpencer Oliver <spen@spen-soft.co.uk>
Tue, 13 Nov 2012 12:02:26 +0000 (12:02 +0000)
committerFreddie Chopin <freddie.chopin@gmail.com>
Mon, 10 Dec 2012 16:16:35 +0000 (16:16 +0000)
Currently if the target supports srst_nogate we wait until target assert_reset
until we get a chance to assert the srst.
However sometimes we will not get this far if the target has already failed
the jtag_examine_chain.

This has been tested on targets that support this behaviour (STM32 and STR9).

Change-Id: Ibcf7584b137b472f31ba6ddd5cd99d848c5508d1
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/971
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
src/jtag/core.c

index 5d5803a3604a4c2350d72f5dfc19c82195801cf1..9f1e4cf03903fbe223473f7a0aec4b8cd1847386 100644 (file)
@@ -1549,7 +1549,17 @@ int jtag_init_reset(struct command_context *cmd_ctx)
                if ((jtag_reset_config & RESET_SRST_PULLS_TRST) == 0)
                        jtag_add_reset(0, 1);
        }
-       jtag_add_reset(0, 0);
+
+       /* some targets enable us to connect with srst asserted */
+       if (jtag_reset_config & RESET_CNCT_UNDER_SRST) {
+               if (jtag_reset_config & RESET_SRST_NO_GATING)
+                       jtag_add_reset(0, 1);
+               else {
+                       LOG_WARNING("\'srst_nogate\' reset_config option is required");
+                       jtag_add_reset(0, 0);
+               }
+       } else
+               jtag_add_reset(0, 0);
        retval = jtag_execute_queue();
        if (retval != ERROR_OK)
                return retval;
@@ -1572,6 +1582,14 @@ int jtag_init(struct command_context *cmd_ctx)
 
        /* guard against oddball hardware: force resets to be inactive */
        jtag_add_reset(0, 0);
+
+       /* some targets enable us to connect with srst asserted */
+       if (jtag_reset_config & RESET_CNCT_UNDER_SRST) {
+               if (jtag_reset_config & RESET_SRST_NO_GATING)
+                       jtag_add_reset(0, 1);
+               else
+                       LOG_WARNING("\'srst_nogate\' reset_config option is required");
+       }
        retval = jtag_execute_queue();
        if (retval != ERROR_OK)
                return retval;

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)