Resolved: Windows serial port driver problem

25 Nov 2009 . Edited: 01 Dec 2009

I originally started developing with the LPC2368 beta unit on a Windows XP machine. All was working fine with the Windows serial port driver. When the new (current) driver was released, I started using that and it wored fine. I then added a Vista machine to my office. I then loaded the new drivers onto the Vista machine and all worked fine.

 

Recently, I received my LPC1768 mbed. I tried it on my Vista machine, and had to re-install the Windows serial port driver but all is working well on it. Now, either board works fine on this machine.

 

I then tried to run the LPC1768 on my XP machine, and again found I had to re-load the Windows Serial Port Driver. When I did, Windows reported that there was a problem and could not start the serial port driver. I tried re-installing it several times, both from the website as well as from a local drive copy. Finally, I went back to my LPC2368 mbed. Re-installed drivers, and everything works fine. Going back to the LPC1768, it fails. It always says the driver could not start. I have uninstalled, re-installed, etc., but to no avail.

 

Again, everything works fine on my Vista machine, just not on my XP machine, and only with the LPC1768 board...the LPC2368 works fine.

 

Any clues as to what might be the issue?

 

Thanks.

Jim

25 Nov 2009 . Edited: 29 Jan 2019

Hi Jim,

Jim Harris wrote:
Recently, I received my LPC1768 mbed. I tried it on my Vista machine, and had to re-install the Windows serial port driver but all is working well on it. Now, either board works fine on this machine.

Glad this is working at least. To clarify, this behaviour is expected. Windows registers each different mbed as a separate device, hence the need to install again.

Jim Harris wrote:
I then tried to run the LPC1768 on my XP machine, and again found I had to re-load the Windows Serial Port Driver. When I did, Windows reported that there was a problem and could not start the serial port driver.

I wonder if this is some hangover from the old driver getting picked up when you put in a new device. However, we tested this all very thoroughly, including re-installing and upgrading, so it feels like a strange interaction/history thing.

I'll have a chat with Phil (our USB guru) tomorrow, and see what he recommends. But in the mean time you could look at the following:

(Note, I don't have an XP machine with me so can't guide exactly - based on Vista).

First off, can you confirm the Firmware on the LPC1768 and LPC2368 mbed's are up to date (see Firmware).

Then, if you go to Device Manager, what is the version of the driver at:

  • Ports (COM & LPT) > mbed Serial Port - right-click Properties, Driver tab
  • Universal Serial Bus controllers > mbed Composite Device - right-click Properties, Driver tab

I'd expect 2.0.2.0 and 1.0.0.0.

If all looks in order, I'd then try un-installing both of these drivers (serial/composite), selecting to remove the software. But then also check if you disconnect/reconnect, that an old serial driver is not recognised. If it is, remove that too using the same process. Do this for both boards and you'll be basically back to scratch. Probably worth a reboot to ensure windows is not holding anything, then try re-installing.

Please note down every step you do if possible. We haven't seen a problem yet (apart from a problem downloading the driver mentioned in https://os.mbed.com/forum/topic/237/), so capturing the process may help if anyone else gets a similar result.

This may come to nothing, but it'd be good to discount it. Please report back how you get on.

Simon

01 Dec 2009

Hi Simon.

 

Well, I tried all of the above.

1) I Plugged in my LPC1768...

2) Removed the mbed Serial Port (via the 'uninstall' in the properties)

3) Removed the mbed composite device (via the 'uninstall' in properties)

4) Unplugged/plugged in the device...recognized only as mass storage (no other drivers came up)

5) Did exactly the same for the LPC2368 device

6) Re-booted the PC

7) Plugged in the LPC1768...confirmed only mass storage device

8) Installed the latest serial port drivers from the website (mbedWinSerial_16466.exe)

9) Composite device driver loaded fine

10) When serial port driver was installed, got a completion error message that there was a problem installing this hardware....'This device cannot start (Code 10)'

 

Still not having luck with this.

 

Jim

01 Dec 2009 . Edited: 01 Dec 2009

Hi Jim,

Phil suggested it could be that windows is trying to allocate it to a COM port that is already in use. That would cause it to fail with Code 10. It seems sometimes Windows gets an inconsistency in it's registration of what has already been allocated.

To see if this is the problem (and hopefully fix it), try changing the assigned COM port.

  • Go to Device Manager > Ports (COM & LPT) > mbed Serial Port, then right-click and select "properties".
  • Choose "Port Settings" Tab, and click "Advanced"
  • Under "COM Port Number", try selecting a different COM port

Note that windows marks some as (in use), but don't count this as exhaustive for the same reason as this problem may exist!

Try changing it to a few different unused COM ports and see if this has an impact. If not, we'll dive deeper to see what windows is reporting.

Simon

01 Dec 2009 . Edited: 29 Jan 2019

And remember to unplug-replug after making the change to reload the driver, and see any results.

For example, I just assigned my mbed COM port to an already used (COM1). Device manager showed them both as registered to COM1. I then unpluged-replugged, and got:

Simon

01 Dec 2009 . Edited: 01 Dec 2009

Simon,

I had already done the un-lug/re-plug thing. It always assigned the mbed to COM3....which I have confirmed is not used by anything else.

I just went in and manually changed it to COM16, and it seems to have fixed the Windows error.

I then tried to run a program that writes out to the port. This program works on the Vista machine (with either the LPC1768 or the LPC2368, as well as on the XP machine (but only with the LPC2368). SO, while I don't get the Windows error, the serial coms doesn't work on the XP machine with the LPC1768.

By the way...if change the port back to COM3....Windows gives me the error again.

01 Dec 2009
Some programs don't support high port numbers. Try using COM4 or some other low number.
01 Dec 2009

I am using Terratermpro that allows up to COM16.

 

However...I also tried COM2...still no luck.

Thanks.

01 Dec 2009

Ok...just did a couple of more things.

 

I tried my LPC2368 mbed. It came up as COM3 (now that the LPC1768 has moved to COM2). It works fine.

I then changed over to the LPC1768, which came up as COM2...still no serial data being shown.

So...in review....same PC, running XP, same terminal program, same code (compiled for the appropriate mbed board). LPC2368 works fine...LPC1768 does not.

Quite curious. Beginning to think I am having problems on the PC with XP. Next thing to try is maybe another USB port. I realize COM port number will change. I'll let you know.

01 Dec 2009

Ok...just tried another USB port. COM stayed as COM2. Still no serial data.

01 Dec 2009 . Edited: 01 Dec 2009

Hi Jim,

Sounds like the LPC1768 on XP is still coming in on some low numbered port, and I'm worried there may be a clash still if windows is confused. With the LPC1768 plugged in to XP, try changing the COM port to e.g. COM25 or some other higher one. Then unplug-replug and check it comes in OK (i.e. on COM25, and not code 10). Then (re)start teraterm and see if you get life!

If not, this is very strange. Can you list the exact hardware, OS specs? Maybe you can find another XP machine to try just to really narrow it down to that machine?

For sanity, it might also be worth ensuring the program on the mbed really is running - e.g. flashing an LED at the same time. This would confirm e.g. the wrong image hadn't ended up on the wrong board!?! But as you have had the board working with Vista, it is unlikely to be this. And checking teraterm is restarted.

Has anyone else seen this problem? It is the first we've seen where it was not easily resolved.

Simon

01 Dec 2009

Thanks Simon.

 

Actually, I did have other code running to flash some LEDs. It would not be the first time I had the wrong compiler selected...the compiler comes up to the LPC2368 as default.

The good news is...I have it working. I had moved the port to many places, but had to keep it between COM1 and COM16, as Terraterm only goes up to port 16. I finally chose COM9, and it works fine now. I am not sure why. The LPC2368 works fine on COM3, but when the LPC1768 was on that one, it didn't.

At this point, I am not sure where the problem lies, but I am suspecting it might have to do with the PC I am running on. I would not worry about it being any other issue.

Thanks to you and all who tried to help. I am really quite impressed with the quick reponses and good information here.

Jim

01 Dec 2009 . Edited: 29 Jan 2019

Hi Jim,

Jim Harris wrote:
The good news is...I have it working.

That is great news!

So I think the summary of the problem is:

  • Windows sometimes incorrectly and repeatably allocates mbed to a COM port which is in use/not suitable which it thinks is free
  • The result is the error "The device cannot start (code 10)"
  • = no serial :(

The solution is:

  • Go to Device Manager > Ports (COM & LPT) > mbed Serial Port, then right-click and select "properties".
  • Choose "Port Settings" Tab, and click "Advanced"
  • Under "COM Port Number", try selecting a different COM port
  • Unplug and replug the mbed to reload the driver - if the problem persists, try another COM port

Windows is generally very repeatable; once it has allocated a port, it tends to stick to it.

Jim Harris wrote:
I had moved the port to many places, but had to keep it between COM1 and COM16, as Terraterm only goes up to port 16.

It may be worth seeing if you are on the newest version of Teraterm. It has much better support for serial ports, including listing only active ports and naming the device in the serial port list:

The link for the latest version is on https://os.mbed.com/handbook/Terminal

Glad we got it working in the end. Thank you for your persistence; I'm sure it will help any other unlucky Windows users solve their problem much more quickly.

Simon

13 Jan 2010

I have a problem with Windows not recognizing one of my 3 mbed units as a serial device. It works okay otherwise (CAN functions, SPI functions, analog in functions, pwmout functions, lED's flash...). Tried all the changing of ports, swapping over of usb leads, rebooting of machine, running just one mbed, or two (my normal configuration as I'm working on CAN bus controlled lighttubes for an art installation) or three even, but one of them (always the same one) just is never recognized - is there anything more I can try (other than what's on this page) or do I have a faulty unit?

 

Dave

14 Jan 2010 . Edited: 29 Jan 2019

Dave, try this method. It's probably not your case since you do have mass storage working but just in case...
Also, open Device Manager, choose View-Devices by connection, and check whether you have this kind of picture:

 

14 Jan 2010 . Edited: 29 Jan 2019

Hi Dave,

Dave Malham wrote:
I have a problem with Windows not recognizing one of my 3 mbed units as a serial device ... one of them (always the same one) just is never recognized - is there anything more I can try (other than what's on this page) or do I have a faulty unit?

to help diagnose this, can we run through a few things...

  • Plug in the mis-behaving mbed with Device manager open; can you confirm it comes up as a USB mass storage device, but not an mbed Composite device or mbed Serial device
  • Run the serial installer; does it go through and install correctly (or rather, doesn't say otherwise)
  • What mbed related things now appear in device manager?

Note: the installer needs to be run for each mbed, as windows registers the drivers based on the serial number.

Simon

14 Jan 2010

Hi Simon,

Duh'oh! Sorry, sorry - I clean forgot to run the serial installer...if this was my first mbed, that might be forgivable, but it's the third...

<embarassed>

Dave

08 Nov 2010

i ran in the same problem, couldnt get the serial to work. Then i switched the blinking leds of, Reinstalled the driver, and voila,  working, on a port which was blocked before....