Sorry for the long post, but I can assure you that its length is merely to fully convey a potential work-around to the inability to upload to the Teensy without pressing the PROGRAM button !!
I occasionally have similar problems uploading to multiple Teensy 4.x devices which are embedded in a multitude of different projects. In my particular case, I have narrowed it down to the following set of repeatable circumstances (I call this my "shake the rubber chicken" solution . . . you know, shake the rubber chicken & the problem goes away . . . but, does the rubber chicken really have anything to do with the solution, or is it merely a happy coincidence ?!?!?):
EDIT: I forgot to mention that all of these screen captures were done with a Teensy 4.0 running the unmodified BLINK example, with absolutely nothing else connected. So, in this case at least, it's not likely anything going on within the Teensy itself . . . this one is strictly something going wrong with Windows !!
When I am unable to upload to my Teensy(s) without pressing the PROGRAM button, I have noticed the following in Device Manager (I'm running Windows 11 Pro, Version "24H2", OS Build "26100.3037", Experience "Windows Feature Experience Pack 1000.26100,48.0"):
I have an extra device that shows up under the category "Other devices" & is identified by Windows as "USB Serial", always with a yellow triangle on it as follows:
Double-clicking on that (failed) device reveals the following (NOTE, in particular, the indication that "The drivers for this device are not installed. (Code 28)"):
Now, here's the rubber chicken:
If I right-click on that failed USB Serial device, and select "Uninstall device", as follows:
And this warning is presented:
Following the uninstall, the ability to upload to the Teensy without pressing the PROGRAM button is restored !!
I have no idea how nor why this failed device is being created (the "magic" of Windows & its associated registry at work !!), but its presence seems to be interfering with the Teensy upload process in a very deterministic & detrimental way.
Hope that helps . . .
Mark J Culross
KD5RXT
P.S. I'm willing to take any suggestions for further troubleshooting of this particular set of circumstances in order to help pin down an explanation of the actual cause and/or determination of the actual solution, if even there is one (again, this is Windows !!). In the meantime, I'll continue shaking the rubber chicken & making use of the positive results of doing so, even if it shouldn't be having any effect at all !! MJC