Hi All,
I am trying to write Firmware for mass storage device.
I have this issue with the under run error.
When Windows host sends READ(10) command, while copying data (512 bytes) to the TX buffer FIFO, an under run occurs.
This probably means, Windows host sends IN packet for receiving CSW before the 512 bytes are copied to the TX buffer FIFO.
I have tried to make the copy faster so that the TX buffer fifo is loaded before the CSW is requested, but i am not able to go beyond certain point.
The under run is happening intermittently.
When under run happens, host does not receive CSW and no further commands are sent by host.
When under run occurs, I do not think the bulk IN endpoint should be stalled.
One way that I could think of is to divide the 512 bytes packet in smaller chunks and provide the correct data residue value in CSW.
Is this a right way to respond?
What should be the way to handle this kind of situation in case of WRITE(10) command? (Here buffer over run would occur if data is not read from FIFO fast enough.)
Can someone please provide suggest, how to go about handling these situations?
Regards,
nvd