diff options
author | Alexander Osipenko <sipych@gmail.com> | 2012-05-25 13:27:48 +0400 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2012-06-26 10:07:55 +0000 |
commit | b79f9ad1726778bdad2f89b9297a4acc6adb5b77 (patch) | |
tree | 0305ff6e2ba413ed71fbd9f4d51d293da845b669 /src/jtag | |
parent | e571746735029c5da62a505f5e60f42dedf8b8db (diff) | |
download | riscv-openocd-b79f9ad1726778bdad2f89b9297a4acc6adb5b77.zip riscv-openocd-b79f9ad1726778bdad2f89b9297a4acc6adb5b77.tar.gz riscv-openocd-b79f9ad1726778bdad2f89b9297a4acc6adb5b77.tar.bz2 |
J-Link Unsupported firmware version check
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>
Diffstat (limited to 'src/jtag')
-rw-r--r-- | src/jtag/drivers/jlink.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/jtag/drivers/jlink.c b/src/jtag/drivers/jlink.c index 35c1a5c..08df63b 100644 --- a/src/jtag/drivers/jlink.c +++ b/src/jtag/drivers/jlink.c @@ -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); |