Hi Jan,
Thank you for the reply.
The links provided you helped me a lot.
It is a valuable information, that there are so many Pendrives in the market which is not compliance with USB specifications.
But the Pendrive under consideration in our case is one of the Transcend 4GB Pendrives.
Usually the sequence in which SCSI commands are given by our USB Host(On the Go) Driver to a Pendrive is as shown below.
Inquiry,Read Format Capacity,Read Capacity,Mode Sense(1c),Mode Sense(3f),Read Master Boot,Read Partition Boot and then SCSI Write commands to write data into Pendrive. Definitely Stall,Unsupported commands, No Data, Less Data etc. are considered.
Now let me give the sequence of SCSI commands for the above mentioned Sandisk 4GB Pendrive to work.
Inquiry,Read Format Capacity,Read Capacity,Mode Sense(1c),Mode Sense(3f),Read Master Boot(1st time,Failed,Showing SYNC RESET PIPE &CLEAR),Request Sense,Mode Sense(1c),Mode Sense(3f), Read Capacity,Read Capacity, Read Master Boot(2nd time,Failed,Showing SYNC RESET PIPE &CLEAR),Request Sense,Read Master Boot(3rd time,Failed,Showing SYNC RESET PIPE &CLEAR),Request Sense,Read Capacity,Read Capacity,Read Master Boot(4th time,Failed,Showing SYNC RESET PIPE &CLEAR),Request Sense,Get Descriptor from Device(Control Transfer),Test Unit Ready(Failed),Request Sense,Read Capacity,Read Capacity,Read Capacity,Read Capacity,Read Master Boot(5th time,Passed),Read Partiotion Boot,
then SCSI Write commands to write data into Pendrive
Here for the first 4 times, Read Master Boot Data stage would be stalled by the device( less data case), But CSW stage would be passed. But with 1 as the CSW status byte. In USBTRACE this would be appeared as SYNC RESET PIPE &CLEAR.
Why it is happening so?
Initially it is failed, after following the above sequence it is getting passed. Is it because of the Test Unit Ready command, it is passed? What might be happening in Pendrive in this case?
Basically what should be the sequence of SCSI commands from Host to Device?
When a Test Unit Ready command need to be given?
Why a Read Capcity command is repeated so many times?(observed in Windows OS driver)
If One device is failed with One command, how many times to be retried, before declaring "Non supported Pemdrive".
Expect your valuable reply,
regards,
Sajeevan.K