Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 2 1 2 LastLast
Results 1 to 25 of 39

Thread: Can't communicate with Teensy 3.2 through Teensyduino

  1. #1
    Junior Member
    Join Date
    Nov 2015
    Posts
    4

    Can't communicate with Teensy 3.2 through Teensyduino

    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?

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,573
    I'd try with a different USB cable, though, as well as on a different USB port, too.

  3. #3
    Junior Member
    Join Date
    Nov 2015
    Posts
    4
    Thank you for the suggestion. I have now tried that but with the same result.

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    11,507
    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 by defragster; 05-30-2018 at 09:20 PM. Reason: TYQT link and Updated code

  5. #5
    Junior Member
    Join Date
    Nov 2015
    Posts
    4
    That worked!

    Thank you for the clear instructions and thank you both for the prompt responses.

    Tony

  6. #6
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    11,507
    Glad to hear it worked! Is there one spot you could see things going better where your process was different?

  7. #7
    Junior Member
    Join Date
    Nov 2015
    Posts
    4
    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.

  8. #8
    Senior Member
    Join Date
    Feb 2016
    Posts
    122
    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.

  9. #9
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    11,507
    Did you use above sketch setup? Most common usb issue is infinite while in setup

  10. #10
    Senior Member
    Join Date
    Feb 2016
    Posts
    122
    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).

  11. #11
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    11,507
    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;
      }
    }

  12. #12
    Senior Member
    Join Date
    Feb 2016
    Posts
    122
    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 by npashine; 03-07-2016 at 08:38 AM.

  13. #13
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    11,507
    If you have soldered anything to it - you'd know better than I would

    Quote Originally Posted by npashine View Post

    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.

  14. #14
    Senior Member
    Join Date
    Feb 2016
    Posts
    122
    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.

  15. #15
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    11,507
    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.

  16. #16
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,825
    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.

    Quote Originally Posted by npashine View Post
    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.

  17. #17
    Senior Member
    Join Date
    Feb 2016
    Posts
    122
    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.

  18. #18
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,573
    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).

  19. #19
    Senior Member
    Join Date
    Feb 2016
    Posts
    122
    ya Theremingenieur now I am keeping the power separate.

  20. #20
    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/oneh...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.

  21. #21
    Member
    Join Date
    Apr 2016
    Location
    South Carolina, USA
    Posts
    25
    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.

  22. #22
    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).

  23. #23
    Senior Member
    Join Date
    Feb 2016
    Posts
    122
    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.

    Click image for larger version. 

Name:	custom_teensy.jpg 
Views:	194 
Size:	92.7 KB 
ID:	7491

    Also, when I disable the MKL02 and connect the MKL04 via J11 nothing's getting detected.

  24. #24
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,825
    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.

  25. #25
    Senior Member
    Join Date
    Feb 2016
    Posts
    122
    I understand everything Paul but I'm about to finish my project which has a huge value.
    If possible kindly help me to figure this out.MicrowaveTech_Design_Final.pdf

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •