I'm currently developing my own USB stack to use an ATXMEGA64A4U as an external SD card reader, so a Mass Storage device.
Before everyone will reply me to look at LUFA or ASF, I don't want, I want to understand myself the mechanism.
So at the moment I have the enumeration done, and the Host is starting communicating to the Device using the SBC2/3 standard commands.
The Device is able to reply, but I have two issues I'm not able to fix yet, even if I have access to a USB analyzer.
The first issue, seen in the USB Stick.png file, is the Device is not replying to the second READ 10 command, it is Nacking all IN requests.
The second issue is about time, the first READ 10 OUT packet took about 1.7sec, because of NACK as well.
My code is attached to this thread, I wrote it taking example on what I was able to found around.
Can anyone help me?