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) ArduPilot/FastSerial: VM_DBG.h error (Read 16014 times)
Clayton
Junior Member
**
Offline


Posts: 19
Joined: Oct 29th, 2012
ArduPilot/FastSerial: VM_DBG.h error
Nov 3rd, 2012 at 6:41am
Print Post  
I can debug simple programs like the one in your youtube video, but now I'm working with Arduplane.  With Arduplane compiling and loading just fine, I change (Micro Debug) from none to Full and I leave it in "Release" mode - and don't create any debug points.  I get the following:

Code
Select All
Compiling 'ArduPlane' for 'Arduino Mega 2560 or Mega ADK'
Binary sketch size: 171010 bytes (of a 258048 byte maximum) (3.9332249 secs)
Compiling debug version of 'ArduPlane' for 'Arduino Mega 2560 or Mega ADK'
ArduPlane.pde : In file included from
VM_DBG.h : ISO C++ forbids declaration of 'HardwareSerial' with no type
VM_DBG.h : expected ';' before '*' token
VM_DBG.h : 'HardwareSerial' has not been declared
VM_DBG.h : 'HardwareSerial' has not been declared
VM_DBG.h : : In member function 'void VisualMicroDebug::setVariable(T&, int, int)':
VM_DBG.h : 'transport' was not declared in this scope
ArduPlane.pde : : In function 'void setup()':
ArduPlane.pde : begin(FastSerial*, long int)'
VM_DBG.h : begin(int*)
VM_DBG.h : begin(int*, long int)
ArduPlane.pde : 'class VisualMicroDebug' has no member named 'transport'
Error compiling
 

« Last Edit: Nov 3rd, 2012 at 6:56pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VM_DBG.h error
Reply #1 - Nov 3rd, 2012 at 12:35pm
Print Post  
Did you switch the transport to FastSerial in the project settings?

http://www.visualmicro.com/post/2012/05/06/Configure-debug-for-other-types-of-se...
  
Back to top
IP Logged
 
Clayton
Junior Member
**
Offline


Posts: 19
Joined: Oct 29th, 2012
Re: VM_DBG.h error
Reply #2 - Nov 3rd, 2012 at 4:42pm
Print Post  
Shame on me - I had not seen that.  I'm up and running now.   
Thanks so much!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VM_DBG.h error
Reply #3 - Nov 3rd, 2012 at 5:09pm
Print Post  
It's a good think or I would never know that someone had used the FastSerial system without problem. Thanks for feed back  Smiley
  
Back to top
IP Logged
 
Clayton
Junior Member
**
Offline


Posts: 19
Joined: Oct 29th, 2012
Re: VM_DBG.h error
Reply #4 - Nov 3rd, 2012 at 5:23pm
Print Post  
Now I've got it going, but no matter what breakpoint I set, it just keeps running!

[Edit] By running, I mean I changed Remote Transport to FastSerial, then slapped the F5 button.

The serial window is on 57600 and my RC transmitter can move the servos on the Ardupilot, but nothing shows in the Micro Debug Message window.  Here's a screen shot.
« Last Edit: Nov 3rd, 2012 at 5:42pm by Clayton »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPilot/FastSerial: VM_DBG.h error
Reply #5 - Nov 3rd, 2012 at 7:00pm
Print Post  
Are you sure fastSerial on your selected port is working at 57600. 

If I recall, APM uses 115200 on the main USB Serial and 57600 on Xbee serial.

You will see some rubbish in the serial window because apm outputs binary but that looks like the wrong sort of rubbish to me. You will get the wrong sort of rubbish if the speed is wrong. 

Edit: Try setting LocalSpeed and RemoteSpeed to 115200. It looks like vm is not forcing the default of 115200 for fastSerial. 

57600 won't work because ArduPilot is using 115200
« Last Edit: Nov 3rd, 2012 at 7:08pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPilot/FastSerial: VM_DBG.h error
Reply #6 - Nov 3rd, 2012 at 7:13pm
Print Post  
By the way once you have your tracepoint showing you will know things are working.

By default, all breakpoints are tracepoints until you enable "break/pause = true" in vm project settings.

When you enable break/pause you will see a warning message that this feature should not be used during flight or with anything dangerous. This is why it is off by default.
  
Back to top
IP Logged
 
Clayton
Junior Member
**
Offline


Posts: 19
Joined: Oct 29th, 2012
Re: ArduPilot/FastSerial: VM_DBG.h error
Reply #7 - Nov 4th, 2012 at 2:02am
Print Post  
Well, this is starting to get frustrating.  Yes, I was accidentally using the wrong speed, but unfortunately that wasn't the culprit.  I selected the right speed in the serial monitor and hard coded it into Micro Debug as suggested.  Still nothing in the trace window for APM, BUT I can upload a simple program to the APM board and unselect FastSerial, and debug works fine.

Ardupilot code upload and FastSerial:
http://claytonasmith.com/images/screen_2012-11-03_18-51-20.png
debugtest code and no FastSerial:
http://claytonasmith.com/images/screen_2012-11-03_18-58-40.png
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPilot/FastSerial: VM_DBG.h error
Reply #8 - Nov 4th, 2012 at 3:17am
Print Post  
Yes, even if the "case 2:" in the code isn't hit I would expect to see a single message in the trace confirming that debug had started in response to a hello from the arduino.

I'll give it a try

Thanks
« Last Edit: Nov 4th, 2012 at 4:12am by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPilot/FastSerial: VM_DBG.h error
Reply #9 - Nov 4th, 2012 at 3:59am
Print Post  
Okay, I have just downloaded the latest ArduPlane 2.66 and debug worked first time. 

I am using an APM2 and left everything else as default.

You can see the serial window shows apm text messages mixed with binary and looks quite different to the output in your serial window which leads me to suspect the serial rate is different. 

Questions

What config settings have you made to your copy of ardupilot? 
Have you re-started vs since having these problems?
When ArduPlane starts, do you see similar text in the serial window as shown below?


« Last Edit: Nov 4th, 2012 at 4:03am by Tim@Visual Micro »  
Back to top
IP Logged
 
Clayton
Junior Member
**
Offline


Posts: 19
Joined: Oct 29th, 2012
Re: ArduPilot/FastSerial: VM_DBG.h error
Reply #10 - Nov 4th, 2012 at 8:41am
Print Post  
Things seem to be working now.  Thanks very much for the reply - you prompted me to download ArduPlane 2.66, which may have been the problem.  I know it was one of these things:
1) Ardupilot 2.65 (or something I had added)
2) VM or VMdebug install (I uninstalled both and reinstalled)
3) VS 2012 preferences (which I reset to factory settings)

Thanks again!  Now lets see if I can make use of the little deBUGGER!

  
Back to top
 
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: ArduPilot/FastSerial: VM_DBG.h error
Reply #11 - Nov 4th, 2012 at 9:06am
Print Post  
Geez, someone with more desktop icons that me Smiley
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPilot/FastSerial: VM_DBG.h error
Reply #12 - Nov 4th, 2012 at 3:53pm
Print Post  
Great. Yes keep any eye on the apm settings. I think it switches baud rate if you pump the gcs messages via the main serial port instead of the default serial3.

It is also possible that vm wasn't switching your serial window speed (which had previously been used at 57600) to 115200 correctly. 

I'll do some more FastSerial tests when I get time but it seems to be okay for now.

Just remember that when sharing the serial port with the debugger, the debugger speed has to match whatever apm is using.

If you bump into problems because you want the gcs on serial1 then hook the debugger up to serial3 or use the SoftwareSerial option on any available apm digital pins that support interrupts.
« Last Edit: Nov 4th, 2012 at 3:56pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPilot/FastSerial: VM_DBG.h error
Reply #13 - Nov 4th, 2012 at 4:25pm
Print Post  
And a few hints that might mean something at some stage...

Project properties

1) Validation Skip. 

Set to False if you are not altering the apm code in a way that might cause compilation errors. This will skip the "release" build of apm that happens prior to the debug build. (Saves time)

2) Breakpoint Throttle

The unconditional breakpoint example in the 50hz loop is a good example for me to use...

By default, for newer users and non fastserial users the breakpoints are throttled so that the 50hz loop will only run at about 8-12hz. Visual micro ensures an 80 millisecond delay between breakpoints. 

a)
FastSerial is more efficient than normal serial so you could change the project property called Throttle (ms) to, for example, 30 (milllis) which would improve the speed. Leaving the Throttle (ms) empty uses the default of 80ms.

or b)
Try setting "Throttle Enabled = False" to entirely disable throttling in which case apm will send as fast as it can but it is possible for the arduino buffer to overflow causing the debug to stop working or invalid serial packets to be received by the debugger

or c)
Set the breakpoint "HitCount" to 50. Because we are in the 50hz loop this should produce one debug breakpoint message every second allowing apm to function at full speed inbetween each breakpoint message

or d)
Set the "Hit Counter" project property to milliseconds and all the breakpoint "HitCounters" will no longer be treated as counts, instead the HitCounts will represent milliseconds. So a breakpoint "HitCount" of 1000 would produce a debug  message exactly once every second regardless of where you put the breakpoint.

Tim
  
Back to top
IP Logged
 
Clayton
Junior Member
**
Offline


Posts: 19
Joined: Oct 29th, 2012
Re: ArduPilot/FastSerial: VM_DBG.h error
Reply #14 - Nov 5th, 2012 at 5:51am
Print Post  
Awesome.  I will be using the debugger a lot in the next 2 weeks.  We have an electric RC glider that we're dropping from a weather balloon on Nov 11th and I've got to finish up a custom version of the Ardupilot code before then!!

Thanks for the help - I'll let you know how it goes.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint