Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > USB3 Control Endpoint OUT transfer errors

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



USB3 Control Endpoint OUT transfer errors
Moderator:
RSKV

Post Reply
Follow this topic



USB3 Control Endpoint OUT transfer errors

tenbord posted on 18 Apr 2012 1:28 AM PST

1 Forum Post

since response transfer is additionally needed from the existing firmware example
when Control OUT (CY_FX_RQT_I2C_EEPROM_WRITE) transfer using write() function of "CCyControlEndpoint"
among CyAPI library interface classes at PC application software occurs,
following code as shown below have been added.

               glEp0Buffer[0] = status;
            status = CyU3PUsbSendEP0Data(1, glEp0Buffer);

However, timeout error (65) occured in CyU3PUsbSendEP0Data.
I would like to know if there is some way to get this problem solved.

  

/* Callback to handle the USB setup requests. */
CyBool_t
CyFxUSBSetupCB (
        uint32_t setupdat0,
        uint32_t setupdat1
    )
{
    uint8_t attr, rqt, i2cAddr = 0;
    uint16_t value, index, length;
    CyBool_t isHandled = CyTrue;
    CyU3PReturnStatus_t status = CY_U3P_SUCCESS;

    /* Parse the control request parameters. */
    attr    =  (uint8_t) (setupdat0 & 0x000000FF);
    rqt     =  (uint8_t)((setupdat0 & 0x0000FF00) >> 8);
    value   = (uint16_t) (setupdat0 >> 16);
    index   = (uint16_t) (setupdat1 & 0x0000FFFF);
    length  = (uint16_t) (setupdat1 >> 16);

   /* Fast enumeration is used. Only vendor is handled here. */
    if ((attr & CY_U3P_USB_TYPE_MASK) != CY_U3P_USB_VENDOR_RQT)
    {
        return CyFalse;
    }

    switch (rqt)
    {

case CY_FX_RQT_I2C_EEPROM_WRITE:
            i2cAddr = 0xA0 | ((value & 0x0007) << 1);
            status  = CyU3PUsbGetEP0Data(length, glEp0Buffer, NULL);
            if (status == CY_U3P_SUCCESS)
            {
                CyFxFlashProgI2cTransfer (index, i2cAddr, length,
                        glEp0Buffer, CyFalse);
            }

            glEp0Buffer[0] = status;
            status = CyU3PUsbSendEP0Data(1, glEp0Buffer);
            break;

    default:
            /* This is unknown request. */
            isHandled = CyFalse;
            break;
    }

    /* If there was any error, return not handled so that the library will
     * stall the request. Alternatively EP0 can be stalled here and return
     * CyTrue. */
    if (status != CY_U3P_SUCCESS)
    {
        isHandled = CyFalse;
    }

    return isHandled;
}
 




Re: USB3 Control Endpoint OUT transfer errors

aasi posted on 19 Apr 2012 03:10 AM PST
Cypress Employee
1073 Forum Posts

Write() of CCyControlEndpoint is for OUT transfer and CyU3PUsbSendEP0Data() is used to respond to IN packet. Looks you're confusing the direction of transfers.

Regards,

Anand






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.