We probably encountered a bug, although we are not sure whether the problem is in the USBtinyISP firmware and/or in the USBtinyISP specific part of avrdude.
We stumbled across this while trying to download a bootloader to a ATmega1284p with avrdude and the USBtinyISP programmer. Writing the bootloader worked, but the verification failed.
After some investigation we found that the writing actually did work, but reading back the data is broken. After 64kb of data it starts reading from byte 0 again. So with 128kb flash it returns the first 64kb twice.
Trying to hunt that bug down we looked at the USBtinyISP firmware and avrdude source, but unfortunately we are not able to provide a clean fix - but we got a dirty one. (;
(I couldn't attach the patch to this post, so here it is inline)
Code: Select all
--- avrdude-5.11.1/usbtiny.c 2011-09-15 16:37:05.000000000 +0200
+++ avrdude-5.11.1.fix/usbtiny.c 2011-11-25 09:29:04.392417554 +0100
@@ -552,7 +556,7 @@
/* Optional Functions */
pgm->powerup = NULL;
pgm->powerdown = usbtiny_powerdown;
- pgm->paged_load = usbtiny_paged_load;
+ //pgm->paged_load = usbtiny_paged_load;
pgm->paged_write = usbtiny_paged_write;
pgm->set_sck_period = usbtiny_set_sck_period;
pgm->setup = usbtiny_setup;
Digging deeper into the USB internals we gave up yesterday and decided to not invest any more time. If anyone is interested in more information from our debugging hell, don't hesitate.. (: