Teensyduino randomly loses USB port while programming 4.1 board

Status
Not open for further replies.

kg4rul

Member
I am trying to use the Teensy 4.1 board in a new project. I have version 1.8.13 of the Arduino IDE with Teensyduino 1.5.3 installed.

The bottom status line of the IDE reads: Teensy4.1, Serial, Faster, English, on usb:0/140000/0/5

When I click upload, the program compiles and the Teensyduino popup appears. Sometimes it automatically programs the board. Other times, the button on the board needs to be pressed. Still other times, the message erasing appears and the program hangs. OR it does nothing.

I have tried different cables and USB ports on the computer (WIN10 w/current updates) with no change is these behaviors.

Any suggestions?:confused:
 
Can you repro this uploading the simple example Blink sketch?

Win 10 used here exclusively and this isn't seen here. Been using T_4.1 since first pre-release beta board - same with T_4.0 and not had such issues.

Typical setup is a USB3 Hub from a USB3 port - and have managed to keep/get good cables. T_4.1 with 480 Mbps USB requires a good data cable, perhaps try another cable, or port or USB Hub connect pathway?

If the problem recurs, in TeensyLoader the 'Help' menu item has 'Verbose info' that shows the interactions that can be saved to a file and posted for Paul's review in case it shows something.
 
UPDATE: I was using the 3.3V output of the Teensy 4.1 to power a small LCD display. Apparently the current draw was causing the USB port to behave erratically. I am now powering the display from another source and the problem seems to have corrected itself (fingers tightly crossed).
 
@kg4rul I have had similar issues. In my case, it is a cheap 4 port hub that has trouble providing the current. If I plug directly into the laptop, it has no problems at all. If I plug my project in closer to the cable end of the hub it *almost* always works. I suspect that I am right on the edge of what the little hub can do. Check out my QRZ.com page to see the project in question. I am using the Adafruit HX8357 based 480 x 320 display with the Teensy 4.1.
73,
Len, KD0RC
 
To emphasize:

- I am using the native port on an windows 10 PC and NOT using a hub
- I have tried using four different USB cable with the same results as above
- I am powering attached devices from a separate 3.3V power supply with a common ground connection for all devices and the Teensy 4.1
- The bottom status bar of the Arduino IDE reads "Teensy 4.1, Serial, Faster, US English on usb 01/140000/0/3".
- The first time you access the "Port" field in the "Tools" dropdown it reads: "hid#vid_16c0&pid_0478 Bootloader (Teensy 4,.1)".
- The next and subsequent times it reads: "[no_device]Bootloader (Teensy 4,.1)".


When the upload starts, the window has the "AUTO" button in Green
I press the Teensy button, the read light by the USB port illuminates and I get a message that says "Erasing" that remains for up to 30 seconds and then is replaced with a "DOWNLOAD ERROR" message.

Up till about nine days ago, the upload process worked reliably.

Any thoughts?
 
- The next and subsequent times it reads: "[no_device]Bootloader (Teensy 4,.1)".

Seeing "[no_device]" means something is going wrong in Windows. What exactly, and why, I can not say. I can only explain what "[no_device]" means.

Every Teensy reboots, the USB disconnects because it's native USB built into the processor. This is distinctly different from boards like Arduino Uno and ESP32, where the connection is from a dedicated USB-serial chip which doesn't reboot when the main processor does. With Teensy, and with Arduino's native USB boards like Leonardo/Micro/Zero/MKR1000, the USB shuts off while the processor is rebooting. To your PC, it is as if you had physically unplugged the cable and then you quickly plug it back in as the processor boots up again.

When anything about your PC's hardware configuration changes, Windows will send a WM_DEVICECHANGE message to all programs which have requested to be notified of changes. While Arduino is open, the "teensy_ports.exe" program runs in the background to listen for those messages and figure out which Teensy you've connected and what mode it is using.

Typically Windows will send several WM_DEVICECHANGE notifications as Teensy starts up. One is sent when the main USB host controller driver detects the USB device. Then as Windows identifies each interface within the USB device, it will load whatever driver it uses for that interface and send another WM_DEVICECHANGE.

When teensy_ports.exe gets that first WM_DEVICECHANGE, it can see Teensy is present but no drivers have loaded yet. It creates a record so it can tell Arduino to show something when you click the Tools > Ports menu. (how the communication & info is managed between Arduino & teensy_ports is a bit more complicated, but I'm going to gloss over those details) The important thing to know is "[no_device]" is the name teensy_ports assigns when it hears that first WM_DEVICECHANGE and querying Windows for details shows only the main USB device has been detected but the drivers for interfaces haven't loaded. Only a matter of milliseconds later Windows would normally load its built-in HID driver for ID 16C0:0478, which has just one HID interface. When teensy_ports gets that 2nd notification, it's supposed to learn the actual HID interface name and replace "[no_device]" with that info.

Why that's not happening on your Windows machine, I can not say. The best I can do is write this lengthy message to explain how this process is supposed to work. Teensy is appearing to your PC, but for reasons unknown the teensy_ports program either isn't getting that 2nd WM_DEVICECHANGE or Windows isn't giving it the info about the HID interface.
 
I think I have found the problem. I had previously connected a TFT display to the 3.3V output of the Teensy 4.1. I think it was drawing too much current from the TLV75733P regulator and may have damaged it. When I cut the jumper connection from VUSB to the regulator and supplied 3.3V to the 3.3V pin of the Teensy, it programs without problems. Since the project I am working on was going to supply 3.3V from a small, switching power supply, to the teensy, display and other devices, no harm done and I can still use the Teensy.
 
Status
Not open for further replies.
Back
Top