You are here

How to receive residual data in FX3 cyusb3014? | Cypress Semiconductor

How to receive residual data in FX3 cyusb3014?

Summary: 2 Replies, Latest post by hxf_fly_1858941 on 08 Sep 2016 12:38 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
hxf_fly_1858941's picture
User
2 posts

Hi, dear friends,

   I met a problem in FX3 to receive residual data in FX3:in order to achieve high speed, I set a large transfer data length for XferData() function, such as 1024*1024, but at the end of the data transfer, there will be a little amount of data smaller than 1024*1024.So when XferData() time out,I can't receive the data tail .

In addition,I want to know how many bytes in the endpoint buffer before XferData ? so I can set Xferdata second parameter with this.

here is part of my code:

 BYTE * pContext=NULL;
 long   nBulkLen = 1024*1024;
 pContext=pBulkEpIn->BeginDataXfer(pBulkBuf, nBulkLen, &oRdOvLap);
if(!pBulkEpIn->WaitForXfer(&oRdOvLap, 1000))
{
    pBulkEpIn->Abort();
    WaitForSingleObject(oRdOvLap.hEvent,INFINITE);
    nRetCode=0x01;
    TRACE("time out!\n");
    //break;
}

bool recvRet = pBulkEpIn->FinishDataXfer(pBulkBuf, nBulkLen, &oRdOvLap, pContext);

//bool recvRet = pBulkEpIn->XferData(pBulkBuf,nBulkLen);
TRACE("the actual receive length = %d ,recvRet = %d\n",nBulkLen,recvRet);

   Does anybody know how to solve this problem?Thank you very much and best wishes.

mady's picture
Cypress Employee
1053 posts

Hi,

Can you please confirm if the residual amount of data was actually committed by Fx3? (available for transfer to the USB Consumer).

Please check if you are able to receive this residue using Cypress Control center or streamer. If so, please check your FX3 firmware.

regards,

- Madhu Sudhan

hxf_fly_1858941's picture
User
2 posts

Thanks for answer me!

I have Know that it is necessary to add a ZLP after data package.

Log in to post new comments.