Teensy Fails to Upload or to Blink or run, Wonder if it got bricked?
Steps to get a fresh blink upload to your Teensy
*Setup IDE* {section below}
Unplug your Teensy
Close Teensy Loader.
make sure : Tools / USB Type: is "Serial"
Open and compile a sketch like below in the IDE.
When it fails to find the Teensy and says press button.
On the
unplugged Teensy
press and hold the button
Plug the Teensy in - Pause - release the button.
Wait and watch Teensy Loader - perhaps open the : Help / Verbose Info window.
{ allow 5-10 seconds for Windows(other) to see the device if it programmed - if it is installing the driver don't interrupt it }
Ideally that will upload a USB sketch that is properly recognized. The LED will blink and Windows will recognize the Teensy on USB and you can open the Serial Monitor [check Tools/Port] to watch it print dots. Edit the Code somewhat to alter the USB printing and Try a normal upload with a single Teensy connected.
If that fails Unplug and repeat those steps as needed -
but plug into a different USB port, or a HUB, or cable.
Windows USB can go to an odd(er) place when it sees a series of insert/removals that are not properly resolved. Once this works you should not see this again as Windows will have the working driver associated with Teensy.
I've not 'damaged' a Teensy - and these steps have gotten me through the software connect confusion states that have shown in different ways on Windows.
> If you have a second working Teensy connect it once and download this sketch to see your system work, then retry the steps above.
>
Have a good USB cable - not a charge only cable,
good cables can go bad.
> If this fails, restart your machine with Teensy unplugged and begin again above.
Code:
// https://forum.pjrc.com/threads/31518-Can-t-communicate-with-Teensy-3-2-through-Teensyduino?p=88073&viewfull=1#post88073
#define qBlink() (digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) )) // Pin13 on T3.x & LC
void setup() {
Serial.begin(38400);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
while (!Serial && (millis() <= 4000))
{ qBlink(); delay(50); }
Serial.print("\nSetup() OK :: millis()==");
Serial.println(millis());
Serial.println("\n" __FILE__ " " __DATE__ " " __TIME__);
}
elapsedMillis emilBlink; // Teensy way to delay action without delay()
int8_t loopCount = 0; // Print a NewLine periodically
void loop() {
if ( emilBlink > 1000 ) {
qBlink();
emilBlink = 0;
Serial.print(".");
loopCount += 1;
if ( 40 < loopCount ) {
loopCount = 0;
Serial.println("!");
}
}
}
*Setup IDE*
> Make sure you have a supported
version of the Arduino.cc IDE installed
> Perhaps Download the current ZIP and unzip to a fresh directory
> Have a
current version of TeensyDuino Installed
> In process BETA versions typically listed here :
forum.pjrc.com/forums/6-Announcements
> A failure during install may mean some software element is stuck in memory, restart the machine and do setup again.
> Under IDE : Tools /Board - make sure
your Teensy model is selected
> Under IDE : Tools /USB Type - make sure the setting is >
USB Type: "Serial"
> Under IDE : Tools /CPU Speed - make sure chosen speed is
not marked (No USB)
>
Other standard Troubleshooting tips here: http://www.pjrc.com/teensy/troubleshoot.html
General notes:
> Teensy Button takes it OFFLINE into Program mode, it is not a Reset button.
> Factory blink is nice, but it will not show up as USB like the above sketch.
> If Teensy doesn't run right when not connected to PC USB - in setup() check for "while( !Serial );" This won't timeout but the above code does.
A better Serial Monitor:
I generally use
TYQT for USB Serial debugging interface:
TYQT :: Teensy-Qt. It is more robust and has added Teensy Specific features ( GUI Reset and Upload and connectivity information Serial and HID )
> If you have questions or issues with TYQT please read/post on that thread.