COM-Port problem

Status
Not open for further replies.

Tony31

Member
Hey there,

I am new here and have no experience with Teensys.

What´s the problem:
I have written this little Sketch, which should just return "Hello World" at the serial monitor and uploaded it to my Teensy 3.6.
But it said me: "No serial port, please select with Tools > Port"
So I went to Tools, but couldn´t select Port.
Then I went to the device manager. There I have seen that my Teensy is connected to the PC, but no COMs.

Code/Sketch:

void setup() {
Serial.begin(38400);
}

void loop()
{
Serial.println("Hello World");
delay(1000);
}

Hardware:
Teensy 3.6
Arduino IDE 1.8.5
Windows 10

It would be nice, if someone could help me :)
Thank you
 
If this is a nice new and Shiny Teensy 3.x, which you have not programmed before, the Teensy has been reprogrammed simple blink program that does not create a USB serial port and as such does not show up as a COMxx

What you should try is with your simple program, choose Teensy 3.6 as the board type. And have USB Type as Serial.
Choose the Verify/Compile command, which should compile your program and should bring up the Teensy program.
Now go to your teensy and press the program button on the board. You should then see the Teensy program show a download progress and at that time you should see your computer say something like setting up new device and then assign a COMxx port to your teensy. As long as your Teensy has a program on it with a USB type that includes Serial, you can then just choose the Upload command in the Arduino IDE to program it again
 
Teensy uses HID protocol, not serial, for uploading. So the first big question is whether you're able to upload that sketch at all?

The Tools > USB Type menu sets which type of USB device Teensy becomes when it runs your program. It's supposed to default to "Serial", but if it's changed to some other setting without serial, then Teensy isn't supposed to ever appear as a serial device. Double check that it's set to Serial.

If things aren't working, it's entirely possible something has gone wrong in the Windows registry regarding the USB device detection. Windows 10 is much better than 8, 7 & XP, but it still can happen. As a first sanity check, try setting USB Type to MIDI or RawHID and upload. Then open the serial monitor. It uses HID to emulate serial, so you should see the printing "just work" without selecting any port. HID is detected automatically.
 
Thank you for your Reply!

@KurtE
I have tried this way, but nothing happens. I also tried it with a simple blink sketch, to make sure that my teensy isn´t faulty.

Code:
const int led = LED_BUILTIN;

void setup() {
pinMode(led, OUTPUT);
}

void loop() {
digitalWrite(led, HIGH);
delay(100);
digitalWrite(led, LOW);
delay(100);
}


The LED is blinking, so the communication between PC - Teensy is working, but in this case i don´t need the serial monitor.


@PaulStoffregen
1) Yes I can upload sketches.
2) It has always been set to serial and I have not changed anything.
3) This is exactly the problem. The Teensy is mentioned in the device manager as HID and as USB controller but no COM.

The interesting thing is that I can upload sketches, but can´t use the serial monitor, because of no port.
 
you must enable the usb serial port in setup --> Serial.begin(300); <-- the value doesnt matter as it runs full speed 12mbit, then the port will show on the pc...

next, sketches are not uploaded via serial, its uploaded via HID, so not weird at all, just very fast :)
 
I think there is an obvious mistake which I always do again.

So I have changed the BAUD rate. Uploaded it to my Teensy. Started the sketch. Nothing happens.
Just: "No serial port, please select with Tools > Port" but I can´t select Port. Here we go again. :(
 
Did you try this (from message #3)

As a first sanity check, try setting USB Type to MIDI or RawHID and upload. Then open the serial monitor. It uses HID to emulate serial, so you should see the printing "just work" without selecting any port. HID is detected automatically.
 
Yes, when I open the serial monitor comes this: "no Connection".
And I have tried both USB types MIDI and RawHID.
 
This is very strange. When you have uploaded a sketch using RawHID, the serial monitor uses HID protocol which is the exact same driver the Teensy Loader uses to program your board. It really should "just work".

Please try again. Make sure the serial monitor is closed, and USB Type is RawHID. Then upload and watch Teensy Loader to make sure the upload worked, so you can be sure the Teensy really is using RawHID. Then open the serial monitor again.

Be careful to follow ALL those steps in the correct order.

If it *still* does not work after those steps, please post a screenshot so we can see the error.
 
So, I have tried all steps in the correct order like you have said it.
The IDE says me "no connection".
Unbenannt.jpgUnbenannt3.jpgUnbenannt2.jpgUnbenannt4.jpgUnbenannt5.jpg
 
Ok,

Check your Tools/Port menu and see if there is now a valid item to select.

After you upload the program using RAW HID, I showed a similar issue, when I first tried it, if I had unplugged the board after it had been programmed as RAW HID.

That is I took a T3.6 board that had been programmed with USB: Serial which showed up as COM6. I then created program like yours, Set USB to RAWHID and uploaded the program to the Teensy... It worked. I then unplugged the Teensy, exited, the Arduino IDE... I then plugged in the Teensy and reloaded the Arduino IDE. I then uploaded the program again, which worked, but the Arduino monitor would not open... It still said for COM6 and the closed message.

However, I then looked at the Serial port menu and it now had a COM15 like object listed, I choose that one and now the serial monitor opens and my hello world messages show up.
 
I have tried it with different USB Types (serial, MIDI and RAW HID), but no one works.
I have also tried to use different USB cables and plugged them into different ports.
Is it possible that the connection couldn´t be found because of the USB port version?
All my ports are USB 3.0, not USB C. Could this maybe be the problem?
 
The memory usage summary in your screenshot looks very wrong. When I compile here, I get this:

Code:
Sketch uses 13364 bytes (1%) of program storage space. Maximum is 1048576 bytes.
Global variables use 5028 bytes (1%) of dynamic memory, leaving 257116 bytes for local variables. Maximum is 262144 bytes.

sc.png

Your screenshot shows *much* less memory usage, far below what's needed for the USB code to run on Teensy 3.6. The HEX file you're actually loading onto your Teensy is almost certainly not functional. It doesn't matter if your PC's USB port and your USB cable are good if you program Teensy with bad code that can't possibly make its USB port communicate.

I do not understand how this is even possible. Maybe your installation of Teensyduino is somehow corrupted?

Please try reinstalling Arduino and Teensyduino from a fresh download. Please pay close attention to any errors during install. Sometimes an overly aggressive anti-malware program can interfere with the installer writing all the files.
 
@Tony31, did you ever figure this out? I have similar problems when I use my laptop and I always end up trying different ports or restarting my computer until it works again. Very annoying.
 
I too would really like to know what went wrong. This looks very different from the normal Windows issues. Arduino was successfully compiling the code, but ending up with a memory summary that's obviously wrong.

It's tempting to think perhaps the core library files in hardware/teensy/avr/cores/teensy3 got corrupted. Or maybe anti-virus software interfered with the installer writing some of the files? But how that could happen and result in an error-free compile is very mysterious!

@Tony31 - Is there any chance you or someone using your machine edited those files? Or maybe other changes were made to the installation? I just can't understand how Arduino managed to successfully compile your code without all the normal code that makes USB work.
 
@BuffaloFan32 - maybe need additional information, like are is this Windows/Mac/Linux....

Some of Tony31 builds looked bad as the size of the executable was too small... That is for example if I build for T3.5 on Linux with 1.8.5 RawHid Faster ...
My build with yesterdays Beta build is 13064 bytes in size. If I remember his showed 2k?

If I ran into issues like this, I would probably try exiting Arduino and then delete all the temp files.
On my Linux machine under /tmp I would delete all of the directories that had names like:
arduino_build_* arduino_* untitled*.tmp

Then restart Arduino and try a new build and see if the results work better...
 
On Windows - watching my TEMP folder where the IDE drops the folders - they go away as the IDE exits each time. If any part of the IDE was open or failed a clean exit they may remain - but I haven't seen that in recent days as I was testing new machine and new install and parallel builder etc.

I have seen on Windows that compiling as RAW HID may/will not show a PORT for Teensy. However TyCommander does detect and provide reliable connect to RawHid - TyCommander links and more info posted here.

As noted in that linked post IDE SerMon currently takes 2 or more seconds to reconnect in Windows. When you get a proper sized file (Teensy 3.6 compiled 'Faster' with USB Type "Serial"):
Sketch uses 14292 bytes (1%) of program storage space. Maximum is 1048576 bytes.
Global variables use 4944 bytes (1%) of dynamic memory, leaving 257200 bytes for local variables. Maximum is 262144 bytes.

Perhaps with this code where a programmed wait for SerMon was added and text to USB SerMon:
Code:
const int led = LED_BUILTIN;

void setup() {
  pinMode(led, OUTPUT);
  while ( !Serial && millis() < 4000);
  Serial.print( "Hello World! @ millis ==" );
  Serial.println(millis());
}

void loop() {
  digitalWrite(led, HIGH);
  delay(900);
  Serial.println(millis());
  digitalWrite(led, LOW);
  delay(100);
}

TyCommander output starts like this:
Hello World! @ millis ==424
1324
2324
3324
4324
 
Sorry, that I don´t replied quicker but I wasn´t home last week.

So I´m glad, that somehow I have fixed my problem.
What do I have done?
1) Deleted my Teensy in the device manager
2) Uninstall the Arduino IDE and deleted the Arduino folder
3) Cleaned everything with CCleaner
4) Installed the Arduino IDE and the TeensyduinoInstall
5) Started the Ardunino IDE and opened my "Hello World" Sketch
6) Clicked verify and then the pushbutton on my teensy
7) Selected the port and opened the serial monitor

I don´t know if it is important or not, but after you install the "TeensyduinoInstall" there is written:

First use: Click Verify and then the pushbutton
Later: only the upload

I think my fault was, that I have always pressed the button, so the Teensy went off and wasn´t "available" anymore.

I don´t know what exactly was the problem, fortunately it is working.
But it is interesting to know, what triggered this problem.
 
@Tont31 - Do you make backups of your computer? Is there any chance the corrupted copy of the Arduino IDE may still be on any of your old backups? If so, and if you can make a big ZIP file of everything from C:\Programs Files (x86)\Arduino and upload it somewhere like dropbox, maybe I can take a look and try to see what went wrong.
 
@PaulStoffregen
No I´m sorry.
When I have deleted the Arduino IDE, I have also deleted the old Arduino folder.
 
Looks like we'll never know what really happened here.

But nonetheless, I'm considering adding some sort of check that the core lib files are intact for future versions. I might also have the installer re-read everything to check it all got installed correctly. It seems things are becoming less and less reliable for Windows users has anti-virus programs take stronger measures to interfere with programs writing too much data (assuming they're ransom-ware which is encrypting all your files).
 
I also have a COM-Port problem in W10 with a Teensy 4.0 board

Looks like we'll never know what really happened here.

But nonetheless, I'm considering adding some sort of check that the core lib files are intact for future versions. I might also have the installer re-read everything to check it all got installed correctly. It seems things are becoming less and less reliable for Windows users has anti-virus programs take stronger measures to interfere with programs writing too much data (assuming they're ransom-ware which is encrypting all your files).

Hello, I have recently started to work with a Teensy 4.0 board as this is the one used by many in the lab. However, when I tried to install it yesterday, I did not pay to much attention that W10 did not really recognized the board when attached.

After the installation I have worked on another system that uses also the Teensy 4.0 and it worked great. However, this morning I tried to play with my Teensy 4.0, the one I was given to play with and it seems that I can connect with it.

I have saved all the reports from Windows10 stating the issues in getting the COM-port to recognize the Teensy board when connected to a USB port. Please see the attached file. If you need anything else, please let me know. Is it possible that the board is not working? Is there a way to check what is the issue?

This is the attached file: View attachment Teensy4p0_USB_COM issues 2021.05.20.txt

Compiling seems to be fine:
"Sketch uses 13152 bytes (0%) of program storage space. Maximum is 2031616 bytes.
Global variables use 41660 bytes (7%) of dynamic memory, leaving 482628 bytes for local variables. Maximum is 524288 bytes."

Also the errors I am getting from Arduino when I try to do an upload are:
"An error occurred while uploading the sketch
avrdude: AVR Part "imxrt1062" not found."

"No Teensy boards were found on any USB ports of your computer.
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch."

When I press the PROGRAM MODE BUTTON the LED turns off and Windows does a sound like a new device is plugged in, but nothing happen and in the Device Manager section of W10 there is an error saying "Unknown USB Device (Device Descriptor Request Failed".

How can I resolve this? Can someone help me?

Thank you in advance.

Massimo
 
Also the errors I am getting from Arduino when I try to do an upload are:
"An error occurred while uploading the sketch
avrdude: AVR Part "imxrt1062" not found."

"No Teensy boards were found on any USB ports of your computer.
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch."

Wow, that's a new one! "avrdude" is a program for non-Teensy boards. It should never be used when you try to upload to a Teensy.

But several of the messages you are seeing do from from Teensyduino. How you could end up with such a strange & wrong installation of the software is pretty mysterious. Maybe anti-virus software interfered with installation, deleting or corrupting some of Teensyduino's files?

You definitely need to reinstall Arduino and Teensyduino. I recommend getting Arduino 1.8.15 (latest version released only a few days ago) and use Teensyduino 1.54-beta9 with this link:

https://www.pjrc.com/teensy/td_154-beta9/TeensyduinoInstall.exe

Download Arduino 1.8.15 here:

https://downloads.arduino.cc/arduino-1.8.15-windows.exe

You may need to temporarily disable anti-virus software. These installers don't use any internet communication, so you can unplug from the internet & disable wifi while your anit-virus protection is off, then run these and turn it back on after you have a successful install.

Run the Arduino installer first. It will uninstall the old copy of Arduino and install 1.8.15. Then run the Teensyduino installer. Hopefully this will give you a brand new & correct install of the software.

Then open Arduino. Click Help > About to make sure you have 1.8.15 and 1.54-beta9 installed (both numbers must be shown). Click Tools > Boards to select Teensy. Open File > Examples > 01.Basics > Blink. Then click the Verify button (not the Upload button, but Verify). When Arduino finishes compiling, you should see the small Teensy Loader window appear. On it's bottom status bar, you should see it has already opened the Blink.ino.hex file which Arduino just compiled.

While watching the Teensy Loader, press the pushbutton on your Teensy. DO NOT use Upload from Arduino. Do this first upload by having Teensy Loader ready to go on your screen (in Auto mode), then press the button on Teensy to cause the upload. If your Teensy has been previously written with wrong code, it can't automatically respond to Arduino's upload request, so this manual pushbutton press is needed to recover.

If pressing the pushbutton doesn't cause Teensy Loader to upload the LED blink code, then you may need to do the full memory wipe. To completely wipe the flash, hold the pushbutton on Teensy 4.0 for 15 seconds. The red LED near the USB connector will flash briefly at the 15 second mark. Release the button at that moment (or within 4 seconds of that moment) and it will fully wipe the memory and write a known-good LED blink program into flash. The red LED will be on bright for about 1 minute, and when it turns off your Teensy 4.0 will reboot and be running the default LED blink program, just like when it was brand new. It should then be responsive to your PC. Clicking Tools > Ports should show it in the Ports menu, but as a HID device, not a COM port. Teensy only becomes a COM port after you upload, and only if you have Tools > USB Type selected to Serial (which is the default).

But again, something must have gone very wrong with the initial software install for you to end up with a mixture of Teensyduino messages and avrdude messages, which isn't supposed to be used with any Teensy board. How that would happen is pretty hard to imagine. There may be a very severe problem with this particular PC, perhaps malware or overly aggressive anti-virus software, or a badly corrupted Windows system.
 
Hi Paul,

Thank you for your help. I have tried what you suggested in your reply and it didn't help.
Regarding the error "avrdude" that is from Arduino, at least that is what I gathered from the internet and it can happen when a board is corrupted.

I am not sure if the avrduge message has anything to do with my computer, as I was able to use a different Teensy 4.0 yesterday, when I did the installation of the arduino (1.8.13) and Teensyduino (1.53). These are supposed to work fine with each other, correct? In fact they did yesterday. We did a full session of data recording from a load cell.

So, there seems to be an issue with this card. I tried the wipe of the flash, but that did not help.

Tomorrow, I will try to plug the other Teensy 4.0 that we have at work and see if it works. If it does, but not the one I am using today, can you think of any other alternative?

Are there ways to debug the card to see if there is anything wrong with it?

This is a sample page about the avrdude error: https://forum.arduino.cc/t/avrdude-error-while-uploading/526151

Let me know if you have any suggestion. Thank you very much for your help.

Massimo
 

Please take a screenshot with the avrdude error message and post it here, so we can see the exact same thing you are viewing on your screen.


And to specifically answer your latest questions:

when I did the installation of the arduino (1.8.13) and Teensyduino (1.53). These are supposed to work fine with each other, correct?

Correct, Teensyduino 1.53 works with Arduino 1.8.13.

However, the latest 1.54-beta9 has an improved memory usage summary which gives much more detail about how the compiled code is using Teensy 4.0.



So, there seems to be an issue with this card. I tried the wipe of the flash, but that did not help.
...

Normally the full memory wipe is the best way to troubleshoot. You said "that did not help", but you have not said what you observed. Did the red LED blink just before you released the pushbutton? Did the red LED turn on bright for about 30-60 seconds? Did the board return to orange LED blinking when it was done? Did the HID device appear in Arduino's Tools > Ports menu? These are the important thing to observe to know whether the Teensy hardware (and your USB cable / port / hub) are working properly.


Are there ways to debug the card to see if there is anything wrong with it?

The first step in any debugging is to try to figure out where the problem is. If your software installation on the PC is so wrong that it is using avrdude, then there is little point trying to test the Teensy hardware. The avrdude software is never supposed to be used with Teensy. I hope you can understand how futile attempting to diagnose the Teensy board is when your PC isn't even running the correct software?!
 
Last edited:
Status
Not open for further replies.
Back
Top