I have re-created (and re-verified) the patch. Regards, Alex.
diff --git a/src/jtag/drivers/jlink.c b/src/jtag/drivers/jlink.c
index 35c1a5c..c3efb05 100644
--- a/src/jtag/drivers/jlink.c
+++ b/src/jtag/drivers/jlink.c
@@ -738,6 +738,23 @@ static int jlink_set_config(struct jlink_config *cfg)
return ERROR_OK;
}
+/* List of unsupported version string markers */
+static const char * const unsupported_versions[] = {
+"May 3 2012", /* "J-Link ARM V8 compiled May 3 2012 18:36:22" */
+0 };
+
+static void jlink_check_supported(const char *str)
+{
+ const char **p = unsupported_versions;
+ while (*p) {
+ if (NULL != strstr(str, *p)) {
+ LOG_ERROR("Unsupported J-Link firmware version.");
+ return;
+ }
+ p++;
+ }
+}
+
static int jlink_get_version_info(void)
{
int result;
@@ -767,6 +784,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);
--
2012/5/23 Alexander Osipenko <[email protected]>:
> Patch attached.
> For now, I have added only the latest version,
> it's easy to add more.
>
> Regards,
> Alex.
>
> diff --git a/src/jtag/drivers/jlink.c b/src/jtag/drivers/jlink.c
> index 35c1a5c..bacea7a 100644
> --- a/src/jtag/drivers/jlink.c
> +++ b/src/jtag/drivers/jlink.c
> @@ -738,6 +738,21 @@ static int jlink_set_config(struct jlink_config *cfg)
> return ERROR_OK;
> }
>
> +/* List of unsupported version string markers */
> +static const char * const unsupported_versions[] = {
> +"May 3 2012", /* "J-Link ARM V8 compiled May 3 2012 18:36:22" */
> +0 };
> +
> +static void jlink_check_supported(const char *str)
> +{
> + const char **p = unsupported_versions;
> + while (*p)
> + if (NULL != strstr(str, *p)) {
> + LOG_ERROR("Unsupported J-Link firmware version.");
> + return;
> + }
> +}
> +
> static int jlink_get_version_info(void)
> {
> int result;
> @@ -767,6 +782,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);
> --
>
>
> 2012/5/22 Antonio Borneo <[email protected]>:
>> It would be nice to have OpenOCD reading the date of J-Link firmware
>> and print error message for firmware version unsupported. Eventually
>> with a suggestion to re-flash J-Link with the latest working firmware.
>>
>> In the past we already had a set of versions not working (I should dig
>> in mail archive to find it), from a certain date till when Segger
>> fixed the issue with a new firmware.
>> I think that till now, OpenOCD does not support those versions.
>> The check on firmware date should include this range too.
>>
>> Any volunteer willing to write such patch?
>>
>> Best Regards,
>> Antonio
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> OpenOCD-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/openocd-devel
0001-Unsupported-firmware-version-check.patch
Description: Binary data
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
