1
\$\begingroup\$

I am having a issue with USB CDC (running in a LPC1788). If I power up a mother board with the USB cable (NXP device) already connected, the O.S. (Linux) does not identify the device, but if I unplug and plug it again it is identified and works fine. The same thing happens if I reset my NXP board, the O.S. does not identify the NXP device until that I unplug/plug the cable.

I checked the code, and what happen is that the application stays forever in the while (!USB_Configuration); loop. Is necessary some configuration on USB device to that the device do an auto-configuration when it is already plugged?

I am using the example code from 177x_8x_PDL_110602 package from NXP.

\$\endgroup\$
1
  • \$\begingroup\$ The usb configuration code might need to be looked at. If its freezing at that step because the computer is booting up, that could mean that the computer isn't booting up fast enough for the usb system to recognize the device. There should be code for failed or timed out events, as in if failed, wait 1 minute and try again or something. As for resetting the device not being recognize, maybe the usb pins are not being toggled to mimic a reset device as well. \$\endgroup\$
    – Passerby
    Jul 25, 2013 at 21:31

1 Answer 1

2
\$\begingroup\$

The host only starts enumerating the USB device when it knows that it is connected. The connection is communicated to the host by setting a pull-up resistor on the D+ line (for full speed devices).

The LPC1788 has a USB_CONNECT pin which is used to connect the pull-up resistor using software. See section 11.6.7 SoftConnect in document UM10360 (LPC17xx user manual). For some reason the code setting this pin does not run in some cases I suppose. Maybe this is related to sensing the bus voltage at start up.

My suggestion: Measure the USB_CONNECT pin voltage in the working and non working situations. If they are different, look where in the code this pin is set/unset.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.