Windows ****ing 10 and COM ports. - Page 1
Forum section: electronics / general

author: paulca
author_rank: Super Contributor
timestamp: September 14, 2020, 01:20:28 pm
content: I'm programming a SOnOff S20 smart socket today.The first 5-10 disconnect/reconnect went fine. Then, "Access Denied" to the port. I disconnected and reconnected it and windows says, "The device is not recognised or has malfunctioned."This is a common occurence, yesterday it was a Wemos Mini D1.Swapping to a different USB port sometimes fixes this, sometimes not. A reboot always fixes it.It's extremely annoying.Does anyone have a quick fix or work around to restore the port? To me it looks as though the port has locked up or has a file/process lock on it, so won't reconnect/enumerate.Another annoying problem, probably a security feature is if you swap devices on a USB lead. Say you are flashing 2 devices. The first one goes to plan, you connect the second and all you get is "Access Denied". It's like the device ID binds to the USB port for a period of time to prevent people swapping in a malware device, but again... it's annoying.

author: AndyC_772
author_rank: Super Contributor
timestamp: September 14, 2020, 01:26:31 pm
content: Sorry, I use COM ports with Win 10 all the time and have never come across this behaviour.In fact, I'd go so far as to say that Win 10's improved handling of USB - serial converters (it can recover gracefully from the cable being disconnected at the USB end, not just the serial end) is the first, last andonlyway in which Win 10 is actually an improvement over Win 7.I use a powered USB 3.1 hub, and if I do have a USB problem, switching it off and on again almost always recovers it. It only takes seconds, much quicker than a PC reboot.

author: Fred27
author_rank: Unknown
timestamp: September 14, 2020, 01:45:25 pm
content: I've also worked extensively with commercial and custom products using USB COM ports in Windows 10 - including ensuring that disconnection and reconnection is handled. No problems at all.I suspect the problem may be with the device or the software that goes with it rather than Windows 10.

author: Ian.M
author_rank: Super Contributor
timestamp: September 14, 2020, 01:52:28 pm
content: I would suspect dodgy USB leads or worn-out USB connectors. If a Vbus powered device isn't getting quite enough voltage, all sorts of odd things can happen. Try using a powered hub, (which is a good idea anyway as it reduces the risk of blowing your motherboard's USB ports).

author: paulca
author_rank: Super Contributor
timestamp: September 14, 2020, 02:19:19 pm
content: Interesting. I am using a USB3.1 powered hub (with 4 USB3 ports, 3 Quick Charge 2.0 ports and a beefy PSU!)Pulling it's USB lead out and back in again cured the problem, thanks AndyC

author: ajb
author_rank: Super Contributor
timestamp: September 14, 2020, 08:30:09 pm
content: As others have said, I use tons of USB-CDC devices and never have any problems. "Access Denied" sounds a lot like an application isn't properly releasing access to the device.If reconnecting the USB hub fixes it, then it could be related to the hub itself. I have seen enough weirdo things happen when trying to debug embedded systems via USB hubs that I just bought a 5-port USB3 PCI card and use that via extension leads for basically everything that isn't a permanent fixture on my desk.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 14, 2020, 08:43:11 pm
content: I have a cheap hub that sometimes seems to not quite work as well as it should... usually power cycling it (replugging both its 5V adapter and the host USB) clears out the crud.Entirely possible it could be handled better by the OS, but who knows. Did a project with an EMC issue years ago, EFT knocked out the USB. Presumably, telling the driver (it was a multicore SoM running Linux) to just retry a few more times would've fixed it, but nah, with default configuration anyway, it was just giving up after enough failures (or just the right kind of failure that broke enumeration or something, I don't know).(Lesson from that project: USB is shielded for a reason. Customer insisted on using unshielded cables (IP rated circular connectors) for combined 12V power and USB comms (basically, making a bit of an industrialized, nonstandard USB cable). Ended up with shielded cables, metallic connectors and shielded enclosures, about doubling the product cost. Can't say I didn't warn them..)Tim

author: paulca
author_rank: Super Contributor
timestamp: September 15, 2020, 03:36:45 pm
content: Quote from: ajb on September 14, 2020, 08:30:09 pmYea, probably the hub. I actually suspect it's a "bounce" issue, seems much more likely to happen if I'm physically plugging/unplugging it. if I use the actual button they provided to swtich the port on/off it happens only rarely.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: September 16, 2020, 10:59:47 am
content: What kind of USB controller are you using? I've ran into issues with an AMD USB 3.10 controller.

author: Renate
author_rank: Super Contributor
timestamp: September 18, 2020, 11:43:57 pm
content: I may be out of date, but I don't know of any USB UARTs that are USB 3.0The other thing to bear in mind is that USB 2.0 and USB 3.0 areunrelated.They share a cable, they share a connector, they share a box but they are pretty much independent.You can take a USB 3.0 device, cut the USB 2.0 pins and it will still work on USB 3.0 but not USB 2.0(Of course the spec requires that USB 3.0 devices work on USB 2.0)

author: nuclearcat
author_rank: Unknown
timestamp: September 19, 2020, 01:55:03 am
content: Or install Linux, or run livecd - and check dmesgYou will know much more, than meaningless windows error messages.Also, Linux is very convenient for programming and flashing esp devices. Sometimes i run dedicated Linux server or raspberry just for such purposes.

author: NiHaoMike
author_rank: Super Contributor
timestamp: September 19, 2020, 03:46:35 pm
content: Quote from: Renate on September 18, 2020, 11:43:57 pmSome multifunction USB 3.0 controllers like the FX3 have UARTs. It's just silly to use one only for the UART.QuoteWhat about devices that require the bandwidth of USB 3.0 to work at all?

author: Renate
author_rank: Super Contributor
timestamp: September 19, 2020, 08:07:19 pm
content: Quote from: NiHaoMike on September 19, 2020, 03:46:35 pmWell, that may well be, but show me an off-the-shelf USB 3.0 that only does UART.Moreover, I have no idea what an FX3 does on a USB 2.0 connection.Quote from: NiHaoMike on September 19, 2020, 03:46:35 pmWell, that may well be, but the point is that any USB 3 device should respond/identify on USB2.0Whether it will fill your expectations is another matter.

author: tszaboo
author_rank: Super Contributor
timestamp: September 19, 2020, 08:26:40 pm
content: It's those CH341 and other chinese USB-serial converters and their drivers. They are a load of crap. I even had one of them BSOD my system, something that I haven't seen in a very long time.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: September 19, 2020, 08:27:20 pm
content: Quote from: Renate on September 18, 2020, 11:43:57 pmThe device itself may be Full Speed (USB 1.x) but the USB 3.1 Controller is xHCI.Back with USB 2.0 EHCI host controllers, which redirected USB 1.x traffic to either an UHCI or OHCI host controller,an xHCI controller handles all traffic, for all generations of USB. So, even if the protocols, as they appear on the wire, are different, there is the hostcontroller.And I have been experiencing troubles with this specific host controller, which showed up as "AMD USB 3.1"edit: controller -> host controller

author: nuclearcat
author_rank: Unknown
timestamp: September 19, 2020, 10:45:27 pm
content: Quote from: NANDBlog on September 19, 2020, 08:26:40 pmNever had issues with them on Linux. Might be bad cable or connector that fails too fast, but thats not CH341 to blame.More likely their Windows drivers are bad.

author: Bassman59
author_rank: Super Contributor
timestamp: September 20, 2020, 12:11:07 am
content: Quote from: nuclearcat on September 19, 2020, 10:45:27 pmWho writes their Windows drivers?

author: nuclearcat
author_rank: Unknown
timestamp: September 20, 2020, 01:51:02 am
content: Quote from: Bassman59 on September 20, 2020, 12:11:07 amTechnically it's WCH to blame. But i will blame mostly Microsoft, because:1)Windows is awful OS for "professional community contributions" on drivers. Linux have great drivers for such pieces because they are friendly in this matter.Silicon company might be terrible at software and even documentation (ST!), but when their product is great, volunteers might put enough efforts to make supporting software flawless (libopencm3).2)Microsoft doesn't put enough efforts in drivers review, to keep system stable. Linux maintainers do.3)HW manufacturer might throw in driver, and if it is up to standards - OS maintainers just easily keep hardware supported in newer versions, until they have users who want it.4)Cryptic errors on crash. We dont know even, what exactly is reason of crash, OS or driver. And we can't help WCH or Microsoft easily. In Linux i did bug report many times and got problem fixed within very short timeframe, and sometimes fixed by myself.Last example, i have ~10 years old _Microsoft_ branded fingerprint sensor, no longer supported in Windows 10. But works in Linux.

author: aargee
author_rank: Frequent Contributor
timestamp: September 20, 2020, 07:02:57 am
content: Have you tried disabling Windows power management of the port? Just a thought, I’ve had all sorts of trouble with Windows shutting down the power to ports when it thought fit.

author: David Hess
author_rank: Super Contributor
timestamp: September 20, 2020, 09:48:27 pm
content: I have had all kinds of problems with USB to serial converters; sometimes it is on the software side, and sometimes it is the hardware. My standard solution is to install an RS-232 expansion card into a PCI or PCIe slot.

author: BravoV
author_rank: Super Contributor
timestamp: September 21, 2020, 03:41:00 am
content: Quote from: David Hess on September 20, 2020, 09:48:27 pm+1, if its desktop, that is the best choice after what I've experienced various USB to serial nightmares.I use this (attached below) a PCIE x1 to 1 parallel + 2 serial ports WCH382L based card (there so many other variants too), and it just work. The driver for Windows 10 x64 and Linux x64 downloaded from the manufacturer's web works flawlessly, and its dirt cheap.

author: tszaboo
author_rank: Super Contributor
timestamp: September 21, 2020, 09:44:18 pm
content: Quote from: nuclearcat on September 20, 2020, 01:51:02 amFixed that for ya.Pushed out non Microsoft signed drivers, that crash the system.Microsoft reviews drivers, and they havent gave it's blessing, because it would auto install. It doesn't.It's the hardware provider's job to provide drivers. You can stop hating microsoft now.

author: nuclearcat
author_rank: Unknown
timestamp: September 22, 2020, 04:46:44 am
content: Quote from: NANDBlog on September 21, 2020, 09:44:18 pmThis is not a hating, it is a list of objective reasons why a certain software product lags far behind other products.I can name many more reasons why working with hardware seems like hell on Windows, especially with serial ports.Especially if you are developing something.

author: BrianHG
author_rank: Super Contributor
timestamp: September 22, 2020, 04:57:28 am
content: Just for knowledge: Altera/Intel USB Byteblaster JTAG programmer will interfere with open com ports on FTDI devices. Doesn't matter the com number. If you have an FTDI com port open, the Byteblaster gives you an access denied error. Closing the com port and retrying in the Byteblaster JTAG interface will work fine and then you can reopen the FTDI com port in your other app. Going in the other direction, trying to open a COM port while JTAG programming, your FTDI usb to RS232 interface become un-useable until you stop the JTAG processing and remove-reconnect the FTDI RS232 converter device.Evidence seen on Win7 and Win10 alike...

author: tszaboo
author_rank: Super Contributor
timestamp: September 22, 2020, 07:04:30 am
content: Quote from: nuclearcat on September 22, 2020, 04:46:44 amNone of what you wrote was true. Easy as that. What you should be writing:1) Windows is closed source. If you ask for "professional community contributions", you are clueless.2) You dont know about signed drivers.3) You dont know about signed drivers.4) You dont know where crash logs go.

author: nuclearcat
author_rank: Unknown
timestamp: September 22, 2020, 10:08:46 am
content: Quote from: NANDBlog on September 22, 2020, 07:04:30 amYou just don't get it.1) Totally irrelevant.MacOS mostly closed source, but they handle it well.Windows have "Windows Driver Kit", WinUSB and similar tools. But they are just awful. libusb written using it. You can write driver for windows over libusb, but usability of libusb installation on Windows specifically - bad as well, even Dave failed on that.You don't need to open OS sources to have freeware/opensource contributors writing for it. Well documented and developer-friendly API and tools, and being friendly to contributors more than enough.2,3) FYI Linux have signed drivers as well, if you wish so. Difference they enforce it only where it is required to be done, single line, module.sig_enforce=1. On distributions where it is a requirement it is enabled by default.Difference that Linux and MacOS goal to protect user without sacrificing usability. Btw, you might know, MacOS considered much more secure than Windows in many institutions, while being more friendly to users.4)I know where it goes. It is just so cryptic and uncomfortable to work, that nobody really want to deal with it.For example, on driver crash many people hesitating to provide minidump because it often contains confidential data, while on Linux in most cases it is enough to have stack trace from dmesg or pstore, and it doesn't contain anything sensitive.

author: Renate
author_rank: Super Contributor
timestamp: September 22, 2020, 01:15:51 pm
content: Quote from: BrianHG on September 22, 2020, 04:57:28 amThat's interesting.I have a Digilent CMOD-A7 that uses a FTDI FT2232.That has an interface for JTAG and another interface for a regular FTDI UART.I can open the JTAG in Vivado Hardware Manager and independently open the UART in Putty or whatever.Windows-wise and USB-wise there should be no problem with independent programs splitting this.Maybe Byteblaster is snarfing the UART too?

author: Ian.M
author_rank: Super Contributor
timestamp: September 22, 2020, 01:42:05 pm
content: FTDI USB UARTs also cause issues with Sigrok Pulseview.If you have been using a Salae logic 8 clone or a number of other USB logic analyzers with Sigrok on a Windows PC, Pulseview may crash repeatedly on startup when it tries to scan for the logic analyzer, or if you get past that with the-Dcommand line switch, will crash when you attempt to select many USB logic analysers. A workaround is to unplug the FTDI device until Pulseview is up and running and has established its logic analyzer connection, at which point you may plug it back in and use both it and Pulseview normally.

author: perieanuo
author_rank: Frequent Contributor
timestamp: September 22, 2020, 02:37:24 pm
content: the easy-peasy solution:just install virtualbox, install your favorite os (windows, linux...) with drivers, make snapshot and cut vm from internetit will work FOREVERi've been there, updates that f...k your drivers, 30 minutes to repair the damned thing.last time tpm driver was dead after w10 update, bitlocker on system drive==dead.they are using kids for dev, like everyone in IT, at least on some part of the OS, they don't test thouroughly, result is bug after bug even on simple stuff.regards, pierre

author: NorthGuy
author_rank: Super Contributor
timestamp: September 22, 2020, 03:28:06 pm
content: Quote from: Renate on September 22, 2020, 01:15:51 pmFT2232H has two independent USB channels (compared to FT232H which only has one). This is practically the same as if you had two FT232H chips. In your particular case, one channel is used for JTAG, the other one is used as a virtual com port. These are different interfaces, and different drivers, although on some systems both drivers are united. If you had only one FT232H, you could use either com port or JTAG, but not both together.

author: Renate
author_rank: Super Contributor
timestamp: September 22, 2020, 04:23:21 pm
content: Oh, so you're saying that the ByteBlaster is using an FT232H?Well, then any craziness is to be expected.

author: NorthGuy
author_rank: Super Contributor
timestamp: September 22, 2020, 04:44:23 pm
content: Quote from: Renate on September 22, 2020, 04:23:21 pmNo. I'm not saying that.

author: Buriedcode
author_rank: Super Contributor
timestamp: September 22, 2020, 04:49:27 pm
content: Quote from: Renate on September 22, 2020, 04:23:21 pmNo, the ones I've seen - official, clones, and my own clone, all used the FT245.I've no doubt someone could make one using the FT232R or H, but I haven't seen it.I have also had the byte blaster running, with an FT2232C and FT232R on the same machine, debugging the same hardware at the same time on windows 10, and had no issues.With that said, I had elected to not update the FTDI drivers, by disabling driver update for those devices ages ago.

author: BrianHG
author_rank: Super Contributor
timestamp: September 23, 2020, 02:51:46 am
content: Quote from: Renate on September 22, 2020, 01:15:51 pmIf the JTAG port open in Quartus or Quartus Prime? If not, it's obviously not an USB-BLaster Quartus device I described.USB-Blaster is not configured or recognized as an RS232 device, it has it's own drivers made by Altera/Intel. It just uses the FTDI chip as the USB front end & they wont open their hardware if you have another FT232 device with an open com port running in the system.

author: BrianHG
author_rank: Super Contributor
timestamp: September 23, 2020, 03:01:02 am
content: Quote from: Buriedcode on September 22, 2020, 04:49:27 pmYes, the 2 on the system work together until you push the 'PROGRAM' button in Quartus' JTAG window.Maybe it is the way the COM port has been opened on a few of the test systems I have noticed:921600,N,8,1, no handshaking.

author: tru
author_rank: Regular Contributor
timestamp: September 23, 2020, 06:05:57 am
content: Quote from: NANDBlog on September 19, 2020, 08:26:40 pmI have used 2 of these chinese CH341 USB serial converters I got from ebay and have never had a single crash or BSOD under Windows 10. Most likely you were using very old non signed drivers.Btw I did not manually install any CH341 driver. The driver was installed automatically by Windows (most likely from the internet), I see it is version 3.5.2019.1 and is digitally signed by Microsoft. I suggest you remove the manually installed one and just let Windows 10 install it automatically.They work flawlessly with reading and flashing Renesas M16C MCU, these are used in industrial vat fryer controllers that I maintain. I have done this many times. I have also used it to program old M68HC11 MCUs (used in industrial temperature controllers). They are connected directly to the TTL side of the converter.