Author Topic: Multiple virtual USB serial COM ports over single serial COM port?  (Read 20511 times)

toddintr

  • Member
  • ***
  • Posts: 3
Hi,

I am running into the dreaded "COM port already in use" problem when trying to upload programs to an Arduino board over a USB connection.  The Arduino system uses virtual serial ports over USB.  When I look at the available ports through Sysinternals' Portmon utility, I see situations where USBSER000 and USBSER001 are shown to be assigned to the same COM port (in this case COM14).  I am not sure if this is the reason why the Arduino IDE thinks the port is in use.

I recently installed the latest FTDI driver suite, because a USB board from Sparkfun that uses an FTDI chip (the XBee Explorer dongle) required it to run the X-CTU software on the PC.  I am not sure if this is related to my problems.

I am on Windows 7 Professional on a Lenovo laptop.  Has anyone else seen this situation?  Is there a solution that does not require a reboot?  Jan? ;-)

Thanks -

Todd

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Multiple virtual USB serial COM ports over single serial COM port?
« Reply #1 on: October 20, 2011, 05:23:30 pm »
Are you sure it's the correct port number? When you detach the board does the port number disappear in Device Manager?

Are you running any other software that might be using the port?

Jan

toddintr

  • Member
  • ***
  • Posts: 3
Re: Multiple virtual USB serial COM ports over single serial COM port?
« Reply #2 on: October 20, 2011, 05:48:35 pm »
>When you detach the board does the port number disappear in Device Manager?

Yes, Device Manager refreshes on detach and the port # (and the device) disappear from the Ports (COM & LPT) category.

>Are you running any other software that might be using the port?

The only other software is the laptop's Bluetooth system that shows up as "Standard Serial over Bluetooth Link (COM4)" and "Standard Serial over Bluetooth Link (COM5)".  However COM ports 3, 6 to 13 and 15 to 19 also show up as "in use" when I try to do port assignment through Device Manager.

Is there any utility that can look deep into the system to show why ports are in use, and what uses those ports?  Portmon is only somewhat helpful, it shows those ports that it thinks are in use.

I understand that the "USBSERxxx" IDs are the virtual serial ports, but is there rhyme/reason to how they are generated and assigned to Windows COM ports?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Multiple virtual USB serial COM ports over single serial COM port?
« Reply #3 on: October 20, 2011, 10:29:33 pm »
Uninstalling a port from within Device Manager should release the port number for use by other applications.

Windows uses a COM-port database to help ensure a unique number for each port.

A device that contains a USB serial number retains its COM-port number when moved to a different USB port. A device without a serial number gets a new COM-port number on each attachment to a different USB port. That may be why your system shows so many COM ports.

The WDK has a pnpports example that shows how to claim and release port numbers in program code. (Search on WDK.)

Jan

toddintr

  • Member
  • ***
  • Posts: 3
Re: Multiple virtual USB serial COM ports over single serial COM port?
« Reply #4 on: October 22, 2011, 02:16:52 pm »
Hi Jan,

Thanks, I have located the example in the WDK download, will give it a try.

Todd

supriya

  • Member
  • ***
  • Posts: 4
Re: Multiple virtual USB serial COM ports over single serial COM port?
« Reply #5 on: October 25, 2013, 05:02:57 am »
Hi Jan
  Currently I have configured one serial com port using USB CDC driver for STM32 .Is it possible to configure such multiple ports using same USB CDC ?
Does it require changes in windows driver as well ?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Multiple virtual USB serial COM ports over single serial COM port?
« Reply #6 on: October 25, 2013, 10:28:25 am »
I believe this will work using the same INF file for multiple devices. If you try it, please report what you find.