I write simple test programm (host mode, full speed) to work with USB stick. In the begining this program do: - get descriptor form USB stick (with numbers of IN and OUT end-points in the device), - set this number of IN, OUT endpoints in the USB controller, - set Address 1, - set Configuration 1, - set Interface 0. It's works correct. Than program send CBW with any SCSI command (inquory/read10/write10) and recive ACK. But when it send IN (or OUT for write10 command) request, than device answer STALL. Where is my mistake? For only one USB stick (A-Data 2 Gb) my programm work correct - I can read or write sector from/to USB stick (I don't undestand why!).
Alex.
Jonathan, thanks for your answer.
All testing USB sticks have descriptor: class = 0x08 (MSC), subclass = 0x06 (SCSI), protocol = 0x50 (bulk only).
What delay (in ms) is needed after INQUIRY (or after CSW)? Where I can read about this extra delay? I used 10-20 ms delay, but result is the same - SCSI commands don't work.
I believe the spec says 10ms, but to find the actual delay needed can be a trial and error thing. I use 100ms and that has worked fine for all devices so far.
http://www.lvr.com/ covers various USB devices and a lot of their non-compliance quirks.