阅读:2599回复:8
FX2 USB ISO传输数据中的疑问?????
我在固件中ISO传输模式下(IN端点2,双缓冲区,1K,AUTOIN = 0),采用CPU介入传输的方式,在TD_Poll()函数中传送包,为了记录每一包,在1K包缓冲区头两个字节中写入包号(其它字节都置0),以便windows应用程序知道当前包,windows应用程序为双缓冲,每帧8缓冲,包个数为16,结果发现一次可以收到16K数据,但是只有头2K是正确的包数据,其它都不是希望的值!!!如果固件中采用4缓冲,16K数据中头4K是正确数据,其它都不正确!!!!!!
测试了很多中情况都是如此,希望各位高手指点!!!!! |
|
沙发#
发布于:2004-06-08 10:33
有个叫Rick的老外也遇到类似问题。
原文引用: I have purchased the Cypress FX2 development board am am writing my own windows application (Win2k) to transfer ISO data to and from the FX2. I have written code for the FX2 that takes data that is in EP2OUT and transfers it to the EP6IN buffer so that the host can read it back (Both EPs have a MaxPacketSize of 64). This transfer is done in the SOF interrupt service routine. So, i've set up my application so that the user can specifiy the number of packets, number of buffers, etc (as in the control panel application) to characterise the transfer. Therefore, the application takes the parameter values and writes data to the FX2 through pipe 0 (EP2OUT). The user then prompts the application to read the data back through pipe 1 (EP6IN). However, when i attempt to read back the data that was written to the FX2, i only get back a portion of the data. Having performed many transfers with different parameter values, it seems that i can never read back more than 4 packets of data. The following results were recorded. # Pkts PktSize #Buffers Frms/Buffer #PktsReadBack Success 1 16 1 1 1 yes 2 16 1 1 1 no 2 16 2 1 2 yes 4 16 2 2 4 yes 4 16 2 1 3 no 4 16 1 2 4 yes 6 16 3 2 4 no 6 16 2 3 4 no etc....... An interesting observation was that when there is only 1 buffer, the application seems to read back every second packet that was sent. I have a feeling that there is something wrong with the way the buffer count is being used in the transfers. I cannot find out where the problem lies. I am careful to reset the pipe before every ISO transfer. I have analysed the code for the control panel application but i cannot find where i could be going wrong. I have also tried using both the control panel and my own application (ie. writing to the FX2 with one app, and then reading from the FX2 with the other app, and vice versa) to try and pinpoint the location of the problem. It seems that my application is not writing the whole burst of data. However, i know through these tests that my read isn't working either. Could anyone provide me with some help on this problem??? Thankyou. |
|
板凳#
发布于:2004-06-08 15:06
怎么没人回答我
|
|
地板#
发布于:2004-06-08 15:47
你用的固件与驱动是自己写的,还是cy提供的?
我试了我的(cy提供的固件与驱动),读出来是没问题的. |
|
地下室#
发布于:2004-06-08 17:56
固件是自己写的,windows驱动用的是cy的驱动!
收到数据包并不是都不对,有一部分不对! 楼上的用的是哪一个例程啊?能否告诉我? |
|
5楼#
发布于:2004-06-09 14:14
大家顶一下吧
|
|
6楼#
发布于:2007-07-05 10:44
我也遇到了和楼主一样的问题,该怎么办亚
|
|
7楼#
发布于:2008-03-26 14:00
可以交流:QQ:317889998
|
|
8楼#
发布于:2010-07-09 16:04
我下载CY现成的固件,却没办法实现这个ISO传输,很郁闷啊。楼上QQ能不能指点一下。
|
|