My Teensy Is Stuck Pressing Keys, and Now I Can't Upload New Code

Status
Not open for further replies.

coward.cameron

New member
Hello!

I'm working on a project in which I'm using the Teensy 3.2 as an HID keyboard. Unfortunately, I messed up my code and it is constantly inputting characters every 90 milliseconds or so. Because it's inputting text, I can't upload new code.

Is there anyway to fix this?

I've tried resetting it and uploading the new code very quickly, but that doesn't help. I have also tried uninstalling the "keyboard" in Windows device manager. Putting the cursor on a comment line doesn't help either, as it gives me this error:

Code:
Error opening HID device
  Windows Error Info: The process cannot access the file because it is being used by another process.
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.

Obviously I have tried pressing the hardware button to enter programming mode, but because it's trying to send text it doesn't remain in programming mode (from what I can tell).

Any suggestions you all can provide would be very welcome!
 
Obviously I have tried pressing the hardware button to enter programming mode, but because it's trying to send text it doesn't remain in programming mode (from what I can tell).

You need to turn off Auto mode in Teensy Loader. By default Arduino turns it on, so be aware it goes back into Auto mode if you do almost anything in Arduino.

When Auto mode is off, Teensy will remain in programming mode. Keep that small Teensy window visible, so you can see when it's actually in programming mode.
 
You need to turn off Auto mode in Teensy Loader. By default Arduino turns it on, so be aware it goes back into Auto mode if you do almost anything in Arduino.

When Auto mode is off, Teensy will remain in programming mode. Keep that small Teensy window visible, so you can see when it's actually in programming mode.

Thanks for the reply! But, I'm confused. How would I upload the new code without touching the Arduino IDE?
 
If I follow and remember the buttons/steps:

> take Teensy Loader app off Auto per p#2
> allows pressing Program Button on Teensy and have it stay in bootloader mode, and not Auto Load
->> May need to unplug Teensy USB and Press Button while plugging it in
> Compile a safe sketch with Verify in IDE GUI

Then Teensy Loader has GUI button to Program and RESET Teensy to run the new code
 
If I follow and remember the buttons/steps:

> take Teensy Loader app off Auto per p#2
> allows pressing Program Button on Teensy and have it stay in bootloader mode, and not Auto Load
->> May need to unplug Teensy USB and Press Button while plugging it in
> Compile a safe sketch with Verify in IDE GUI

Then Teensy Loader has GUI button to Program and RESET Teensy to run the new code

That worked! Thank you so much for your help!
 
Status
Not open for further replies.
Back
Top