Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: LPC2148 USB samples (not working)

2006-02-13 by householder_lpc

Hi,

I noticed your post on the Yahoo LPC2000 forum about porting Keil
LPC2148 Examples to the GNU toolchain on an Embedded Artists board.
I've tried to follow the hints you posted with the USB_HID example,
but without luck. The enumeration process fails....

USBView reports :

bcdUSB:             0x0000
bDeviceClass:         0x00
bDeviceSubClass:      0x00
bDeviceProtocol:      0x00
bMaxPacketSize0:      0x00 (0)
idVendor:           0x0000
idProduct:          0x0000
bcdDevice:          0x0000
iManufacturer:        0x00
iProduct:             0x00
iSerialNumber:        0x00
bNumConfigurations:   0x00

ConnectionStatus: DeviceFailedEnumeration
Current Config Value: 0x00
Device Bus Speed:      Low
Device Address:       0x00
Open Pipes:              0

Can you give any extra infromation/hints on how I should proceed?
Would it please be possible for you to share your code ?

Thanks in advance for your help! 

--- In lpc2000@yahoogroups.com, Bertrik Sikken <bertrik@...> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Carsten Grøn wrote:
> > Hello,
> > 
> > I have been playing around with some of the USB samples from Keil
> > etc, and been trying to get just one of them to run on a LPC2148
> > board from www.embeddedartists.com (very nice boards btw) but I'm
> > having some problems. Well, actually it's the sam eproblem no matter
> > which sample I try, I always get a message from Win2K "Unknown
> > device....."....
> > Now, before I bury myself deeeeeep into the "unknown of USB", is
> > there something I need to be aware of when running some of these
> > samples ? The LPC2148 board has P0.31 switching the USB+ to 3V3, and
> > P0.23 senses Vcc from the USB host, which should be the same as the
> > Keil MC2140 board......
> > The same thing happens with the Keil usbmem, usbhid and the philips
> > vcom sample (the keil audio reports an internal linker error when I
> > try to build that....)
> > 
> > So, something I must be doing wrong, any leads ???
> > 
> > (PS: I have ported uIP to a LPC2138 Ethernet board from
> > embeddedartists running with the Keil RTX RTOS, working very nicely)
> 
> I too have an LP2148 from embedded artists and I just got the usbmem
> example working with gcc to the point that windows recognises my
> board as a mass-storage device with the proper USB device descriptors
> (product/vendor id, strings descriptor, etc.)
> 
> USB mass storage itself is not quite working yet, although windows
> properly recognises the size of the disk (at 16 kB).
> 
> I think the relevant steps to make it work were:
> * the P0.31 pin should be configured for the USB 'CONNECT' function
> * aggressive packing of all USB related structs by means of
>   '__attribute ((packed))' and of every 'sub-struct' within those
>   structs.
> * aligning several structures to 32-bit boundaries, using
>   '__attribute ((aligned(4)))'
> * replacing __irq by '__attribute__ ((interrupt))'
> * (I just removed some of the '__at' directives)
> * Modifying the for-loop in USB_ReadEP into
>   for (n = 0; n < (cnt + 3) / 4; n++) {
> 	dw = RX_DATA;
> 	*pData++ = dw >> 0;
> 	*pData++ = dw >> 8;
> 	*pData++ = dw >> 16;
> 	*pData++ = dw >> 24;
>   }
> * Modifying the for-loop in USB_WriteEP into
>   for (n = 0; n < (cnt + 3) / 4; n++) {
>     TX_DATA = (pData[3] << 24) | (pData[2] << 16) | (pData[1] << 8) |
> pData[0];
>     pData += 4;
>   }
> (there used to be some __packed directive in these parts in the
> Keil code)
> 
> I may have changed some other stuff, but I think the list above
> are the most significant changes.
> 
> Some very useful tools in making it work so far, were:
> * OpenOCD in combination with a wiggler clone and arm-elf-insight.
>   OpenOCD is similar to what OCDRemote does, except this is open-source
>   http://developer.berlios.de/projects/openocd
> * "usb in a nutshell", a really good document describing the essence
>   of USB, at
>   http://www.beyondlogic.org/usbnutshell/usb-in-a-nutshell.pdf
> * usbsnoop, a windows USB packet sniffer, see:
>   http://benoit.papillault.free.fr/usbsnoop
> 
> Kind regards,
> Bertrik
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (MingW32)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> 
> iD8DBQFDx/4iETD6mlrWxPURAnaXAJ46r76Yzi/5+YR16aypISUGCIC3fQCgl1HE
> Dss2pAvZbJVHFWL2KAZQevc=
> =XTft
> -----END PGP SIGNATURE-----
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.