Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > gpif callback and zlp

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



gpif callback and zlp
Moderator:
RSKV

Post Reply
Follow this topic



gpif callback and zlp

gd_net posted on 24 Sep 2012 8:39 AM PST
Senior Member
17 Forum Posts

Hello,

is it possible to send a zero length packet from a gpif callback?

i use a slavefifosync like design.

I configured the the P to U Channel to CY_U3P_DMA_TYPE_MANUAL

I do not use a U to P Channel.

I tried it like this:

 

void CyFxGpifCB (CyU3PGpifEventType event,uint8_t currentState)
{
   if (event == CYU3P_GPIF_EVT_SM_INTERRUPT)
   {
       if (currentState == ZLP)
          {
            CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
            status = CyU3PDmaChannelCommitBuffer (&glChHandleSlFifoPtoU, 0, 0);    // send ZLP
            if (status != CY_U3P_SUCCESS)
              CyU3PDebugPrint (4, "CyU3PDmaChannelCommitBuffer GPIF CB failed, Error code = %x\n", status);
         }
    }
}

void CyFxSlFifoPtoUDmaCallback (CyU3PDmaChannel *chHandle,CyU3PDmaCbType_t  type,
                                CyU3PDmaCBInput_t *input)
{
    CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
    if (type == CY_U3P_DMA_CB_PROD_EVENT)
    {
        if(input->buffer_p.count!=0)
        {
         status = CyU3PDmaChannelCommitBuffer (chHandle, input->buffer_p.count, 0);
        if (status != CY_U3P_SUCCESS)
           CyU3PDebugPrint (4, "CyU3PDmaChannelCommitBuffer DMA CB failed, Error code = %d\n", status);
       
        }
    }
}

but i get the error code "CyU3PDmaChannelCommitBuffer GPIF CB failed, Error code = 0x47"

Is there some other way ?

best regards

g.




Re: gpif callback and zlp

RSKV posted on 24 Sep 2012 07:43 PM PST
Cypress Employee
655 Forum Posts

You can try the following:

I think in your current implementation, you are doing the INTR_CPU action when you are in the ZLP state.

Instead of that you can directly do COMMIT action when you are in ZLP state. COMMIT action itself commits a ZLP to host PC.

Thanks,

sai krishna.






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.