ARM7: LPC2148 & USB communication

I want to develop mass storage device using LPC2148.I am just referring code from Keil for USBMem. My problem is -
I get Get_descriptor command from PC to which I respond with device descriptor. On receiving 8th byte it generates Reset.
Then I get Set_address command. On response to it, I execute Set Address command in protocol engine.
Then again I get Get_descriptor command (It should actually have index field of 18 but I receive with 64).
Again after 8th byte it generates Reset and again gives Set_address command instead of Get_descriptor command for Configuration descriptor.
What can be the problem?

Parents
  • I am just referring code from Keil for USBMem.

    This one?

    LPC2148 USB Mass Storage Device Example
    http://www.keil.com/download/docs/307.asp

    > I get Get_descriptor command from PC to which I respond with device descriptor. On receiving 8th byte it generates Reset.
    Then I get Set_address command. On response to it, I execute Set Address command in protocol engine.
    Then again I get Get_descriptor command (It should actually have index field of 18 but I receive with 64).

    Up to this point, it's a usual enumeration course of Windows, even though it sounds like somewhat weird. Just because Microsoft doesn't know USB well.

    > Again after 8th byte it generates Reset and again gives Set_address command instead of Get_descriptor command for Configuration descriptor.

    At this point, enumeration goes out of the rail.

    Did you change USB_MAX_PACKET0 to 8?
    If so, recover it to 64.

    usbcfg.h
    
    #define USB_MAX_PACKET0     64
    

    Tsuneo

Reply
  • I am just referring code from Keil for USBMem.

    This one?

    LPC2148 USB Mass Storage Device Example
    http://www.keil.com/download/docs/307.asp

    > I get Get_descriptor command from PC to which I respond with device descriptor. On receiving 8th byte it generates Reset.
    Then I get Set_address command. On response to it, I execute Set Address command in protocol engine.
    Then again I get Get_descriptor command (It should actually have index field of 18 but I receive with 64).

    Up to this point, it's a usual enumeration course of Windows, even though it sounds like somewhat weird. Just because Microsoft doesn't know USB well.

    > Again after 8th byte it generates Reset and again gives Set_address command instead of Get_descriptor command for Configuration descriptor.

    At this point, enumeration goes out of the rail.

    Did you change USB_MAX_PACKET0 to 8?
    If so, recover it to 64.

    usbcfg.h
    
    #define USB_MAX_PACKET0     64
    

    Tsuneo

Children
More questions in this forum