LPCUSBlib CDC Device Detection Taking Long Time in Window/Linux

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPCUSBlib CDC Device Detection Taking Long Time in Window/Linux

832 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by u14user on Wed Jul 17 08:29:18 MST 2013
Hi All,

Currently I am using LPC11u14 MCU with NXPUSBlib usb stack, CDC class. When I connected either to Windows/Linux, it take more than 10seconds before the USB-Comm Port is available for usage. Below is the dmesg in linux:
[ 5338.418039] usb 1-1.1: new full-speed USB device number 21 using ehci_hcd
[ 5353.467716] usb 1-1.1: device descriptor read/64, error -110
[ 5353.665374] cdc_acm 1-1.1:1.0: ttyACM0: USB ACM device

As shown above, it took 15seconds before the device is ready.

How can I shorten the device detection time.

Thank you very much.
Labels (1)
0 Kudos
Reply
2 Replies

662 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by u14user on Mon Aug 19 23:51:48 MST 2013
Hi,

After I perform the upgrade to LPCOpen version 1.03 the problem go away.

But the downside is the new LPCOpen break many of my driver code, previously from nxpusblib.

Thank you very much.
0 Kudos
Reply

662 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Fri Jul 19 09:21:06 MST 2013

Quote: u14user

[ 5338.418039] usb 1-1.1: new full-speed USB device number 21 using ehci_hcd
[ 5353.467716] usb 1-1.1: device descriptor read/64, error -110
[ 5353.665374] cdc_acm 1-1.1:1.0: ttyACM0: USB ACM device



Maybe, this scenario occurs behind the scene.

Just after your device connects by enabling D+ pull-up, it doesn't respond to Get_Descriptor(Device) request from host, and timeout occurs on the host. The error code 110 means,

http://lxr.free-electrons.com/source/include/uapi/asm-generic/errno.h#L83
#define ETIMEDOUT       110     /* Connection timed out */

And then, host should retry enumeration a couple of time, and finally it successes, after 15 seconds.


(1) Initialization specific to your code should be placed before SetupHardware(), which enables D+ pull-up.
(2) USB_USBTask() should be called every 50 ms (**1), at least, in the main loop, because USB_USBTask() respond to the host requests.
\lpcopen_v1.03\applications\LPCUSBlib\lpcusblib_VirtualSerialDevice\VirtualSerial.c

int main(void)
{
                         // <--- (1)
    SetupHardware();

    for (;; ) {

#if (CDC_TASK_SELECT == ECHO_CHARACTER_TASK)
        EchoCharacter();
#else
        CDC_Bridge_Task();
#endif
                         //  <--- (2)
        USB_USBTask(VirtualSerial_CDC_Interface.Config.PortNumber, USB_MODE_Device);
    }
}


(**1) 50 ms is the shorter timeout limit in control transfer process on host.
If your device supports suspend/resume, this value reduces to 7 ms

Tsuneo
0 Kudos
Reply