bus_blaster: do not fail on missing get_latency_timer 27/1627/2
authorSøren Jørvang <jorvang@users.sourceforge.net>
Tue, 17 Sep 2013 13:21:38 +0000 (14:21 +0100)
committerSpencer Oliver <spen@spen-soft.co.uk>
Wed, 25 Sep 2013 13:55:27 +0000 (13:55 +0000)
Patch submitted from Trac #64
Seems certain clones do not correctly emulate the ftdi chip, if
the call to read the latency timer fails then do not treat this as a
failure.

Change-Id: Iae671b926d101adf1010639d11ca46c58d0af524
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1627
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
src/jtag/drivers/usb_blaster/ublast_access_ftd2xx.c
src/jtag/drivers/usb_blaster/ublast_access_ftdi.c

index e350650d3bab2d156a1a602ff5ed416d2501f4dc..14351fbd439e1c38f7176a89e7c75985b4c6c0df 100644 (file)
@@ -136,12 +136,11 @@ static int ublast_ftd2xx_init(struct ublast_lowlevel *low)
        }
 
        status = FT_GetLatencyTimer(*ftdih, &latency_timer);
        }
 
        status = FT_GetLatencyTimer(*ftdih, &latency_timer);
-       if (status != FT_OK) {
+       if (status != FT_OK)
                LOG_ERROR("unable to get latency timer: %s",
                                ftd2xx_status_string(status));
                LOG_ERROR("unable to get latency timer: %s",
                                ftd2xx_status_string(status));
-               return ERROR_JTAG_INIT_FAILED;
-       }
-       LOG_DEBUG("current latency timer: %i", latency_timer);
+       else
+               LOG_DEBUG("current latency timer: %i", latency_timer);
 
        status = FT_SetBitMode(*ftdih, 0x00, 0);
        if (status != FT_OK) {
 
        status = FT_SetBitMode(*ftdih, 0x00, 0);
        if (status != FT_OK) {
index 23893e14dfe6553ec60a6ced3a479bc2fb0770e9..2527fe9a6315f41dd856ac80622b6a9867b635f6 100644 (file)
@@ -99,11 +99,10 @@ static int ublast_ftdi_init(struct ublast_lowlevel *low)
                return ERROR_JTAG_INIT_FAILED;
        }
 
                return ERROR_JTAG_INIT_FAILED;
        }
 
-       if (ftdi_get_latency_timer(ftdic, &latency_timer) < 0) {
+       if (ftdi_get_latency_timer(ftdic, &latency_timer) < 0)
                LOG_ERROR("unable to get latency timer");
                LOG_ERROR("unable to get latency timer");
-               return ERROR_JTAG_INIT_FAILED;
-       }
-       LOG_DEBUG("current latency timer: %u", latency_timer);
+       else
+               LOG_DEBUG("current latency timer: %u", latency_timer);
 
        ftdi_disable_bitbang(ftdic);
        return ERROR_OK;
 
        ftdi_disable_bitbang(ftdic);
        return ERROR_OK;

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)