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

  • Hi,

    I am using CRIUS AIOP PRO V2  with ArduCopter-3.2.1_I2C branch (from URUS8).

    I have done the following modification to drive my Hexacopter (X frame) using CRIUS V2 :

    #define CONFIG_HAL_BOARD HAL_BOARD_MPNG (in config.h)

    #define CONFIG_HAL_BOARD HAL_BOARD_APM2 (in AP_HAL_Boards.h)

    and also declared HEXA_FRAME (in APM_Config.h)

    I can compile and download it successfully but the thing is I have only 4x motors running out of 6 . ( d2, d3, d5, d6 but not d7 & d8). I thought that it was due to difference in motor mapping for APM2 versus CRIUS but in fact not (I have tried d11 and d12 as well). The board is OK since it drives correctly the 6 motors if I returned back to Official Megapirate Release 3.1.5 ...

    Do you have an idea ?

    Do I have to create an HAL for the CRIUS V2 ?

    Thanks a lot for your help .

    Rgds,

    Guillaume

  • Hi,
    I tried new arducopter 3.2.1 megapirate branch.
    And my 3dr radio telemetry works very good on serial port1,TX1/RX1 at 57600 baud.
    hirosi takey, Good job!
    Greetings and thanks!

  • Hi folks,

    I updated ArduCopter 3.2.1 megapirate branch and fixed the 2nd telemetry port,

    This is the mapping between the ArduCopter and the hardware:

    HARDWARE (Physically)        ArduCopter    Function

    uart0                                      portA              Telemetry 1st

    uart1                                      portC              Telemetry 2nd

    uart2                                      portB               GPS

    Please, it's really easy for everyone to open an issue from github and leave your problem there.

    https://github.com/hiro2233/URUS8/issues

    Greetings

    Hiroshi.

    hiro2233/URUS8
    URUS Project are moving to this repo https://github.com/UrusTeam/URUS - hiro2233/URUS8
  • Hi Jose Antonio,
    yes i'm using a 3DR radio.
    I saw this information recently about Arducopter 3.2.1 in APM
    "there are the following serial ports:
    SERIAL0: this is always the USB serial port and it is possible to use it only with MAVLink protocol. Connected to a PC, it is useful to configure and monitor the board and to download the logs in a very fast and secure way.
    For all each other port, in the list of parameters, there are two items for setting baud rate and protocol:
    SERIALn_BAUD: With this parameter, it is possible to set the baud rate of the serial port. The possible values are: 1: 1200, 2: 2400, 4: 4800, 9: 9600, 19: 19200, 38: 38400,57: 57600, 111: 111100, 115: 115200, 500: 500000, 921: 921600, 1500: 1500000
    SERIALn_PROTOCOL: this is the protocol (or service) to use on the serial port. The possible values are:
    1: Primary GCS MAVLink. This is the first channel for telemetry via MAVLink to use with a communication channel (like as radio link) and GCS or similar
    2: Secondary GCS MAVLink. This is the second channel for telemetry via MAVLink to use with a communication channel (like as radio link) and GCS or similar. In the future, it will be possible to use this channel to bridge with another device that maycommunicate with theGCSwith the same
    3: FrSky D-Port Telemetry. This protocol is useful to send the telemetry to Taranis via D-Port of the FrSky D4R-II receiver.
    4: FrSky S-Port Telemetry. This protocol is useful to send the telemetry to Taranis via S-Port of the FrSky XnR (X4R, X6R and X8R) receiver. It is necessary to install some useful LUA script on the Taranis.
    5: Primary GPS. First GPS module
    6: Secondary GPS. Second GPS module
    7: Alexmos Gimbal Serial"
    But in Arducopter 3.2.1 on megapirate version the SERIALn_PROTOCOL parameter I don't see it.
    Perhaps, Is this the problem?

    Thanks.

    Fran

  • Hi Fran,
    Thx for the info.
    Is the same problem in the CRUIS V1.1.

    In MPNG 3.1.5 the telemetry is present in TX3/RX3 but in this version no telemetry signal  present in these ports.

    The TX0/RX0 is working but this port is not a real telemetry port can be used for, but better is for connect a BT or 3DR Radios.

    I thing the problem come from the original APM 3.2.1 code.
    A good point if somebody with a APM2 board loading with 3.2.1 tell us if telemetry is present in any serial port.

    In this situation is not posible to use the MinimOSD.Best Regards

    Jose A.

  • Help on antenna tracker please.
    step 2.8 cannot find "define AVR_ARDUINO_ENVIRONMENTS" in file AP_HAL_Boards.h
    step 2.9 there is no antennaTracker.ino or pde file to open and compile with Aduno

    tried steps 2.xx several time but the outcome is the same everytime.

  • Hi:
    I'm trying this version 3.2.1. My FC is a Crius V2 with version 3.1.5 telemetry was present in TX3 / RX3, but now only is working on serial port 0 at 115000 baud. I use a external compass, it works fine connected in Ic2 port ,but the trace on jumper Sj2 and Sj3 must be cut before.

    Thanks.

  • Hi

    Some info about Serial2 broken, see here, the problem seem comes from APM 3.2.1 code.

    https://github.com/ArduPilot/ardupilot/issues/1854

    @Hiroshi i post the problem in the github when i have good info about it, thank for your info and help.
    I continue performing several test.

    Greetings

    Jose A.

    SerialManager: allow user to set multiple serial port's protocol to MAVlink instead of using MAVLin…
    Something in Serial2 just broke between v3.2.1alpha2 and v3.2.2alpha1. I can not communicate via MAVLink over serial2 using SERIAL2_PROTOCOL=1 (GCS M…
  • The last antenna tracker v1,0,0 version, right now are running ok on the AVR boards.
  • Hi Folks!

    Thank you very much following this work and interest.

    I'm having troubles loading diydrones web page from my country, i have to enter with proxy, i think some people doesn't want to cooperate with this thread.

    For future problems and issues, please go here and open a issue

    https://github.com/hiro2233/URUS8/issues

    leave your issue and we solve this as soon as possible. Please put the reference title at begining with:

    master-AVR: [YOUR BOARD].

    Thank you Jose to write the solution.

    We are working raight now in a solution for use AVR based board as a cape to work with the last APM version from master branch.

    All comments about it's will be appreciated.

    Greetings
    Hiroshi.
    hiro2233/URUS8
    URUS Project are moving to this repo https://github.com/UrusTeam/URUS - hiro2233/URUS8
This reply was deleted.