My MSC class implementation tries to transfer 4K at a time from the mass storage media and then send it to the host*. This works fine normally, with Windows requesting up to 64K at a time for contiguous clusters. The class will alternately read 4K from the media and send it to the host repeatedly until all required data is sent. As I say, with Windows this is fine, but the USBCV2.0 compliance checker invariably hits its NAK timeout limit on the IN endpoint on the second block and that is even for the 8K test parameter. The only way to pass the tests is with a 512 byte buffer so the read-media-write-endpoint loop is executed many more times. This behavior is observed with both a RAM disk and a NAND Flash implementation so speed of access does not appear to be the issue.
Has anybody seen this sort of problem and, if so, is there a way around it. Can the dCSWDataResidue value be used in some way to tell the host to hold off while I get the next batch of data? Is stalling the endpoint the way to go, followed by a CSW with a non-zero dCSWDataResidue value? If so, is the bCSWStatus set to 0x00 or 0x01?
* By the way, the USB controller I am using can transmit mutliple packets at a time using DMA.
Thanks for any assistance anyone can offer.
Martin