- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Set the TimeOut to 10 seconds. Then use XferData() to read 2KB data from an IN endpoint, then the wait begain since there is no data available.
Then 2KB data arrived, but XferData() won't return until time out and fail. Then the next XferData() call will get the 2KB data successfully.
Why does this happen? Shouldn't XferData() return true immediately during wait when the data arrive? Does this behavior depend on some properties of CyBulkEndPoint, or depend on the firmware?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
You can call CyU3PUsbLPMDisable() here to prevent FX3 enter low power state. That would make things work.
Regards,
Eddie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The firmware used is AN87216's AutoSlave.img.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
May I know how did you set the time out?
Regards,
Eddie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CyBulkEndPoint inEndpoint;
inEndpoint.TimeOut = 10*1000;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Now I have tested with Control center too, same result.
Test method:
(1) Load master and slave firmware to board
(2) Open two control center
(3) Click transfer data in button for slave in one control center to receive 1KB data, it will be blocked since there is no data and will time out soon
(4) Quickly (before slave time out) get to another control center and press transfer data out button for master twice to send 2*1KB data to master. (Why twice - this is another problem, if you only send 1*1KB, the slave will always timeout. But this have nothing to do with this question, just send 2*1KB - or 1*2KB)
(5)Switch back to the first control center and wait for the time out(unexpected as described). Then press data in button for slave twice, both 1KB will be received succesfully.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This doesn't make sense, did you mean what ever the time out is, and whether enough data have arrived during wait, XferData will always fail with zero data if there is no data when XferData is called?
For exampe, did you mean:
(1) set time out to 10 sec
(2) use XferData to receive 1KB data at 0 sec and blocked
(3) transfer 1KB data to that device at 1 sec
(4) XferData time out /faile with zero data at 10sec?
The expected behavior is XferData success at 1 sec with 1KB data returned, since 1KB data arrive at 1 sec.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Sorry my former reply was incorrect. Actually I did the test you mention with two USB control center window. The firmware I uesed is USBBulkLoopAutoEnum. If I press Transfer Data-in on the left first and then the Transfer Data-out on the right fast enough, the left window can get the data without error. So I guess you problem is still the timing parameter issue, try to extend the TimeOut value and see if there are any improvement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Where are the bulk loop firmwares? Can't find them in C:\Program Files (x86)\Cypress
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Found it , C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\basic_examples
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Confirmed, but what is the difference between Master/Slave and bulkloop firmware to make this difference? They both use hardware manager buffer queue, should not have difference between IO read behavior.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Or how to debug and find out what cause this behavior with Master/Slave FW and stacked CYUSB3KIT-003? Do you have stacked CYUSB3KIT-003 in hand to test?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you verify the behavior with stacked FX3 board? The reason that bulkloop works may be the DMA is U2U, not P2U.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got several CYUSB3KIT-003 but I could not find the connector. But I think with USBBulkLoop example we have confirmed that the TimeOut parameter in host side is vaild. XferData() actually can return when data arrives during wait no matter what the FX3 application is. The data loop in AN87216 may took more time delay which caused the XferData timeout.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The environment is different. With USBBulkLoop the DMA is U2U, not P2U, maybe it is this difference that cause the problem. You can order the connector. As a setup in some AN, its normal to stock some such parts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can also use some fly wire to connecte the boards. No need to connect data bus, just enable pull up/pull down resistors on IO pad.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
You can call CyU3PUsbLPMDisable() here to prevent FX3 enter low power state. That would make things work.
Regards,
Eddie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Now I tested the configuration with two Streamer.exe the speed finally get fast, but the process stall after several seconds. The method is start one Streamer to receive on slave, then start another Streamer to send on master.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This works! Did you find out that by guess and try or a debug session of the framework?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My colleagure debug this issue with USB analyszer and found FX3 did not send EDRY which make the Xfer fail. But bulkloop example sends ERDY.