EmbeddedRelated.com
Forums

USB - Composite Device

Started by Adriano February 19, 2013
I have developed an USB device using a LPC2148 and the
LPCUSBUSB stack. It works
well when I set it as an HID device (a keyboard), but
when I set it as a composite device, storage (SD Flash Card) and HID, it
only works on Windows XP. I tried in two different Windows 7 computers and
both showed me that the device cannot start (code 10 error).

I used two softwares to trace the USB (USBTrace and USBlyzer) and couldn't
find what is going on. The device is shown as installed on Win 7, except
that it states it can't be started in the hardware device properties. So
anyone knows what is different between XP and Win7 when handling a USB
composite device?

I know it's a Windows related question, but maybe one here had already gone
through this issue.

Here you have the descriptor used in the source code:

http://pastebin.com/E9HqeTDK

And here the output from USBlyzer:

http://pastebin.com/vzbP8HFS
Thanks,
Adriano Prado


An Engineer's Guide to the LPC2100 Series

I've never use composite device as
HID+(SD Flash Card) but CCID+CD-ROM.
When I run my composite device on both WinXP and Win7, then use
ellisys catch
data flows, there some different commands they handle.

I can't remember particular cmd clearly, so list all mass storage
cmd I deal with(Include Linux and MAC platform)

void MID_USB_UmassScsiProcess()
{
    switch(CBW.CB[0])
    {
        case INQUIRY:
            MID_USB_UmassScsiInquiry();
            break;
        case TEST_UNIT_READY:
            MID_USB_UmassScsiTestUnitReady();
            break;
        case READ_CAPACITY:
            MID_USB_UmassScsiReadCapacity();
            break;
        case READ_FORMAT_CAPACITIES:
            MID_USB_UmassScsiReadFormatCapacities();
            break;
        case WRITE10:
            MID_USB_UmassScsiWrite10();
            break;
        case READ10:
            MID_USB_UmassScsiRead10();
            break;
        case MODE_SENSE:
            MID_USB_UmassScsiModeSense();
            break;
        case MODE_SENSE10:
            MID_USB_UmassScsiModeSense10();
            break;
        case MODE_SENSE46:
            MID_USB_UmassScsiModeSense46();
            break;
        case REQUEST_SENSE:
            MID_USB_UmassScsiRequestSense();
            break;
        case START_STOP_UNIT:
             MID_USB_UmassScsiStartStopUnit();   
            break;
        case VERIFY:
            MID_USB_UmassScsiVerify();
            break;
        case MODE_SELECT:
            MID_USB_UmassScsiModeSelect();
            break;
        case MODE_SELECT10:
            MID_USB_UmassScsiModeSelect10();
            break;
        case MEDIUM_REMOVAL:
            MID_USB_UmassScsiMediumRemoval();
            break;
        case READ_TOC:
            MID_USB_UmassScsiReadToc();
            break;
        case SET_CD_SPEED:
            MID_USB_UmassScsiSetCDSpeed();
            break;
        case READ_CD:
            MID_USB_UmassScsiReadCD();
            break;
        case READ_DISC_INFO:
            MID_USB_UmassScsiReadDiscInfo();
            break;
        case TEST_UNIT_READY52:
            MID_USB_UmassScsiTestUnitReady52();
            break;
        case MODE_SENSE4A:
            MID_USB_UmassScsiGetEventStatusNotification();
            break;
        case SYNCHRONIZE_CACHE:
            MID_USB_UmassScsiSynchronizeCache();
            break;
        default:
            MID_USB_UmassScsiSendCSW(0x01);
            break;
    }
}

________________________________
发件人: Adriano
收件人: l...
发送日期: 2013年2月20日, 星期三, 9:57 上午
主题: [lpc2000] USB - Composite Device


 
I have developed an USB device using a LPC2148 and the
LPCUSBhttp://sourceforge.net/projects/lpcusb/>USB stack. It works
well when I set it as an HID device (a keyboard), but
when I set it as a composite device, storage (SD Flash Card) and HID, it
only works on Windows XP. I tried in two different Windows 7 computers and
both showed me that the device cannot start (code 10 error).

I used two softwares to trace the USB (USBTrace and USBlyzer) and couldn't
find what is going on. The device is shown as installed on Win 7, except
that it states it can't be started in the hardware device properties. So
anyone knows what is different between XP and Win7 when handling a USB
composite device?

I know it's a Windows related question, but maybe one here had already gone
through this issue.

Here you have the descriptor used in the source code:

http://pastebin.com/E9HqeTDK

And here the output from USBlyzer:

http://pastebin.com/vzbP8HFS

Thanks,
Adriano Prado






On Wed, Feb 20, 2013 at 9:57 AM, Adriano wrote:
> I have developed an USB device using a LPC2148 and the
> LPCUSBUSB stack. It works
> well when I set it as an HID device (a keyboard), but
> when I set it as a composite device, storage (SD Flash Card) and HID, it
> only works on Windows XP. I tried in two different Windows 7 computers and
> both showed me that the device cannot start (code 10 error).
>
> I used two softwares to trace the USB (USBTrace and USBlyzer) and couldn't
> find what is going on. The device is shown as installed on Win 7, except
> that it states it can't be started in the hardware device properties. So
> anyone knows what is different between XP and Win7 when handling a USB
> composite device?
>
> I know it's a Windows related question, but maybe one here had already gone
> through this issue.
>
> Here you have the descriptor used in the source code:
>
> http://pastebin.com/E9HqeTDK
>
> And here the output from USBlyzer:
>
> http://pastebin.com/vzbP8HFS
>

It seems to me your descriptors are okay. So it may be timing
related. Windows XP is rather relax with regard to device firmware
bugs but Windows 7 is more stringent.

Have you tried to just have the MSD interface only? Do you
have some long block function in your MSD handling? That
might cause some problems.
--
Xiaofan