This requires a recompile of the Arduino software, which may include issues such as the inclusion of a 32-bit librxtxserial in the linux distro.
I purchased a Cricket (Atmega644) from soc-robotics.com (via ebay), and didn't have a way to program it, so I decided to adapt the Arduino to program it. After looking at diagrams and everything I could upload the Arduino bootloader, etc. After getting the Sanguino software loaded, and entering it in boards.txt, I could upload 1 sketch to it, via setting perferences in boards.txt. The second sketch failed. I could upload the bootloader then again get another sketch to upload. After finding the cause being the -D option passed universally from the arduino software to avrdude, I disabled this and it works to upload, and I suspect will work with any programmer. (I can not prove that.)
I propose adding an option upload.disable_erase which will default to true, and if true, will still enable the -D option. Only if it is false, will the default behavior be changed. (Though if the value is set to anything other than false it will be, unfortunately, I haven't programmed java in 10 years, can't find a .notequals("") function, and when I tried (!boardPreferences.get("upload.disable_erase").toLowerCase().equals("false"), it threw back a warning. So that's a known problem.)
/* This option is to allow ISP uploading of sketches.
Otherwise 1 sketch can be uploaded and all others will fail. */
if (boardPreferences.get("upload.disable_erase") == null ||
boardPreferences.get("upload.disable_erase").toLowerCase().equals("true")) {
commandDownloader.add("-D"); // don't erase
}
This would allow the comment on line 44 ( // XXX: add support for uploading sketches using a programmer) to be removed.
If there is a more appropriate place to send this (mailing list or such), if someone could refer me to that, I would appreciate it. (I looked, but couldn't find it, it's probably something that should be in the FAQ.)
(Also the comment isn't strictly true, if the sketch is the exact same, except for changing a few 1s to 0s, it can also upload fine. )