I did everything that was explained on AN84868. However, I would like to do my own source code so that I can integrate it with my code. (On linux)
I call cyusb_control_write() with:
bReqType: 40 (hex)
bType: 40 (hex)
wLength: 16 (decimal)
C++ code fragment
rStatus = cyusb_control_write(
MimacUSB3Connection::device_handle, /* a handle for the device to communicate with */ WRITE_REQUEST_TYPE, /* bmRequestType: the request type field for the setup packet */ VND_CMD_SLAVESER_CFGLOAD, /* bRequest: the request field for the setup packet */ wValue, /* wValue: the value field for the setup packet */ wIndex, /* wIndex: the index field for the setup packet */ (unsigned char *) &fpga_firmware_size, /* *data: a suitably-sized data buffer */ wLength, /* wLength: the length field for the setup packet. The data buffer should be at least this size. */ timeout); /* timeout (in millseconds) that this function should wait before giving up due to no response being received. For an unlimited timeout, use value 0. */
Everytime I run there are 3 options (in order of frequency):
cyusb_control_write never returns but it is able to send data and FX3 device gets all correctly.
cyusb_control_write gets `Process finished with exit code 139 (interrupted by signal 11: SIGSEGV).`
Everything works correctly.
Why could this be happening? As I get unexpected output I am clueless on how to debug this. My main concern is cyusb_control_write not returning after sending the data.