Chapter 6: Interfacing to Flash Memory

Overview

Flash memory is quickly becoming the standard non-volatile memory choice in embedded systems. Flash memorys versatility, price per byte, and density fall in the right range to make it a very good choice for most new embedded systems projects. Flash memory is non-volatile and in-system-writable memory. In other words, the content of the device remains intact even after power is removed. There are mechanisms, however, available to the firmware that support the ability to write and re-write data to the flash memory device.

Interfacing to flash devices comes with its share of headaches . Reading from flash memory is the same as reading from regular memory, but thats where the similarity ends. Flash devices vary in size from about 64KB to 8MB and densities increase regularly. Flash devices are broken up into sectors or blocks of memory space. Each sector is an erasable unit. When a sector is erased, the bits of data within that sector are all set to 1 (bytes = 0xff ). Writing to the flash device (after it has been erased) is the process of changing a bit that is currently a 1 to a . After the bit is , the only way it can be set back to 1 is by erasing the entire sector that contains the byte. Both the erase and write operations involve a complicated handshake between the processor and the memory device.

On top of all of this, for most flash devices, while an operation (write or erase) is being performed on the device, the CPU cannot access the device for anything else; hence, you cant be executing out of the same flash device on which you are operating. Just in case youre still not up to your ears in complexity, these devices eventually wear out. Typically, a sector on the device is guaranteed to last for 100,000 to 1,000,000 erase cycles not very large numbers for an embedded microprocessor system.

This chapter describes how to provide support for multiple flash devices in varying widths and not necessarily in contiguous memory space. I will step through the MicroMonitors flash command and discuss the functions that underlie MicroMonitors flash memory features. This discussion continues in Chapter 7, which describes a flash file system.



Embedded Systems Firmware Demystified
Embedded Systems Firmware Demystified (With CD-ROM)
ISBN: 1578200997
EAN: 2147483647
Year: 2002
Pages: 118
Authors: Ed Sutter

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net