Hi all. I'm trying to edit the ArduCopter 2.5.3 code and compile it myself. It's turning out to be surprisingly difficult! Here's where I am now:
I was able to compile using make, with lots of warnings. Then I end up with a .hex and .eep, and don't know the procedure for uploading these. I suspect I can figure it out, but instead I figured I will just use the Arduino IDE for compiling.
When I do use Arduino IDE, I get a series of "warning: internal error: out of range error" . There is a bunch of stuff out there about needing to patch Arduino IDE in order to make it compile ArduPlane, but I can't tell if this is required for ArduCopter. Anyway, the patch isn't available for Linux, my operating system. If I had the source of this patch, or some information on what it actually does, I would be happy to compile the Arduino IDE from source.
So, my questions boil down to:
- What's the best way to upload my .hex? (Can I use APM Planner? It works great on linux now under mono.)
- Do I need the relax patch to use Arduino 0022?
- How do I get the relax patch?
Thanks!
Aaron
Also worth noting that I wasted a lot of time trying to follow http://code.google.com/p/ardupilot-mega/wiki/Eclipse which needs to be updated or deleted since it has been incorrect for 6 months now.
Tags:

Aaron, did you make sure to select the correct board in the Arduino IDE? That has gotten me several times. I would recommend pulling down fresh code (just to make sure) and then load up Arduino again. Pay close attention to:
1. The sketchbook location which is defined in the Preferences menu. This location should be one folder up from Arducopter so that you can see the libraries folder. So something like this /My Computer/My Desktop/ardupilot-mega/ArduCopter, you want the folder in bold to be the location
2. Then make sure to set the board in Tools->Board to Arduino Mega 2560
Permalink Reply by Aaron Curtis on April 10, 2012 at 8:40am Thanks for the quick reply, but I've done both of these things.

Also you should be using Arduino 1.0 relaxpatch found here.
Permalink Reply by Aaron Curtis on April 10, 2012 at 8:42am Ok, good to know that I do actually need this patch. As I said above, I'm using Linux, and I can't find a linux version of the patch, or a source code version of it. There must be source for it out there somewhere, right?
Note that I did not get any "out of range errors" (which I think result from the relax problem or the "uptight problem" I guess!) when compiling with make, so that .hex I made may actually work. When I use the Arduino IDE, it does put something on the APM2 board but it just constantly spits "Init A" out of the serial and won't talk to the APM Planner.

See this: http://www.arduino.cc/en/Hacking/BuildProcess
The upload is handled by avrdude.
Permalink Reply by Aaron Curtis on April 10, 2012 at 9:12am So, now that I try to do this I realize I can't actually find the .hex ... Where would make have put it? I get this output from make at the end of the build process:
In file included from /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h:30:0,
from /usr/share/arduino/hardware/arduino/cores/arduino/wiring_pulse.c:25:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/delay.h:36:2: warning: #warning "This file has been moved to <util/delay.h>."
In file included from /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h:30:0,
from /usr/share/arduino/hardware/arduino/cores/arduino/wiring_shift.c:25:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/delay.h:36:2: warning: #warning "This file has been moved to <util/delay.h>."
%% arduino/core.a
%% ArduCopter.elf
%% ArduCopter.eep
%% ArduCopter.hex
make[1]: Leaving directory `/home/aaron/sketchbook/arducopter-git/ArduCopter'
Also, when I try to follow the cmake instructions in the git repository's root README.txt, it only produces files for ArduBoat and ArduRover -- nothing for ArduCopter.
Permalink Reply by Aaron Curtis on April 10, 2012 at 9:30am So, ArduPlane and ArduCopter are commented out in CMakeLists.txt! This is directly contrary to README.txt, which uses ArduPlane as its example. Why is it commented out? This kind of thing is such a barrier to entry for would be developers like me...
When I remove the comments and try to follow the cmake instructions in README.txt, I get the attached output (compiles a few things and then hits errors).
Permalink Reply by Aaron Curtis on April 10, 2012 at 9:38am Ok, I found the .hex outputted from make. It was in the system tmp directory as specified in my Arduino.mk file. Going to try and upload it with avrdude now.
Permalink Reply by Aaron Curtis on April 10, 2012 at 10:12am Seems to upload very quickly, using avrdude -v -v -v -v -patmega2560 -cstk500v2 -P/dev/ttyACM1 -b115200 –Uflash:w:ArduCopter.hex:i
I attached the output.
Can't connect to it so I assume it didn't really upload.
Permalink Reply by Aaron Curtis on April 10, 2012 at 10:32am I've also tried downloading the .hex file that the Planner is using (from http://code.google.com/r/meee146-planner/source/browse/#git%2FTools... ), and I get the same results trying to upload that file.
Aaron: The Mission Planner works well under Mono on Linux and will upload the code for you.
Aaron, if you can send me the necessary corrections to the Eclipise wiki page, I'll enter them. I don't use Eclipse myself so don't know what needs to be changed there.
Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.314 members
4 members
1292 members
684 members
110 members
© 2013 Created by Chris Anderson.
Powered by
