Can't communicate with Teensy 3.2 through Teensyduino

Status
Not open for further replies.

tony2001

New member
I bought 2 Teensy 3.2 boards. When first connected to a USB port both demonstrated the blink program. I successfully installed Teensyduino in an Arduino 1.6.5 environment. When I connected a Teensy board and compiled and tried to upload a program, Windows reported a USB error. Device manager revealed it to be a "Windows 7: unknown device Code 43" problem. The Teensy Troubleshooting page says: Windows Code 43 is a mystery.

I have tried uninstalling and reinstalling the device driver. I have completely reinstalled Teensyduino. Nothing works. The USB cable I am using is the same one I use to connect my phone to Zune on my PC, so I am sure it's a data as well as power cable.

The second board suffered the same fate. Now neither board executes the blink program, and they both simply light the Orange LED.

Can anyone suggest what I might do? Is there a test I can perform to establish whether the boards are dead or alive?
 
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.
 
Last edited:
Glad to hear it worked! Is there one spot you could see things going better where your process was different?
 
What was different about your suggestion from everything else I tried was to hold down the Teensy reset button while the Teensy was unplugged. I don't think that's obvious and it would be a valuable addition to the Teensy documention.

Thanks again.
 
Hi all,

What all the solution defragster has given works fine with USB but my teensy 3.2 is not working with battery.
Kindly give some solution in battery prospective.
 
Yes, I used the same and the teensy(3.2) working fine with USB but not at all working with cell phone battery.

But my other teensy's(3.2 and 3.1) is working with cell phone battery.

I have total 3 teensys (3.2,3.2,3.1).
 
Glad the steps worked on 2 - of course they should work on all three - something odd there. Has the odd one been soldered to?

You could use a version of the code above with all Serial removed since it will never help on a battery only situation. If that doesn't work to blink on all 3 you need to follow up with other troubleshooting specs or remedies - checking voltages etc.

Code:
#define qBlink() (digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) ))  // Pin13 on T3.x & LC
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, HIGH);
  qBlink();
  delay(200);
}

elapsedMillis emilBlink;
void loop() {
  if ( emilBlink > 1000 ) {
    qBlink();
    emilBlink = 0;
  }
}
 
soldered with what?

The above is not working with that odd teensy.

one more thing I see here is when I dump the led blinking program on teensy it works fine till the loder window is present.

Once I close the loader and press reset with USB inserted the program stops working.

Don't understand this behavior.
 
Last edited:
If you have soldered anything to it - you'd know better than I would :)

What all the solution defragster has given works fine with USB but my teensy 3.2 is not working with battery.
Kindly give some solution in battery prospective.

If you can get the code in Post #11 and #4 to work as I did on one Teensy and not the other then something is odd - especially if they all work when running on the PC USB cable.
 
I didn't solder anything and sorry I can't post the code as it is official and confidential.

But the code is working fine on battery with other 2 teensy's. I guess something went wrong at the firmware level.

As the code only works when teensy loader forces to press reset button than program gets dump and code start working.

kindly let me know if you know any debugging way.
 
That button is only to enter program mode - not a reset button - it sounds like it is working to allow code updating. With no PC on USB - the button will simple take the Teensy offline.

If you can run the sample code above as is to see the problem - other code not an issue.

But you must be clear on the steps you are taking on each unit and what the effect is for a given process - showing where the 'ODD' one doesn't conform.
 
One way others have produced these mysterious Windows errors is using Serial.print() inside C++ constructors. Accessing any other C++ object from within the constructor of an object that's statically allocated is not allowed. This isn't just Teensy. It's a well known limitation of C++, called the static initialization order fiasco. Impossible to know if you're doing this, just a guess, but I tell you some other reports of similar issues turned out to be this problem once we investigated.

sorry I can't post the code as it is official and confidential.

If you want good support here, you're going to have to create a non-confidential version that reproduces the problem. That's how we work here.

No matter how secret your project, I'm confident with some work you can create a public code sample without any secret or proprietary info.
 
Hi all,

What I figured out is probably below is a reason why my teensy is not responding via battery.

I'm giving power to LM386 based audio amplifier and Winbond serial flash from teensy only so at the start probably they take much power and not giving enough power to start teensy.
The above reason because when I am disconnecting the LM386 the teensy starts working fine even with battery and after that I back connect the LM386 and everything goes smooth.
If above is correct kindly suggest the better way of powering things as I am using Winbond serial flash along with LM386 based audio amplifier only and I am powering both from teensy.
 
Do you mean that you power the LM386 from the Teensy's internal or onboard 3.3V regulator? Why not power it directly from the battery since it has a wide input voltage range from 4 to 12V? This would prevent inrush current problems (seen that the LM386 needs a 100uF capacitor on the supply rail).
 
Ok, I've looked around, but can't find an answer to this. How do I "push the reset button" on the Teesy 3.2? It's a little "pad" ... do I short it to ground? 3.3V? short the two little pads near there together? It's unclear to me.

My teensy became unresponsive while I was working on things; the project is a bit complex, perhaps I am doing too much in an interrupt handler, or each loop. I don't know. But, whatever the reason, I now can't get it to respond an reprogram.

I tried following the above advice, but it isn't working, and suspect my setup. I've got a teensy 3.2, an audio board, and a small power board (https://www.tindie.com/products/onehorse/lipo-battery-charger-add-on-for-teensy-31/) to power it over USB and battery. It has been working great, and I don't think I did anything to cause real electrical damage. The light for the power board still work (green when on, red one comes on if I plug a different, non-charged battery in).

Thanks for any advice.
 
Does your Teensy 3.2 look anything like this?
http://pjrc.com/store/teensy32.html

If so, see the button on the right side? If not, then i am guessing that it's damaged or that you don't have a real Teensy 3.2. Also, none of those pictures that you linked to show a Teensy - i guess that's just the LiPo module.
 
hahaha. How mortifying. yes, I see it. And, sure enough, it worked. wow. I'm all good now! Thanks so much.

With all the references to "the 3.x has a reset pin" I had simply assumed there wasn't a button, and hadn't looked between the

(I have the audio board mounted on that side, the reverse of the way it's suggested to be mounted in the pictures, because that's the only way I could also get the lipo board on too).
 
Hi Paul,

Attached is the schematic of which i made the PCB and I only checked the blinking program and its working fine.
But when I disable the bootloader by not shorting the J14 the LED stops working.
Kindly tell how to remove the bootloader once the programming done.

custom_teensy.jpg

Also, when I disable the MKL02 and connect the MKL04 via J11 nothing's getting detected.
 
I just barely read your schematic. Next time, post a PDF.

Disconnecting power to the MKL02 does not remove it from the circuit. Some chips have special I/O pins meant for hot-plug devices, where the pin acts as a high impedance when the chip is unpowered. But the MKL02 is *not* such a chip!

I really need you to understand this type of custom design assistance is something I do only as I have extra time. It's far beyond normal support for Teensy. I really do hope you manage to get your product working, but please understand I may not be able to keep answering these sorts of questions.
 
Status
Not open for further replies.
Back
Top