usbasploader not erasing flash

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
sbm
Posts: 4
Joined: Mon Jun 06, 2011 9:57 pm

usbasploader not erasing flash

Post by sbm » Mon Jun 27, 2011 4:48 pm

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?

_frank26080115

Re: usbasploader not erasing flash

Post by _frank26080115 » Sun Jul 03, 2011 8:38 am

just read the usbasploader source code, there's nothing in there that does a simple erase

_frank26080115

Re: usbasploader not erasing flash

Post by _frank26080115 » Sun Jul 03, 2011 8:40 am

how did you compile it? you must enable HAVE_CHIP_ERASE and disable NO_FLASH_WRITE

Post Reply