FX3 - Control Transfers - Custom command

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hallo!

   

Based on
http://www.cypress.com/?app=forum&id=167&rID=53345
and
http://www.cypress.com/?id=4&rID=61438
I am trying to implement a custom "Vendor command" which sets/toggles a GPIO pin of the FX3.

   

I started with the "slfifo, 2bit addressing" example from Cypress and modified the CyFxSlFifoApplnUSBSetupCB function by adding
else if (bType == CY_U3P_USB_VENDOR_RQT) {
        if (bRequest == 0x13) {
            isHandled = CyTrue;
            // todo here comes the gpio code
            CyU3PUsbAckSetup();
        }
}

   

But when I do a control transfer on the PC:
libusb_control_transfer(handle, 0x40, 0x13, 0, 0, NULL, 0, 1000)
the PC only yields an "I/O error". Libusb in the debug mode (DebugView) says that the "device is not working as expected"
Based on the time the control action needs (always ~5 seconds), some timeout gets hit.

   

Do you known what is/might be going wrong here?

   

Regards,

   

Markus

0 Likes
1 Reply
Anonymous
Not applicable

Ok, solved it with help of USBPcap and Wireshark.
There was a control request with a data part that did not get processed with the CyU3PUsbGetEP0Data function.

0 Likes