
VxWorks
Hardware Considerations Guide, 6.0
26
block now maps to the area of flash that contains the modified data. This mapping
information is protected, even during a fault. For more information on fault
recovery and mapping information, see Recovering Mapping Information, p.29.
Erase Cycles and Garbage Collection
The write operation is intrinsically linked to the erase operation, since data cannot
be “over-written.” Data must be erased, and then those erased units must be
reclaimed before they are made available to a write operation. This section
describes that process, as well as the consequences of over-erasing sections of flash.
Erasing Units
Once data is written to an area of flash memory, modifying blocks leaves behind
block-sized regions of flash memory that no longer contain valid data. These
regions are also un-writable until erased. However, the erase cycle does not
operate on individual bytes or even blocks. Erasure is limited to much larger
regions called erase units. The size of these erase units depends on the specific flash
technology, but a typical size is 64 KB. For more information on erase units, see the
VxWorks Device Driver Developer’s Guide: Flash File System Support with TrueFFS.
Reclaiming Erased Blocks
To reclaim (erase) blocks that no longer contain valid data, TrueFFS uses a
mechanism called garbage collection. This mechanism copies all the valid data
blocks, from a source erase unit, into another erase unit known as a transfer unit.
TrueFFS then updates the block-to-flash map and afterward erases the old (erase)
unit. The virtual block presented to the outside world still appears to contain the
same data even though that data now resides in a different part of flash.
For details on the algorithm used to trigger garbage collection, see Garbage
Collection, p.28. For information about garbage collection and fault recovery, see
Recovering During Garbage Collection, p.30.
Over-Programming
As a region of flash is constantly erased and rewritten, it enters an over-programmed
state, in which it responds only very slowly to write requests. With rest, this
condition eventually fixes itself, but the life of the flash memory is shortened.
Eventually the flash begins to suffer from sporadic erase failures, which become
more and more frequent until the medium is no longer erasable and thus no longer
writable (data that is already resident on the flash is still readable). Consequently,
flash limits how often you can erase and rewrite the same area. This number,
Comentários a estes Manuais