Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 16 of 16

Thread: Teensy did not respond to a USB-based request to enter program mode.

  1. #1
    Junior Member
    Join Date
    Jan 2018
    Posts
    3

    Teensy did not respond to a USB-based request to enter program mode.

    Hi all.

    This is actually my first Teensy, and hence my first project with it so it's entirely likely that there's something simple that I'm overlooking with this. I've connected a button to my Teensy 2.0, and I'm essentially trying to have it push the 'W' key when pressed.

    My process for attempting to load this very basic script into the Teensy is, as far as I can tell, correct. I've set the board to 'Teensy 2.0', and set the USB type to 'Keyboard' in Arduino (1.8.5).

    When I plug the Teensy in, the orange LED blinks. From there, I press 'Verify', the Teensyduino program opens and I press the button on the Teensy, and the light stops blinking. Just like it told me to when I was installing the Teensyduino program.

    The problem is that when I press upload, the display says:

    "Teensy did not respond to a USB-based request to enter program mode.
    Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch."

    When as far as I'm concerned, I did this.
    This is the only thing written on the display (other than 'Sketch uses xyz bytes' etc.).

    Any assistance would be greatly appreciated.
    Thanks.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,579
    Watch the Teensy Loader window when you press the button on the Teensy. You should see it show your Teensy and "Programming" then "Reboot OK". The programming goes quickly, so it's easy to miss if you're not looking or the Teensy Loader window is minimized or behind another window.

    If nothing happens in the Teensy Loader window...

    Check your USB cable - some cables sold for phone charging have no data wires, only power.

    Check any USB hubs or other stuff between the Teensy and computer

    Check the Teensy. Is the cable plugged in? Is the board damaged? It is a genuine Teensy or Chinese fake?

  3. #3
    Junior Member
    Join Date
    Jan 2018
    Posts
    3
    Actually, when I plug the Teensy in and press verify, the Teensy loader window just says "Press Button on Teensy to manually enter Program Mode". I can then proceed to press the button. While the light stops blinking, the Teensy loader window remains completely unchanged.

    The board itself is undamaged, and it's certainly not a fake (I bought it directly from the PJRC website). It may be in the USB cable, so I'll certainly look into that.

    Thanks.

  4. #4
    Quote Originally Posted by j.adams124 View Post
    Hi all.

    This is actually my first Teensy, and hence my first project with it so it's entirely likely that there's something simple that I'm overlooking with this. I've connected a button to my Teensy 2.0, and I'm essentially trying to have it push the 'W' key when pressed.

    My process for attempting to load this very basic script into the Teensy is, as far as I can tell, correct. I've set the board to 'Teensy 2.0', and set the USB type to 'Keyboard' in Arduino (1.8.5).

    "Teensy did not respond to a USB-based request to enter program mode.
    Please press the PROGRAM MODE BUTTON on your Teens
    I had this problem in Ubuntu. I had not done the install bit with the 49 in it. Once I did that it was fine. You have to copy a file somewhere.

  5. #5
    Junior Member
    Join Date
    Jan 2018
    Posts
    3
    It turns out the problem actually lay in the cord that I was using. All works fine now and my homemade joystick works perfectly. I'll definitely be buying more Teensies in the future, since they're very good to work with. Thanks for the replies.

  6. #6
    Junior Member
    Join Date
    Mar 2019
    Posts
    6
    Quote Originally Posted by PaulStoffregen View Post
    Watch the Teensy Loader window when you press the button on the Teensy. You should see it show your Teensy and "Programming" then "Reboot OK". The programming goes quickly, so it's easy to miss if you're not looking or the Teensy Loader window is minimized or behind another window.

    If nothing happens in the Teensy Loader window...

    Check your USB cable - some cables sold for phone charging have no data wires, only power.

    Check any USB hubs or other stuff between the Teensy and computer

    Check the Teensy. Is the cable plugged in? Is the board damaged? It is a genuine Teensy or Chinese fake?
    I actually have the same problem with Teensy 3.6 and Windows. What I find most frustrating, is that it sometimes works to upload new code. It takes me between 3 and 30 tries every time I want to update the code. There's no USB hub between Teensy and the computer, I bought a new quality cable and it is a genuine Teensy.

    My feeling is, that it helps when I disconnect everything from the Teensy before uploading. However, I have soldered the Audio shield to it already, so this is not easy to take off every time I want to change the code.

    And also, disconnecting the Teensy from the rest of my electronics is a bit of an annoying procedure, as I'm usually testing a lot during the developing of the firmware.

    Do you have any suggestions how I could get the uploading work every time? This would be so helpful!

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,579
    Quote Originally Posted by royrobotiks View Post
    Do you have any suggestions how I could get the uploading work every time?
    Have you tried on a different computer? Maybe a non-Windows machine? If the same problems happen on different computers, that's a pretty strong indication the issue may be on the Teensy side.

    Often using a powered hub helps. USB 2.0 hubs have a "transaction translator", where your PC sends packets to the hub at 480 Mbit/sec and the hub actually does the 12 Mbit/sec communication to your Teensy. Best to use a powered hub, if you have one with a power adaptor.

    If the problem is on the Teensy side, does the code matter? Maybe try uploading the LED blink example. If the code affects uploads, that's a sign something is going wrong with blocking interrupts or staying in low power modes, or other stuff that prevents the USB port from working.

    If the problem is on the Teensy side and seems to be hardware related, it's time to start watching the 5V and/or 3.3V lines with a voltmeter or oscilloscope. Many hardware issues turn out to be power related.

  8. #8
    Junior Member
    Join Date
    Mar 2019
    Posts
    6
    Thanks a lot for the quick answer. Now I have a few things to try

  9. #9
    Senior Member
    Join Date
    Apr 2017
    Posts
    187
    What version of Windows are you using and do you have any virus checking software running?
    I have Win7 and McCafe. I can rarely upload code to my Teensy 3.2 unless I disable real-time scanning.

    Once real-time scanning is turned off, Teensyduino works perfectly.

  10. #10
    Junior Member
    Join Date
    Mar 2019
    Posts
    6
    I'm also using Windows 7. Thanks for the tip! I'll try that as well.

    Edit: Ok, I tried it without Virus scanner - the problem is still there. I'm waiting for the delivery of a powered USB hub and then I'll report again.
    Last edited by royrobotiks; 03-15-2019 at 05:45 PM.

  11. #11
    Junior Member
    Join Date
    Mar 2019
    Posts
    6
    Quote Originally Posted by PaulStoffregen View Post
    Have you tried on a different computer? Maybe a non-Windows machine? If the same problems happen on different computers, that's a pretty strong indication the issue may be on the Teensy side.

    Often using a powered hub helps. USB 2.0 hubs have a "transaction translator", where your PC sends packets to the hub at 480 Mbit/sec and the hub actually does the 12 Mbit/sec communication to your Teensy. Best to use a powered hub, if you have one with a power adaptor.

    If the problem is on the Teensy side, does the code matter? Maybe try uploading the LED blink example. If the code affects uploads, that's a sign something is going wrong with blocking interrupts or staying in low power modes, or other stuff that prevents the USB port from working.

    If the problem is on the Teensy side and seems to be hardware related, it's time to start watching the 5V and/or 3.3V lines with a voltmeter or oscilloscope. Many hardware issues turn out to be power related.
    I have tried now the following things:

    - Different computer
    - Virus scanner off
    - Powered USB hub
    - Checked the power lines with oscilloscope (they look good)

    The problem still exists and I have decided to order another Teensy. I hope that this will work better.

    For the moment I just have a question: What does it tell that the Arduino IDE always shows the Teensy in the Ports when it is connected (it actually shows twice - as Teensy serial and as Teensy)? I assume that there must happen some communication between the laptop and the Teensy, so that the computer knows that a Teensy is connected. I also assume, this shows that the USB cable works correctly. Are those assumptions correct or is there still a chance that the cable is the problem?
    Last edited by royrobotiks; 03-19-2019 at 08:51 AM.

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,579
    Quote Originally Posted by royrobotiks View Post
    For the moment I just have a question: What does it tell that the Arduino IDE always shows the Teensy in the Ports (it actually shows twice - as Teensy serial and as Teensy) when it is connected? I assume that there happens some communication between the laptop and the Teensy, so that the computer knows that a Teensy is connected.
    Yes, this is true for all USB devices. When you plug in a device, your PC (the "host" in USB lingo) notices something new has connected and sends several queries to discover what type of device it is and do certain types of necessary configuration that some devices need. This process is called "enumeration" in USB speak (and indeed USB is filled with lots of other terminology...)

    So your PC always knows what USB devices are connected. On Microsoft Windows, you can see this in the Windows Device Manager, which updates as you plug and unplug. On Linux, "lsusb" shows the connected devices, and commands like "tail -f /var/log/syslog" can show you the kernel's syslog messages which will tell you the details as USB devices connect and disconnect.

    Teensy appears twice in the Ports menu because about 1 year ago we added a Teensy-specific way to check whether it's connected. This was done because Arduino's way (the "Serial ports" section of that menu) sometimes doesn't work, especially on Windows 7 machines where driver installation gets messed up. Arduino's menu also doesn't detect Teensy if it's been programmed in any non-serial modes, or when it's in bootloader mode (if you have Teensy Loader auto mode turned off and you press the button on your Teensy). The Teensy Ports way knows how to detect all those cases, so it always shows whether your Teensy is connected, even if using non-Serial modes Arduino doesn't understand.

    Before version 1.42, many people wasted a lot of time trying to troubleshoot their hardware, when in fact it was all working fine. Arduino's normal Ports menu only works when Teensy is using Serial mode communication, and when lots of driver & Java stuff is correct. The Teensy-specific part of that menu uses native APIs from each operating system (no Java libs involved) to give a far more reliable view of whether the hardware is really connected. It can even see if the USB is connected but Windows hasn't loaded a driver, and will show "[no driver]" in the spot where a COM# would normally appear. This is less of an issue today as more people are thankfully moving away from the terrible Windows 7 & 8 to Windows 10 where USB works much better.


    I also assume, this shows that the USB cable works correctly. Are those assumptions correct or is there still a chance that the cable is the problem?
    If Teensy is appearing in the Ports menu, and you don't happen to have another Teensy connected elsewhere on your PC, then that's a very sure sign the USB cable is good and the communication is working.

    But plenty can still go wrong on your PC. If some other software is automatically opening the serial port, that can interfere with Arduino's ability to access it. On Linux, the Gnome Modem Manager is often a problem if you haven't properly installed the udev rules file (and many years ago there were several buggy versions of Modem Manager which didn't properly check the udev rules). On Windows, apparently Autodesk has some sort of software for managing 3D printers, which tends to assume it should automatically open the port for any Teensy.

  13. #13
    Junior Member
    Join Date
    Mar 2019
    Posts
    6
    Just wanted to report - programming the new Teensy works now without any problems

  14. #14
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,579
    Any idea what was wrong? Any tips to share for other Windows 7 users who might hit the same issue?

    Window is often the hardest system, even though it's used by the most people, because so many problems never get any useful info...

  15. #15
    Junior Member
    Join Date
    Mar 2019
    Posts
    6
    Quote Originally Posted by PaulStoffregen View Post
    Any idea what was wrong? Any tips to share for other Windows 7 users who might hit the same issue?
    It's hard to tell what was the cause of the problem, as I've changed a few variables at the same time:

    - My new board is a Teensy 3.2 (this worked right away under Ubuntu) and the old board was a Teensy 3.6 (this caused problems with Windows 7, 10 and Ubuntu)
    - I haven't tried to program the new board in Windows, as I had the feeling that the compiler works much faster under Ubuntu

    What I've learned furthermore was, that I invested a bit too much time and money in buying different USB cables and the USB hub. This would have been not necessary, as the Arduino IDE always showed the Teensy in the Ports. Thus, (at least some) communication via USB always worked.

  16. #16
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,579
    Yup, Linux seems to run the compiler much faster than Windows.

    Windows 7 also seems to detect new USB devices *very* slowly, especially if they're composite devices with several interfaces (like Serial + MIDI + Audio) - sometimes so slowly that any reasonable person would think it gave up or just didn't work.

Posting Permissions

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