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] 2  Send TopicPrint
Very Hot Topic (More than 25 Replies) avrdude problem with VM (Read 28387 times)
John Fitter
Junior Member
**
Offline


Posts: 26
Location: Australia
Joined: Mar 2nd, 2013
avrdude problem with VM
Apr 5th, 2014 at 2:39pm
Print Post  
Without warning avrdude has locked itself to one only com port and refuses to change. ATS and VM are now completely unuseable. The message is

Uploading to I/O board using 'COM16'
avrdude: ser_open(): can't open device "\\.\COM16": The system cannot find the file specified.

Nothing I do will convince avrdude to use another port (reboot, clean, uninstall unused drivers, lots of other changes).
I have spent hours reading this forum for an answer and not found one.
Does anyone have any ideas?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: avrdude problem with VM
Reply #1 - Apr 5th, 2014 at 2:44pm
Print Post  
Hi John,

Sorry to hear of this strange issue.

Can you confirm what serial ports are displayed when you view the available list of ports?

When you rebooted did you power off then on again?

Thanks
  
Back to top
IP Logged
 
John Fitter
Junior Member
**
Offline


Posts: 26
Location: Australia
Joined: Mar 2nd, 2013
Re: avrdude problem with VM
Reply #2 - Apr 5th, 2014 at 3:06pm
Print Post  
Tim@Visual Micro wrote on Apr 5th, 2014 at 2:44pm:
Hi John,

Sorry to hear of this strange issue.

[quote/]Can you confirm what serial ports are displayed when you view the available list of ports?

The same serial ports shown in Device Manager are also shown in VM. I can select ports in VM, open serial monitors, etc. all correctly. It is only avrdude that has lost the plot.

[quote/]When you rebooted did you power off then on again? [/quote]
Yes. Just a "restart" which is a near as a laptop can get to poweroff.
I have uninstalled all of the serial ports including the unused "hidden" ones. The board now connects to com3 and VM sees it, but when I try to upload to it, avrdude still tries to upload to com16.

I have just looked into the VM configuration files and found no reference to the upload com port, however I did find it in the project file, where it is as expected - same com port as displayed on the ribbon in VM (but not the one avrdude is trying to use).
avrdude was a little hard to find. I also found its config but it is unchanged from installation. It must save its settings somewhere - where should I look? It must be flaky to suffer this sort of problem.
Any more ideas?
cheers, John Smiley
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: avrdude problem with VM
Reply #3 - Apr 5th, 2014 at 3:25pm
Print Post  
Hi John,

I think you need to force a power off. I find windows needs it once every few years Smiley

The selected vm serial port is passed to avrdude when it runs.

You can see how, what and where if you switch on tools>options>visual micro>compiler>verbose

With verbose on try the upload and lets see what is returned. 

Avrdude doesn't store anything which is why I suggest the power off/on but only if you are unable to open com16 in the serial terminal

« Last Edit: Apr 5th, 2014 at 3:25pm by Tim@Visual Micro »  
Back to top
IP Logged
 
John Fitter
Junior Member
**
Offline


Posts: 26
Location: Australia
Joined: Mar 2nd, 2013
Re: avrdude problem with VM
Reply #4 - Apr 5th, 2014 at 3:36pm
Print Post  
Tim, thanks for the reply. Here is the verbose output for the upload.
Code
Select All
Uploading to I/O board using 'COM16'
Uploader started for board Arduino Nano w/ ATmega328
Uploader sometimes uses programmer name: usbasp
Upload method will be: bootloader
Uploading via Bootloader
C:\Program Files\arduino-1.5.6-r2\hardware\tools\avr\bin\avrdude "-CC:\Program Files\arduino-1.5.6-r2\hardware/tools/avr/etc/avrdude.conf" -v -v -v -v -patmega328p -carduino -PCOM16 -b57600 -D tmega328/LevRemote.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 "C:\Program Files\arduino-1.5.6-r2\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : COM16
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: ser_open(): can't open device "\\.\COM16": The system cannot find the file specified.



avrdude done.  Thank you.
 


Note that the command line for avrdude incorrectly specifies com16 when the ide most definitely shows com3, on the ribbon, in the tools/visualmicro dropdown, and in the project config file (the cppprog).
Who generates the command line?
clearly avrdude is just blindly following instructions.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: avrdude problem with VM
Reply #5 - Apr 5th, 2014 at 3:57pm
Print Post  
That's strange, Visual Micro generates the command line based on the same settings that put a tick by tools>visual micro>serial port.

Please try re-selecting the port. Visual Micro does attempt to remember the port and there have been big changes in this area however you say the .cppproj shows COM3 which is what the project retains for vm.

Does COM3 or COM16 show in device manager?

EDIT>> What are you clicking to perform the upload?
« Last Edit: Apr 5th, 2014 at 4:04pm by Tim@Visual Micro »  
Back to top
IP Logged
 
John Fitter
Junior Member
**
Offline


Posts: 26
Location: Australia
Joined: Mar 2nd, 2013
Re: avrdude problem with VM
Reply #6 - Apr 5th, 2014 at 4:09pm
Print Post  
Reselecting port done - lots of times.
com3 shows in Device manager, com16 does not, which is as expected - there is a board connected as com3.
Just looked at Compile.vmps.xml in the visualmicro project sub-dir. It shows com16 as the upload port. I edited this and changed it to com3 but it was changed back again by VM as soon as I rebuilt the project. Note that it was not changed merely by doing an upload. the upload still tried to upload to com16. It took a rebuild to for the entry to be changed.
I have also tried project clean and solution clean, to no effect.

Some history. I have 2 projects in the solution. Each has a radio transceiver and communicates with the other. Each is connected to a serial port for debugging and two serial monitors are displayed. Changes to one project usually require a rebuild and upload of both, especially if the change was to the common header (another arduino pain in the....). All this was working smoothly all day today. Uploading was transparent - the correct com ports were used - I just clicked away and focussed on the code. Then without warning it stopped - only com19 would show. end of work and wasted day.

  
Back to top
 
IP Logged
 
John Fitter
Junior Member
**
Offline


Posts: 26
Location: Australia
Joined: Mar 2nd, 2013
Re: avrdude problem with VM
Reply #7 - Apr 5th, 2014 at 4:11pm
Print Post  
Tim@Visual Micro wrote on Apr 5th, 2014 at 3:57pm:
EDIT>> What are you clicking to perform the upload?

Project/Upload last sketch built
  
Back to top
 
IP Logged
 
John Fitter
Junior Member
**
Offline


Posts: 26
Location: Australia
Joined: Mar 2nd, 2013
Re: avrdude problem with VM
Reply #8 - Apr 5th, 2014 at 4:17pm
Print Post  
Just reinstalled VM (just the repair option), fully expecting the problem to go away. It did not.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: avrdude problem with VM
Reply #9 - Apr 5th, 2014 at 4:24pm
Print Post  
Hi John,

I think/hope this is some minor confusion. 

If you have two projects in your solution it is important to set the port for each project. The port you see in the toolbar relates to the port of the currently "active" project. It is not always obvious which project is active because the code editor and the solution tree can have different active selections.

Visual Micro remembers the upload port for each project. However, if you have never specifically set the port for the project then it will always use the last used port. (needs a bit more dev time to standardise this workflow)

Click the name of projectA in the solution explorer and select a port, then click the name of projectB in the solution explorer and select a port.

Now here is where the confusion can really lie, I just replicated it.

In my solution explorer I was editing and had selected ProjectA, which showed upload port of COM3. I clicked compile and upload and Visual Micro attempted to upload ProjectB using COM16.

Indeed Visual Micro was entirely correct to attempt upload of ProjectB to COM16 because ProjectB is set as the "Start-up Project" in my Atmel Studio solution (ProjectB appears in bold).
« Last Edit: Apr 5th, 2014 at 4:25pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: avrdude problem with VM
Reply #10 - Apr 5th, 2014 at 4:28pm
Print Post  
Oh our messages crossed

Upload last sketch build is not really the right option and it might or might not be a bug/feature (subject to discussion) that it retains the last upload parameters. 

Click F5 or Shift+F5 to upload, or the green/blue arrow on the ribbon or Debug>Start or Debug Start without debugging. All of these options are the official upload commands.

« Last Edit: Apr 5th, 2014 at 4:29pm by Tim@Visual Micro »  
Back to top
IP Logged
 
John Fitter
Junior Member
**
Offline


Posts: 26
Location: Australia
Joined: Mar 2nd, 2013
Re: avrdude problem with VM
Reply #11 - Apr 5th, 2014 at 4:29pm
Print Post  
Everything worked as you say. Two projects, different com ports. Each one changed when I selected the appropriate source file. I seem to remember that I had to select the upload port from the menu for the actual upload, nevertheless it was all working. Then it stopped working.
Now, even with just one project and one board connected, I am stuck with com16.

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


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: avrdude problem with VM
Reply #12 - Apr 5th, 2014 at 4:31pm
Print Post  
Please see prev post I think you forgot how you uploaded before  Smiley

Don't use upload last for your purposes

New documentation system is underway http://visualmicro.com/documentation/Upload-and-Run.html
  
Back to top
IP Logged
 
John Fitter
Junior Member
**
Offline


Posts: 26
Location: Australia
Joined: Mar 2nd, 2013
Re: avrdude problem with VM
Reply #13 - Apr 5th, 2014 at 4:36pm
Print Post  
F5 - same result
  
Back to top
 
IP Logged
 
John Fitter
Junior Member
**
Offline


Posts: 26
Location: Australia
Joined: Mar 2nd, 2013
Re: avrdude problem with VM
Reply #14 - Apr 5th, 2014 at 4:59pm
Print Post  
I deleted all project and solution files and rebuilt the project. Now it works as expected. I hope I don't have to do this too frequently though.

The upload last build option on the menu dropdown is the same as the green arrow, and in fact it has a green arrow drawn beside it.

All is now working as I expected. I like the separation of the build and the upload. If I don't need debugging then I don't want the extra baggage and time it takes. for small changes just build then upload <CUCB>.

You may want to take a look at why it happened in the first place. It is clearly a deeper issue than me clicking the wrong buttons  Wink
  
Back to top
 
IP Logged
 
John Fitter
Junior Member
**
Offline


Posts: 26
Location: Australia
Joined: Mar 2nd, 2013
Re: avrdude problem with VM
Reply #15 - Apr 6th, 2014 at 4:44am
Print Post  
Quote:

If it happens again I need a clearer picture of what com port shows when clicking between the multiple projects within your solution. Does the port change as the project changes?

When switching between multiple projects the expected com port is displayed on the ribbon, ie. a different com port for each project.
Quote:
I would also need to know which project is set as Startup Project

As it was, the com port that was problematic was the one the second project was setup to use (not the startup project).
Quote:
and finally a zip of the ".visual micro" folder below your sketch folder.

Too late - I deleted it. If it happens again I will send you a zip.
Quote:
I guess you had two com ports showing in your ide?

Yes
Quote:
do you only plugin a board into the usb when you want to program it

No. Both are plugged in all the time. I code for both projects simultaneously because it's a communication system - small changes to one require changes to the other.

My comment earlier about Arduino being a pita refers to the inability to use relative paths in include specifications. I understand why this is so, but it doesn't make it any less annoying for experienced programmers. This is my first foray into Arduino which I have done because it offers the opportunity to very quickly produce prototypes and tech demonstrators. I have been making prototypes for customers for many years, and Arduino has revealed itself as a revolution. What used to take weeks now takes just days. I guess the pita is work putting up with.  VM at least provides me with an environment I am used to and feel comfortable with. Cool 

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


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: avrdude problem with VM
Reply #16 - Apr 6th, 2014 at 1:45pm
Print Post  
Quote:
As it was, the com port that was problematic was the one the second project was setup to use (not the startup project).


Thanks for the clear info.

You asked why Visual Micro kept trying to use COM16, it sounds like your other project was set to use COM16 and that it was the startup project? 

I think the confusion is the uploads were attempting to upload the other project in your solution?

Please consider this:-

F5 and Upload will ALWAYS compile and/or upload the startup project
Solution>Build/Rebuild - will rebuild all projects.
Solution>Build Project 'x' - will re-build the named (currently selected if available) project 

I don't really know what you click to do your builds but I am pretty sure the problem was that you didn't realize the importance of the start-up project to the upload process. 

I will extend the documentation and agree it is an unclear area for people who have not used atmel or visual studio for other non-arduino projects. It is certainly confused by the fact that it is possible to have all code files closed, more than one project open in a single solution and no be clicked on any project files. Therefore the concept of a startup project is required.

In your case you have two related projects so the use of a single ide for both projects make sense, to other users who are new to these ide's, I suggest one project per ide initially.

I hope I have hit the mark with this answer otherwise, sorry and please do submit the files if it happens again

Thanks
  
Back to top
IP Logged
 
John Fitter
Junior Member
**
Offline


Posts: 26
Location: Australia
Joined: Mar 2nd, 2013
Re: avrdude problem with VM
Reply #17 - Apr 8th, 2014 at 4:46am
Print Post  
Further to ongoing problems, nothing has changed. It really is a simple task being asked of VM.

One solution with two projects. One project is targeted at a device on one comm port. The other project is targeted at another device on another comm port. A common enough requirement.

I have just spent an entire day coding and now I cannot upload the code to the device. What a waste of time.

VM refuses to cooperate. This has nothing to do with stupid users who can't read instructions or understand what is happening. Every suggestion so far offered has been tried, and none of them solve the problem.

No matter what I do, VM insists on sending the (any) code to the device on the comm port of the first opened project. Of course avrdude complains, but it is clear now that avrdude is being fed with faulty information from VM, a variable called serial.port that appears to be generated by VM. 

If the system cannot handle such a simple and common task, then what is it's reason for existence. Why bother with providing a user interface that allows users to select different comm ports for different projects when these selections are simply ignored?

These are reasonable questions that require answers.

As requested, if the problem recurs (it never went away), I have prepared an archive of the project files. I have just discovered that I cannot attach this archive to my messages on this forum. I am awaiting a suggestion on how to get it to you.

Hope this helps.

« Last Edit: Apr 8th, 2014 at 4:54am by John Fitter »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: avrdude problem with VM
Reply #18 - Apr 8th, 2014 at 11:54am
Print Post  
Hi John,

You originally reported this problem as avrdude attempting upload to the wrong COM port (com16). Only after some invested time by myself did we establish that you have two projects in your solution and one is supposed to upload to COM16.

I then asked if you were using the normal F5/start and you told me you were using "Project>upload last sketch build". You then gave me a whole bunch of reasons why upload last was the same as F5 all of which were irrelevant words. 

I have to support many people of differing skill levels. Most people manage to provide clear, concise and polite reports that I am happy to help and answer for free.

In your case you are just rude and furthermore seem incapable of answering simple questions. You have a working development system. If you are not prepared to be polite and to clearly answer simple questions then why not open two copies of Atmel Studio with one project per instance.

I have already said that normally two projects in a single Atmel Studio instance works fine for other users so with some more exploration I am sure we will identify the cause of your problem. You still have not confirmed you know how to change the "Start-up project". Atachments can be email to info [at] visualmicro.com
« Last Edit: Apr 8th, 2014 at 11:57am by Tim@Visual Micro »  
Back to top
IP Logged
 
John Fitter
Junior Member
**
Offline


Posts: 26
Location: Australia
Joined: Mar 2nd, 2013
Re: avrdude problem with VM
Reply #19 - Apr 8th, 2014 at 4:21pm
Print Post  

Quote:
You originally reported this problem as avrdude attempting upload to the wrong COM port (com16). Only after some invested time by myself did we establish that you have two projects in your solution and one is supposed to upload to COM16.

This is correct. At the time there was no reason to suspect that it had anything to do with the use of two comm ports. When the fault showed itself I was only targeting one device and the other device was disconnected. I could not get the upload to go to the correct port. That was the problem, and still is.

Quote:
I then asked if you were using the normal F5/start and you told me you were using "Project>upload last sketch build". You then gave me a whole bunch of reasons why upload last was the same as F5 all of which were irrelevant words.

The "whole bunch of reasons" was, to be accurate, just one - it had a single green arrow. So I was wrong - big deal.

Quote:
In your case you are just rude

Frustrated at having worked all day only to find that a development system that ought to be transparent to the development process in fact is stopping further progress. Just human like most people.

Quote:
and furthermore seem incapable of answering simple questions.

35 years of teaching and tutoring engineers and mentoring in the corporate environment gives me a legion of people who will strongly refute this claim...

Quote:
You have a working development system. If you are not prepared to be polite and to clearly answer simple questions then why not open two copies of Atmel Studio with one project per instance.

Using two copies is a kludge. There is no reason to expect software not to function as designed.
You think I am not polite but you don't know me, or anything about me. I asked reasonable questions about the operation of VM and some unusual behaviour that indicated a fault in the software. It's behaviour certainly was not consistent with the user interface that was provided in that certain setting were being completely ignored. In response I got questions that indicated that you thought that I, the user, was at fault for not using the software properly. There was no indication that you were considering the software to be at fault, which left me wondering whether it would be fixed at all (and whether my investment in your debugger was a mistake).

Understand this. If you wrote the software then you know intimately it's detailed inner workings. I do not, and cannot, so there is only a very limited amount of information I can give you that may be relevant. You, on the other hand know exactly what questions to ask to probe the problem with precision, so I can do no more than await those questions. All of the questions you have so far asked, I have answered.

Quote:
You still have not confirmed you know how to change the "Start-up project"

Yes I do. I have done it now several times as part of probing this fault. It does not solve the problem, but it does influence which target/comm port the system gets "stuck on". It's always the start-up project. I did state this on an earlier post.

How about we just focus on the problem from now on.

I am sending the archive immediately to the email you quoted.

Thanks, JohnF

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint