J-Link Unsupported firmware version check
authorAlexander Osipenko <sipych@gmail.com>
Fri, 25 May 2012 09:27:48 +0000 (13:27 +0400)
committerSpencer Oliver <spen@spen-soft.co.uk>
Tue, 26 Jun 2012 10:07:55 +0000 (10:07 +0000)
OpenOCD does not work with the latest firmware versions
of Segger J-Link.

Latest working version: V4.42c
Unsupported versions: 4.44 to 4.46f, 4.20 to 4.30

Older versions of firmware can be found here:
  http://www.segger.com/j-link-older-versions.html

The firmware versions does not correspond directly with
"Software and documentation pack for Windows", it may be
distinguished by the "compile" date in the information string.

Print an warning message if unsupported firmware version detected.

Change-Id: Id7d1f965b8ce2fdbcd0026a85ddd093e2fa48720
Signed-off-by: Alexander Osipenko <sipych@gmail.com>
Reviewed-on: http://openocd.zylin.com/666
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/jtag/drivers/jlink.c

index 35c1a5c4b6dee2086c45a98c18626c97451a5466..08df63bca7d7db3cf9dfebd31af096bd007c793b 100644 (file)
@@ -738,6 +738,42 @@ static int jlink_set_config(struct jlink_config *cfg)
        return ERROR_OK;
 }
 
+/*
+ * List of unsupported version string markers.
+ *
+ * The firmware versions does not correspond directly with
+ * "Software and documentation pack for Windows", it may be
+ * distinguished by the "compile" date in the information string.
+ *
+ * For example, version string is:
+ *   "J-Link ARM V8 compiled May  3 2012 18:36:22"
+ * Marker sould be:
+ *   "May  3 2012"
+ *
+ * The list must be terminated by NULL string.
+ */
+static const char * const unsupported_versions[] = {
+       "Jan 31 2011",
+       "JAN 31 2011",
+       "Mar 19 2012",  /* V4.44 */
+       "May  3 2012",  /* V4.46 "J-Link ARM V8 compiled May  3 2012 18:36:22" */
+       NULL                    /* End of list */
+};
+
+static void jlink_check_supported(const char *str)
+{
+       const char * const *p = unsupported_versions;
+       while (*p) {
+               if (NULL != strstr(str, *p)) {
+                       LOG_WARNING(
+                       "Unsupported J-Link firmware version.\n"
+                       "       Please check http://www.segger.com/j-link-older-versions.html for updates");
+                       return;
+               }
+               p++;
+       }
+}
+
 static int jlink_get_version_info(void)
 {
        int result;
@@ -767,6 +803,7 @@ static int jlink_get_version_info(void)
 
        usb_in_buffer[result] = 0;
        LOG_INFO("%s", (char *)usb_in_buffer);
+       jlink_check_supported((char *)usb_in_buffer);
 
        /* query hardware capabilities */
        jlink_simple_command(EMU_CMD_GET_CAPS);

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)