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: 'MicroDebug' was not declared in this scope (marlin core) (Read 15218 times)
Dewey
Newbies
*
Offline


Posts: 7
Joined: Feb 7th, 2016
error: 'MicroDebug' was not declared in this scope (marlin core)
Feb 7th, 2016 at 10:11pm
Print Post  
Hi

I really appreciate any help with this.  I don't normally come to forums unless I've banged my head MANY times, and I'm at that point now where I could use some experienced help.  I'm brand new to VM, but it looks very promising.

I'm getting the following string of errors when trying to compile a version of a firmware called Marlin, which drives 3D printers, CNC machines, and some lasers.  There is one odd thing about it, and I'm not sure if it's responsible for this or not:  It comes as an Arduino project, but functions setup() and loop() are not in the .ino file...they exist in "MarlinMain.cpp".  However, I simply renamed them in MarlinMain.cpp, and inserted setup() and loop() functions in the .ino file that call the renamed ones in the .cpp file.

I'm using a motor driver board called an Azteeg X3 Pro, which is based around an Atmel Mega 2560.  I'm using Visual Studio 2015 Enterprise Update 1 with Win 10 (64) Home, and I'm both uploading and attempting to debug through the board's USB port (which on my machine is showing up as COM3).  I just downloaded the VM extension last night, and installed it immediately after installing Visual Studio.

Everything compiles fine under Release, but when I switch to Debug, I get an error message. 

The settings in Visual Micro that I set manually are: 

(Micro Debug) = Full
Remote Port = Serial2  <- (I saw on a tutorial video that the Mega 2560 uses this port. I have tried all available options for this: Serial, Serial1, Serial3, Serial4, Serial5, SerialUSB, even Console)
Remote Transport = SoftwareSerial
Upload Port = COM3
Remote Port = COM3

Here is the error I get when compiling:
Marlin.pde:In function 'void setup()
Marlin.ino:58:57: error: 'Serial2' was not declared in this scope
:void setup() { 
    debugger: The error shown above might be caused by invalid breakpoint syntax or the board is not yet supported for debugging (pls let us know!)
Error compiling project sources


Maybe I'm jumping the gun...the demo version of the plugin...does come with debug over USB functionality, doesn't it?

Thank you for any help!
« Last Edit: Feb 8th, 2016 at 12:09am by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12201
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: 'MicroDebug' was not declared in this scope
Reply #1 - Feb 7th, 2016 at 10:20pm
Print Post  
Hi,

If you are using Serial2 on a mega then it is a standard hardware serial port and does not use SoftwareSerial.

Please remove the SoftwareSerial setting from RemoteTransport which can be empty. (Empty will default to the correct setting)
  
Back to top
IP Logged
 
Dewey
Newbies
*
Offline


Posts: 7
Joined: Feb 7th, 2016
Re: error: 'MicroDebug' was not declared in this scope
Reply #2 - Feb 7th, 2016 at 10:25pm
Print Post  
Hi Tim

Thanks so much for your help.

I actually just read that and changed it, but now I'm getting a different string of errors.  They are:
Marlin.ino:In file included from
VM_DBG.h:170:2: error: 'HardwareSerial' does not name a type
:HardwareSerial *transport
VM_DBG.h:171:13: error: 'HardwareSerial' has not been declared
:void begin(HardwareSerial *theSerial)
VM_DBG.h:172:13: error: 'HardwareSerial' has not been declared
:void begin(HardwareSerial *theSerial, unsigned long baud)
VM_DBG.h:In member function 'void VisualMicroDebug::setVariable(T&, int, int)
VM_DBG.h:363:2: error: 'transport' was not declared in this scope
:transport->print("value=")


any idea what I'm doing wrong?

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


Posts: 12201
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: 'MicroDebug' was not declared in this scope
Reply #3 - Feb 7th, 2016 at 10:30pm
Print Post  
This is related to the marlin software. If I recall it redefines the standard Arduino serial.

From memory, support was added for marlin a month or so ago and its discussed in another thread.

I'll look it up when I get a mo and report back

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


Posts: 12201
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: 'MicroDebug' was not declared in this scope
Reply #4 - Feb 7th, 2016 at 10:33pm
Print Post  
ps: If you do have to use the RemoteTransport = SoftwareSerial then you will not enter Serial2 into the RemotePort but instead enter the numbers of the RemoteRx and RemoteTx pins. These must be interrupt-able pins.
« Last Edit: Feb 7th, 2016 at 10:33pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Dewey
Newbies
*
Offline


Posts: 7
Joined: Feb 7th, 2016
Re: error: 'MicroDebug' was not declared in this scope
Reply #5 - Feb 7th, 2016 at 10:38pm
Print Post  
Awesome!  Thanks for the tip.  When you say support was added recently, do you mean within a new version of the Marlin code itself, or were you referring to Visual Micro?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12201
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: 'MicroDebug' was not declared in this scope
Reply #6 - Feb 7th, 2016 at 10:41pm
Print Post  
Visual Micro, you  can also try a forum search if you want.
« Last Edit: Feb 7th, 2016 at 10:41pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Dewey
Newbies
*
Offline


Posts: 7
Joined: Feb 7th, 2016
Re: error: 'MicroDebug' was not declared in this scope
Reply #7 - Feb 7th, 2016 at 10:49pm
Print Post  
Wow, that's really cool for VM to incorporate functionality for specific types of firmware.

I think I found the post you were thinking of (here).

So I did what the admin from Visual Micro was recommending to the poster there; I inserted
Serial.println("Hello world");
in the .ino's setup() function.

...and something really weird happened.  It threw a spew of errors, then decided to compile anyway. (?)
You can see down at the bottom where immediately after the errors, it goes about compiling.  I'm trying debugging next...

Marlin.ino:In file included from
VM_DBG.h:170:2: error: 'HardwareSerial' does not name a type
:HardwareSerial *transport
VM_DBG.h:171:13: error: 'HardwareSerial' has not been declared
:void begin(HardwareSerial *theSerial)
VM_DBG.h:172:13: error: 'HardwareSerial' has not been declared
:void begin(HardwareSerial *theSerial, unsigned long baud)
VM_DBG.h:In member function 'void VisualMicroDebug::setVariable(T&, int, int)
VM_DBG.h:363:2: error: 'transport' was not declared in this scope
:transport->print("value=")
Marlin.pde:In function 'void setup()
Marlin.ino:58:57: error: 'Serial2' was not declared in this scope
:void setup() { 
    debugger: The error shown above might be caused by invalid breakpoint syntax or the board is not yet supported for debugging (pls let us know!)
Marlin.ino:58:112: error: 'class VisualMicroDebug' has no member named 'transport
:void setup() { 
    debugger: The error shown above might be caused by invalid breakpoint syntax or the board is not yet supported for debugging (pls let us know!)
Marlin.ino:60:1: error: 'Serial' was not declared in this scope
:Serial.println("Hello world")
Error compiling project sources

Compiling debug version of 'test' for 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)'
Build folder: file://C:/Users/dd/AppData/Local/V.Micro/Arduino/Builds/test/mega_atmega2560
Binary sketch size: 3,364 bytes (used 1% of a 253,952 byte maximum) (1.49 secs)
Minimum Memory Usage: 371 bytes (5% of a 8192 byte maximum)
  
Back to top
 
IP Logged
 
Dewey
Newbies
*
Offline


Posts: 7
Joined: Feb 7th, 2016
Re: error: 'MicroDebug' was not declared in this scope
Reply #8 - Feb 7th, 2016 at 10:52pm
Print Post  
OKay, maybe not as promising as I had hoped.  It only compiles if I choose the "build" option.  If I try to actually Debug, it stops after the first bunch of errors and doesn't proceed to try to build.   

Stuck again.  Undecided
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12201
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: 'MicroDebug' was not declared in this scope
Reply #9 - Feb 7th, 2016 at 10:57pm
Print Post  
I think you have two projects in your solution. One is called test and using the standard mega 2560 board selection?

The build option builds all projects in the solution, where as the start/upload attempts to build the "startup project" (in bold) and then upload.
  
Back to top
IP Logged
 
Dewey
Newbies
*
Offline


Posts: 7
Joined: Feb 7th, 2016
Re: error: 'MicroDebug' was not declared in this scope
Reply #10 - Feb 7th, 2016 at 11:00pm
Print Post  
Oh..my..GOSH.  You are correct.  I was fiddling with the debugger when I got it and created a generic "test" project, but didn't know it managed to get into my Marlin solution.

I deleted it, and now get the same errors, but at least the generic test project is gone.  Good eye!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12201
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: 'MicroDebug' was not declared in this scope (marlin core)
Reply #11 - Feb 7th, 2016 at 11:55pm
Print Post  
I found this in the release notes from 1st of Jan

Quote:
Debug support for default Marlin Serial port (tip: To use Serial1 set project>Transport=HardwareSerial and project>RemotePort=Serial1)
« Last Edit: Feb 8th, 2016 at 12:09am by Tim@Visual Micro »  
Back to top
IP Logged
 
Dewey
Newbies
*
Offline


Posts: 7
Joined: Feb 7th, 2016
Re: error: 'MicroDebug' was not declared in this scope (marlin core)
Reply #12 - Feb 8th, 2016 at 3:48am
Print Post  
Thanks for that tip.  I did try that combo of transport and port...still no joy.  Not sure what I'm doing/not doing wrong though.  Has anyone seen anything similar?

Marlin.ino:In file included from
VM_DBG.h:170:2: error: 'HardwareSerial' does not name a type
:HardwareSerial *transport
VM_DBG.h:171:13: error: 'HardwareSerial' has not been declared
:void begin(HardwareSerial *theSerial)
VM_DBG.h:172:13: error: 'HardwareSerial' has not been declared
:void begin(HardwareSerial *theSerial, unsigned long baud)
VM_DBG.h:In member function 'void VisualMicroDebug::setVariable(T&, int, int)
VM_DBG.h:363:2: error: 'transport' was not declared in this scope
:transport->print("value=")
Marlin.pde:In function 'void setup()
Marlin.ino:58:57: error: 'Serial1' was not declared in this scope
:void setup() { 
    debugger: The error shown above might be caused by invalid breakpoint syntax or the board is not yet supported for debugging (pls let us know!)
Marlin.ino:58:112: error: 'class VisualMicroDebug' has no member named 'transport
:void setup() { 
    debugger: The error shown above might be caused by invalid breakpoint syntax or the board is not yet supported for debugging (pls let us know!)
Marlin.ino:60:1: error: 'Serial' was not declared in this scope
:Serial.println("Hello world")
Error compiling project sources
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12201
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: 'MicroDebug' was not declared in this scope (marlin core)
Reply #13 - Feb 8th, 2016 at 3:55pm
Print Post  
I see you are still using Serial.

Did you try the guide in my previous message and set RemotePort=Serial1?
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint