Cannot download code to Teensy 4.1 (Win 10 PC)

davec

Member
After 1 month of successful use, I suddenly cannot download code to Teensy 4.1. It appears that my Windows 10 PC is no longer recognising the Teensy properly - see screenshot. I have tried a new USB cable but still no success.

Can this be fixed or is the Teensy broken? Teensy LED is red.

Clipboard01.jpg
 
I had similar behavior if previous sketch run some complicated math and take a lot of power resources that my laptop's USB cannot feed. I see it already when T4.1 consume 0.2A and more from USB. I fixed it by external 5V power supply to my teensy and never meet the same problem after.
 
T_4.1 LED and the image shown indicate it is in bootloader mode for some reason.

Is the Teensy responsive to a ~15 second Hold of the Button - then release the button when it blinks a FLASH from Off to On at that point?

Normal case then is 15 second Restore - on Button release the RED LED will go ON during FLASH clearing and restore of factory BLINK ( with no USB ) when the RED LED goes off the Pin #13 Orange LED should begin a 1 second blink cycle.

It should now be in a factory new state for the processor where a Button Press is required for the first upload. Start with a simple blink sketch.
 
That process does seem to work (15 sec hold, then red light, then orange blink) but I still cannot download new code. And the port info is now different:Clipboard02.jpg
 
At least the port info shows the restore process did work. That process wipes the memory and writes a known-good LED blink program which communicates as RawHID using vic 16c0 pid 0486. Seeing it appear properly in the ports menu also means your USB cable is good and USB is working.

Why you can't upload, I do not know. But all signs so far look like hardware is good. Very likely something is going wrong software-wise on your PC.

Some questions (since I can't see your screen)...

After Verify or Upload, the small Teensy Loader window is supposed to appear. Do you see it?

If you click Help > About in the Teensy Loader window, what version number does the About info show? (1.56 is the latest, and 1.53 is the oldest which works well with Teensy 4.1... if you have older than 1.53 you need to install newer software, since Teensy 4.1 was released in April 2021)

If you press the button on your Teensy, while keeping your eye on that window, does it respond in any way?

When you click Upload in Arduino, after compiling, Arduino is supposed to take control of the Teensy Loader window. The "press button..." message should change to "Arduino is attempting...", and the filename shown on the bottom status bar is supposed to update to whatever your program's name is. In rare cases, the localhost networking which allows these programs to communicate (only on the same PC) gets messed up. Not seeing "Arduino is attempting..." or the filename update are the sign localhost communication isn't working.

Also hidden in that Help menu is "Verbose Info" which gives a *lot* of detail about everything the software is doing. It's Log menu lets you save to a file, which you can share here. If using "Quick Reply" on this forum, click "Go Advanced" to get the full editor which lets you attach a file.
 
Also, if you have access to another computer, just trying on another machine is probably the quickest and easiest thing to try.

Again, appearing in the ports menu with the expected HID ID numbers is a pretty sure sign the hardware is good. So maybe just trying fresh on another computer can help you see the hardware is working.
 
Thanks for helping!

After Verify or Upload, the small Teensy Loader window is supposed to appear. Do you see it? YES, version is 1.55.

If you press the button on your Teensy, while keeping your eye on that window, does it respond in any way? Yes. A "press button" message shows briefly.

Tried upload again, log attached. (DOWNLOAD ERROR)

View attachment log.txt
 
This might be a sign Teensy is struggling to communicate. Unfortunately we don't get access to very low-level info in Windows about USB communication trouble, so the best I can do is guesswork.

Code:
17:55:59.116 (loader): [B]program: write error[/B]
17:55:59.117 (loader): HID/win32: HidD_GetPreparsedData ok, device still online :-)
17:55:59.118 (loader): end operation, total time = [B]31.261 seconds[/B]
17:55:59.120 (loader): set background IMG_[B]DOWNLOAD_ERROR[/B]

Maybe try a different USB cable? Or if you have a USB hub or adaptors between your PC and Teensy, try going with the simplest and most direct connection possible.
 
So I have a new Teensy 4.1, new USB cable and trying different USB ports. Still getting problems! Suspect it is now my PC USB h/w? I am getting frequent "WM_DEVICECHANGE DBT_DEVICEARRIVAL" messages on the log which accompany the usual sound when a USB device is removed. Extract below. Any ideas what is causing this?
17:13:14.432 (ports 1): WM_DEVICECHANGE DBT_DEVICEARRIVAL
17:13:14.433 (ports 1): update_usb_device, devinst list change, old had 1, new has 2
17:13:14.433 (ports 1): comport_from_devinst_list attempt
17:13:14.433 (ports 1): found Ports in classguid_list at index=1
17:13:14.433 (ports 1): port COM10 found from devnode
17:13:14.433 (ports 1): usb_add: usb:80001/3/0/2 COM10 (Teensy 4.1) Serial
17:13:14.434 (ports 1): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
17:13:14.434 (ports 1): nothing new, skipping HID & Ports enum
17:13:19.397 (ports 1): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
17:13:19.398 (ports 1): remove: loc=usb:80001/3/0/2
17:13:19.398 (ports 1): usb_remove: usb:80001/3/0/2
17:13:19.398 (ports 1): nothing new, skipping HID & Ports enum
17:13:19.411 (ports 1): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
17:13:19.411 (ports 1): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
17:13:19.411 (ports 1): nothing new, skipping HID & Ports enum
17:13:21.057 (ports 1): purge, name=COM10 (Teensy 4.1) Serial, loc=usb:80001/3/0/2, age=1.659 sec
 
DBT_DEVICEARRIVAL means Windows just detected a new device connected to your computer, and DBT_DEVICEREMOVECOMPLETE means Windows just realized a device disconnected.
 
Back
Top