URL: <http://savannah.nongnu.org/bugs/?30061>
Summary: stk500 skips writing blocks of 0xff, even if the part/page wasn't erased Project: AVR Downloader/UploaDEr Submitted by: None Submitted on: Mon 07 Jun 2010 03:36:06 AM UTC Category: None Severity: 3 - Normal Priority: 5 - Normal Item Group: None Status: None Privacy: Public Assigned to: None Originator Name: Adam Wolf Originator Email: adamw...@fing.comeelslikeburn Open/Closed: Open Discussion Lock: Any _______________________________________________________ Details: I noticed that when writing many blocks of 0xff to an atmega328p (with auto-erase off), sometimes a big stretch didn't actually write, and the values were preserved from the last program. I noticed if I changed even one bit in the area to a 0, the block would actually write. I tracked it down-- in stk500_paged_write in stk500.c, there's a check for stk500_is_page_empty. If the whole page consists of 0xFF, the page isn't written. To me, to do this correctly, you'd have to take into account if the page was actually set to all 0xff. I tested it by commenting out the entire /* Only skip on empty page if programming flash. */ if (flash) { if (stk500_is_page_empty(addr, block_size, m->buf)) { continue; } } section. Making this change fixed my issue. Is this intended behavior, and just part of what disabling auto-erase means? I was thinking a more optimal fix might be to skip writing blank pages if you know the page has been erased, but I wasn't quite sure of how you folks would want that implemented. _______________________________________________________ Reply to this item at: <http://savannah.nongnu.org/bugs/?30061> _______________________________________________ Message sent via/by Savannah http://savannah.nongnu.org/ _______________________________________________ avrdude-dev mailing list avrdude-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/avrdude-dev