Invalid port on Windows 10

nefarious

Active member
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?
 
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?
 
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.
 
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:
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
@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
 
@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?
 
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?
 
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
 
Back
Top