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

Thread: Invalid port on Windows 10

  1. #1

    Invalid port on Windows 10

    I have been building away for a few weeks now and all of a sudden the Windows port for my teensy board, a Teensy 3.2, is:

    Port: "hid#vid_16c0&pid_0478 Bootloader (Teensy 3.1)"

    If I shutdown to power off the problem is repaired for a few turns.

    Is there a way to get an idea of what is going on, what I could be doing wrong?

  2. #2
    Is it that no one has ever heard of this? It happens at upload time and sometimes the teensy can't reboot after the upload.

    I took all of my code out of the equation, and started with a fresh copy of blink.
    Blink doesn't do much so it works every time.

    So I added the ILI9341_t3 library and it worked well, for more then 10 reboots

    I then added XPT2046_Touchscreen and found it is causing the issue.

    Is there a teensy specific version of this library?


    #define TCS 5
    #define TIRQ 2

    XPT2046_Touchscreen ts(TCS, TIRQ);

    I am using the same interrupt pin as that of the sample.
    Just the above is enough to cause the problem. Is it known to work?

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,226
    Might be a hardware problem. Did you buy this Teensy 3.2 direct from PJRC, or through a distributor?

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,226
    Just to answer your "idea of what is going on" question, from the info you've given, sounds like the board is mistakenly going into bootloader mode as if you had pressed the pushbutton. So perhaps check the PROG pad on the right hand side, to make sure you haven't accidentally touched it with a wire or anything else that might be shorting it to ground (which would be the same as pressing the button).

    Obviously this isn't supposed to happen with normal programs when you don't physically press the button. Damaged or defective hardware where the PROG pin is getting messed up would be the plausible cause.

  5. #5
    Quote Originally Posted by PaulStoffregen View Post
    Might be a hardware problem. Did you buy this Teensy 3.2 direct from PJRC, or through a distributor?
    Not sure, I bought some from you and some from adafruit. Depends on what else I need for the project.

    Not sure where the prog pad is? If you are referring to the program pin, then nothing is touching it.
    Last edited by nefarious; 01-16-2022 at 01:19 AM.

  6. #6
    Sometimes I get the message:

    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.

    The port listed in the menu seems correct. When I press the button nothing happens.

  7. #7
    Definitely a defective teensy. I took one from a project I am no longer using and works like a champ.

  8. #8
    The same issue is now happening on the other teensy.

    What I would like to know, is there any way the program I am writing could cause this problem.
    My plan is to get a 4.1 to implement this project on and I just want to better understand this issue.

    Both teensy's that have this error have had the USB power trace cut and are powered by a wall wort and a voltage regulator chip. Hasn't been touched in years.

    I get messages:
    Unable to reboot the first time it goes bad.
    If I try to upload Blink, I get an Download Error

    Sometimes Windows will say: USB device Not Recognized.

    The Teensy can run for many hours without this issue coming up, when it happens, I have to wait a period of time and it solves itself.
    How long the device will continue to operate is random, sometimes a full day, sometimes a few uploads.

  9. #9
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,226
    Quote Originally Posted by nefarious View Post
    What I would like to know, is there any way the program I am writing could cause this problem.
    Probably not.

    To really mess up a Teensy 3, you need to craft a very special program which both erases a part of the flash memory, and then programs it. If you change the FSEC and FOPT bytes in flash memory, you can cause very strange problems, even permanently brick your Teensy. Things can go also awry in very strange ways if you turn on the NMI feature and you have external circuitry which drives pin 33 low.

    Usually these aren't much of an issue, because it's just not common to create program which self-modify the flash memory. But if you're created a program which writes to flash, and it might mistakenly write to that 2nd sector (which would usually end up destroying part of your program), it is theoretically possible.

    Anything might be possible if you have counterfeit Teensy boards from an Aliexpress vendor. Just running the CPU at a slower clock might brick such boards. Again, only theoretical, since definitely not an issue if you purchased from Adafruit or direct from PJRC.

  10. #10
    So, given that all went way over my head, I can assume this isn't caused by my code. Then it is safe to say, something else is in play and getting a 4.1 is a good idea. Thanks.

  11. #11
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,226
    If you'd like me to check, you can post your HEX file and I'll program it onto a Teensy 3.2 here. To get the hex file, you can use click Sketch > Export Compiled Binary. Or you can turn on verbose output during compilation in File > Preferences, and then look at the pathnames in all the compiler messages to find the temporary folder where Arduino is compiling your code and creating the HEX file.

    When replying, click the "Go Advanced" button to get to the full editor which lets you attach a file to your message.

  12. #12
    Quote Originally Posted by PaulStoffregen View Post
    If you'd like me to check, you can post your HEX file and I'll program it onto a Teensy 3.2 here.
    Thank you for this, I am in the middle of a change I want to get done. Then I will attempt to upload it until it no longer works. If I get that state, I will send the hex file for that version. If it doesn't happen, I will also tell you that.

  13. #13
    I tried to upload the hex file and got the message that the file was invalid? Is there something I need to do differently? I pressed the paper clip and followed the prompts.

  14. #14
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,226
    put it into a zip file and try attaching the zip to your message

  15. #15
    I think I added it, Can't tell from here.
    Attached Files Attached Files

  16. #16
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,226
    I uploaded your HEX file several times to a Teensy 3.2 here. Every time, my computer (running Ubuntu 20.04 Linux) properly detected the serial port (as /dev/ttyACM0, the name normally used on Linux). Since I only have the HEX file, I ran "teensy_reboot" in a terminal to cause the upload to happen automatically. Every time it was able to automatically find and upload to the Teensy which was running with your previously programmed HEX file and complete the upload successfully.

    Here's a quick screencast, so you can see exactly what I did and what I saw here.



    While this is Linux and you're using Windows, hopefully it can at least confirm this HEX file is good and isn't somehow damaging the Teensy 3.2 it runs upon.

  17. #17
    Thank you, I use Linux for almost everything except arduino, I can't handle hoe the IDE works. They should move it to eclipse.

    So, I feel safe getting the new teensy, thanks for your effort. I do wonder what is going on here.

  18. #18
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,226
    Before you completely give up on those boards, maybe trying them with your Linux machine (assuming it really is Linux running natively, not inside a VM). Or even with another Windows machine.

    Sometimes "mysterious" problems seem to happen on Windows which never get fully resolved, even with something unexpectedly fixes them. Clearly the HEX file is ok, and if Teensy is communicating at all with your PC, its hardware is probably good. So even if everything else about Windows seems to work, might be worthwhile to try with a different computer.

  19. #19
    Senior Member
    Join Date
    Jul 2014
    Posts
    3,440
    @nefarious
    if you have not done yet,
    eliminate (uninstall) ALL unused HID and Com ports with the device manager
    (activate view -> show hidden devices)
    This ensures that you get a clean port when you add teensy

  20. #20
    Quote Originally Posted by WMXZ View Post
    @nefarious
    if you have not done yet,
    eliminate (uninstall) ALL unused HID and Com ports with the device manager
    (activate view -> show hidden devices)
    This ensures that you get a clean port when you add teensy
    Thanks for this, I am not a windows guy, I use it as infrequently as possible.
    I am not sure what you mean. I did the View->Show hidden device and I see in the Ports group
    3 Teensy USB[com4,com6,com7] and 2 others[com3, com5]
    Is this where you want me to look?

    I have a mouse on a usb port and a thumb drive on another.
    I think this explains com3,com5;

    Should I unplug the teensy and uninstall them?

  21. #21
    Quote Originally Posted by PaulStoffregen View Post
    Before you completely give up on those boards, maybe trying them with your Linux machine (assuming it really is Linux running natively, not inside a VM). Or even with another Windows machine.

    Sometimes "mysterious" problems seem to happen on Windows which never get fully resolved, even with something unexpectedly fixes them. Clearly the HEX file is ok, and if Teensy is communicating at all with your PC, its hardware is probably good. So even if everything else about Windows seems to work, might be worthwhile to try with a different computer.
    I think the boards are still good and once I get code uploaded to it, they seem to run fine. I am not going to ditch them.

    My original plan was to use both boards, one for the UI and one for the Machine. Then the Machine talks to the UI as an SPI device or over a UART. I could still do that but when you offer the Teensy 4.1 with all the pins, all the power, for $30, why would I do all that extra work, as fun as it would be?

  22. #22
    Senior Member
    Join Date
    Jul 2014
    Posts
    3,440
    Quote Originally Posted by nefarious View Post
    Should I unplug the teensy and uninstall them?
    If the teensies are working, no need.
    If the uploading is not working, you may clean the HID devices (Human Interface Devices)
    Only these are used for uploading, not com devices

Posting Permissions

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