atishd12345 / optiboot

Automatically exported from code.google.com/p/optiboot
0 stars 0 forks source link

RAMPZ ignored in NRWW determination #75

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The code for determining whether an address is in the RWW or NRWW region of 
Flash is incorrect for devices with more than 64K bytes of Flash memory.  The 
attached patch corrects the issue by using the value of RAMPZ as part of the 
address test for those devices and has no effect for devices with 64K or less.

It should be noted, I suppose, that the existing code doesn't cause malfunction 
but is merely suboptimal.  For the mega1280 and mega1284 writes to addresses 
from 0xe000 through 0x1dff are slower than they might otherwise be because the 
page erase is delayed unnecessarily.

Original issue reported on code.google.com by dkin...@gmail.com on 8 Jan 2013 at 6:57

Attachments:

GoogleCodeExporter commented 8 years ago
I meant to leave the fact that the current code works (by treating the top of 
both 64k segments at NRWW) documented, I think :-(

Original comment by wes...@gmail.com on 17 Jan 2013 at 8:33

GoogleCodeExporter commented 8 years ago
I realized a few days ago that my statement about the range 0xe000 through 
0x1dff was incorrect.  As you noted, it's only the range 0xe000 through 0xffff 
that is slower to write than necessary.  In any event, the solution is simple 
and doesn't affect any devices not having RAMPZ.

Original comment by dkin...@gmail.com on 17 Jan 2013 at 7:37

GoogleCodeExporter commented 8 years ago
All the NRWW region stuff has been removed from 6.0.  It had only a marginal 
effect on performance (on SOME chips (~12% on atmega328 - about 1s difference 
in total time)), and the space was needed for other fixes.

Original comment by wes...@gmail.com on 27 Jun 2014 at 6:41