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
  • Now I can create a composite device with HID and MSC w/o using the on-chip driver.
    My mistake is that I put an IAD in the USB Configuration Descriptor, and yet it is not allowed as you've answered me in the other thread. You're so great.And your replies really help me.
    One more thing,the device has been enumerated but theirs something I want to clarify, why is it that the Mass storage device(USB icon in the left side of my monitor) it seems it is been disable.I mean it can't be ejected, and when I open the enumerated the Removable Disk it can't be opened and Insert disk window will pop up showing that Removable Disk should be inserted.
    Is this about the memory size?

    Thanks.

Reply
  • Now I can create a composite device with HID and MSC w/o using the on-chip driver.
    My mistake is that I put an IAD in the USB Configuration Descriptor, and yet it is not allowed as you've answered me in the other thread. You're so great.And your replies really help me.
    One more thing,the device has been enumerated but theirs something I want to clarify, why is it that the Mass storage device(USB icon in the left side of my monitor) it seems it is been disable.I mean it can't be ejected, and when I open the enumerated the Removable Disk it can't be opened and Insert disk window will pop up showing that Removable Disk should be inserted.
    Is this about the memory size?

    Thanks.

Children
  • Ummm..
    On my side, it works as we expect;
    It mounts a disk with single file, README.TXT

    On your side, sound like the MSC works, but disk contents are corrupted.
    Did you run it on RAM, instead of FLASH?

    I posted modified source here,

    www.8052.com/.../LPC134x_USBMem_HID.zip

    Compare it with yours.

    Tsuneo

  • 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