I have done around 500 programming cycles of the ATMega644 on the Atmel BC100 board. No debugging, just straight erase-and-program using AVR Studio/Dragon/JTAG. Never any problems until now, with the last four needing several tries to pass verification. Typically some random location reads back a zero bit that should have been one.
I'd be happy with the current firmware if I could remove some debug output but don't want to risk a complete failure. So, is there a technique for getting a final program into flaky flash? Erase several times before writing (does each erase count as a programming)? Write several times (does each write count as a cycle)? Raise Vcc a bit? Heat or cool the chip?
Or if such failures are rare maybe I should be looking for a hardware problem. The Dragon seems to be working fine, and for programming I power the board with a 12 volt battery. But the board has seen some overloads and high temperatures, solar charging 12 volt SLA batteries at 2-3 amps.