I have been working with my mega644PA for a while now with a fair sized application that still has a few bugs that are very hard to find. In my main loop every minute I run some tests and have response messages outputted back to myself. Every so often (like one out of 10 units I am working for 1 minute randomly once a week) output these debug messages in a constant stream, much faster than could generally processed even without the timer. As such i thing their is either a loose pointer reading program memory, a stack overflow or somehow I am accidentally doing something with the program counter (unlikely) that i don't know of. I am only programming in C and have no direct functions I have written that use the PC directly.
Is it perhaps an overflow? Despite my compiler telling me I have only used 50% of program memory and 65% of data memory?
Side note, I have a bootloader on the AVR also contributing 10% to the program memory.
Any thoughts or criticism would be greatly appreciated!