Content originally posted in LPCWare by tjoAG on Tue Sep 18 01:25:03 MST 2012
Hi All
I'm trying to get USB Host to work on my LPC1788. I'm using port 2 as host.
I use the USBHost lite sample from NXP
What I have changed:
The port pin setup to use the USB port 2
The base address to match the lpc1788 mem map. (0x2000 0000)
Added Port 2 stuff to the IRQ handler (LPC_USB->RhPortStatus2 control etc.)
What do work:
When I insert an USB stick, the IRQ get called and handle interrupt for port 2
The HOST_RhscIntr get set and the Host_EnumDev function continue.
The RhPortStatus2 get reset
The Host_ProcessTD gets called.
The OHCI port status registers seems to contain the right flags when the USB device is inserted. Speed, device type etc.
What does not work:
When I try to get the the host descriptor( Host_ProcessTD) I do get an error.
The transfer do happen and I get a new interrupt where the HOST_TDControlStatus ( TDHead->Control )is set. Bit 28-31 has the value of 5. But in the USBLite code it should be 0. The Host_ProcessTD returns ERR_TD_FAIL because of this.
Do any one know where I can see the description for the HostController Transfer Descriptor structure used in the code? What does the flags mean?
Also, when processing a transfer descriptor, how does the LPC1788 know which USB port to use? I only have port 2, but I can't see anywhere in the USBLite sample, where that is specified when doing USB transfers?
USB clock is 48 MHz
Thomas