1 Reply Latest reply on Feb 1, 2019 5:18 AM by agba_3844561

    libusb_control_transfer() never returns

    agba_3844561

      I am communicating with a [Cypress FX3 kit](https://www.cypress.com/products/ez-usb-fx3-superspeed-usb-30-peripheral-controller) device.

      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)

               bTarget: 0

               bRequest: B2

               wValue: 0

               wIndex: 1

               wLength: 16 (decimal)

       

      like this:

      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):

      1. cyusb_control_write never returns but it is able to send data and FX3 device gets all correctly.
      2. cyusb_control_write gets `Process finished with exit code 139 (interrupted by signal 11: SIGSEGV).`
      3. 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.