This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB Composite Device for LPC134x

Hi,

I've created a firmware application for USB composite device in LPC1343, I found an example for this Micro controller which is the composite device is composed of CDC and MSC in AN11018 from nxp for my reference. What I did I've created a composite driver using USB HIDROM and USB MSCROM running in Keil, but unfortunately when i run the firmware it didn't enumerate the device. I used both of the on-chip driver of the LPC1343 for this firmware application. It is possible to combine this two?
I combine the code sample of on-chip driver for HID and MSC into one file but different function on each and call in the main function, but unfortunately it didn't worked. When I checked on the Device Manager, I found a "USB Mass Storage" with a warning sign (exclamation point). I think the device doesn't enumerated
properly.Could someone help me about this?

Thanks.

Parents Reply Children
  • Tsuneo,

    Thanks a lot. The only difference is the physicalMemorySize for the MSC.
    Now its working.

  • Tsuneo

    Thanks for the code. I tried porting it to the LPCxpresso environment and it almost works. The only change was to use the CodeRed header files (with GCC conventions for packed data).

    The MSD part seems to work 100%.

    For the HID part I updated the definition of HID_DESC_OFFSET:

    /*
    #define HID_DESC_OFFSET              0x0012
    */
    #define HID_DESC_OFFSET             ( 1 * USB_CONFIGUARTION_DESC_SIZE +  \ 
                                          1 * USB_INTERFACE_DESC_SIZE     +  \ 
                                          2 * USB_ENDPOINT_DESC_SIZE      +  \ 
                                          1 * USB_INTERFACE_DESC_SIZE        )
    
    

    There is still something wrong. Running the usbhid example code we see these transactions on USBlyzer:

    Select Configuration - Success
    Class Interface/Set Idle - Success
    Get Descriptor From Interface - Success
    

    Running the composite device code we see (after a bunch of successful MSD transactions):

    Select Configuration - Success
    Class Interface/Set Idle - Fail (Invalid Parameter) Status = 8000_0300h
    Get Descriptor From Interface - Fail (Invalid Parameter)
    

    I am debugging right now, but any hints as to where the problem might lie would be appreciated - the Keil code isn't the easiest to read.

    Tim