avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avrdude-dev] [RFC] stk500: skip empty pages


From: Brian Dean
Subject: Re: [avrdude-dev] [RFC] stk500: skip empty pages
Date: Tue, 16 Sep 2003 13:18:45 -0400
User-agent: Mutt/1.4.1i

Hi Eric,

On Tue, Sep 16, 2003 at 10:39:32AM -0600, E. Weddington wrote:

> Attached is a patch for the stk500, which skips empty pages on a
> paged write. This is useful in a project I have, where there is an
> application and a bootloader in a mega128. So there is a chunk of
> code at the begginning addresses and small chunck of code at a very
> high address and a whole lotta nothing in between. This will
> significantly speed up programming time.

I've been thinking about adding a similar optimization, so I'm
certainly in agreement with the utility of it.

> Now, this code assumes nothing about whether the chip was previously
> erased. If the chip was erased, the code behaves as expected. If the
> chip was not erased, then skipping over a page of 0xFFs does nothing
> more than trying to write 0xFFs (erased state) to an already
> programmed page, i.e.  they both do nothing.

> Comments?

The only issue that I see (aside from '{'s on a line by themselves for
'if' and 'for' blocks), is that this optimization should _only_ be
applied to the FLASH.  EEPROM memory supports rewriting and we should
honor whatever data is given to us for that.  FLASH, as I know you
know, is special and writing 0xff is a no-op, but not so for EEPROM.

One of the reasons I had not committed an optimization like this is
that I hadn't yet thought of a good way to know whether we are working
with FLASH or EEPROM from down in the lower level routines.

But I'm all for it - assuming we can differentiate between those.

-Brian
-- 
Brian Dean
address@hidden
http://www.bsdhome.com/
http://www.bdmicro.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]