Content originally posted in LPCWare by Arkadyosh on Tue Apr 24 05:46:51 MST 2012
Hi,
I'm trying to run Virtual Serial Device Example on LPC1786 in my development board(I dont have any of supported board LPCXpresso, EA etc). I set BSP configuration to "LPC177x_8x_EAOEMBaseRevA"(it is similar to my board), for CDL I set "LPC177x_8", for nxpUSBlib "LPC177x_8x_Device" and for Example_VirtualSerialDevice LPC177x_8x. For all of this modules I choose target processor for LPC1786. Im want to use USB port 2, so I have to some changes in HAL_USBInit(), and now its look like follow:
LPC_IOCON->P1_30 &= ~(0x07);
LPC_IOCON->P1_30 |= 0x02;// vbus
LPC_IOCON->P0_31 &= ~0x07;
LPC_IOCON->P0_31 |= 0x1; // USB2 D+, USB2 D- is dedicated
LPC_SC->PCONP |= (1UL<<31);
LPC_USB->USBClkCtrl = 0x1A; /* Dev, PortSel, AHB clock enable */
while ((LPC_USB->USBClkSt & 0x1A) != 0x1A);
LPC_USB->OTGStCtrl = 0x3; // portsel usb u2 port
HAL_Reset();
I use only 3 lines: D2+, D2- and VBus. When I connect board with PC, PC find device as unknown device. When I debug code, and go into DcdIrqHandler() I see that device dont get EndpointSlowInterrupt and Device cant be enumerate by Host, I still got DEV_STAT interrupt, next receive SIEDeviceStatus which value is 0x11 and USB is reset.
I use Red Suite 4 and nxpUSBlib v0.94.
What change in this example I must to put to get correct connection, anybody have some idea?
Regards