Hey Everyone,


I'm back fiddling with my ArduPilot after an absence caused by a couple of crashes and just being busy with summer.


Anyways, I'm having an issue with my ArduPilot board that is starting to become a bit of an annoyance. I wanted to ask here to see if anyone else has had the same problem, or if I'm doing something blatantly wrong.


It seems like, as I'm working on the code, at some point, the addition of an innocuous line of code will cause the software to hang during boot. The serial window shows the first couple of lines after "ArduPilot X.X" and then just sits there.


It feels like I'm hitting a size restriction on the code, but I'm still well under the limit specified in the IDE. I say this because it has happened to me several times, and whenever this happens, if I comment out the last couple of lines I wrote, the sketch works just fine.


Does the bootloader on the ATMega take up some of the 30720 byte maximum that the Arduino IDE says I have room for? If so, how much?


I've attached an example of what I'm seeing.
ArduPilot_2_6 - working.zip: The IDE says it is 24630 of 30720 bytes. It boots and runs just fine.
ArduPilot_2_6 - freezing.zip: The IDE says it is 24658 of 30720 bytes. It compiles and loads fine, but freezes after the first 4 lines of output:


"Init Ardupilot 2.6 Beta
%%%PWP:  0, 0, 0,
NWP:045" --- then nothing.


The only difference between these two sketches is one line of code. In GPS_IMU, I've de-commented the line:

 Serial.println("Checksum error");

Is there anything I can do to fix this problem? At the moment I'm working on getting an X-Plane/Labview/Ardupilot closed loop simulator going, (which is why I'm troubleshooting the binary parser). For some reason ArduPilot doesn't like the binary strings I'm making with Labview.


Other details of my setup:
ArduPilot (Purchased ~March 2010) with ATMega 328P
Arduino 0018 IDE with Duemilanove/Nano w/ 328 selected as the board.
FTDI cable from the DIY Drones Store.







Views: 329


Reply to This

Replies to This Discussion

Question, are you using I2C bus to communicate with magnetometer or some other I2C device? I have noticed that sometimes if you have I2C in use and there is problems on databus, it hangs atmel cpu's..
I did not download your code, but did you add too much to it that it is running too much RAM? I have had that problem where i needed more RAM than it could provide and the sketch would just freeze or not start.
Are you editing in the Arduino IDE? If you use another editor, it can put in characters that screw up the code.
You've run out of ram. Get rid of as much of the debug Serial.prints as you can.
Hey all,

Thanks for the replies. I am not using any i2c sensors, and I am using the Arduino IDE, so I guess it seems that I've run out of RAM.

I just did some browsing on the Arduino.cc website, and it seems the best advice there is to reduce the size/number of variables used, and/or to us PROGMEM where possible. I'll probably just upgrade to ArduPilot 2.6.2 and start from there anyways.

Any other tips for reducing the RAM size that I should know about?

Thanks for the help,


Reply to Discussion



Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service