This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1294NCPDT: USB Composite HID-CDC surpise-removal issue with Windows 7 serial driver

Part Number: TM4C1294NCPDT

I have TM4C1294NCPDT part running composite usb hid-cdc device. The problem is on the surprise-removal usb device (or terminating and restarting usb controller) from the pc running Windows 7 x64 (SP1) the former locks the com port. So when i plug the usb back Windows can not open the com port. However the hid complement is working fine. There is no such problem with cdc-only usb device. It seems like usbser.sys should delete symbolic link from NT device name ( \Device\USBSER001 ) to DOS device name ( COM4 ) and registry key at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM on the device removal but somehow it doesnt do that. Is there any workaround for this? Could it be a device side problem?

  • Hello Igor,

    By removal issue do you mean that the COM Port doesn't free up in Device Manager for re-use?
  • Hello Ralph,
    The COM port does disappear in Device manager after unplugging the Usb device. However when i plug it in the COM port can not be opened.
  • Hello Ralph,
    Addition to my previous reply: the COM port is not being used by any application in this scenario. Also it correctly appears/disappeares in the Device Manager if i plug/unplug the device multiple times. However after the first unplugging of the Usb device i can see that symbolic link and registry key which i pointed in my question is not being removed. I've noticed that plugging/unplugging cdc-only device which is working fine causes Windows to create/delete those link and registry key, so i assume its Windows fault (usbser.sys to be more precise).

  • Hello Igor,

    I should have been clearer with what I meant by seeing it in Device Manager. If you turn on 'Show Hidden Devices' in the View tab, do you see the COM port still listed there? If so I think that is what you are seeing in Registry as well. Not 100% if it's a Windows or a TI issue, but it is not limited to TM4C, MSP430 behaves the same way too. It usually occurs when the USB is unplugged while the COM port was open. That causes it to not properly close and then it persists in Windows.
  • Hello Ralph,
    The COM port disappears completely, i can not see it even with 'Show Hidden Device' option. The problem is that i do not try to open or use the COM port after the first plug-in, it gets lock by itself after usb device removal. I only try to open it after the second plug-in to detect if its locked. Then i reboot pc or delete symlink and registry key to unlock the port.

    Update:

    My Usb HID complement is using Power Device class. I have tried to replace Power Device class for Generic Desktop Mouse class and the problem is gone. But even making HID Power Device descriptor empty does not help. So apparently the problem is somehow related to the Windows power driver (hidbatt.sys i guess), Windows serial driver (usbser.sys) and Windows generic parent driver for complement USB devices (usbccgp.sys).

  • Hello Igor,

    I have no experience using Power Device classes so that is really beyond my ability to help with. I would recommend trying Windows forums to see if any Windows experts have advice regarding those files.