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

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

  1. #1

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

    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!

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,837
    Quote Originally Posted by coward.cameron View Post
    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.

  3. #3
    Quote Originally Posted by PaulStoffregen View Post
    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?

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,122
    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

  5. #5
    Quote Originally Posted by defragster View Post
    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!

Posting Permissions

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