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