Issues with teensy 4.1

Jimbean123

New member
Hi all,
Have had esp32’s and arduino’s with no issue but got the new 4.1 teensy as an upgrade but it does not work correctly. Using windows 10 and have programs uploading using the teensy program but the computer is making the usb connection sound every couple of seconds and serial port disconnects. Do I have a faulty unit or is it the PC? When looking at the device manager it keeps popping up and then disappearing I am using different leads and no joy. Any help would be great as i dont wanna send it back for a simple issue I can fix
 
It sounds like the code is causing the Teensy to Crash and then reboot.
Can we see your code, without this it's just guesswork.
When you enter your code place it between code tags using the </> button.
 
Hi it was not the code was only doing a keypad matrix and moved over to the arduino and that was ok. Now plugged in the teensy tried a simple for loop printing up-to 2000 with delay and worked so loaded the program back up and now working without a pip. Hoping thats solved as it was doing it on a blank sketch loaded up before very strange.
 
@Jimbean123:

Your reply indicates that you don't want to believe that repeated Windows connect/disconnect indications is almost certainly your code crashing (if a crash continues to occur, this connect/disconnect behavior will repeat on an 8-second cycle). Also, what do you mean when you say the reset cycle was occurring on a "blank sketch" ?? Code that runs successfully on a different Arduino platform may or may not run correctly on the Teensy (which is typically WAY faster, typically has WAY more RAM, potentially includes MUCH different hardware capabilities, & almost certainly uses different libraries), & not very likely to succeed without modification, so attempting to draw any conclusions with such a comparison is not valid.

If you ever suspect any kind of a hardware problem, here's what you should follow (in this order) to be able to clearly rule that out (If any step is unsuccessful, then concentrate on that step until you can definitively determine the cause):

1) On a Teensy 4.x, you can execute a "factory reset" by following the procedure detailed <here>, which will leave the Teensy 4.x running the factory default Blink sketch
2) Using the Arduino IDE, build the example Blink.ino (unmodified) & load that into your Teensy [ this also verifies that you can successfully program your Teensy 4.x ]
3) Using the Arduino IDE, modify the example Blink.ino sketch in some way (make it blink twice, or make it blink twice as fast, or make it blink some recognizable sequence of blinks), build & load that into your Teensy
4) Using the Arduino IDE, return to your sketch that seems to be having a problem, include the following in your setup() function (making sure that the Arduino IDE Serial Monitor is open to see if anything is reported), build & load that into your Teensy:

Code:
while (!Serial);
if (CrashReport) Serial.print(CrashReport);

Note that with the Crash Report monitor written this way (specifically, the while (!Serial);), it will wait forever if the Serial Monitor is not open or connected, so this added code should be commented out and/or removed after you've identified & resolved the cause of your crash.

Mark J Culross
KD5RXT
 
Last edited:
Back
Top