- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
I am trying to transfer large files(larger than 1MB) with fx2lp. Actually, I just followed AN61345(Implementing an FX2LP™-FPGA Interface). It worked well on EZ-USB console, 512 bytes send to ep2, 512 bytes back to ep6.
Then I made a app with VC6. Divide the large file to 512 bytes packets, and transfer them via Xferdata() fuction. The code is
for(i=0;i<pcount;i++)
{
for(j=0;j<buf_size;j++){usb_i
if(USBDevice->BulkOutEndPt)
i_finish=USBDevice->BulkOutEndPt->XferData(usb_i,buf_size);
if(USBDevice->BulkInEndPt)
o_finish=USBDevice->BulkInEndPt->XferData(usb_o,buf_size);
for(j=0;j<buf_size;j++) {sig_o[buf_size*i+j]=usb_o
}
When the files are small(<20kB), it works well. Every step ep6 become empty when the data is read by host.
If the file is larger, as the process continus, ep6 will not be empty sometime and all the followed data is error code(always CD).
I am using cy3684_kit_15, hope someone help me to find the reason or give some advice.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Please take the trace of USB traffic(using USB traffic analyzers like CATC) and post it here so that we can have a look at it.
Thanks
Prajith
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for your reply. Besides, what's a CATC? An instrument or some kind of software?
I just made a simple test:
LONG buf_size=512;
for(int i=0;i<100;i++)
{
o_finish=USBDevice->BulkOutEndPt->XferData(usb_i,buf_size);
i_finish=USBDevice->BulkInEndPt->XferData(usb_o,buf_size);
cout<<o_finish<<'\t'<<i_finish<<endl;
}
The output:
1 1
1 1
...
1 1
1 0
1 0
...
1 0
press any key...
The BulkIn XferData immediately failed. I think there are two possible reasons: (a)EP6 stalled; (b)EP6 do not have enough data. Is it right?
Then after the test above, I just do
i_finish=USBDevice->BulkInEndPt->XferData(usb_o,buf_size);
again. And it returns 1, the empty flag also changed.
So, can I say EP6 works well, the XferData() goes wrong?
I am try to start two new threads for BulkIn, one failed, start another, hope it worked.
Thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry guys,
I just changed a powersupply, and the problem solved...
Should find this at the very start...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Coool
Thanks for sharing the fix.