Uploading new file/code to the apm

Hi guys,

I’ve recently tried my hand at editing the existing apm code, for use in a custom frame. While i’ve edited the code, i am unable to figure out a way to actually upload the code into my apm 2.6.

The files i’ve edited are in the AP_Motors folder,where i have a my files AP_MotorsQuadd.cpp and AP_MotorsQuadd.h

Could any kind soul tell me how to go about uploading it to my flight controller

Thanks!

If you are using the Ardupilot Arduino 1.0.3 for Windows (what I have) after you complile the code you need to find the HEX file it created in the Arduino IDE folder located C:\Users\user name\AppData\Local\Temp or similar. Once you have found the file you can upload it using Mission planner>Install Firmware>Load Custom Firmware.
It’s been a while since I uploaded any customized firmware, but if my memory is correct that should do it for you.

[quote=“Nathaniel Caner”]If you are using the Ardupilot Arduino 1.0.3 for Windows (what I have) after you complile the code you need to find the HEX file it created in the Arduino IDE folder located C:\Users\user name\AppData\Local\Temp or similar. Once you have found the file you can upload it using Mission planner>Install Firmware>Load Custom Firmware.
It’s been a while since I uploaded any customized firmware, but if my memory is correct that should do it for you.[/quote]

Hi Nathaniel,

Thanks for your assistance, i’ve managed to compile the code and generate the hex file. However, upon uploading the file, i get the following error " Upload succeeded, but verify failed: exp 21 got D at 253952".

Furthermore, while i’ve uploaded the code ( which is a compilation of arducopter.hex), how would i go about using just the relevant code for a penta-copter frame? In Mission Planner, i am given the choice of a quad/hexa/octo , etc but i am unable to do select a specific frame when i compile arducopter.pde and upload it into my APM.

Hi Nathaniel,

Thanks for takign the time to reply.I’ve run and compiled Arducopter.pde, with my modified AP_MotorQuadd files, and uploaded the subsequent hex file into my APM. However, i get the error “Upload Succeeded, but verify failed: exp 21 got D at 253952”.

I’ve tried uploading arducopter V3.2 Quad, and it worked, therefore im assuming the problem lies with the compiled hex file.I’ve tried re-compiling and uploading it but i get the same error. How would i go about solving it?

Also,in mission planner, i am given the choice of uploading different firmwares(i.e ArduCopter V3.2 Quad/Hexa/Octo) etc, how would i go about using my AP_MotorQuadd file/frame once the Arducopter.hex file is uploaded into my APM?

Hi Kencephalon,

I had the similar error when uploading my hex file using Mission Planer on Windows: “Upload Succeeded, but verify failed: exp” etc.

When I change to Ubuntu, this works for me:

cd Ardupilot/ArduPlane make upload

Maybe you can try with cygwin if you don’t have a linux machine.

I hope this helps.