Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) COM issues w/ Teensy? (Read 5562 times)
PoutinePlatter
Junior Member
**
Offline


Posts: 23
Joined: Jun 16th, 2019
COM issues w/ Teensy?
Jun 23rd, 2019 at 3:05pm
Print Post  
Having COM problem:

VS2017Community
VM 1906.16.1
ArduinoIDE 1.8.9
Teensy 3.6
Teensyduino 1.4.6 

  1. VS/VM struggle to reboot the Teensy.  When I select Build/Upload, normally execution indeed stops, the onboard LED goes solid without it bootloading the new build, but then it is just locked up in that state
  2. VS/VM neither will startup the Serial Monitor properly (Teensy 3.6 on COM6 in this case). Even when the VM console reported "port open" and shows "green" for Connected I could get no Serial.print output.  No expressions were monitored etc. etc. 


Now manually rebooting the Teensy would load the sketch but had to do it every time.  That was OK but lack of Serial monitor was a huge problem. 

So in desperation I finally opened up the (ugghgackhorriblechokepuke) Arduino IDE, tried opening Serial Monitor there, and, hell.  Whaddayaknow.  Voila, it works perfectly.  Info scrolling by like mad.  

AND - if I do that (open Arduino), and THEN revert back into to VS/VM, and re-connect the Serial Port, everything is lovely, suddenly all the messages are flying by happy as clams in VS/VM.   And guess what - now Build/Upload all works hunkydory.  Loads the program via bootloader, reboots into Debug mode fine, etc. etc.   

BTW I can close AIDE and all continues to work fine. 

Now that I know the workaround I can startup Arduino every time first (and then close it again) but it would be nice if I didn't have to?  

Is this a config issue on my setup that is my problem? 

Help would be greatly appreciated.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: COM issues w/ Teensy?
Reply #1 - Jun 23rd, 2019 at 5:44pm
Print Post  
Hi, 

If you have a lot of your own serial please use visual micro in release mode to test the serial monitor and upload is working well before using debug mode.

What is the DTR and RTS of your serial monitor set to? They are ON by default and should be ON.

What board options are set in Arduino and what are set in Visual Micro?

What is the name of the usb driver that teensy is using? You can see this in device manager. I ask because there can be a difference between the arduino java access of serial v's Visual Micro windows.

« Last Edit: Jun 24th, 2019 at 12:18pm by Tim@Visual Micro »  
Back to top
IP Logged
 
PoutinePlatter
Junior Member
**
Offline


Posts: 23
Joined: Jun 16th, 2019
Re: COM issues w/ Teensy?
Reply #2 - Jun 25th, 2019 at 12:58pm
Print Post  
Thanks for reply!  Appreciate the diag suggestions. 

Tim@Visual Micro wrote on Jun 23rd, 2019 at 5:44pm:
If you have a lot of your own serial please use visual micro in release mode to test the serial monitor and upload is working well before using debug mode.


No other serial ports are listed either in DevMgr or in VS etc. on this computer at this time. 

Hmmm.  That's interesting.  
1. Compile/upload in Release mode does not hang the reboot after the upload, however, 
2. still no output in the serial monitor. 

Tim@Visual Micro wrote on Jun 23rd, 2019 at 5:44pm:
[highlight]What is the DTR and RTS of your serial monitor set to? They are ON by default and should be ON.


yes for sure these are always ON. 
(Auto-recon also on)

Tim@Visual Micro wrote on Jun 23rd, 2019 at 5:44pm:
What board options are set in Arduino and what are set in Visual Micro?


All the same.  Defaults. 
Board: Teensy 3.6
USB type: Serial
CPU speed: 180mhz
Optimize: Faster

Tim@Visual Micro wrote on Jun 23rd, 2019 at 5:44pm:
What is the name of the usb driver that teensy is using? You can see this in device manager.


Hmmmm.  This comes up as COM6 and In Events info for it I have:  
Quote:
Driver Management concluded the process to install driver usbser.inf_amd64_106c37dc8954b06b for Device Instance ID USB\VID_16C0&PID_0483\3267220 with the following status: 0x0.

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: COM issues w/ Teensy?
Reply #3 - Jun 25th, 2019 at 3:14pm
Print Post  
Please switch off auto-reconnect on the serial monitor and leave it open and connected. The build and upload.

Does that have different effect?

  
Back to top
IP Logged
 
PoutinePlatter
Junior Member
**
Offline


Posts: 23
Joined: Jun 16th, 2019
Re: COM issues w/ Teensy?
Reply #4 - Jun 26th, 2019 at 10:29pm
Print Post  
Tim@Visual Micro wrote on Jun 25th, 2019 at 3:14pm:
Please switch off auto-reconnect on the serial monitor and leave it open and connected. The build and upload.

Does that have different effect?


Same thing Tim.  Auto-recon turned off now. 

  • In Release mode it still uploads the program and reboots fine.   
  • In Debug it still hangs and needs manual reboot.   
  • In both cases nothing on the screen.  "Connect" is in green so it believes to be connected. 
  • Un-click Connect to release the port, start Arduino > Port Monitor and immediately comes up and looks fine. 


I have been having trouble with debug breakpoints too - only can get them to work rarely.  I'm pretty sure this is related.   

It must be something wrong with my config.  Any other things I can check? 


  
Back to top
 
IP Logged
 
PoutinePlatter
Junior Member
**
Offline


Posts: 23
Joined: Jun 16th, 2019
Re: COM issues w/ Teensy?
Reply #5 - Jun 26th, 2019 at 10:46pm
Print Post  
Also:   

Just opened a generic serial term app window (RealTerm) and the messages are were appearing perfectly fine and instantly. 
Closed the term app.  Restarted VS/VM, suddenly the port is appearing/working. 


Its like the other apps do some kind of port init but VS/VM doesnt?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: COM issues w/ Teensy?
Reply #6 - Jun 27th, 2019 at 12:16pm
Print Post  
Let's step back a bit please

1) Please ensure using the latest Visual Micro

2) Ensure that "vMicro>Uploader>auto open serial after upload" is no checked"

3) Ensure release mode

4) Click build.

5) Open serial monitor and switch DTR off then back on Again.

6) if that fails then please give the information described in yellow that the top of this page

7) Confirm the date, time and name of the usb driver you are using for teensy

Thanks
  
Back to top
IP Logged
 
PoutinePlatter
Junior Member
**
Offline


Posts: 23
Joined: Jun 16th, 2019
Re: COM issues w/ Teensy?
Reply #7 - Jun 27th, 2019 at 2:18pm
Print Post  
Tim@Visual Micro wrote on Jun 27th, 2019 at 12:16pm:
Let's step back a bit please

1) Please ensure using the latest Visual Micro


Well just FYI I have pretty clearly posted all the versions I am using right from the start ^^^ as I always do, but I see the new release just came out so I updated to:
1906.26.0 as of this morning. 

No change. 

Tim@Visual Micro wrote on Jun 27th, 2019 at 12:16pm:
2) Ensure that "vMicro>Uploader>auto open serial after upload" is no checked"


Done.  I had tried that both ways in past, but... nonetheless, done, and, no change. 

Tim@Visual Micro wrote on Jun 27th, 2019 at 12:16pm:
3) Ensure release mode

4) Click build.


Done again (as noted here I have been trying that per previouis instructions already and have noted the results...)

Tim@Visual Micro wrote on Jun 27th, 2019 at 12:16pm:
5) Open serial monitor and switch DTR off then back on Again.


No change. 

Tim@Visual Micro wrote on Jun 27th, 2019 at 12:16pm:
6) if that fails then please give the information described in yellow that the top of this page


Done. Emailing 

Tim@Visual Micro wrote on Jun 27th, 2019 at 12:16pm:
7) Confirm the date, time and name of the usb driver you are using for teensy


usbser.sys
v.10.0.17763.1
6/21/2006

"Driver Management concluded the process to install driver usbser.inf_amd64_106c37dc8954b06b for Device Instance ID USB\VID_16C0&PID_0483\3267220 with the following status: 0x0."


Other notes:

I have also tried "Reset These Settings" under debugger to no effect. 

Have tried "Debug Settings" both Off and Debug:Serial to no effect. 

I have reverted for this testing purpose to an extremely simplified sketch with no interrupts enabled, and barely any lines of code aside from reading some joystick pins and printing to Serial.  So there should be no conflicts anywhere in the code.  I will attach the sketch as well although its about as short a sketch as you can write. 

The output continues to appear no problem on any other program that opens COM6 on this computer - Arduino, RealTerm, etc. so the port is working perfectly fine, there's just some issue w/ how VM is trying to open it.  

I sometimes get "Port open" message in the Port window, but sometimes/often it remains completely blank.  With the last run sent by email I got these messages after attempting to load it a couple of times. 

Quote:
Opening port
Port open

Port closed
Uploading to I/O board
Opening port
Port failed to open
To try connecting again untick and then tick the 'Connect' button or switch on communications 'Auto Reconnect' in the options
Opening port
Port failed to open
Opening port
Port failed to open
Opening port
Port failed to open



  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: COM issues w/ Teensy?
Reply #8 - Jun 27th, 2019 at 2:39pm
Print Post  
Thanks for all the great info. Sorry it's such a strange problem.

Real term and Arduino don't use the c# windows access to serial ports which can give a difference sometimes.

It might sound like a silly question but is your usb cable connected direct to the pc or via a hub?

If you use a different usb port on the pc does it work better?

If you alter the COM port number in device manager to a new port do things work better?

Silly questions maybe but I am struggling to see what Visual Micro could do different. Based on these answers I might have to send you a c# program that simply opens and reads the serial port. 

  
Back to top
IP Logged
 
PoutinePlatter
Junior Member
**
Offline


Posts: 23
Joined: Jun 16th, 2019
Re: COM issues w/ Teensy?
Reply #9 - Jun 27th, 2019 at 8:40pm
Print Post  
Tim@Visual Micro wrote on Jun 27th, 2019 at 2:39pm:
Thanks for all the great info. Sorry it's such a strange problem.

Real term and Arduino don't use the c# windows access to serial ports which can give a difference sometimes.

It might sound like a silly question but is your usb cable connected direct to the pc or via a hub?

If you use a different usb port on the pc does it work better?

If you alter the COM port number in device manager to a new port do things work better?

Silly questions maybe but I am struggling to see what Visual Micro could do different. Based on these answers I might have to send you a c# program that simply opens and reads the serial port. 



There are no silly questions at this point!

Yes.  Using a hub.  I will try both of those things.  I suppose I could write my own C# console app and check that too, but let me try the basic serial port stuff and see what happens.   

I did once have a Netduino that was bizarre about which USB ports it preferred but the hub/port I use now has been generally rock solid but... who knows... 
  
Back to top
 
IP Logged
 
PoutinePlatter
Junior Member
**
Offline


Posts: 23
Joined: Jun 16th, 2019
Re: COM issues w/ Teensy?
Reply #10 - Jun 27th, 2019 at 8:46pm
Print Post  
Well well well OK. 

I can't explain this but.   

I moved the Teensy from port 2 to port 4 on the same hub (not actual port numbers, just physically / visually ports on the strip).   

Reconnected and instantly can see everything in the VM port monitor.  Huzzah. 

Moved to port 1 on same hub.  Works again. Huh. 

Moved back to port 2. 

Works again. 

Weird. 

BTW this Teensy has not been plugged in to the hub all this time, I've often plugged/unplugged it from the hub and that has not helped before.  But indeed I have not changed the port it was on. 

I'm going to chalk this up to something about VS and USB hubs and maybe this specific USB hub, and if it happens again I'll immediately try shifting ports. 

Thanks so much for the suggestion, indeed it does seem like some dumb problem on my setup! 


  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: COM issues w/ Teensy?
Reply #11 - Jun 27th, 2019 at 8:57pm
Print Post  
Ah well done, thanks for all the good reporting.

VS isn't involved, this is windows getting it's knickers in a twist when using the Microsoft System.IO.SerialPorts namespace instead of using underlying win32 calls for the port management. Hopefully it only happens once or twice in a life time. Sometimes powering off (then restarting) the pc and all hubs can also resolve port issues.

Having said that never seen this combination before.
« Last Edit: Jun 27th, 2019 at 8:58pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Pierre Benard
Newbies
*
Offline


Posts: 1
Joined: Jun 27th, 2019
Re: COM issues w/ Teensy?
Reply #12 - Jun 27th, 2019 at 10:26pm
Print Post  
FYI: had the same issue with a Mega 2560 clone.

Everything was working well until about a week ago, then the port monitor couldn't open the port anymore, no messages at all. Other apps would open it normally.
Tried all the things mentioned in the thread, nothing worked.

Finally fixed it by uninstalling the 2019-05 KB4495590  .net update. It might be a coincidence, but I don't think so.

Of course, YMMV.

Pierre
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: COM issues w/ Teensy?
Reply #13 - Jul 8th, 2019 at 6:22pm
Print Post  
Sorry for the delay. The latest release 1907.6.7 resolves the issue which was related to the recent conversion to asnyc packages for VS2019 (vs2017 uses same vm code so was also affected).
« Last Edit: Jul 8th, 2019 at 6:23pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint