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 Port Error (Read 16313 times)
Firebug24k
Newbies
*
Offline


Posts: 7
Joined: Jan 27th, 2013
Com Port Error
Jan 27th, 2013 at 8:00pm
Print Post  
Hello,

I'm trying this with both a Uno and a Leonardo, same issue.

When I connect the USB to my laptop, it shows up as COM16.  I select COM16 at the top of the visual studio window, and hit debug to upload.  Program compiles fine, but then the word COM16 magically changes to COM10, and the verbose output in the Micro Build window says "Uploading to I/O board using 'COM10'".  So something switches it to COM10, and the upload doesn't work since it's talking to the wrong COM port.

I can upload fine from AVRDUDE and from the Arduino IDE.  Any thoughts on what's going on?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Com Port Error
Reply #1 - Jan 27th, 2013 at 8:10pm
Print Post  
Hi,

You should only see the com port switch when uploading to a Leonardo. This is how the Leonardo works, it presents itself as one com port for normal use but when it reboots for programming upload then it used a different com port. Vm shows this in the upload message so that we can see what is going on. The Arduino IDE does the same but it doesn't show you the port it used. 

If you open Device Manager you will see the com port switch as the Leonardo boots

So you have an Uno we can test with that first? 

Please restart vs and close any open solution. Then open a simple sketch, ensure that when the sketch is open the solution contains only the one sketch project. Using the tool bar, ensure the board is set to Uno, that the serial port is set to the Uno serial port and click upload.

Please post the entire output window contents into a post in this thread or email to info [at] visualmicro.com

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


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Com Port Error
Reply #2 - Jan 27th, 2013 at 8:20pm
Print Post  
ps: Visual Micro also uses avrdude to upload, that's one reason for setting the arduino location after you install vm. Let's try with Uno first if you have one, then Leonardo. Before Leonardo look for COM10 appearing in Device Manager after plugging in the Leonardo usb cable and then for it to become COM16 after a few seconds. 

Also confirm the Uno serial port by watching Device manager after you plug it in

Thanks
« Last Edit: Jan 27th, 2013 at 8:21pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Firebug24k
Newbies
*
Offline


Posts: 7
Joined: Jan 27th, 2013
Re: Com Port Error
Reply #3 - Jan 27th, 2013 at 8:21pm
Print Post  
Hello,

I did as you suggested - brand new project, with a Uno.  This time the COM port stays COM16, but nothing happens.  Here's the output:

Compiling 'TestBlink' for 'Arduino Uno'
Build folder: file://C:\Users\Firebug24k\AppData\Local\VMicro\Arduino\Builds\TestBlink\uno
SketchLibFolders
cuments\arduino-1.0.3\hardware\tools\avr\lib\gcc\avr\4.3.2\include\;
Summary: Header=1 Prototypes=3 Imports=0
Additional Defines: VISUALMICRO_COMPILER_VER=1;
C:\Users\Firebug24k\Documents\arduino-1.0.3\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=103 -DVISUALMICRO_COMPILER_VER=1 -I"C:\Users\Firebug24k\Documents\arduino-1.0.3\hardware\arduino\cores\arduino" d" .cpp" -o .cpp.o"
C:\Users\Firebug24k\Documents\arduino-1.0.3\hardware\tools\avr\bin\avr-gcc -Os -Wl,--gc-sections -mmcu=atmega328p -o .elf" .cpp.o" "C:\Users\Firebug24k\AppData\Local\VMicro\Arduino\Builds\TestBlink\uno\core.a" -L"C:\Users\Firebug24k\AppData\Local\VMicro\Arduino\Builds\TestBlink\uno" -lm
C:\Users\Firebug24k\Documents\arduino-1.0.3\hardware\tools\avr\bin\avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 .elf" .eep"
C:\Users\Firebug24k\Documents\arduino-1.0.3\hardware\tools\avr\bin\avr-objcopy -O ihex -R .eeprom .elf" .hex"
Binary sketch size: 1084 bytes (of a 32256 byte maximum) (0.5928011 secs)
Uploading to I/O board using 'COM16'
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Com Port Error
Reply #4 - Jan 27th, 2013 at 8:21pm
Print Post  
Both the Uno and the Leonardo will not use COM16. Have you one board or two boards?

Please see my post above, I wrote it at same time as your last post so maybe you will not see it
« Last Edit: Jan 27th, 2013 at 8:22pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Firebug24k
Newbies
*
Offline


Posts: 7
Joined: Jan 27th, 2013
Re: Com Port Error
Reply #5 - Jan 27th, 2013 at 8:23pm
Print Post  
I've got a Leonardo and a Uno R3, that output I just posted was from the Uno.

Here's what Arduino studio does (well, shortened, because no need to post the whole thing):

C:\Users\Firebug24k\Documents\arduino-1.0.3\hardware/tools/avr/bin/avrdude f -v -v -v -v -patmega328p -carduino -P\\.\COM16 -b115200 -D k.cpp.hex:i 

avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "

         Using Port                    : \\.\COM16
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :
  
Back to top
 
IP Logged
 
Firebug24k
Newbies
*
Offline


Posts: 7
Joined: Jan 27th, 2013
Re: Com Port Error
Reply #6 - Jan 27th, 2013 at 8:28pm
Print Post  
Hmmm... I just thought of something.  The driver installed for the USB serial port is "PJRC.COM" 1/1/2008 Driver Version 1.0.0.0.  Perhaps I've got something weird going on with the USB driver (not sure what, but possibly?).  

UPDATE:  Nope, changed to standard driver "ARDUINO UNO R3" and made no difference (still showing up as COM16 as well).  Still works from command line/Arduino studio, but no output from VisualMicro after "Uploading to I/O board using 'COM16'"
« Last Edit: Jan 27th, 2013 at 8:34pm by Firebug24k »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Com Port Error
Reply #7 - Jan 27th, 2013 at 8:33pm
Print Post  
Okay so we see that the Uno is on COM16. 

I'm not sure why vm would fail when arduino is working, the Uno upload is well tried and tested system. 

1)

Which version of arduino are you using?
Which windows version?
Visual Studio version?
Please are check your vm version in tools>options>Visual Micro>version?

2)
Shut down VS, then open task manager and ensure that any remaining devenv.exe processes are terminated (if there are any). The re-start vs

3)
Write a simple sketch that sends a serial message and upload using arduino. then in VS open the serial monitor for the arduino port, and confirm you can see the data from the arduino. This will test the serial comms and usb system from a windows app.

Sorry I can't give you a simple solution, it seems very odd.
  
Back to top
IP Logged
 
Firebug24k
Newbies
*
Offline


Posts: 7
Joined: Jan 27th, 2013
Re: Com Port Error
Reply #8 - Jan 27th, 2013 at 8:34pm
Print Post  
Will try these out and report back.  Thanks!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Com Port Error
Reply #9 - Jan 27th, 2013 at 8:39pm
Print Post  
Okay well with an Uno R3 plugged in it shows in device manager at "Arduino Uno R3" and has an arduino.llc driver date of 2007. PJRC (teensy) stuff is usually good but it must be a usb issue. 

Vm does use the usb to reboot the arduino just before running avrdude. There is a short delay required between calling the reboot and running avrdude. Maybe this will be an area of me too look at if you don't find a solution but sounds like a different usb driver might alter this too.
« Last Edit: Jan 27th, 2013 at 8:40pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Firebug24k
Newbies
*
Offline


Posts: 7
Joined: Jan 27th, 2013
Re: Com Port Error
Reply #10 - Jan 27th, 2013 at 8:41pm
Print Post  
Is there any way to make it even more verbose to see the output from AVRDUDE when it gets called?  That would help see why it's not launching or where it's getting lost.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Com Port Error
Reply #11 - Jan 27th, 2013 at 8:42pm
Print Post  
Yes was thinking that would help. I'm a bit stuck for a version build for a little while so hopefully installing the driver from the arduino\drivers folder will sort this out. 

Out of interest, have you got the serial monitor in vm closed?

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


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Com Port Error
Reply #12 - Jan 27th, 2013 at 8:49pm
Print Post  
If you don't find a solution then let me know. I can make you up a couple of files to test without the need for a full release.

In the meantime , you can switch on the File>Preferences>External Editor checkbox in the arduino IDe. That will allow you to have a sketch open in both vs and arduno at the same time. Arduino will be read-only and will auto detect changes made in vs prior to upload. So you just click save in VS then switch to arduino and click upload. It's a useful short term fallback Smiley
« Last Edit: Jan 27th, 2013 at 8:49pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Firebug24k
Newbies
*
Offline


Posts: 7
Joined: Jan 27th, 2013
Re: Com Port Error
Reply #13 - Jan 27th, 2013 at 8:50pm
Print Post  
Hmmm.  Still no luck.  VS 2010 Pro, Win 7, pretty new install, nothing weird there.  I'm thinking it's something with the USB, but at a loss as to what.

Uploaded a serial comm sketch and can successfully talk to the board with Visual Micro Serial Monitor app, so that works fine.

Swapped drivers to the official Arduino Uno R3 drivers in the Arduino folder (1.0.3), no difference.

Right now I'm using the 'external editor' feature in the IDE to write in VM and upload with Arduino, which works.  I'll hold off for a while and keep going that route until you get a chance to throw a bit more debug info into the next build and I'll continue the troubleshooting then.  Thanks for all your hard work on this, I really love using VS to write rather than the pretty terrible Arduino environment.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Com Port Error
Reply #14 - Jan 27th, 2013 at 9:00pm
Print Post  
Ok, that makes sense. Thanks for the support and clear reports.

I will try to find time later this week. 

In the meantime please install the latest release from codeplex. It is labeled "TeensyDuino Alpha" in the "DOWNLOADS" list on http://visualmicro.codeplex.com but it is just the standard plugin.

The reason for the update is so that you are on a compatible version to the latest vm sources. (Therefore minor updates won't break anything)

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


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Com Port Error
Reply #15 - Jan 11th, 2015 at 2:51am
Print Post  
Off-Topic replies have been moved to this Topic.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Com Port Error
Reply #16 - Jan 11th, 2015 at 2:53am
Print Post  
Hi,

Sorry this thread got side-tracked by a different conversation. 

Update for any others reading...

I am sure it is a little late to say this but I think the problem was the when you selected the serial port it was the solution that was selected and not the project? This would not select the port for the project and has since been made more intelligent.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint