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) ArduPlane debug with Visual Micro (Read 23749 times)
Shyam B
Junior Member
**
Offline


Posts: 18
Location: Netherlands
Joined: Aug 3rd, 2012
ArduPlane debug with Visual Micro
Sep 23rd, 2012 at 8:23pm
Print Post  
I am happy to have used Visual Micro debuger, it saves a lot of time certainly. I am using the latest (Ver 3) of VM. Smiley However, I am facing some issues while dealing with Mega projects like ArduPlane. Sad

I have two issues:
1) Debugging ArduPlane on VS 2010 with Visual Micro
2) Enabling Visualizations to see IMU output.

The debugger works well for non-fast Serial programs. I am unable to use debugging feature on ArduPilot code. the debugger either throws error or gets hung after compilation/before upload onto APM board.

I am not unable to find the step by step 'tutorial'  and instructions for precisely making it work on 'Fast Serial' and on ArduPilot code (like ArduPlane/ ArduCopter).

If someone could help me with it and also how to set up visualizations (the tutorial that exists for this goes over my head and says get some visualization plugin from codeProject, I a project name/ link and a stepwise guide need to be provided for us to appreciate the true capability of VM). Any help is appreciated.

Thank you!
« Last Edit: Oct 9th, 2012 at 12:50pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPlane debug with Visual Micro
Reply #1 - Sep 23rd, 2012 at 9:55pm
Print Post  
Hello, 

FastSerial

You need to select FastSerial in the RemoteTransport project property:-



This will give FastSerial at 115200. You can also change the Local or Remote Speed to a different value depending on the speed that the Apm code is using for the selected Serial Connection.

I haven't tested FastSerial in the last debugger release so hopefully it's still working with this setting?

Visualizations

Give me some examples of the Apm variables you want to Visualization and where possible, the ranges of values you will expect

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPlane debug with Visual Micro
Reply #2 - Sep 24th, 2012 at 7:15pm
Print Post  
I've also just noticed this document on the main wiki which might be clearer

How to configure other debug transports such as SoftwareSerial or APM FastSerial
  
Back to top
WWW  
IP Logged
 
Shyam B
Junior Member
**
Offline


Posts: 18
Location: Netherlands
Joined: Aug 3rd, 2012
Re: ArduPlane debug with Visual Micro
Reply #3 - Sep 25th, 2012 at 8:51pm
Print Post  
Hi Tim,

I tried to configure ArduPlane code for FastSerial access. Btw it builds fine with VisualMicro and uploads well, but when it comes to debugging, it does not work and hangs! 

I checked the link you had sent already before posting here, but the setting detailed there results in a 'no response' Undecided. I used Arduplane v.2.65 (latest code base) and also v2.40 (earlier code base).
Could you please test FastSerial setting with ArduPlane code and see if it debugs properly?

Visualizations: It would be really nice to have a feature to check the signals (PWM) coming from the (8) OUTPUT pins for the APM board. These are the signals to drive the servo motors, etc.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPlane debug with Visual Micro
Reply #4 - Sep 25th, 2012 at 9:31pm
Print Post  
Hi Shyam, okay I'll check it but please look at this first...

What speed is the apm program using for FastSerial? Did you try 57600 in LocalSpeed and RemoteSpeed?

If it builds fine I would expect it to work because everything else is the same as normal debug.

Yes been thinking about pwms. You can hook them up yourself easy enough with what you have. Open another thread and I will explain.
« Last Edit: Sep 25th, 2012 at 9:32pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Shyam B
Junior Member
**
Offline


Posts: 18
Location: Netherlands
Joined: Aug 3rd, 2012
Re: ArduPlane debug with Visual Micro
Reply #5 - Sep 26th, 2012 at 9:03pm
Print Post  
Hi Tim,

I set the speed of APM program to be 57600 and then tried to debug by putting in this speed in local/ remote port speeds under debug option. After upload onto board, it just hangs(no response), says 'Visual Studio is busy performing some operation'.
I understand you said it should work, but it does not work for me; I even tried various other combinations and it throws error that 'avr-objcopy* : No such file' and other errors (I think it tries to compile the code in Visual Micro). Embarrassed

I am using Windows7 environment under VS 2010 (full version). Let me know if you could make it work...

Thanks!
« Last Edit: Sep 26th, 2012 at 9:05pm by Shyam B »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPlane debug with Visual Micro
Reply #6 - Sep 26th, 2012 at 9:34pm
Print Post  
Hi Shyam,

Thanks for trying. The idea to change the visual studio speed was only if your arduino program was already using a different speed. The idea is to make the debugger work at the right speed and not to change your program. You can clear the speeds and set the ardupilot code back to 115200

After some other reports I am starting to suspect that a settings refresh bug has crept into the system. I will be testing at the weekend and will test arduplane at the same time.

One thing: One user fixed the problem by switching to release and compiling then switching back to debug.

Tim
  
Back to top
WWW  
IP Logged
 
Shyam B
Junior Member
**
Offline


Posts: 18
Location: Netherlands
Joined: Aug 3rd, 2012
Re: ArduPlane debug with Visual Micro
Reply #7 - Sep 29th, 2012 at 3:17pm
Print Post  
Hi Tim,

I am sure there is some problem. I thought it worked for me after trying the workaround you stated but gave me errors this time, switching back from Release to Debug. I had to clean the solution and build again, but this time it hung (instead of giving Visual micro build errors), quite funny.  Shocked Next time, I reproduce the exact same problem I will attach the log file for your reference.

However, I would be eagerly awaiting a your solution on making Arduplane run using VM  Roll Eyes
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPlane debug with Visual Micro
Reply #8 - Sep 29th, 2012 at 3:29pm
Print Post  
Yes Shyam, I agree. No need for logs I will test thanks
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPlane debug with Visual Micro
Reply #9 - Sep 29th, 2012 at 9:59pm
Print Post  
I think I found the problem. It wasn't to do with FastSerial it was a clash of names with the apm memcheck functions.

The vm memory check functions are new features which is why it had stopped working in recent releases.

This also showed up an oversight, because the debugger memcheck code should not have been included unless the memory reporting option had been enabled.

The vm memory check routines have been renamed. 

There is a new debug upgrade msi on the beta download page.

Look forward to hearing how you get on.

Thanks
  
Back to top
WWW  
IP Logged
 
Shyam B
Junior Member
**
Offline


Posts: 18
Location: Netherlands
Joined: Aug 3rd, 2012
Re: ArduPlane debug with Visual Micro
Reply #10 - Sep 29th, 2012 at 10:47pm
Print Post  
HI Tim,

The latest release is dated Sept 15, 09:00hrs as seen from the beta download page. Could you please pass me the link of current release of VM?

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPlane debug with Visual Micro
Reply #11 - Sep 29th, 2012 at 11:57pm
Print Post  
Hi Shyam, the beta download page is the link you were emailed for the debugger upgrade, not codeplex.

Does this make sense?
  
Back to top
WWW  
IP Logged
 
Shyam B
Junior Member
**
Offline


Posts: 18
Location: Netherlands
Joined: Aug 3rd, 2012
Re: ArduPlane debug with Visual Micro
Reply #12 - Sep 30th, 2012 at 8:52am
Print Post  
Hi Tim,

I downloaded 'Debug V3.1 (2012/09/29)', and guess what, Great work!!  Cool

Now, works like a charm. I am able to get the debug trace running on ArduPlane (latest code)! While testing, I found an issue as under:

When I switch to 'True' the 'Report Digitals' OR 'Report Analogs' in F4 properties, I get the following error: (Error esp. while compiling breakpoints/ VM code)

Compiling 'ArduPlane' for 'Arduino Mega 2560 or Mega ADK'
Binary sketch size: 171488 bytes (of a 258048 byte maximum) (5.3723073 secs)
Compiling debug version of 'ArduPlane' for 'Arduino Mega 2560 or Mega ADK'
ArduPlane.cpp.o : In function `loop'
ArduPlane.cpp : printPortsDigital()'
ArduPlane.cpp.o : In function `setup'
AP_AHRS.h : printPortsDigital()'
avr-objcopy* : No such file
avr-objcopy* : No such file
Couldn't determine program size: D:\arduino-1.0.1-windows\arduino-1.0.1\hardware\tools\avr\bin\avr-size: ne.hex': No such file

How do I see the default visualizations from here?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPlane debug with Visual Micro
Reply #13 - Sep 30th, 2012 at 4:01pm
Print Post  
Hi Shyam, I just tried the visualizations with ArduPlane and they work fine.

Can you explain what breakpoints you have added, if any, and to which files?

Thanks

Tim
  
Back to top
WWW  
IP Logged
 
Shyam B
Junior Member
**
Offline


Posts: 18
Location: Netherlands
Joined: Aug 3rd, 2012
Re: ArduPlane debug with Visual Micro
Reply #14 - Sep 30th, 2012 at 4:49pm
Print Post  
Hi Tim,

I have added only one breakpoint in ArduPlane.pde under loop() on line 695 (in  ArduPlane v2.65) i.e. in fast_loopTimer_ms   = millis(); line.

Can you tell me (the settings) on how I can enable visualizations using the F4 property settings? Last time (without doing anything) I could see 2-visualization windows pop up. Shocked

Also, can I notice (analog) visualizations for a variable we define in code ?

Thanks for the quick response to the issues so far!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPlane debug with Visual Micro
Reply #15 - Sep 30th, 2012 at 5:16pm
Print Post  
Okay we have to find out what is different for you. Yes you should only need to set the "Reports" to True for this to work.

My simple test is shown below.

I made a mistake by including the "Validation Skip" parameter in the image. It should be False (default) if you are manually changing the Apm code. It can only be true if you do not change the Apm code and have successfuly compiled. Also ignore the title of the DigitalPins window, it is showing the ArduPilot pins from my APM2 board



Questions

1) What happens if you click the project node in the solution explorer and then select "Build>Clean Solution". Does it compile okay after that?

2) Do you have the visual studio breakpoint list open? Can you confirm there is only one breakpoint in the list

3) What happens with a simple sketch, do the visualizations open?

4) Please zip and email your visual studio .sln, .shu, .vcxproj files and the files from the Visual Micro folder below the ArduPlane folder to info [at] visualmicro.com.

Look forward to hearing

Thanks

Just for my sanity...

This is not the problem but... the fastLoop without condition will really slow the apm system down. You should not attach props or attempt to fly with debug until you become very familiar with this system (if at all). You need to find out how fast the various loops run at and try to limit your debug messages to 10 a second. If you do not do this then the debug tool will automatically force the slow down
« Last Edit: Sep 30th, 2012 at 5:20pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Shyam B
Junior Member
**
Offline


Posts: 18
Location: Netherlands
Joined: Aug 3rd, 2012
Re: ArduPlane debug with Visual Micro
Reply #16 - Oct 1st, 2012 at 10:52pm
Print Post  
Hi Tim,

Sorry for the delay in reply! My answers in blue:

1) What happens if you click the project node in the solution explorer and then select "Build>Clean Solution". Does it compile okay after that?
- Yes, this looks Ok.

2) Do you have the visual studio breakpoint list open? Can you confirm there is only one breakpoint in the list
- Ya, there is only 1 breakpoint enabled.

3) What happens with a simple sketch, do the visualizations open?
- I checked this, with a simple sketch, visualization work when 'ReportDigital' is On. With ArduPlane (it does not seem to work) with the very same settings.

4) Please zip and email your visual studio .sln, .shu, .vcxproj files and the files from the Visual Micro folder below the ArduPlane folder to info [at] visualmicro.com.
- Thanks, I just sent it to the email.

My question:
What do the default analog/ digital visualizations indicate? How can I visualize a PWM and a variable in code graphically? This feature would be a ton helpful.

Thanks. Look forward to hearing  Tongue
« Last Edit: Oct 1st, 2012 at 10:53pm by Shyam B »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPlane debug with Visual Micro
Reply #17 - Oct 1st, 2012 at 11:17pm
Print Post  
Hi Shyam,

Thanks for the responses, no prob with a delay. Waiting for your email (hasn't arrived yet) but have some questions.

When say only one breakpoint is enabled does that mean you have some disabled breakpoints? 

There is a project property called "Inc. Disabled Breakpoints" is that set to false? 

If you have other breakpoints can you confirm the names of the source files they are in?

I'll do you some examples for apm as soon as we have a stable debug system at your end.

Thanks
« Last Edit: Oct 1st, 2012 at 11:18pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Shyam B
Junior Member
**
Offline


Posts: 18
Location: Netherlands
Joined: Aug 3rd, 2012
Re: ArduPlane debug with Visual Micro
Reply #18 - Oct 1st, 2012 at 11:31pm
Print Post  
HI Tim,

I have only 1 breakpoint in the whole solution. (Sorry for not being clear earlier), this being in ArpuPlane.pde. This only breakpoint was enabled and 'Inc. Breakpoints' is set to ' False'. 
Please let me know if you did not receive my zipped version by tomorrow morning, I will need to send it again (It was 1.2 MB in zip).

Sure, APM examples to generate PWM pin visualizations + variable in code visualizations would save me a year of work  Smiley!

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPlane debug with Visual Micro
Reply #19 - Oct 1st, 2012 at 11:58pm
Print Post  
Ok, yes I hope to do a variety of examples over the next week or two. 

When time (few months) I've been looking at windows presentation foundation for some smarter looking controls.

I found the Microsoft OBDII vehicle telemetry system on their Code4Fun web site. It would need extending for ArduPilot use but is an example of how nice things could be.

The OBD stuff comes with a sample application with 3 different dashboards, you can swipe the mouse or screen to see a different dashboard. It is a working open source example.

Sample Window Application (zip) - Try It (no install required)

Project On Codeplex
« Last Edit: Oct 4th, 2012 at 12:42pm 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: ArduPlane debug with Visual Micro
Reply #20 - Oct 2nd, 2012 at 12:23am
Print Post  
Hi Shyam,

Got your email thanks.

I've been looking at the project file with your source and it is not the project you have been opening. I think that after you first opened the ardupilot project and then closed vs you selected to save the project in another location. I can't recall if that is supported but it is much easier to have the project with the arduino files.

Your project file in the ardupilot folder is actually empty, this shows is was created by vm but that you subsequently saved it elsewhere. I suggest deleting the files in the attached image, then opening the ardupilot.pde in a new empty visual studio. Vm will prompt you to create a new project. Select OK.

After the new project has been created vm will automatically load all the ardupilot files into the project. At this point select "File>Save All" in Visual Studio. A prompt should appear allowing you to "save as" the solution with a different name. Save the solution with the name "ArduPilot" (or any name you like) but save it into the ArduPilot folder. You don't have to do this but, initially, it's easier to always have your solution in with the ardupilot project sources. Everything in one place.

When closing vs or whenever you are prompted to save the project, just click save, not save as. 

I'm going to make a note about this. I think I can change vm to do more of this automatically.

Let's get this structure right then try a breakpoint please.

Thanks very much
  
Back to top
WWW  
IP Logged
 
Shyam B
Junior Member
**
Offline


Posts: 18
Location: Netherlands
Joined: Aug 3rd, 2012
Re: ArduPlane debug with Visual Micro
Reply #21 - Oct 2nd, 2012 at 12:45am
Print Post  
Hi Tim,

I sent you the files (zipped) again along with the library (~5Mb). Sorry, might be pretty heavy on your inbox Shocked, guess, I included the build files too.
Note: I have included a .sln file along, and made sure the code builds. I have also sent you by mail some description of the file names for your reference.

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPlane debug with Visual Micro
Reply #22 - Oct 2nd, 2012 at 12:51am
Print Post  
Thanks will look tomorrow
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPlane debug with Visual Micro
Reply #23 - Oct 4th, 2012 at 12:45pm
Print Post  
Hi Shyam, your project compiled for me without error. I will spend some time at the weekend looking into this some more. I will be looking at why AP_AHRS.h is menitoned in the error you are receiving.
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduPlane debug with Visual Micro
Reply #24 - Oct 6th, 2012 at 4:18pm
Print Post  
Hi Shyam,

This works fine for me in both debug and normal upload mode, but I would like you to do the following please:-

1) An Arduino rule is that sketches must reside in a folder with the same name. So you need to rename the folder called "main" to "maincam"

2) I can see that your Visual Studio project file started life as "main" but has been renamed in Visual Studio to "maincam". Renaming in Visual Studio doesn't alter the project name on disk. 

I would normally suggest renaming the project files using windows explorer. (I hope that the next release of vm will provide a facility to make this task easier). 

In your case, because of the problem you are hitting when trying to debug this particular project, I suggest deleting the .vcxproj files and .sln/.suo files and re-opening the maincam.pde in Visual Studio. In this case the plugin will re-create the project for you in a clean manner. Be sure to have renamed the folder to match Arduino rules before doing this.

3) If you still have a debug problem with this project after performing these two actions then please delete the following folder (vm compiler cache) 

"C:\Users\[YourName]\AppData\Local\VMicro\Arduino\Builds\maincam"

4) If the problem remains then please copy all of the text from the error into a new reply to this thread

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