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) Visual Studio crash following debug download (Read 10278 times)
Don Moser
Junior Member
**
Offline


Posts: 16
Joined: Mar 7th, 2013
Visual Studio crash following debug download
Mar 20th, 2013 at 4:28pm
Print Post  
I have been using this tool for a couple of weeks now with fairly good results however today I have run into something I have not seen yet.

When I attempt to us VS, compile my program and download to the target all is well UNTIL sometime during the download process. I get the following message:

Uploading to I/O board using 'COM3'. I can observer the TX / RX led's indicating activity to / from the target

Usually I will get a message indicating that the process is complete. Following this point in time the VS application is hung, unresponsive and requires a stop via kill or 'X' (dialog button).

A power cycle / reset to the target results in non-operation so I suspect the download process failed. (validated via the Arduino standard Serial Monitor tool)

It I attempt to reproduce the issue without unplugging and reinserting the Arduino target I receive a message indicating that the COM3 port is in use. (I suspect a problem in the program download process)

If I remove / re-insert the USB plug and attempt to use the 'normal' Arduino tool chain the application runs properly and the target performs as expected.

If I configure VS to disable the debug the download is successful and I can use the Serial Monitor to verify the proper operation of the program. (obviously without debug support! Smiley)

Setting VS back to debug results in the same hang.

I have attempted to reproduce this issue with another very simple sketch and all works fine.

Any ideas? I have grown accustomed to the debugger; would like to use it! Smiley

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio crash following debug download
Reply #1 - Mar 20th, 2013 at 6:58pm
Print Post  
Hi Don,

The upload process for the debugger is the same as normal upload. I suspect the serial monitor is the problem and if it is we will discover which setting is causing the problem after I understand the following:-. 

If you close the serial monitor and then perform the debug upload does this work?

Are RemotePort and LocalPort empty in your project properties? If not what is entered into them?

Please zip and email the "Visual Micro" folder that will have been automatically created below your sketch folder to info[at]visualmicro.com

Thanks
  
Back to top
IP Logged
 
Don Moser
Junior Member
**
Offline


Posts: 16
Joined: Mar 7th, 2013
Re: Visual Studio crash following debug download
Reply #2 - Mar 21st, 2013 at 2:38pm
Print Post  
The serial monitor is not displayed during the attempted download; not sure how it could be though, in my experience it is closed by VM prior to the download process.

The RemovePort and LocalPort variables are '' (empty)

Zip file being sent.

Thanks for the support!

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio crash following debug download
Reply #3 - Mar 21st, 2013 at 3:12pm
Print Post  
Hi Don,

The serial monitor remains open during upload, it is the expressions window and graphical controls that close.

I have received your files thanks. They settings seem very straightforward so this might some the usb driver.

Once we have established if we still get the crash with the serial monitor closed I would like to test with your sketch if possible?

Can you email it? Thanks very much.
  
Back to top
IP Logged
 
Don Moser
Junior Member
**
Offline


Posts: 16
Joined: Mar 7th, 2013
Re: Visual Studio crash following debug download
Reply #4 - Mar 21st, 2013 at 3:37pm
Print Post  
Not sure if company will allow me to send complete sketch (I don't see why but I will have to ask for permission).

Interesting note RE the USB though; I started having this issue after I inserted a 'different' Arduino board (One that I have not used before). When I inserted the new board the OS assigned a different COM  port to the USB. I wonder if this is causing some issues?

As far as the serial window goes; I do not 'see' the serial monitor and the Window->Windows menu option does not indicate a serial monitor. 

Clicking on Tools -> Arduino -> Serial Monitor however will bring up the serial monitor.

If I attempt to download with the Serial Monitor displayed I get:

Port open
Port closed
Uploading to I/O Board

And nothing else.

However VS does not die if Serial Monitor is displayed.

If I close the Serial Monitor and attempt to load again (without a restart) I get the 'Access to the port 'COM3' is denied so I suspect the process is still 'stuck'.

Keep in mind I have a very simple sketch that still works ok..... Sad

BTW; I have searched the Arduino forum and it is a reported problem that the libraries (sprintf) do not currently support floating point.. Just in case someone else on this forum was curious.

Hmmm

Don

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio crash following debug download
Reply #5 - Mar 21st, 2013 at 4:01pm
Print Post  
Hi Don,

The sketch is fine, this is a USB issue. The debugger does have to perform an additional reset on the board when it starts which I think is the problem.

Can you see what driver shows via "control panel>device manager" when you have the board plugged in.

Thanks

ps: Arduino support (or lack of it) for sprintf or any other function is irrelevant to Visual Studio and can not cause a crash. 

If the upload completes then we know the Arduino is working well.

When the debugger starts Visual Micro will always attempt to open the serial monitor if it is not already open. 

After debug upload and when the debugger starts it will perform a double reset on the USB port. 

It sounds like the double reset is causing the problem. You could try switch project property "DtrOrDelay=False" and also setting the "Dtr" to False on the serial monitor window. This will stop the double reset but will mean that breakpoints in the setup() method might be missed when the debugger starts.

I think a more up to date usb driver will fix this but it's currently just a guess.
« Last Edit: Mar 21st, 2013 at 4:07pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Don Moser
Junior Member
**
Offline


Posts: 16
Joined: Mar 7th, 2013
Re: Visual Studio crash following debug download
Reply #6 - Mar 22nd, 2013 at 3:01pm
Print Post  
Driver:

'Arduino Mega 2560 (COM3)'

Driver date: 11/15/2007
Driver Version 5.1.2600.0


Is this the latest USB driver? If not where can I get the latest.

Startup Delay (ms)  0
Startup Delay or Dtr false
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio crash following debug download
Reply #7 - Mar 22nd, 2013 at 8:34pm
Print Post  
Thanks, the driver is the standard driver that we all use.

As concerns COM port it is normal that a different port is assigned to each board.

1) Does your Arduino sketch code use the serial port?

2) Please switch break/pause=False. Does this stop the problem?

3) What is the compiled size of the sketch in normal compile mode?

Thanks

  
Back to top
IP Logged
 
Don Moser
Junior Member
**
Offline


Posts: 16
Joined: Mar 7th, 2013
Re: Visual Studio crash following debug download
Reply #8 - Mar 29th, 2013 at 9:21pm
Print Post  
Sorry for the delay; I have been on travel this week.

Yes, my sketch does use the serial  port (for diagnostic output, written before I started using your tool)

I switched the break/pause to FALSE and things now seem to work (of course I cannot break; but that may not be a big problem)

The compiled size of the sketch is:

Binary sketch size: 20686 bytes (of a 258048 byte maximum) (2.6520047 secs)

Thanks,

Don


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