EmbeddedRelated.com
Forums

LPC2388 USB VirtualCom example

Started by Konrad Heksel September 30, 2008
Hi,
I play with USB Comunication Device Class attached with Keil uVision
and IAR compilers. I had to adopt these software a little bit to the
EBV Chameleon evaluation board I have. That is to handle ISP1301 OTG
driver. I use it only to drive D+ line to 3V3 when I initialize USB1 port.
Generally these examples work fine. I can transmit data between
VComPort and UART.
The problem is, when I plug out and plug in the USB cable (my board is
powered by its own supply) the communication is lost. Only device
enumeration is done successfully, but characters sent to VComPort (I
use TeraTerm) are rejected (or something...). The Device Monitoring
Studio shows that host tries to retransmit bulk packets, but without
success.
Any clue, what is wrong?
Should I handle ConnectChange or SuspendChange messages more, that is
have already done in the example?
More actions regarding the ISP1301?
Originally the config descriptor was set as BusPowered, I changed it
to SelfPowered, but it didn't help.
I've also tried the Keil HID example with analogic modification and,
what is strange, it works perfect. I could plug out and in USB cable
and communication was recovered.
Is someone have some experience with this issue?
I appreciate any hint.

Regards,
Konrad Heksel

An Engineer's Guide to the LPC2100 Series

As far as I know this is standard behaviour for all of the virtual com port implementations (drivers) I have seen. And it's why we created our own when faced with a new product design that would see the user's unplug and replug our USB device "at will".

I don't know at what level the data loss occurs, but for sure applications with an open COM port need to close and reopen in order to continue sending/receiving data (if the USB device is replugged). If anyone knows more about the internals I'd love to hear it.

GB
Hi,
Thanks for the answer.

I've solved the problem (regarding the micro).
It appeared that bug existed in ISP1301 otg controller service.
I've set P1.27 line as USB1_INT (ISP1301 interrupt line)
PINSEL3 &=~0x00C00000;
PINSEL3 |= 0x00400000;
... and not handled USB_ATX_INT (in USBIntSt register) interrupt.
By the way. In the NXP manual threre is no word, how to handle it.

When I set P1.27 as GPIO and polled ISP1301 interrupt line state, the
problem disappeared.

Of course, the issue with system driver still exists. When I remove
USB plug when terminal is connected, the driver (I think usbser.sys)
hungs up.
Is it a big issue to create own driver? Could you recomend some
examples or give some tips?

Regards,
Konrad