AnsweredAssumed Answered

USB ENUMERATION PROBLEM

Question asked by Utsav Kumar on Sep 22, 2017
Latest reply on Jan 10, 2018 by Leire Torres

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?

Outcomes