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) Re: Upload problem with retry sometimes (Read 11364 times)
Mike
Junior Member
**
Offline


Posts: 13
Joined: Jun 10th, 2014
Re: Upload problem with retry sometimes
Oct 17th, 2014 at 11:35pm
Print Post  
Hi Visual Micro,

I am having the same problem.  Did you ever figure out how to solve this?  I had been developing, and out of the blue it stopped working.  What I have tried doing so far...

- Uninstalling Visual Micro from "Uninstall Program" menu in windows and reinstalling.

- Upload a example on the arduino IDE (Worked fine)

- If I let it timeout on its own I get the following... "Upload timed out waiting for a response"

- When I unplug when it freezes, it kicks it out with the following error.  

"avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: ser_send(): write error: sorry no info avail"



- Intermittently I will get the following upon reattempting to compile and load.  "Access to the port 'COM3' is denied."

- Yes i have tried turning debugging off. Still doesn't work.
« Last Edit: Oct 19th, 2014 at 9:57am by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Upload problem with retry sometimes
Reply #1 - Oct 18th, 2014 at 11:09am
Print Post  
Hi Mike,

Thanks for the useful detail.

This sounds like usb driver issues however there are a few factors to consider.

Visual Micro uses the .net api to access the com ports where as Arduino uses java so there can be a small difference.

Depending on the board you have the upload can involve opening the serial port, touching the port then closing the port and calling the arduino avrdude.exe command to perform the actual upload.

From your report it sounds like both Visual Micro and avrdude are having problems accessing the com port.

There are two parameters that Visual Micro supports that determines the time we wait before and after touching the port. I expect it is this delay that is either too short or too long causing avrdude to fail to open the port or detect the arduino is ready for upload. I can explain how to add these params and try this out if you can answer the following.

Questions

Is the serial monitor open when you attempt upload?
Which board are you using?
Which arduino ide version?

Please also try this version http://www.visualmicro.com/downloads/beta/ArduinoForVisualStudio.msi

Thanks

reminder for me:- defaults:-
boards.txt 
[broard].vm.upload.sleep.before.close.flush=100
[broard].vm.upload.sleep.after.close.flush=5
« Last Edit: Oct 19th, 2014 at 9:57am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Mike
Junior Member
**
Offline


Posts: 13
Joined: Jun 10th, 2014
Re: Hang when trying to connect to debugger
Reply #2 - Oct 18th, 2014 at 2:07pm
Print Post  
I have tried uploading with and without the monitor open.

I'm using an Arduino 1.0.x version. Can give u exact if needed when I get home.

I'm using a mega.

Please note that I have used my setup regularly until out of the blue it stopped working.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Hang when trying to connect to debugger
Reply #3 - Oct 18th, 2014 at 2:29pm
Print Post  
Thanks for the info. This suggests that a windows or usb update has caused the usb driver to respond in a different way than when it worked previously.

I expect this is a timing issue where windows is taking some time to release the com port causing problems for the uploader

The solution will probably be for Visual micro to pause for a longer duration between closing the port and attempting upload.

If you install the link supplied below the build has some properties we can apply at your end to force longer delays allowing us to discover if that is the issue so let me know when you have applied it.

It would also be useful to know the date/time/name of the usb driver that shows for the COm port in window device manager.

Thanks
  
Back to top
WWW  
IP Logged
 
Mike
Junior Member
**
Offline


Posts: 13
Joined: Jun 10th, 2014
Re: Hang when trying to connect to debugger
Reply #4 - Oct 19th, 2014 at 2:15am
Print Post  
Some more info.

Within the same night in a 3 hour window it went from working to not working. Without doing any restarts.  I also do not have any auto update services on.

Something interesting which I don't know how it would relate to timing.. When I try to upload the Arduino light that blinks during uploads comes on and blinks for about 2-3 second and then stops.  Then my visual studio will time out after 30 seconds. Would the timing issues you meantion allow for the Arduino to respond like this?
  
Back to top
 
IP Logged
 
Mike
Junior Member
**
Offline


Posts: 13
Joined: Jun 10th, 2014
Re: Hang when trying to connect to debugger
Reply #5 - Oct 19th, 2014 at 2:42am
Print Post  
Also Driver date is 1/4/2013   1.0.0.0
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Hang when trying to connect to debugger
Reply #6 - Oct 19th, 2014 at 6:47am
Print Post  
Hi,

You ate both having different issues. Please open your own threads so o can ask questions and see clear answers.

Thanks very much
  
Back to top
WWW  
IP Logged
 
Mike
Junior Member
**
Offline


Posts: 13
Joined: Jun 10th, 2014
Re: Hang when trying to connect to debugger
Reply #7 - Oct 19th, 2014 at 6:49am
Print Post  
Visual, your comment to me never provided a link by the way.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Hang when trying to connect to debugger
Reply #8 - Oct 19th, 2014 at 9:53am
Print Post  
I have split this thread because it is unconnected to the debugger which the original thread was specifically about.

Mike, let me know when you have seen this thread and I will give you a config setting to try out

Thanks
« Last Edit: Oct 19th, 2014 at 10:57am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Mike
Junior Member
**
Offline


Posts: 13
Joined: Jun 10th, 2014
Re: Upload problem with retry sometimes
Reply #9 - Oct 19th, 2014 at 4:03pm
Print Post  
Micro,

I installed that beta version you recommended.  Still same problem.

What parameters do I need to change...
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Upload problem with retry sometimes
Reply #10 - Oct 19th, 2014 at 4:27pm
Print Post  
I've just seen that Arduino appear to have updated the usb drivers 

I have 18/08/2013 v 1.2.0.0 drivers which might or might not make a difference.

As a test, if you can find the boards.txt below the arduinoide/hardware/arduino folder then edit as follows:-

Find the line that is:-

Code
Select All
mega2560.build.variant=mega 



Add the following two lines after the line

Code
Select All
mega2560.vm.upload.sleep.before.close.flush=500
mega2560.vm.upload.sleep.after.close.flush=500
 



You need to re-start the ide or click tools>VISUAL MICRO>reload tool chains

Please check you are using the latest 1.0.x and latest usb drivers before editing the boards.txt. Thanks

  
Back to top
WWW  
IP Logged
 
Mike
Junior Member
**
Offline


Posts: 13
Joined: Jun 10th, 2014
Re: Upload problem with retry sometimes
Reply #11 - Oct 19th, 2014 at 5:00pm
Print Post  
Hi Visual,

I solved my issue by just recreating a new project from scratch.  Not sure why this would work, but perhaps you have an idea.

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Upload problem with retry sometimes
Reply #12 - Oct 19th, 2014 at 5:13pm
Print Post  
Good to hear that but a strange one. 

Maybe I should have asked for the verbose build output. I guess it is possible that even though the tool bar said board x ir was actually compiling for for board y. 

The only other thing I can think of is that the compiler cache hadn't detected a lib or ide core change, clicking "project>build>clean solution" would ensure a full clean compile.

Thanks for the update
  
Back to top
WWW  
IP Logged
 
Mike
Junior Member
**
Offline


Posts: 13
Joined: Jun 10th, 2014
Re: Upload problem with retry sometimes
Reply #13 - Oct 20th, 2014 at 4:26am
Print Post  
False Alarm!

So it appears to have worked.  After a couple more builds, it brought me to the same issue.   

Only think i did between loads was use beyond compare to diff my code and update it.


I tried the suggested updated including adding your suggested lines and doing a clean solution.  Arduino still times out.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Upload problem with retry sometimes
Reply #14 - Oct 20th, 2014 at 8:23am
Print Post  
Sorry I don't understand exactly  Smiley

Is it working in vm but not arduino?
Is it not working in either?
Eh?

Smiley

Thanks
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint