[time-nuts] USB problems and solutions - Some what Off Topic

Attila Kinali attila at kinali.ch
Fri May 29 23:24:07 UTC 2015


On Fri, 29 May 2015 13:17:40 -0600
Cash Olsen <radio.kd5ssj at gmail.com> wrote:

> I have been plagued with hard crashes of the computer when plugging in and
> unplugging USB devices. I have generally determined that some of the USB to
> serial devices are the worst offenders. I am also suspicious of some of the
> hubs. I wander if even the operating system is partly to blame.


I do not know about Windows Vista, but I have developed several USB
devices using Windows XP as main targed. All serial drivers use the
same code (usbser.sys) as driver, and just reference it in their
respective .ini file. From the time I developed those devices, i can
tell you with great confidence that usbser.sys is the worst piece
of shit i've seen in my entire life. There is no data validation,
no input sanitation or anything the like at all. Any inconsitency
in the data structures that describe the USB device (there are several
of those in even the most simple device) or just a wrongly set bit
will crash Windows XP hard. Hard as in, your system will freeze.
If you are lucky you will get a black screen. No blue screen with
any information will ever appear.

I don't know whether they rewrote the code completely or not. At least
the impression I have is that the Vista usbser.sys is slightly more
stable than the one in XP, but i have not tested it as throughly as I
did with XP. I would still not be surprised if the code is still pretty
bad and fucks up when it seems something uncommon but completely valid.

You might try upgrading usbser.sys to its newest version, but i am
not sure whether that would help or make things worse.

> One further issue, the COM ports are marked in use from 3 to 50+ and I'm
> only using at any one time 3 or 4. Can I clean up the assignments and can I
> make the assignments static after connect and reconnect or restarting the
> computer?

This is another very annoying thing. If a COM port was in use when its
underlying device was lost, then you cannot close the device completely
anymore. I have not found a cure for that, other than a reboot. So always
close the application that has uses a specific COM port before you
disconnect it.

If you plug in a device and you get a COM port that is very high up,
you can go into the device manager and re-assing its number (if the
ini file has that feature enabled). You have then to unplug it and
re-plug it for the change to take effect. Please be aware that you
have to plug it in at the exact same port of the exact same hub
(if you use one). Otherwise windows will think it's a different
device and assign it a different port number (or even ask you
to "reinstall" its driver).


If it is possible for you, I would suggest to use a different
operating system if you have to deal with lots of USB serial ports.

			Attila Kinali

-- 
< _av500_> phd is easy
< _av500_> getting dsl is hard



More information about the Time-nuts_lists.febo.com mailing list