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 APM 3.0 Issues (Read 10906 times)
Dennis
Junior Member
**
Offline


Posts: 12
Joined: Jan 7th, 2013
APM 3.0 Issues
Apr 15th, 2014 at 5:19pm
Print Post  
APM 2 Visual Micro Issues

I thought I had Visual Micro working for the APM boards but actually, the build sizes are different and some options for the build do not work as expected (I.E with Mission Planner)

This is soooooo close to working but I can not use Visual Micro on the APM and fly my ardcopter with confidence as it now stands.

Here are some issues I do not understand. Can you shed some light on any of this?  The arducopter site has other options to build, including with make so if I can provide links or any help, let me know. Perhaps the info for those methods could shed some light.

All these scenarios are using same Ardupilot source code (ardupilot-ArduCopter-3.1.2  actually rev 3.1.3 - the latest supported version). I am building Arducopter.pde - source code for each scenario is exactly the same. And each upload attempt with Atmel Studio is "Start without Debugging".  Visual Studio 2008 behaves just like Atmel Studio.

Scenario 1:  (The official APM build tool)
Ardupilot Arduino 1.0.3  (Modified for APM and HAL - using  MHV AVR Tools)
see here: http://dev.ardupilot.com/wiki/building-ardupilot-with-arduino-windows/
Tools>>Ardupilot>>HAL Board>>Ardupilot Mega 2.x
Tools>>Board>>Arduino Mega 2560 or Mega ADK
  Compiles, Uploads and works as expected with the Mission Planner
  Build size: 226,074

Scenario 2:
Atmel Studio with Visual Micro.  Using Standard Arduino 1.0.5 install.
APM/boards.txt added to Arduino/hardware folder
Tools>>Visual Micro>>boards>>Arduino Mega 2560 HAL (Apm 2)   
Compiles, Uploads without issue but will not communicate with Mission Planner.  
[Connect] finds the USB port but fails to download parameters and/or fails to connect in terminal mode.
(It just times out)
Build size:  253,016     (Why is this different?)

Scenario 3:  I just tried this on a whim
Atmel Studio with Visual Micro.  Using Ardupilot Arduino 1.0.3 without any modifications
Tools>>Visual Micro>>boards>>Ardunio Mega 2560
Since APM/boards not added the HAL boards do not show up.
Does not build. Errors like 
ArduCopter.pde:from
AP_HAL_Boards.h:91:2: error: #error "Unknown CONFIG_HAL_BOARD type"
AP_Compass_HMC5843.h:In file included from
... etc.

Scenario 4:  On another whim
Atmel Studio with Visual Micro.  Using Ardupilot Arduino 1.0.3 with APM boards.txt
Added APM/boards.txt to the Ardupilot Arduino 1.0.3 hardware folder.
Select Tools>>Board>>Arduino Mega 2560 HAL (Apm 2) board
Builds, uploads and "Seems to" work with mission planner  (I would not try to fly this upload)
Build Size 239,556 
(smaller but still not the same as official Arducopter built with Ardupilot Arduino 1.0.3)

Scenario 5: 
Ardupilot Arduino 1.0.3  (Modified for APM and HAL - using MHV AVR Tools)
Same as scenario 1 but with APM/boards.txt still in the hardware folder. 
Tools>>Ardupilot>>HAL Board>>Ardupilot Mega 2.x
Tools>>Board>>Arduino Mega 2560 or Mega ADK
Builds, loads and works with Mission Planner
Build size: 226,074

Scenario 6: 
Ardupilot Arduino 1.0.3  (Modified for APM and HAL - using MHV AVR Tools)
Same as scenario 1 but with APM/boards.txt still in the hardware folder. 
Tools>>Ardupilot>>HAL Board>>Ardupilot Mega 2.x
Tools>>Board>> Mega 2560 HAL (Apm 2) board
  Does not build. Gets error No board selected, Please choose a board from the Tools>>board menu


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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: APM 3.0 Issues
Reply #1 - Apr 15th, 2014 at 6:47pm
Print Post  
Okay thanks for the post

Sounds like some defines have changed which should be easily applied via the vm config files on your pc

In the arduino ide you can switch on file>preferences>compile verbose 

In Visual Micro you can switch on "tools>options>visual micro>compiler>verbose" and "always show build properties"

In Visual Micro click "build>clean solution" then run a compile.

In the aurduino ide close and re-open the ide then make a compile

Both products will produce a verbose output. Please paste into .txt files and email to info [at] visualmicro.com

Thanks
« Last Edit: Apr 15th, 2014 at 6:48pm 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: APM 3.0 Issues
Reply #2 - Apr 16th, 2014 at 5:18pm
Print Post  
That's sort of funny. I was looking at it and found the two output commands to be identical. Then I got to the end of the .txt files you sent. Take a look at the compile sizes in the two files you sent. They are identical.

What has happened is that the build>clean solution zapped the compiler cache and performed a clean build. You can switch off the compiler library cache in the visual micro project properties but compilation will be much slower because of the large number of libs in the apm project. 

I seem to recall in the original release notification for apm we pointed out that changing source code #defines that affect non-sketch code should be followed by a "build>clean solution" or switch off the library compiler cache.

The compiler cache works per project/board and monitors for source changes but can't currently detect that #define changes in sketch code will affect non-sketch code. Normally Arduino does not support this so this relates soley to the APM project.

Sorry the info has been diluted over time, it's a good thing you have made such a clear instructions page for apm users. Thanks!
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: APM 3.0 Issues
Reply #3 - Apr 16th, 2014 at 5:20pm
Print Post  
ps: You are best to ensure each apm project has a unique name such as ArduCopterV30.ino
  
Back to top
WWW  
IP Logged
 
Dennis
Junior Member
**
Offline


Posts: 12
Joined: Jan 7th, 2013
Re: APM 3.0 Issues
Reply #4 - Apr 16th, 2014 at 9:46pm
Print Post  
Tim, 

You are going to want to kill me but...  The confusion was also do to this:

If, I reference the Standard release Arduino 1.0.5 in Visual Micro (Atmel studio), then the build sizes are always different.
If, I reference the special Arduino 1.0.3 (modified for APM), then the build sizes are the same (if I do a clean and rebuild after changing any defines).

Somehow in the process of messing with things, the Arduino reference got changed at the same time I set verbose.  Oh my, so many options and so little brains.

Now it all makes sense.

Also, and this is important.

If Visual Micro references a standard install of Arduino instead of the special Ardupilot Arduino, The build size is not only different but... The build referencing the standard Arduino 1.0.5 will upload to the APM but will not connect to the APM in Mission Planner.
The Visual Micro (Atmel Studio) build that references the special Ardupilot Arduino uploads and connects to the APM in Mission Planner.  I have not checked it out by flying yet but am confident it will be fine because the build size is the same as using Ardupilot Arduino. 

I will send you an email with the build outputs (different Arduino/sizes) in case there is a fix.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: APM 3.0 Issues
Reply #5 - Apr 17th, 2014 at 6:23pm
Print Post  
Great thanks, that's what I thought anyway so was going to ask for the output  Smiley
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint