USB ENUMERATION PROBLEM

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

USB ENUMERATION PROBLEM

1,098 Views
utsavkumar
Contributor II

Trying to enumerate USB Host using NXP's USBHostLite using LPC2468 controller. It stuck at "while (!HOST_RhscIntr)" in Host_EnumDev() 

Below is my Host_init function(reference LPC2468 USBHostlite code)

void Host_Init (void)
{
USB_INT32U pinsel;
USB_INT32U pinmode;


PCONP |= 0x80000000;
VICIntEnClr = (1 << 22); /* Enable the USB interrupt source */
OTG_CLK_CTRL = 0x00000001; /* Enable USB host clock */

while ((OTG_CLK_STAT & 0x00000001) == 0) {
}
/* P0[12] = USB_PPWR2 01 */
pinsel = PINSEL0;
pinsel &= 0xFCFFFFFF;
pinsel |= 0x01000000;
PINSEL0 = pinsel;
/* P0[31] = USB_D+2 */
pinsel = PINSEL1;
pinsel &= 0x3FFFFFFF;
pinsel |= 0x40000000;
PINSEL1 = pinsel;
/* P1[30] = USB_PWRD2 01 */
/* P1[31] = USB_OVRCR2 01 */
pinsel = PINSEL3;
pinsel &= 0x0FFFFFFF;
pinsel |= 0x50000000;
PINSEL3 = pinsel;


PRINT_Log("Initializing Host Stack\n\r");
Hcca = (volatile HCCA *)0x7FD00000;
TDHead = (volatile HCTD *)0x7FD00100;
TDTail = (volatile HCTD *)0x7FD00110;
EDCtrl = (volatile HCED *)0x7FD00120;
EDBulkIn = (volatile HCED *)0x7FD00130;
EDBulkOut = (volatile HCED *)0x7FD00140;
TDBuffer = (volatile USB_INT08U *)0x7FD00150;
FATBuffer = (volatile USB_INT08U *)0x7FD001D0;
UserBuffer = (volatile USB_INT08U *)0x7FD01000;

/* Initialize all the TDs, EDs and HCCA to 0 */
Host_EDInit(EDCtrl);
Host_EDInit(EDBulkIn);
Host_EDInit(EDBulkOut);
Host_TDInit(TDHead);
Host_TDInit(TDTail);
Host_HCCAInit(Hcca);


Host_DelayMS(50); /* Wait 50 ms before apply reset */
HcControl = 0; /* HARDWARE RESET */
HcControlHeadED = 0; /* Initialize Control list head to Zero */
HcBulkHeadED = 0; /* Initialize Bulk list head to Zero */

/* SOFTWARE RESET */
HcCommandStatus = OR_CMD_STATUS_HCR;
HcFmInterval = DEFAULT_FMINTERVAL; /* Write Fm Interval and Largest Data Packet Counter */

/* Put HC in operational state */
HcControl = (HcControl & (~OR_CONTROL_HCFS)) | OR_CONTROL_HC_OPER;
HcRhStatus = OR_RH_STATUS_LPSC; /* Set Global Power */

HcHCCA = (USB_INT32U)Hcca;
HcInterruptStatus |= HcInterruptStatus; /* Clear Interrrupt Status */
/* Enable interrupts */
HcInterruptEnable = OR_INTR_ENABLE_MIE |
OR_INTR_ENABLE_WDH |
OR_INTR_ENABLE_RHSC;


VICIntSelect &= ~(1 << 22); /* Configure the ISR handler */
VICVectAddr22 = (USB_INT32U)Host_Isr; /* Set the vector address */
VICIntEnable = (1 << 22); /* Enable the USB interrupt source */
PRINT_Log("Host Initialized\n\r");
}

Please what mistake I am doing?

Labels (2)
0 Kudos
2 Replies

526 Views
leiretorres
Contributor I

I am currently experiencing the same problem with LPC2478. Have you been able to solve it?

 

.

0 Kudos

526 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Kumar,

If you are developing a new USB-based application, it is recommended considering a newer Kinetis or LPC microcontroller based on Cortex M4/M0+, as the LPC2xxx family is now legacy.

If you really need the USB with LPC2xxx, you could take a look at the following links:

http://www.utasker.com/forum/index.php?topic=894.0

https://www.embeddedrelated.com/showthread/lpc2000/54409-1.php


Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos