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) Error Compiling (Read 15205 times)
jchamilt
Junior Member
**
Offline


Posts: 14
Joined: Aug 8th, 2012
Error Compiling
Aug 9th, 2012 at 1:24pm
Print Post  
Windows 7 Pro x64
VS 2010 - 10.0.30319.1 RTMrel
Arduino 1.0.1

when compiling existing sketch with debugger I am getting

===

Compiling 'Version_1_xnp_uno_Temp' for 'Arduino Uno'
Binary sketch size: 17866 bytes (of a 32256 byte maximum) (1.6958223 secs)
Compiling debug version of 'Version_1_xnp_uno_Temp' for 'Arduino Uno'
Version_1_xnp_uno_Temp.ino : In function 'void setup()'
Version_1_xnp_uno_Temp.ino : 'MicroDebug' was not declared in this scope
Error compiling 

====

if I create a new sketch it seems to work though..

any ideas?

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error Compiling
Reply #1 - Aug 9th, 2012 at 2:54pm
Print Post  
Okay the caching has been improved in the next release. For now in the original sketch please click "Build, Clean Solution". This deletes all the temp files in users\appdata\VMicro
  
Back to top
WWW  
IP Logged
 
jchamilt
Junior Member
**
Offline


Posts: 14
Joined: Aug 8th, 2012
Re: Error Compiling
Reply #2 - Aug 10th, 2012 at 7:07pm
Print Post  
still doesn't compile with the old sketch after Build, Clean Solution.   

I just copy and pasted into a new project from with in VS and it compiles successfully.

running is another matter, I can debug simple sketches, but some of my bigger ones dont even start after compiling and uploading.

should I be developing on a Mega to get the extra horsepower?

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error Compiling
Reply #3 - Aug 10th, 2012 at 8:14pm
Print Post  
1)
Good (for me), after giving it some thought I was hoping you would say it failed. Please email the Upload.vmps.xml file from the .vmprogram folder below the sketch. Thanks.

..

2)
As far as size goes I have seen proper errors if size is exceeded so this must be something else. Have you switched on "Startup Wait" if so you certainly need to switch on the DTR checkbox on the serial window otherwise VS will miss the F5 message. In which case sending any serial char using the serial window would have the same affect as F5 but the DTR will stop the problem.

If you haven't switch on "startup wait" or if the DTR doesn't fix this then please email the sketch and the folder below called .vmprogram. 

..

Thanks
« Last Edit: Aug 10th, 2012 at 8:19pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
jchamilt
Junior Member
**
Offline


Posts: 14
Joined: Aug 8th, 2012
Re: Error Compiling
Reply #4 - Aug 10th, 2012 at 8:25pm
Print Post  
Email sent..

xml file from the sketch that does not compile, and the sketch that does compile but has issues running..

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error Compiling
Reply #5 - Aug 10th, 2012 at 8:38pm
Print Post  
thanks, i've sent you an email. I need all the xml files from the .vmprogram folder thanks and also please tell me where you have breakpoints, if any? or just send the entire sketch folder so i can see breakpoints for myself.

I prob should have just asked for the entire sketch folder and .vmprogram folder in the first place! sorry
« Last Edit: Aug 10th, 2012 at 8:41pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error Compiling
Reply #6 - Aug 10th, 2012 at 11:16pm
Print Post  
Got all the files thanks.

From your config I can see the following:-

1) You have the local debug port set to COM3. 

2) You are expecting the debug to use the main arduino "Serial" for debug (which is also upload port). I can see this because the RemotePort and RemoteTansport properties are empty therefore using the defaults.

Are you sure that COM3 is the correct port?, if not clear out COM3 from the project properties and the debug will default to whatever you are using for an upload port.

In my test of your project, I cleared COM3 and added a breakpoint to the loop() function. After debug upload I could correctly see trace messages.

By the way in terms of memory usage, the debug stuff has added very little extra memory and your sketch is still well within the limits of a 328/uno type chip. No mega required. Your sketch is 17850 bytes without debug and 18044 bytes with debug + a single breakpoint. So you have plenty of room for more code and more breakpoints. The limit of a 328 is 30720 bytes.

Let me know how you get on or if I am missing the point.

Thanks
« Last Edit: Aug 10th, 2012 at 11:24pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
jchamilt
Junior Member
**
Offline


Posts: 14
Joined: Aug 8th, 2012
Re: Error Compiling
Reply #7 - Aug 13th, 2012 at 3:06pm
Print Post  
still not working on my end with the sketch..

Release works fine..

but when I compile and upload with debug it seems to lock up the arduino


i get a few lines of

Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1
Program Started 'XNP_TEMP_V2' Version 1

and then it just stops

no activity lights on the arduino.. no rx or tx lights

I have tried a different arduino, changed the com ports, updated Visual Studio, rebooted the machine, etc..

still no go..


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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error Compiling
Reply #8 - Aug 13th, 2012 at 3:54pm
Print Post  
Yes it's just re-booting all the time, something is going wrong just after the "void setup() {"

I need you to explain which settings you have changed and where you have placed breakpoints with what properties. OR, It might be easier for you to zip and email the sketch folder (and sub folders). You also need to include the visual studio solution files that contain your project (.sln and.slo) because the breakpoints are stored in the solution.

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


Posts: 14
Joined: Aug 8th, 2012
Re: Error Compiling
Reply #9 - Aug 13th, 2012 at 5:21pm
Print Post  
emailed you the project folder..

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error Compiling
Reply #10 - Aug 13th, 2012 at 9:36pm
Print Post  
Thanks for the files they were very useful.

I think I've got to the bottom of the problems, when you asked about memory the other day I should have given it more thought.

This certainly appears to be memory related but it easily fixed. Once we fix the memory issues we can see if vm is working correctly in a shared serial senario, if not it can be addressed.

I used the new memory reporting options that are standard in the next release to discover that all of your manual debug messages have nearly blown the 2048Kb limit on your arduino (see below). 

You are so close to the limit that even in "release" (normal) mode your program soon starts to fail with a a few more serial.print("big string") calls.

Switching on vm debug currently has a fixed overhead of about 40 bytes + each breakpoint can consume further bytes. 

A simple visual micro breakpoint with a "When Hit" message will consume 8 bytes REGARDLESS of the length of the text in the message. Adding {expressions} will consume a few bytes per expression.

In your sketch the code after the "hihi" message can  causes extra memory bytes to be consumed by the arduino which, with debug enabled, can just push things over the limit and cause the arduino to crash.

Commenting out the following two unrelated but memory consuming lines in your program stopped the crash.

Code
Select All
Serial.println("CRC is not valid!");
Serial.print("Device is not recognized"); 




Below are the memory reports for release and debug compilations...

Compiling release version of 'XNP_TEMP_V2' for 'Arduino Duemilanove w/ ATmega328'

Data:       1892 bytes (92.4% Full)

Compiling debug version of 'XNP_TEMP_V2' for 'Arduino Duemilanove w/ ATmega328'

Data:       1932 bytes (94.3% Full)

Solutions

I can see two possible solutions

1) 

Move all your "strings" to using PROGMEM memory(limited to 1kb I think)

OR

2) 

Swap out all your Serial.print() manual debug stuff for Visual Micro breakpoints using the "When Hit" property for nicely formatted information messages. Doing so should save you about 1800 bytes of memory out of 2048 Smiley

Don't forget that you can add multiple {expressions} and/or  text into the "When Hit" breakpoint property. So a single breakpoint might tell a big story.

You can also format your expressions as required. 

Example:-

Function xyz has returned {myExpression,HEX} and x={expression1/expression2}
  
Back to top
WWW  
IP Logged
 
jchamilt
Junior Member
**
Offline


Posts: 14
Joined: Aug 8th, 2012
Re: Error Compiling
Reply #11 - Aug 14th, 2012 at 1:49pm
Print Post  
commented out a bunch of my serial print lines and its working like a charm! 

sharing the com port is working as well..

Thanks for the help.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error Compiling
Reply #12 - Aug 14th, 2012 at 2:00pm
Print Post  
Thanks for the update. I enjoyed using the memory checker that Joe Sto recommended to solve this puzzle Smiley
  
Back to top
WWW  
IP Logged
 
jchamilt
Junior Member
**
Offline


Posts: 14
Joined: Aug 8th, 2012
Re: Error Compiling
Reply #13 - Aug 14th, 2012 at 4:01pm
Print Post  
Tim@Visual Micro wrote on Aug 14th, 2012 at 2:00pm:
Thanks for the update. I enjoyed using the memory checker that Joe Sto recommended to solve this puzzle Smiley



link?

I would like to check it out as well..

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error Compiling
Reply #14 - Aug 14th, 2012 at 6:17pm
Print Post  
If you read this thread you see the AVR Memory Report that can be optional enabled. The report shows how much memory has been consumed immediately after compile, prior to upload.

http://www.visualmicro.com/forums/YaBB.pl?num=1330632829

More recent posts in the same thread shows an additional graphical view of real-time available memory (via the debugger) while the arduino is running.

I used the memory report (after compile) option to see how much memory your program was using. 

Commenting or adding strings and clicking compile immediately showed the impact of the code changes.

+ When building a debug version you get to see both memory reports (release and debug) so we can clearly see the overhead of the debugger.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint