saleae and other FX2: show firmware name when loading fails

The "firmware load failed" message would be even more helpful if users
could learn which firmware file failed to load. Add those filenames to
various FX2-based drivers.

This addresses bug #1262.
This commit is contained in:
Gerhard Sittig 2018-08-18 15:31:09 +02:00 committed by Uwe Hermann
parent ee425a466a
commit 1372bdcdb5
6 changed files with 28 additions and 19 deletions

View File

@ -268,14 +268,16 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
libusb_get_device_address(devlist[i]), NULL);
} else {
if (ezusb_upload_firmware(drvc->sr_ctx, devlist[i],
USB_CONFIGURATION, prof->firmware) == SR_OK)
USB_CONFIGURATION, prof->firmware) == SR_OK) {
/* Store when this device's FW was updated. */
devc->fw_updated = g_get_monotonic_time();
else
} else {
sr_err("Firmware upload failed for "
"device %d.%d (logical).",
"device %d.%d (logical), name %s.",
libusb_get_bus_number(devlist[i]),
libusb_get_device_address(devlist[i]));
libusb_get_device_address(devlist[i]),
prof->firmware);
}
sdi->inst_type = SR_INST_USB;
sdi->conn = sr_usb_dev_inst_new(libusb_get_bus_number(devlist[i]),
0xff, NULL);

View File

@ -338,14 +338,16 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
libusb_get_device_address(devlist[i]), NULL);
} else {
if (ezusb_upload_firmware(drvc->sr_ctx, devlist[i],
USB_CONFIGURATION, prof->firmware) == SR_OK)
USB_CONFIGURATION, prof->firmware) == SR_OK) {
/* Store when this device's FW was updated. */
devc->fw_updated = g_get_monotonic_time();
else
} else {
sr_err("Firmware upload failed for "
"device %d.%d (logical).",
"device %d.%d (logical), name %s.",
libusb_get_bus_number(devlist[i]),
libusb_get_device_address(devlist[i]));
libusb_get_device_address(devlist[i]),
prof->firmware);
}
sdi->inst_type = SR_INST_USB;
sdi->conn = sr_usb_dev_inst_new(libusb_get_bus_number(devlist[i]),
0xff, NULL);

View File

@ -228,11 +228,12 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
devices = g_slist_append(devices, sdi);
devc = sdi->priv;
if (ezusb_upload_firmware(drvc->sr_ctx, devlist[i],
USB_CONFIGURATION, prof->firmware) == SR_OK)
USB_CONFIGURATION, prof->firmware) == SR_OK) {
/* Remember when the firmware on this device was updated. */
devc->fw_updated = g_get_monotonic_time();
else
sr_err("Firmware upload failed.");
} else {
sr_err("Firmware upload failed, name %s.", prof->firmware);
}
/* Dummy USB address of 0xff will get overwritten later. */
sdi->conn = sr_usb_dev_inst_new(
libusb_get_bus_number(devlist[i]), 0xff, NULL);

View File

@ -330,11 +330,12 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
devices = g_slist_append(devices, sdi);
devc = sdi->priv;
if (ezusb_upload_firmware(drvc->sr_ctx, devlist[i],
USB_CONFIGURATION, prof->firmware) == SR_OK)
USB_CONFIGURATION, prof->firmware) == SR_OK) {
/* Remember when the firmware on this device was updated */
devc->fw_updated = g_get_monotonic_time();
else
sr_err("Firmware upload failed");
} else {
sr_err("Firmware upload failed, name %s", prof->firmware);
}
/* Dummy USB address of 0xff will get overwritten later. */
sdi->conn = sr_usb_dev_inst_new(
libusb_get_bus_number(devlist[i]), 0xff, NULL);

View File

@ -200,10 +200,12 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
continue;
if (!scan_firmware(devlist[i])) {
const char *fwname;
sr_info("Found a Logic Pro 16 device (no firmware loaded).");
fwname = "saleae-logicpro16-fx3.fw";
if (upload_firmware(drvc->sr_ctx, devlist[i],
"saleae-logicpro16-fx3.fw") != SR_OK) {
sr_err("Firmware upload failed.");
fwname) != SR_OK) {
sr_err("Firmware upload failed, name %s.", fwname);
continue;
};
fw_loaded = TRUE;

View File

@ -219,11 +219,12 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
libusb_get_device_address(devlist[i]), NULL);
} else {
if (ezusb_upload_firmware(drvc->sr_ctx, devlist[i],
USB_CONFIGURATION, FX2_FIRMWARE) == SR_OK)
USB_CONFIGURATION, FX2_FIRMWARE) == SR_OK) {
/* Store when this device's FW was updated. */
devc->fw_updated = g_get_monotonic_time();
else
sr_err("Firmware upload failed.");
} else {
sr_err("Firmware upload failed, name %s.", FX2_FIRMWARE);
}
sdi->inst_type = SR_INST_USB;
sdi->conn = sr_usb_dev_inst_new(
libusb_get_bus_number(devlist[i]), 0xff, NULL);