Content originally posted in LPCWare by pra18 on Sat Feb 27 04:26:22 MST 2016
Hello,
I have a working USB1 driver on my custom board and I am trying to migrate it to the USB0 now Though it seems to be pretty straightforward, I am not able to get it up and running on USB0 .
I am trying to do the following initialisation.
/*Set up USB0 */
CGU_SetPLL0();
CGU_EnableEntity(CGU_CLKSRC_PLL0, ENABLE);
/* for USB0 Connect the output of PLL1 to USB0 base clock */
CGU_EntityConnect(CGU_CLKSRC_PLL0, CGU_BASE_USB0);
scu_pinmux(0x2, 3, MD_PUP | MD_EZI, FUNC7); // P2_3 USB0_PWR_EN, USB0 VBus function
Am I missing anything in the sequence above or is there some configuration error?
I am setting up descriptors for USB0 as below.
/* Setup the USB device descriptors */
USBDesc.device_desc = (uint8_t *) USB_DeviceDescriptor;
USBDesc.string_desc = (uint8_t *) USB_StringDescriptor;
USBDesc.high_speed_desc = USB_HsConfigDescriptor;
USBDesc.full_speed_desc = USB_FsConfigDescriptor;
USBDesc.device_qualifier = (uint8_t *) USB_DeviceQualifier;
I am turning on the PHY before USBD_API->hw->Init call() also.
/* Turn on the USB0 phy */
LPC_CREG->CREG0 &= ~(1<<5);
After all these steps, still I am not finding atleast an Unknown device " or a Virtual COM on the PC .
Can anyone help me in this?
Thanks in advance,