COM port not detected if USB cable is unplugged during a live serial terminal emulator session

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

COM port not detected if USB cable is unplugged during a live serial terminal emulator session

2,240 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by liaochengyi on Mon Mar 24 01:35:08 MST 2014
Hi, LPCWare guys,

Does the below issue has solution?

http://www.lpcware.com/content/bugtrackerissue/com-port-not-detected-if-usb-cable-unplugged-during-l...

Thank you.
BR
Chengyi
Labels (1)
0 Kudos
5 Replies

1,140 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by liaochengyi on Wed Apr 02 18:51:39 MST 2014
Dear Rocketdawg,

Thank you for your reply. I will try that message.

Now, I need to send the zero length package.

Do you know how to send it in LPC11u2x, & u3x

Thank you a lot.
Best regards,
Chengyi
0 Kudos

1,140 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rocketdawg on Fri Mar 28 06:49:31 MST 2014
If a USB device is removed or inserted, all application receive a WM_DEVICECHANGE message.
you can then inspect the devices to see if yours has been removed or inserted.
if teraterm is not doing this, then it is a bug in their application and you will not be able to fix it.
0 Kudos

1,140 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by liaochengyi on Thu Mar 27 00:58:01 MST 2014
Hi,

When I modify the .inf, the windows system add the "Serenum.sys",
but the AP still can't understand unplug & re-plug, and the AP still run  IOCTL_SERIAL_WAIT_ON_MASK.

Because this is a newer project using NXP chip. The old mcu system can work with the original AP.
I need to compatibility the original system.


; 
; NXP  Communication Device Class driver installation file
; (C)2012 Copyright 
;

[Version] 
Signature="$Windows NT$" 
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} 
Provider=%NXP% 
CatalogFile=lpc-ucom-vcom.cat
DriverVer=09/13/2013,1.0.0.1

[DestinationDirs] 
FakeModemCopyFileSection=12
DefaultDestDir = 12

[Manufacturer] 
%NXP%=DeviceList, NTx86, NTamd64, NTARM

[DeviceList.NTx86] 
%DESCRIPTION%=LPCVCOM,USB\VID_1FC9&PID_0083 
%COMPOSITE%=LPCVCOM,USB\VID_1FC9&PID_0083&MI_00

[DeviceList.NTamd64] 
%DESCRIPTION%=LPCVCOM,USB\VID_1FC9&PID_0083 
%COMPOSITE%=LPCVCOM,USB\VID_1FC9&PID_0083&MI_00

[DeviceList.NTARM] 
%DESCRIPTION%=LPCVCOM,USB\VID_1FC9&PID_0083 
%COMPOSITE%=LPCVCOM,USB\VID_1FC9&PID_0083&MI_00

;------------------------------------------------------------------------------
;  Windows 2000/XP Sections
;------------------------------------------------------------------------------
[DriverCopyFiles]
usbser.sys,,,0x20
serenum.sys,,,0x20

[LPCVCOM]
include=mdmcpq.inf
CopyFiles=FakeModemCopyFileSection
AddReg=LPCVCOM.AddReg
;AddReg=LowerFilterAddReg,SerialPropPageAddReg

[LPCVCOM.HW] 
AddReg=LPCVCOM.HW.AddReg 

[LPCVCOM.AddReg] 
HKR,,NTMPDriver,,*ntkern
HKR,,NTMPDriver,,usbser.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
HKR,,PortSubClass,1,01

[LPCVCOM.HW.AddReg]
HKR,,"UpperFilters",0x00010000,"serenum" 

[LPCVCOM.Services]
include = mdmcpq.inf
AddService=usbser, 0x00000002, UsbserService
AddService=Serenum,,SerenumService
;AddService = usbser, 0x00000002, LowerFilter_Service_Inst
; This adds the serial port property tab to the device properties dialog

;------------------------------------------------------------------------------
;  Usbser Service
;------------------------------------------------------------------------------

[UsbserService] 
DisplayName=%Serial.SvcDesc% 
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\usbser.sys 
LoadOrderGroup = Base

;------------------------------------------------------------------------------
;  Serenum Service
;------------------------------------------------------------------------------

[SerenumService] 
DisplayName    = %Serenum.SVCDESC%
ServiceType    = 1               ; SERVICE_KERNEL_DRIVER
StartType      = 3               ; SERVICE_DEMAND_START
ErrorControl   = 1               ; SERVICE_ERROR_NORMAL
ServiceBinary  = %12%\serenum.sys
LoadOrderGroup = PNP Filter

;------------------------------------------------------------------------------
;  String Definitions
;------------------------------------------------------------------------------

[Strings] 
NXP="NXP"
DESCRIPTION="LPC USB VCom Port" 
COMPOSITE="LPC USB VCom Port"
USBSER.DESC = "USB Serial Driver"
SERENUM.DESC = "Serenum Filter Driver"





0 Kudos

1,140 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by liaochengyi on Wed Mar 26 21:08:42 MST 2014
Hi, drs

Thank you for the answer.

But I need to to find the solution for the issue.

I want to modify the original lpc-ucom-vcom.inf, and add the serenum.sys rs-232 driver to do something.

But I am not sure it is workable?

And I have a problem on IOCTL_SERIAL_WAIT_ON_MASK handling when used my AP created by VB6.

If anybody has solution on usbser.sys. Could you do me a favor, please?

Thanks a lot.

Best regards,
Chengyi
0 Kudos

1,140 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drs on Wed Mar 26 16:43:47 MST 2014
The issue is the USB connection is broken while Teraterm has the COM port open. When Windows detects that the USB cable has been unplugged it tried to close the COM port but can't because Teraterm has it opened and resources have been locked.

The solution is to close Teraterm (or whatever terminal program being used) before unplugging the USB cable.
0 Kudos