Teensy 4.1 Windows 10 serial not working [No Device]

M_Azevedo

New member
I'm working with Teensy 4.1 on up to date Windows 10 with Teensyduino 1.56, and I can't get the system to recognize the USB serial device.

With a brand-new Teensy, it shows up in my system as a raw HID device, as expected:

Fresh_board.png

If I then upload the blink sketch with "Serial" selected as USB type, the upload goes fine but the port shows up as [no_device] and there is an error message in the device manager. Trying to reinstall the driver in device manager fails to find a driver, and trying to install a driver from the Teensyduino installer comes up with "Windows 10 USB serial driver found. No driver installation needed."

Ard_afterupload.png

DM_afterupload.png

If I try to upload code from this state, the Auto function on the loader fails and I have to press the button to enter programming mode.

I've experimented with the "Serial + (other)" with similar results.

If I set the USB Type back to "raw HID" Auto upload works correctly again.

I've tried two different Teensy boards and built-in and hub USB ports and gotten the same result.

I use a USB to RS-485 adapter on this system and it works as expected, though it is not currently connected.

This seems to be a Windows issue, does anyone have suggestions for getting the Teensy serial port to load properly?
 
Windows 10 and Teensy connect without any extra driver as noted.

If the build works properly there should be no problem, with a good cable.

TeensyDuino 1.57 just released after beta period. Nothing in that should affect function there - but if the install is corrupted then installing the 1.57 should correct that for a good compile and normal function should be seen with [ USB Type: "Serial" ]
 
I tried installing 1.57 and no change in the issue. I think the next thing is going to be pulling out another computer and seeing how it goes.
 
I tried installing 1.57 and no change in the issue. I think the next thing is going to be pulling out another computer and seeing how it goes.

That was just for sanity - would have been nice if it cleaned it up. Promising the Teensy working as RAW_HID ...

basic\Blink sketch doesn't have any print()'s ... Typically here a Serial.println( micros() ); in the one second LED change area will be enough to see it to prove it working with the Blink.

Using a second computer might show hardware or IDE 1.8.19 problems ... Good Luck.
 
Oh how I wish I knew why Windows sometimes does this, and of course how to fix it. But I don't. Well, other than "fix" by simply using another computer which isn't messed up.

Questions of "what" are a lot easier to answer than "why". And the first step to investigate "what" involves looking at the Windows Device Manager under "Ports". Does Teensy appear as a COM port? Or maybe there is something with a yellow error icon? Really just guessing here, as I can't see your screen. I do know "[no_device]" means the Teensyduino received a notification message from Windows that hardware changed, and it used Configuration Manager and Setup API to get info about the hardware, where Windows said it had detected the USB device, but had not detected (or loaded the driver) for the serial port within the USB device. That is the circumstance which causes Teensyduino to show "[no_device]" in the Tools > Ports menu. That's the "what" answer. Why this happens and how to fix it, I really don't know. Well, other than use another computer.
 
I posted a screenshot of the device manager. It shows up under "Other Devices" as "USB Serial" with the yellow warning triangle. I'll be switching computers tonight.
 
Ah, I missed the screenshot earlier. Pretty clear Windows isn't loading its driver. Why is a mystery.

Typically Windows drivers have 3 parts, the actual device driver code which often has .SYS extension, a text file with instructions of which devices use that driver which has a .INF extension, and a digital signature which has .CAT extension. All 3 are published by Microsoft as part of Windows 10.

Earlier versions of Windows were missing the INF file. Why Microsoft decided for so many years not to publish an INF file to cause their own driver to load for devices which follow the USB standard "communication class device" specs (an official USB standard since 1999) is hard to imagine. But they finally came to their senses about it with Windows 10. The Teensyduino installer only checks whether the INF is present, because Windows XP, Vista, 7, 8 had the SYS driver but didn't have the INF. It does this check by using Windows Setup API functions SetupGetInfFileList and SetupOpenInfFile and SetupGetLineText to look for an INF which contains specific directives like "UsbSerial_Service_Install" & "ServiceBinary" with "usbser.sys". The installer never directly reads INF files directly from disk. It always uses those Windows Setup API functions to check whether Windows had an INF installed that will load the USBSER.SYS driver.

So one possible scenario (just guesswork really) is your Windows install may be missing USBSER.SYS, but does have the INF which the installer is able to find and verify. Every driver from Microsoft should have their digital signature in a corresponding .CAT file, but if the driver is missing its signature, the default security policy not to use unsigned drivers could also come into play. Maybe?

Windows stores info about detected devices in the Windows Registry. For USB this is rather silly, since all the needed USB descriptor info is read as part of detecting the device (called "enumeration" in USB lingo). So it's also possible (more guesswork) that Windows has the right drivers and the INF file is fine (very likely since the installer verified it) but something about the stored USB device info in the Windows Registry is corrupted, causing Windows to not use the device, even though it reads good fresh info during USB enumeration.

The sad reality is these sorts of problems get "solved" by using another computer or "trying random things until it works" which leads to no understanding of what was really wrong or what to do if the problem happens again. And I can tell you, this problem is relatively rare but has come up many times over the years. Back at Teensyduino version 1.42, I put a lot of work into the software to redundantly check for both the serial device and the USB device detection, so I could put in the code that specifically checks for this situation and prints "[no_device]" in the Ports menu. But still to this day, I have no idea why it sometimes happens, or what the proper solution really is (other than simply using another Windows computer or switching to Linux).
 
FWIW, a similar problem sometimes happens on Linux, but it's pretty easy to diagnose by the kernel syslog messages. It's almost always a scenario where someone uses an unusual Linux distro designed for small single board computers or other limited systems, where the kernel is shipped without a lot of the commonly used drivers, probably to reduce disk space used.

But with Windows, USBSER.SYS should always be present. Microsoft has included it with every version of Windows, at least all the way back to Windows XP and Windows 2000 (but their driver had limitations before XP SP3 and Vista SP1 and all Windows 2000 which won't work with the USB "interface association" descriptors commonly used today). Windows 10 should always have the USBSER driver, and the INF so it loads automatically.
 
Last edited:
Back
Top