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

j.adams124

New member
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.
 
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?
 
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.
 
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.
 
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.
 
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!
 
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.
 
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.
 
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:
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:
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.
 
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...
 
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.
 
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.
 
also, make sure you feel confident about the USB hardware on your computer...
This morning I couldn't connect to / upload code to my teensy and kept returning to software explanations until I simply tried a different USB port on my laptop which worked perfectly. I've noticed the USB ports on my 2012 macbook pro are a bit finicky power wise - so make sure you feel confident about your hardware before you go down other paths
 
I also have this issue with Ubuntu

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.

Hi George, I also have this issue with Ubuntu. I am a bit confused, what do you mean with " the install bit with the 49 in it" and "You have to copy a file somewhere".


Thanks
 
from the webpage:
[h=2]Linux Installation[/h]
  1. Download the Linux udev rules (link at the top of this page) and copy the file to /etc/udev/rules.d.
    sudo cp 00-teensy.rules /etc/udev/rules.d/
  2. Download and extract one of Arduino's Linux packages.
    Note: Arduino from Linux distro packages is not supported.
  3. Download the corresponding Teensyduino installer.
  4. Run the installer by adding execute permission and then execute it.
    chmod 755 TeensyduinoInstall.linux64
    ./TeensyduinoInstall.linux64
 
Around February-March 2021, the udev rules filename changed from "49-teensy.rules" to "00-teensy.rules". Old messages on this forum and old versions of Teensyduino before 1.54 probably still mention "49" because we used that filename for many years.

The change was prompted by a problem on very slow Linux systems, particularly Jetson Nano, where the Arduino Serial Monitor would see the device and try to use it before the udev rules had been fully applied. I didn't dig too deeply into the cause. Renaming the file from 49 to 00 seemed to solve the problem.

Several other changes went into the udev rules with the 00 rename, and into the build of Teensy Loader for 1.54, to solve a number of other problems which have turned up on various Linux systems in 2020 and early 2021. So if you find any of those old 49-teensy.rules files, don't use them. Get the latest 00-teensy.rules.

When you run the Teensyduino 1.54 installer, it will check whether 00-teensy.rules is installed properly. If not, you'll get a message. The installer puts a copy in the /tmp folder and gives you a command to just copy into a terminal (the installer doesn't do this automatically because it is designed to never try to obtain root access to your system).
 
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.

Code seems to matter in my case. I am having problems when using the SPISlave_T4 library. Are there any recommendations to troubleshoot such issues?
 
This problem just popped up on my Teensy 4.1
Fedora and Windows are both reporting the same error in the Arduino IDE.

When I go to program (and I've tried my main codebase, as well as blink and some others) Teensy Loader Window briefly reports:
Arduino is attempting to put Teensy into program mode
And then the compiler window in Arduino reports:
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.
An error occurred while uploading the sketch

I also don't get the red programming LED.

I've tried holding the button when rebooting, etc... to no avail.
Last code flashed on the unit runs great, but I can't update it. Board is also (and has been since way before this problem) soldered into a PCBA so it's a bit hard to swap out.
I tried it on another Teensy 4.1 and it programs fine, red LED, etc...

Thoughts?
 
First check the USB connector and cable for damage or other issues.

If you do the 15 sec restore, the flash memory gets completely wiped and a known-good program is written. If the hardware is all good, that's exactly what you want, so it will communicate again. But if there's damage to the USB connector, you could end up with an erased Teensy and no way to program new code.
 
I tried holding the button for 15 seconds - never got a red flash, nothing... Code keeps running - like I didn't even press it.
Tried a couple of other USB cables as well.
(Might have left this out earlier) Programming does reset the Teensy - and restarts my code, but does not reprogram. Hmmmm...

I'm building an engine monitor with about 30 channels of I/O, ~6 serial ports: A teensy 3.6 back by the engine with ~20 channels (thermocouples, pressures, temps, etc...) and a 4.1 running a ILI9488 touchscreen, data logging to an SD card, GPS communications, USB downloading and some more data acquisition.
On another project, I have 2 4.0's talking to a raspberry pi +7" touchscreen as an RV (Airstream) power control, water control and monitoring, weather, etc...
These things are awesome! I tell everyone don't even bother with an Arduino when there's Teensy's! Now if I can only remember to connect Rx to Tx and Tx to Rx when I design boards!

PXL_20220617_203203338.jpgPXL_20220617_203151676.jpg
 
Back
Top