USB Host questions for 1788

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB Host questions for 1788

493 Views
lpcware
NXP Employee
NXP Employee
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




Labels (1)
0 Kudos
1 Reply

382 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Daniel Widyanto on Thu Sep 27 03:24:31 MST 2012
Hi there,

I hope I can help you a bit.

The OHCI for LPC1788's USB host is as described in ftp://ftp.compaq.com/pub/supportinformation/papers/hcir1_0a.pdf In that document, you will find the TD's decription and all of the OHCI registers and usage.

For USB port selection, there's 2 parts. The first one is selecting USB2 as host. This is done in OTGStCtrl. The second one is when reading the root hub status, you need to read from HcRhPortStatus[1] instead of HcRhPortStatus[0]

I did some demo code with USB host lite to move the USB host to USB2 in LPC2478 last time, but I don't think I can remember all of the things that I modified.

Just reply this thread if you need more info. Maybe I can help

Regards,
-daniel
0 Kudos