xvsf player fixes by Dick Hollenbeck <dick@softplc.com>
[openocd.git] / src / jtag / bitbang.c
index e4191d1487e9a35a65767fee33ca5e084a7b8615..05416005e74351678a2038a9e49d4f5a04ccac31 100644 (file)
 #include <unistd.h>
 
 
+/**
+ * Function bitbang_stableclocks
+ * issues a number of clock cycles while staying in a stable state.
+ * Because the TMS value required to stay in the RESET state is a 1, whereas
+ * the TMS value required to stay in any of the other stable states is a 0,
+ * this function checks the current stable state to decide on the value of TMS
+ * to use.
+ */
 static void bitbang_stableclocks(int num_cycles);
 
 
@@ -162,13 +170,14 @@ void bitbang_runtest(int num_cycles)
 
 static void bitbang_stableclocks(int num_cycles)
 {
+       int tms = (cur_state == TAP_RESET ? 1 : 0);
        int i;
 
        /* send num_cycles clocks onto the cable */
        for (i = 0; i < num_cycles; i++)
        {
-               bitbang_interface->write(1, 0, 0);
-               bitbang_interface->write(0, 0, 0);
+               bitbang_interface->write(1, tms, 0);
+               bitbang_interface->write(0, tms, 0);
        }
 }
 
@@ -293,6 +302,9 @@ int bitbang_execute_queue(void)
                                break;
 
                        case JTAG_STABLECLOCKS:
+                               /* this is only allowed while in a stable state.  A check for a stable
+                                * state was done in jtag_add_clocks()
+                                */
                                bitbang_stableclocks(cmd->cmd.stableclocks->num_cycles);
                                break;
 

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)