Hi,
I am working on LPC4337 USB CDC VCOM on a customize board. It uses external crystal for clocking of 10MHz. For the software I am referring to LPCOpen usbd_rom_cdc_vcom project. Unfortunately my board doesn't support debugger yet and I am using UART printing to determine whats going on.
So far, USBD_API->hw->init() and vcom_init() returns LPC_OK. USB interrupts are being generated and program enters EP0_patch; I am also reading USBSTS register in side usb0_IRQhandler() and 'event' parameter in EP0_patch. My serial terminal outputs something like this after USBD_API->hw->Connect(g_hUsb, 1) function call :
1) USBSTS: 0x180 (SOF | SUSPENDED)
2) USBSTS: 0xC0 (SOF | RESET)
3) USBSTS: 0x84 (SOF | PORTCHANGE)
4) USBSTS: 0x81 (SOF | USBERROR)
5) EP0_patch event: USB_EVT_SETUP
6) USBSTS: 0x10001 (SOF | NAK_INT)
7) EP0_patch event: USB_EVT_OUT_NAK
8) USBSTS: 0x1 (USBERROR)
9) EP0_patch event: USB_EVT_OUT
10) USBSTS: 0x81 (SOF | USBERROR)
11) EP0_patch event: USB_EVT_SETUP
12) USBSTS: 0x1 (USBERROR)
13) USBSTS: 0x81 (SOF | USBERROR)
14) EP0_patch event: USB_EVT_SETUP
14) EP0_patch event: USB_EVT_OUT_NAK
16) USBSTS: 0x1 (USBERROR)
14) EP0_patch event: USB_EVT_OUT
15) Stops printing on serial terminal and windows reports, after a delay of 45-50 seconds, Unknown USB Device (Device Descriptor Request Failed) Code 43.
I am also setting the M-divider value to 0x071A7FAA (corrosponding to 10 MHz) in usbPLLSetup. My code is same as LPCOpen CDC_VCOM software except I had to port it to C++.
I am stuck here and hoping to get an idea of what is happening inside, the cause or resolution of the problem.
Thanks in advance,
Rishit