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
Normal Topic Error in debug mode (Read 5600 times)
_Fabio_
Newbies
*
Offline


Posts: 3
Joined: Apr 15th, 2015
Error in debug mode
Apr 15th, 2015 at 1:46pm
Print Post  
Hi,
when I compile in release it works without any problem.
When I switch to debug I receive the following messages:

Compiling debug version of 'Marlin' for 'Arduino Mega w/ ATmega2560 (Mega 2560)'
Marlin_main.cpp:536:2: error: 'MicroDebug' does not name a type
Marlin_main.cpp:536:30: error: 'MicroDebug' does not name a type
Marlin_main.cpp:536:69: error: 'MicroDebug' does not name a type
Marlin_main.cpp:536:116: error: expected constructor, destructor, or type conversion before '(' token
Marlin_main.cpp:536:125: error: expected constructor, destructor, or type conversion before '(' token
Marlin_main.cpp:536:130: error: 'MicroDebug' does not name a type
Error compiling


Does anyone know why this happens?
« Last Edit: Apr 15th, 2015 at 1:46pm by _Fabio_ »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error in debug mode
Reply #1 - Apr 15th, 2015 at 1:55pm
Print Post  
Hi,

A few questions

1) Does your sketch code redefine the standard Arduino Serial object? So can you compile Serial.println("Hello world") in your sketch?
2) What breakpoints have you set? and where?

Thanks


« Last Edit: Apr 15th, 2015 at 1:56pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
_Fabio_
Newbies
*
Offline


Posts: 3
Joined: Apr 15th, 2015
Re: Error in debug mode
Reply #2 - Apr 15th, 2015 at 2:21pm
Print Post  
I put breakpoints both in setup and loop.
I have to say that I'm trying to debug a 3D printer firmware to understand how it works. 
So it's not really clear to me what happens and where it happens.

Serial is not defined in my sketch, I would guess that is because there's a lcd and most likely the serial connection is used there. (It's also the first time I get in touch with arduino, so I might say something wrong)
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error in debug mode
Reply #3 - Apr 15th, 2015 at 3:29pm
Print Post  
The debugger uses Serial by default.

If you sketch re-defines the Arduino Serial then it will not work.

Please answer question...

Can you compile your sketch with Serial.println("Hello world") 

It's just test code that you need to add to the setup or loop to see if it compiles ????
  
Back to top
WWW  
IP Logged
 
_Fabio_
Newbies
*
Offline


Posts: 3
Joined: Apr 15th, 2015
Re: Error in debug mode
Reply #4 - Apr 15th, 2015 at 3:50pm
Print Post  
When I said that it is not defined I was meaning that Serial.whatever doesn't compile.

So the answer is no: Serial.println("Hello world") doesn't compile.

I understand that the debugger needs the serial to communicate, can't I redirect it somewhere else or use the class serial defined in the sketch?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error in debug mode
Reply #5 - Apr 15th, 2015 at 11:11pm
Print Post  
Hi,

Thanks that is clear now.

I guess the Arduino hardwareSerial class has been dumped so I guess that also makes it impossible to use Serial2 or Serial3 (which the 2560 has).

You can try SoftwareSerial but it depends on how much free space you have on the 2560. It will need 3k or so. Normally projects that re-define Serial are BIG and clever projects that take a lot of cpu space.

To use SoftwareSerial you will need a couple of spare digital pins and something like an FTDI cable or adapter.

There is a doc here.

http://www.visualmicro.com/page/User-Guide.aspx?doc=Debugging-With-Different-Por...

Hope that helps.



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