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.
Rather, doesn't the READ10 request more than one block (512 bytes)?
Examine TRANSFER LENGTH field of READ10.
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.)
Overrun on the FIFO doesn't occur, thanking to NAK flow control.
While the FIFO is full, the device USB engine NAKs to more OUT transactions.
And then, the host repeats the last OUT transaction, until the device ACKs to it.