LPC1768 USB Host mode not working

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

LPC1768 USB Host mode not working

2,064 Views
stuartjuengst
Contributor I

I can't seem to get USB Host mode working on LPC1768.  It always gets stuck during enumeration waiting on the GetDescriptor control call to complete.  

 

My primary setup is the mbed NXP LPC1768 on an mbed application board running the lpcusblib_KeyboardHost example project from lpcopen_2_10_lpcxpresso_nxp_lpcxpresso_1769.  The DIP switches on the application board are in the Host position, and a USB keyboard is attached to the Mini USB connector on the application board.

 

It always gets stuck in WaitForTransferComplete(), at this line:

   while ( HcdED(EdIdx)->status == HCD_STATUS_TRANSFER_QUEUED ) {}

 

I've also tried substituting the USBHostLite library in place of lpcusblib, with similar results.  In this case, it gets stuck in Host_WDHWait():

  while (!HOST_WdhIntr) {

    ;

  }

 

Googling it, I don't see anyone else asking about similar problems, so I must be missing something.  Can anyone make a suggestion about why my transfers are never completing?

 

My LPCXpresso project is attached.

 

Thanks,

 

Stu

 

 

Original Attachment has been moved to: USBtest.zip

Labels (3)
0 Kudos
3 Replies

1,064 Views
haukereese
Contributor I

I've got the same problem.

The lpcusblib_KeyboardHost application sometimes works and sometimes not.

Also i've not changed the code or the comiler options. It hangs in the "HOST_STATE_DEFAULT" state,

in the "USB_Host_SendControlRequest(corenum, &DevDescriptor)" routine.

There the "HCD_STATUS WaitForTransferComplete(uint8_t EdIdx)" routine is in an endless loop.

Perhaps it is a timing or Power problem ?

Or is it an unreferenced pointer ?

Hoping for help

hauke

0 Kudos

1,064 Views
haukereese
Contributor I

Some mor Diagnostics:

When I use my hardware (lpx1769 + Base Board) and Lpcxpresso on my Linux PC,

the lpcusblib_KeyboardHost application doesn't work.

When I use the same Hardware and the same application (it's in a Dropbox folder ) with my Windows

Laptop, it works fine.

So perhaps it's atiming problem with the LPC-Link drivers.

best regards

 hauke

0 Kudos

1,064 Views
isaacavila
NXP Employee
NXP Employee

Hello Stuart,

USBHostkeyboard example on LPCOpen was created for being tested on LPCXpresso Base board (LPCXpresso Base Board | Embedded Artists AB ). I've made a quick review for schematic on mbed application board and it should work as well. Are you powering both mbed application boarde and mbed LPC1768 board through CON1? It seems that VBUS is traken from regulator's output so CON1 needs to be used to power the full system.

Besides it, you can try to change UART module (and pins being used) in order to use UART0 (pins P0.2 and P0.3) instead of example's default UART3 (pins P0.0 and P0.1) and check what is being written on console.

Also, an USB analyzer could help to check if USB transactions are sent correctly.

I hope this can help!

Regards,

Isaac

0 Kudos