From: Uwe Hermann Date: Thu, 9 Apr 2015 18:02:17 +0000 (+0200) Subject: dslogic: Fix FPGA bitstream upload. X-Git-Tag: libsigrok-0.4.0~535 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d93c14707e1700861339d86dd8fdd5fbefa170e6;p=libsigrok.git dslogic: Fix FPGA bitstream upload. --- diff --git a/src/hardware/fx2lafw/dslogic.c b/src/hardware/fx2lafw/dslogic.c index 6a8af130..14b5decf 100644 --- a/src/hardware/fx2lafw/dslogic.c +++ b/src/hardware/fx2lafw/dslogic.c @@ -43,6 +43,7 @@ int dslogic_fpga_firmware_upload(const struct sr_dev_inst *sdi, int chunksize, result, ret; unsigned char *buf; int sum, transferred; + uint8_t cmd[3]; sr_dbg("Uploading FPGA firmware at %s.", filename); @@ -53,9 +54,10 @@ int dslogic_fpga_firmware_upload(const struct sr_dev_inst *sdi, } /* Tell the device firmware is coming. */ + memset(cmd, 0, sizeof(cmd)); if ((ret = libusb_control_transfer(usb->devhdl, LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_OUT, DS_CMD_FPGA_FW, 0x0000, 0x0000, - NULL, 0, USB_TIMEOUT)) < 0) { + (unsigned char *)&cmd, sizeof(cmd), USB_TIMEOUT)) < 0) { sr_err("Failed to upload FPGA firmware: %s.", libusb_error_name(ret)); return SR_ERR; }