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) Can't get Visual Micro to work with my real project! (Read 8166 times)
Lonzell Hall
Newbies
*
Offline


Posts: 5
Joined: Jun 26th, 2013
Can't get Visual Micro to work with my real project!
Jul 1st, 2013 at 3:52pm
Print Post  
I have written a test application and I can debug that application with no problem. But when I try to debug my real application I get the following error:

'MicroDebug' was not declared in this scope

Can some one please help me???? I am ready to purchase the Visual Micro plugin but I need to get it working on my real project first, thanks in advance.

I am running Visual Studio 2010 Professional, Arduino 1.04, and the Current Visual Micro dated Thu May 9, 2013 at 3:00 AM. I have activated the 30 day trial also.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Can't get Visual Micro to work with my real project!
Reply #1 - Jul 1st, 2013 at 4:05pm
Print Post  
Hi,

Thanks for the info.

I can only think of two possible reasons for this:-

1) A breakpoint in an invalid location

Do you have any breakpoints?

2) Can you confirm that there is not a blank line between setup() and first open brace. Both of the following examples are okay

Code
Select All
void setup()
{ 



or this is okay

Code
Select All
void setup() {
 



In the current release this is not okay...

Code
Select All
void setup()

{
 




Does this help?

Thanks
« Last Edit: Jul 1st, 2013 at 4:05pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Lonzell Hall
Newbies
*
Offline


Posts: 5
Joined: Jun 26th, 2013
Re: Can't get Visual Micro to work with my real project!
Reply #2 - Jul 1st, 2013 at 4:32pm
Print Post  
Thanks for the quick response, and yes I have verified that there is not blank line between setup and the curly braces. Yes I have 3 breakpoints but since I can't get my project to compile and upload do the breakpoints even matter?

Note: If I disable Micro Debug by setting Enable Debugging to None. My code compiles and uploads with no problem.

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


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Can't get Visual Micro to work with my real project!
Reply #3 - Jul 1st, 2013 at 4:35pm
Print Post  
Hi,

Syntax errors in breakpoints could be the reason for the compiler problem. Remember this is a software debugger so it needs to inject code into a temp copy of your program. Therefore even though the debug is not running the compile is a debug compile, hence the difference from the release build.

The best thing to do is to switch on Tools>options>visual micro>compile>show build folder

Then click compile, after the error CTRL+CLICK the link to the build folder that appears then zip and email all the files in the temp build folder that opens when you click the link

Thanks
  
Back to top
IP Logged
 
Lonzell Hall
Newbies
*
Offline


Posts: 5
Joined: Jun 26th, 2013
Re: Can't get Visual Micro to work with my real project!
Reply #4 - Jul 1st, 2013 at 4:38pm
Print Post  
Correction I just realized that the breakpoints were only in the test code and not my real project sorry for the error. Do you still want me to follow your instructions?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Can't get Visual Micro to work with my real project!
Reply #5 - Jul 1st, 2013 at 4:40pm
Print Post  
Yes please thanks
  
Back to top
IP Logged
 
Lonzell Hall
Newbies
*
Offline


Posts: 5
Joined: Jun 26th, 2013
Re: Can't get Visual Micro to work with my real project!
Reply #6 - Jul 1st, 2013 at 4:50pm
Print Post  
I noticed that the mega2560 build folder contains the actual source code files too, what do you actually need?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Can't get Visual Micro to work with my real project!
Reply #7 - Jul 1st, 2013 at 8:26pm
Print Post  
Yes please send everything in a zip
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Can't get Visual Micro to work with my real project!
Reply #8 - Jul 2nd, 2013 at 3:14pm
Print Post  
Hi,

Thanks for the zip.

Please remove the arduino.h include from your source code and then attempt to compile with the Arduino IDE.

Please tell me if that works or fails??

Info

The problem is that the Arduino.h and the visual micro debugger are automatically added as includes just above real code (non-includes). This is how Arduino works for the arduino.h, even without the debugger. The system does not handle #if defines very well which you have used extensively at the start of your code.

I notice in your code that both the arduino.h and vm debugger includes have ended up inside the check for #if SCREEN, so they are not automatically included when SCREEN=0. I see you have added arduino.h manually possibly to get around a compiler problem for the same reason?

Notice that the arduino.h has been included before the first line of "real" non #define code.

Code
Select All
#if SCREEN
#include "arduino.h"
#include <VM_DBG.h>

void toggleHardwareCc1101ReceivePkt();
//
//
void printUpDown();
int heartRate = 70;
int prevHeartRate = 70;
int val = 0;
#endif
 



Considering the complexity of the #defines and conditional includes within your code you might find that declaring a simple variable such as a uint8_t where you want the includes to be placed would solve this problem. Or even consider changing your code to this for a quick fix. In the following case I would expect both visual micro and arduino to place auto includes just above myDummyVar

Code
Select All
uint8_t myDummyVar;

#if SCREEN
void toggleHardwareCc1101ReceivePkt();
//
//
void printUpDown();
int heartRate = 70;
int prevHeartRate = 70;
int val = 0;
#endif
 



Thanks
« Last Edit: Jul 2nd, 2013 at 3:16pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Lonzell Hall
Newbies
*
Offline


Posts: 5
Joined: Jun 26th, 2013
Re: Can't get Visual Micro to work with my real project!
Reply #9 - Jul 2nd, 2013 at 8:01pm
Print Post  
Hi Tim, thanks for your response. I tried adding the uint8_t myDummyVar above all the #if and #endif and that worked!

Thanks a lot for your help in this matter!

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