Search code examples
windowsembeddedserial-portusbusbserial

How to get stable COM-ports for USB serial dongles in Windows XP?


I develop embedded systems and need serial ports for communication.

In Windows XP the numbers for USB serial port dongles keep moving around, which makes it hard to use in scripts or makefiles (for example for flash programming NXP controllers via their built-in bootloader, or for controlling a target and two lab devices at the same time).

Is there a way to fix the COM-port for such a dongle? In Linux I can do this via udev by matching against the serial number of FTDI dongles (see this answer I just gave while searching for an answer to this question).


Solution

  • In my experience, plugging the device into the exact same USB port each time results in it getting the same COM port number.

    It's also possible to change the port number assigned to a device (Device Manager, edit Properties of the COM port) if you need to plug it into a different USB port. In the past I have labeled a device with a COM port number, and then plugged it into each USB port on my laptop and reassigned the COM port to be that number, regardless of where it's plugged in.