Content originally posted in LPCWare by NXP_Paul on Fri Oct 17 08:09:59 MST 2014
Hello
The issue is probably caused by single-stepping. When the USB host sends a control transfer, it expects a handshake. If it doesn't receive the handshake, it will retry. The host will typically abandon the transfer after three retries, and the enumeration will fail.
If you have a lot of initialization to do, then you can delay the USB enumeration process until you have completed the microcontroller's initialization. This can be accomplished by waiting for the initialization to complete before the 1.5kOhm pull-up resistor is enabled. Enabling the 1.5k resistors tells the host that a USB device has been plugged into the USB port. If the USB device is plugged in, but the resistor is not enabled, the host will not detect the device. This pull-up is enabled when software sets the RS bit (Bit 0) in the USBCMD register.
In the LPCOpen code, the connection of the 1.5kOhm resistor is accomplished with the
USBD_API->hw->Connect(g_hUsb, 1) function.
Paul