Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Flash fails to write a bit or zeroes other bit

2004-05-21 by chazeltopman

I'm experiencing write failures of a bit in flash.  If I
 write the pattern 0xA55A to a location like 0x1DC10
 and then write a vector to the following location,
 0xDC14, I find that the first location has become
 0xA558.
 Now let me explain the write algorithm I'm using.
 I need to be able to store 32 bit values into flash
 one at a time.  Since the IAP routines limit writes
 to a minimum of 512 bytes I  had to work around
 this limit.
 My current algorithm reads the location to be
 written and if it is ones, then the sector does not
 need to be erased and the 512 byte section
 surrounding the word to be changed only needs
 to be altered.
  o 512 byte section is copied to RAM;
  o 32-bit value is stored into the RAM  image
  o 512 byte image is written back to the Flash
     using the IAP copy to Flash command.
 Now the only funky thing I see here which might
 be a problem is multiple writes to flash cells.  In
 some cases multiple writes to cells diminishes
 the charge, but this is usually documented in the
 user manual and I can't find any mention of it. 
 Anyone the wiser?
 So now I use a dumb algorithm:
  o copy 8K sector which contains location to be
     altered, to RAM
  o change location in RAM
  o erase sector in flash with IAP command
  o write back 8K sector with IAP command
 Not only does this take a long time (400ms) but
 I worry that I will run out of flash cycles.
 To make matters more complicated, I'm also
 working with the LPC2129 and I can't use the dumb
 algorithm on it because there is only 16K of RAM
 and two of the flash sectors are 64K!  Also the
 mapping of address to sector numbers no
 longer is linear.

 Sigh, no memory technology has everything yet.

 Rob

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.