Page 1 of 1

usbasploader not erasing flash

Posted: Mon Jun 27, 2011 4:48 pm
by sbm
I have been using usbasploader with avrdude on linux for a good while now. But I have noticed that the -e "erase flash" option does not work.

sudo avrdude -c usbasp -p atmega328p -e

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
avrdude: erasing chip
avrdude: warning: cannot set sck period. please check for usbasp firmware update.

avrdude: safemode: Fuses OK

avrdude done. Thank you.


After the alleged erase operation, the application still runs on the chip. I also think this is causing problems during programming as the chip I do not think is being erase before flashing. This is particularly a problem when flashing a program smaller than the one currently loaded.

Does anyone know if there is a fix?

Re: usbasploader not erasing flash

Posted: Sun Jul 03, 2011 8:38 am
by _frank26080115
just read the usbasploader source code, there's nothing in there that does a simple erase

Re: usbasploader not erasing flash

Posted: Sun Jul 03, 2011 8:40 am
by _frank26080115
how did you compile it? you must enable HAVE_CHIP_ERASE and disable NO_FLASH_WRITE