xvsf player fixes by Dick Hollenbeck <dick@softplc.com>
[openocd.git] / src / jtag / ft2232.c
index c6125025a991f0baa3b8d684e842b9eb213d7e6f..e63b293923b25d70b6adc9d88631e542301feb47 100644 (file)
@@ -1415,22 +1415,9 @@ int ft2232_execute_queue()
                                break;
 
                        case JTAG_STABLECLOCKS:
-                               /* "if (tap_move_map[cur_state] != -1)" is of no help when cur_state==TAP_IDLE */
-                               switch(cur_state)
-                               {
-                               case TAP_DRSHIFT:
-                               case TAP_IDLE:
-                               case TAP_RESET:
-                               case TAP_DRPAUSE:
-                               case TAP_IRSHIFT:
-                               case TAP_IRPAUSE:
-                                        break;                 /* above stable states are OK */
-                               default:
-                                        LOG_ERROR( "jtag_add_clocks() was called with TAP in non-stable state \"%s\"",
-                                                        jtag_state_name(cur_state) );
-                                        retval = ERROR_JTAG_QUEUE_FAILED;
-                               }
-
+                               /* this is only allowed while in a stable state.  A check for a stable
+                                * state was done in jtag_add_clocks()
+                                */
                                if (ft2232_stableclocks(cmd->cmd.stableclocks->num_cycles, cmd) != ERROR_OK)
                                        retval = ERROR_JTAG_QUEUE_FAILED;
 #ifdef _DEBUG_JTAG_IO_
@@ -2336,11 +2323,15 @@ static int ft2232_stableclocks(int num_cycles, jtag_command_t *cmd)
 {
        int retval = 0;
 
+       /* 7 bits of either ones or zeros. */
+       u8 tms = (cur_state == TAP_RESET ? 0x7F : 0x00);
+
        while (num_cycles > 0)
        {
                /* the command 0x4b, "Clock Data to TMS/CS Pin (no Read)" handles
                 * at most 7 bits per invocation.  Here we invoke it potentially
                 * several times.
+                * see: http://www.ftdichip.com/Documents/AppNotes/AN2232C-01_MPSSE_Cmnd.pdf
                 */
                int bitcount_per_command = (num_cycles > 7) ? 7 : num_cycles;
 
@@ -2358,8 +2349,8 @@ static int ft2232_stableclocks(int num_cycles, jtag_command_t *cmd)
                /* scan 7 bit */
                BUFFER_ADD = bitcount_per_command - 1;
 
-               /* TMS data bits are all zeros to stay in the current stable state */
-               BUFFER_ADD = 0x0;
+               /* TMS data bits are either all zeros or ones to stay in the current stable state */
+               BUFFER_ADD = tms;
 
                require_send = 1;
 

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)