It's a solution that you can build and upload the last APM 3.2.1 code for MEGAPIRATE BOARDS and AVR atmega2560 GENERICS BOARD with I2C bus communication.

As you know, megapirate team stop building APM and the last code was 3.1.5 version, we are desired work and port the last AVR APM 3.2.1 to this board, megapirate and AVR boards with atmega 2560 and I2C bus communication.

TESTED AND WORKING on MEGAPIRATE BOARDS:

   - ArduCopter 3.2.1
   - AntennaTracker 0.7.2

VIDEO WORKING APM 3.2.1 ON MEGAPIRATE:

   

    https://www.youtube.com/watch?v=baIYXkhdYcU

1. SOFTWARE TOOLS REQUIRED
--------------------------

These tools you need to download first.

1.1 Arduino 1.0.3 with gcc-4.8.2 version download from this link:

http://firmware.diydrones.com/Tools/Arduino/ArduPilot-Arduino-1.0.3-gcc-4.8.2-windows.zip

1.2 Git tool, download from this link:

https://git-scm.com/downloads


2. STEPS FOR COMPILING
----------------------

2.1 Download and Decompress Arduino from section 1.1 to c:\arduino. You will see this order path c:\arduino\hardware\tools\avr\bin

2.2 Download and install GIT tool from section 1.2 to default path. NOTE.- in the steps windows install choose the option:

"Run Git from the Windows command Prompt"

2.3 Open Explorer and navigate to 'c:\' drive, right click and select "Git bash here", it's open a windows command prompt.

2.4 In prompt command line type the next command to clone ArduCopter-3.2.1_I2C branch as follow:

$ git clone https://github.com/hiro2233/URUS8.git ardupilot
$ cd ardupilot
$ git checkout ArduCopter-3.2.1_I2C

2.5 Open Arduino, go to File, Preferences, in "sketchbook location" click on Browse and choose the path where are the ardupilot folder you checkout with GIT,
in this case c:\ardupilot, ok and close.

2.6 Now load Arducopter sketch, compile and upload to the MEGAPIRATE board.

Enjoy!

BUILDING CODE FOR ANTENNA TRACKER

-------------------------------

1. SOFTWARE TOOLS REQUIRED
--------------------------

These tools you need to download first.

1.1 Arduino 1.6.6 version, download from this link:

http://arduino.cc/download.php?f=/arduino-1.6.6-windows.exe

1.2 Git tool, download from this link:

https://git-scm.com/downloads

1.3 fix_includes_arduino166 program, With this tool you can change all include headers files to work with arduino 1.6.6 in windows.
You need compile the code, it's included on repo branch master-AVR Tools/ArdupilotMega_ON_Generic_Board/


1.4 Notepad++, download from this link:

https://notepad-plus-plus.org/download/v6.8.8.html


2. STEPS FOR COMPILING
----------------------

2.1 Download and Install Arduino from section 1.1 to default path.

2.2 Download and install GIT tool from section 1.2 to default path. NOTE.- in the steps windows install choose the option:

"Run Git from the Windows command Prompt"

2.3 Download and install Notepad++ from section 1.4 to default path.


2.4 Open Explorer and navigate to 'c:\' drive, right click and select "Git bash here", it's open a windows command prompt.


2.5 In prompt command line type the next command to clone Ardupilot master-AVR branch as follow:

$ git clone https://github.com/diydrones/ardupilot.git
$ git checkout master-AVR
$ echo "ARDUINO=/c/arduino" > /c/ardupilot/config.mk


2.6 Compile Tools\ArdupilotMega_ON_Generic_Board\fix_includes_arduino166 with VS2013 or SharpDevelop (with this one was compiled).
Then you use as follow:

fix_includes_arduino166 -P <PATH_TO_FOLDER>

Example: Supose that you cloned Ardupilot in c:\ardupilot then you will have c:\ardupilot\libraries and you want make AntennaTracker c:\ardupilot\AntennaTracker then,

fix_includes_arduino166 -P c:\ardupilot\libraries
fix_includes_arduino166 -P c:\ardupilot\AntennaTracker

WARNING!
This tool make changes to the files in all librarie path and this tool doesn't make a backup of your files. You must be sure.

2.7 Open Arduino, go to File, Preferences, in "sketchbook location" click on Browse and choose the path where are the ardupilot folder you checkout with GIT,
in this case c:\ardupilot

2.8 Open the next file with notepad++, c:\ardupilot\libraries\AP_HAL\AP_HAL_Boards.h and replace this line #define AVR_ARDUINO_ENVIRONMENTS with //#define AVR_ARDUINO_ENVIRONMENTS. Save and close.
NOTE: If you uncomment this line, you are telling to Arduino make code for AVR Generic Board, but if you comment with this line with '//' you are telling to Arduino make code for APM2 Board.

2.9 Open AntennTracker in Arduino and compile.

ENJOY!

If you are looking for detailed and description file libraries modification follow the oficial PR on the oficial Ardupilot repo at:

   

    https://github.com/diydrones/ardupilot/pull/3578  ;

(DEVELOPERS) AVR and MEGAPIRATE DEVELOPMENT SUPPORTS Version Boards
Chat discussions at https://gitter.im/dronebo/URUS8


(USERS) MEGAPIRATE and AVR SUPPORT
Forum Discussions and supports at http://drone.bo/foro/development-english/apm

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • royco, follow the instructions again. I'm sure will get install and run.

  • MABA, you need to do a clean arduino install, point arduino libraries path options to Ardupilo libraries, and verify to ensure your system path variables are pointing to arduino toolchain compiler.

  • Hi maybe I missed somthing here but hopefully someone can help me with this?

    I want to use the antennaTracker on my Cruis AIO board, but it I follow the instructions and download from source https://github.com/diydrones/ardupilot.git, the files do not contain a .pde or .ino file. How can I compile the antennaTracker .hex whitout these files?

  • Thanks Thomas, Hiroshi, compiling well with  Ardupilot-Arduino 1.03

  • And select in the menu option the hal board as described @thomas above.

    Thanks, @thomas.
  • @Rana you need download and compile with this Arduino version http://firmware.diydrones.com/Tools/Arduino/ArduPilot-Arduino-1.0.3....

    The steps is described in the blog.

    Greetings.
  • @Rana there is a custom Arduino v1.0.3 at ArduPilot web site. which has the ArduPilot/HAL boards menu option which is what I used and have been using for quite some time.

    v1.6.6 will no doubt work, since @hirishi is using it...

  • Additionally, only using 1.0.3 cause that's what is on my PC.

  • Be sure to select the preferences for sketchbook location and HAL board as Mega 2.x, also I'm not using Arduino 1.6.6, but the Arduino 1.03 w/gcc 4.8.2. Maybe some issue with 1.6.6...it's open source! I'll try 1.6.6 sometime. You get what you pay for...

    3702196963?profile=original

  • did not work3702196575?profile=originalfor me

This reply was deleted.