Re: USB Mass Storage problems/5.0

From: KM (konstmor_at_nospam_yahoo.com)
Date: 10/12/04


Date: Tue, 12 Oct 2004 11:41:28 -0700

Peter,

....

> Command Block Status: Command Failed
> ScsiGetSenseData - SenseKey:0x6 ASC:0x28 ASCQ:0x0
> SENSE_UNIT_ATTENTION : ASC_MEDIA_CHANGED
> ScsiTestUnitReady ERROR:20
> ScsiUnitAttention:20
> Command Block Status: Command Failed
> ScsiGetSenseData - SenseKey:0x2 ASC:0x3a ASCQ:0x0
> SENSE_NOT_READY : ASC_MEDIUM_NOT_PRESENT
> ScsiTestUnitReady ERROR:20
> ScsiUnitAttention:20
> Command Block Status: Command Failed
> ScsiGetSenseData - SenseKey:0x2 ASC:0x3a ASCQ:0x0
> SENSE_NOT_READY : ASC_MEDIUM_NOT_PRESENT
> ScsiTestUnitReady ERROR:20
> ScsiUnitAttention:20
> Command Block Status: Command Failed
> ScsiGetSenseData - SenseKey:0x2 ASC:0x3a ASCQ:0x0
> SENSE_NOT_READY : ASC_MEDIUM_NOT_PRESENT
> ScsiTestUnitReady ERROR:20
> ScsiUnitAttention:20

I did see similar debug errors.
Although, with the Lexar Falsh key I could get through the MODE_SENSE problems (SENSE_UNIT_ATTENTION : ASC_MEDIA_CHANGED) by
additional stop and start unit call (ScsiStartStopUnit). Basically (according to MS note), some devices require a (re)start. It
helped me to pass the ScsiTestUnitReady and ScsiUnitAttention.

However, then the following error I see:
    IssueBulkTransfer ERROR(5, BytesTransferred:0, Win32Err:31, UsbError:0x5)

> And these errors keep coming...
> As you can see my device has the same interface as yours (Mass Storage
> Device Class with interfaceSubClass = 6 (SCSI))
>
> My guess is that there is NO support in windows CE 4.2 and 5.0 for this SCSI interface.

Yes, there is (on 4.2 and 5.0). Check out PUBLIC\COMMON\OAK\DRIVERS\USB\CLASS\STORAGE\DISK\SCSI2\disk.c and scsi2.c. Look there for
USBMSC_SUBCLASS_SCSI.

> With the interfaceSubClass = 2 (= ATAPI) interface I have no problems, the
> USBDisk6.dll starts the FAT file system driver and my drive appears in
> explorer, but with the SCSI interface I get only errors.

Well... this is why USB CD works fine for me here (ATAPI interface).

> Does any one have a solution for this?
> Where can we find the SCSI driver for CE 4.2 and 5.0 to support our USB drives?

It is there. And according to the documentation it should be a production quality code. But it is not! :-(

I'd appreciate any MS comment on this issue. Knowing that MS works on it now or it would be only availabl in future release would
also help.

-- 
 Thanks,
        KM
> >
> > I am having various issues with a number of USB Flash Key disks under CE
> 4.2/5.0. Please let me narrow the list down to 5.0 only
> > here.
> >
> > Some device are not recognized by CE USB Mass Storage Driver. I know it is
> not a firmware problem as the devices work properly on my
> > XP machine (or, at least, XP has some fixes for such devices which CE does
> not).
> > The Usbmsc driver however works properly with some other USB keys.
> >
> > I am talking about devices that comply with the USB specification
> (bInterfaceSubClass=6, bInterfaceProtocol=80).
> > I turned on debug messages in the USB stack (and particularly in the USB
> Storage class driver). All of the "bad" devices show
> > different failures but here is one of them: "Command Block Status: Command
> Failed. Error: 0" (as you can imagine, this happens right
> > after "5.3.3 CSW") (if interested, feel free to request a full debug
> output log from me, I can email it over).
> >
> > Just to avoid question on what interface descriptor for those devices,
> here is the debug output:
> >     USB_INTERFACE_DESCRIPTOR[0]:
> >     -------------------------
> >     bLength: 0x9
> >     bDescriptorType: 0x4
> >     bInterfaceNumber: 0x0
> >     bAlternateSetting: 0x0
> >     bNumEndpoints: 0x2
> >     bInterfaceClass: 0x8
> >     bInterfaceSubClass: 0x6
> >     bInterfaceProtocol: 0x50
> >     iInterface: 0x0
> >
> > Basically what happens when I plug-in one of the "bad" devices it that
> after some recognition process and failures on Command Block
> > transfer for a few tries, it ends up by disk access error ("DSK_Open:
> ERROR_ACCESS_DENIED") and then removing the device
> > ("USBMSC<RemoveDeviceContext").
> >
> > The fact that all the USB keys I am playing with here (e.g., Lexar Media
> 256M Jumpdrive) are not "new" devices and have been on the
> > market for a while, tells me that it is most likely a CE problem rather
> than particular hardware failures. And again, the keys work
> > perfectly with XP.
> >
> > I am really wondering why CE 5.0 USB MSC driver is under
> Production-Quality group of drivers then?
> >
> > So, my question would be:
> >  1) Has anyone seen similar USB Mass Storage Driver problems recognizing
> some brands?
> >
> >  2) Any ideas on where me better start exploring the USB stack code? What
> to look for?
> >      Maybe it is the protocol implementation issues or etc.? Do I need to
> trace all the commands being sent to the failed device?
> >
> >  3) Sometimes I see that Lexar, for instance, fails to pass the TEST UNIT
> READY USB command. Has anybody seen this sort of problems?
> > I could fix it by restarting (stop and start again) the device within the
> ScsiUnitAttention function and then send the command
> > second time. Then the firmware returned a successful code.
> >
> >  4) On the Lexar 256MB key hot plug-in, right after the TEST UNIT READY is
> done, the GetTransferStatus starts failing with UsbError
> > code 0x5. (Did I mention this is all undocumented? :-( ). The error code
> from a system header file matches to
> > USB_DEVICE_NOT_RESPONDING_ERROR, which does not say much to me. Does
> anybody know what this error means?
> >
> > 5) If I use Lexar 128Mb, I am getting USB_STALL_ERROR (0x4) error code
> there but it finally gets through with some cleaning USB
> > command procedure (my guess was it was one of the fixes in 5.0).
> >
> > Just to mention.. The USB debug output is huge and hard to follow. I am
> not good with USB drivers' implementation and don't know yet
> > where the best to start. I'd appreciate it very much for pointing out a
> good debug or workaround directions.
> >
> > Thank you in advance for any valuable input.
> >
> > -- 
> >  Regards,
> >         KM
> >
> >
>
>


Relevant Pages

  • Re: USB Mass Storage problems/5.0
    ... Look at the ScsiUnitAttention. ... It defines a number of attempts to send Unit Attention command before ... Most of these "undocumented" usb errors listed there. ... >>> Command Block Status: Command Failed ...
    (microsoft.public.windowsce.platbuilder)
  • Re: USB Mass Storage problems/5.0
    ... I think many people who are going to struggle with the MS USB code will ... First things I fixed was the Unit Test Ready command that I mentioned in earlier post. ... Removing the CBW error handling we may unstabilize the USBMSC driver so that some ...
    (microsoft.public.windowsce.platbuilder)
  • Re: USB drives and cache mode page
    ... There are no advanced SCSI-2 features in USB flash drives. ... the cache to the host it is IMHO likely that it don't touch the cache ... they are disabled) the MODE SENSE command should be implemented if they ...
    (comp.periphs.scsi)
  • Re: USBIP protocol
    ... you mean when we rev the protocol to version 2 ... Set Configuration and Set Interface are requests on the command pipe ... according to the usb 2.0 spec (these would be a control message ... request on the command pipe. ...
    (Linux-Kernel)