- added support for FreeBSD ppi (parallel port access similar to /dev/parport on...
[openocd.git] / src / jtag / jtag.c
index b8846f17b8cb0c046694816ee75ed0504c187eda..a60aacd0a4c37464054107ee48b4bdc9a92d1739 100644 (file)
@@ -124,12 +124,12 @@ jtag_event_callback_t *jtag_event_callbacks;
        extern jtag_interface_t parport_interface;
 #endif
 
-#if BUILD_FTDI2232 == 1
-       extern jtag_interface_t ftdi2232_interface;
+#if BUILD_FT2232_FTD2XX == 1
+       extern jtag_interface_t ft2232_interface;
 #endif
 
-#if BUILD_FTD2XX == 1
-       extern jtag_interface_t ftd2xx_interface;
+#if BUILD_FT2232_LIBFTDI == 1
+       extern jtag_interface_t ft2232_interface;
 #endif
 
 #if BUILD_AMTJTAGACCEL == 1
@@ -144,11 +144,11 @@ jtag_interface_t *jtag_interfaces[] = {
 #if BUILD_PARPORT == 1
        &parport_interface,
 #endif
-#if BUILD_FTDI2232 == 1
-       &ftdi2232_interface,
+#if BUILD_FT2232_FTD2XX == 1
+       &ft2232_interface,
 #endif
-#if BUILD_FTD2XX == 1
-       &ftd2xx_interface,
+#if BUILD_FT2232_LIBFTDI == 1
+       &ft2232_interface,
 #endif
 #if BUILD_AMTJTAGACCEL == 1
        &amt_jtagaccel_interface,
@@ -843,7 +843,7 @@ int jtag_add_reset(int req_trst, int req_srst)
        {
                jtag_call_event_callbacks(JTAG_SRST_RELEASED);
                if (jtag_nsrst_delay)
-                       jtag_add_sleep(jtag_nsrst_delay);
+                       jtag_add_sleep(jtag_nsrst_delay * 1000);
        }
        
        if (trst_with_tms)
@@ -881,7 +881,7 @@ int jtag_add_reset(int req_trst, int req_srst)
                         * but we might want to add a delay to give the TAP time to settle
                         */
                        if (jtag_ntrst_delay)
-                               jtag_add_sleep(jtag_ntrst_delay);
+                               jtag_add_sleep(jtag_ntrst_delay * 1000);
                }
        }
 
@@ -1119,7 +1119,9 @@ int jtag_validate_chain()
        {
                if (buf_get_u32(ir_test, chain_pos, 2) != 0x1)
                {
-                       ERROR("Error validating JTAG scan chain, IR mismatch");
+                       char *cbuf = buf_to_char(ir_test, total_ir_length);
+                       ERROR("Error validating JTAG scan chain, IR mismatch, scan returned %s", cbuf);
+                       free(cbuf);
                        exit(-1);
                }
                chain_pos += device->ir_length;
@@ -1128,7 +1130,9 @@ int jtag_validate_chain()
        
        if (buf_get_u32(ir_test, chain_pos, 2) != 0x3)
        {
-               ERROR("Error validating JTAG scan chain, IR mismatch");
+               char *cbuf = buf_to_char(ir_test, total_ir_length);
+               ERROR("Error validating JTAG scan chain, IR mismatch, scan returned %s", cbuf);
+               free(cbuf);
                exit(-1);
        }
        
@@ -1147,9 +1151,9 @@ int jtag_register_commands(struct command_context_s *cmd_ctx)
                COMMAND_CONFIG, NULL);
        register_command(cmd_ctx, NULL, "reset_config", handle_reset_config_command,
                COMMAND_CONFIG, NULL);
-       register_command(cmd_ctx, NULL, "nsrst_delay", handle_jtag_nsrst_delay_command,
+       register_command(cmd_ctx, NULL, "jtag_nsrst_delay", handle_jtag_nsrst_delay_command,
                COMMAND_CONFIG, NULL);
-       register_command(cmd_ctx, NULL, "ntrst_delay", handle_jtag_ntrst_delay_command,
+       register_command(cmd_ctx, NULL, "jtag_ntrst_delay", handle_jtag_ntrst_delay_command,
                COMMAND_CONFIG, NULL);
                
        register_command(cmd_ctx, NULL, "scan_chain", handle_scan_chain_command,
@@ -1217,6 +1221,12 @@ int jtag_init(struct command_context_s *cmd_ctx)
         * didn't match one of the compiled-in interfaces
         */
        ERROR("No valid jtag interface found (%s)", jtag_interface);
+       ERROR("compiled-in jtag interfaces:");
+       for (i = 0; jtag_interfaces[i]; i++)
+       {
+               ERROR("%i: %s", i, jtag_interfaces[i]->name);
+       }
+       
        jtag = NULL;
        return ERROR_JTAG_INVALID_INTERFACE;
 }
@@ -1375,7 +1385,7 @@ int handle_jtag_nsrst_delay_command(struct command_context_s *cmd_ctx, char *cmd
 {
        if (argc < 1)
        {
-               ERROR("nsrst_delay <ms> command takes one required argument");
+               ERROR("jtag_nsrst_delay <ms> command takes one required argument");
                exit(-1);
        }
        else
@@ -1390,7 +1400,7 @@ int handle_jtag_ntrst_delay_command(struct command_context_s *cmd_ctx, char *cmd
 {
        if (argc < 1)
        {
-               ERROR("ntrst_delay <ms> command takes one required argument");
+               ERROR("jtag_ntrst_delay <ms> command takes one required argument");
                exit(-1);
        }
        else

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)