Support Question of the Week: Fully Erase Flash Memory before Re-programming Device

Q: I am re-programming 16MB into 16MB flash memory, which needs to be erased before re-programming. My question – does the Flash Center Software automatically do a full chip erase before re-programming a flash memory device, or is there a setting I need to apply? I'm asking because when I used 120KB images on the device, Flash Center warned about padding a sector as the data was a small part of the chip and was not sector-aligned.  I assumed the warning indicated full-chip resets were not done before re-programming the device.

A: Thanks for your question! How a device is erased depends on the selected mode and erase cycle configuration. Flash Center Software has three programming modes: Program + Verify, Program and Program (No Erase), and a configurable erase cycle. The modes are described below. For complete information about the program modes and the erase cycle, please refer to the Flash Center User’s Manual section 3.5.

Program + Verify: The Program + Verify cycle writes data to one or more attached memory devices and then reads back the data to verify correctness. If any part of the sequence fails, a status message is immediately added to the transaction log. An error dialog is displayed after all adapters have finished their operations.

If the device is an SPI flash memory, an erase cycle is performed first. This erase covers only the sectors that will be written. Erase cycle features are summarized below:

  • If a write ends in the middle of a sector, it is possible to erase more data than is written. A warning is logged if this occurs.
  • If the data to be written is large enough to require that the entire device to be erased and the memory device has an “erase all” instruction, the software will use the “erase all” instruction.

Program: The Program cycle writes data to the device, but without the verification step. If the device is an SPI Flash, an erase cycle will be performed first with the same caveats as Program + Verify.

Program (No Erase): The Program (No Erase) cycle is a special mode for SPI Flash devices. It writes data to the device, but does not perform an erase cycle. This is useful when multiple memory images are being programmed to the device. (Use FF as the pad value when loading each memory image to avoid corrupting previously written data). As the device may have been programmed before this operation, the verification step is not performed.

Erase Cycle: The erase cycle allows you to erase the entire memory device or select a portion to erase. For partial erasure, you specify the start addresses and the length in the Erase Parameters dialog.

Erase Flash Memory Parameters Dialog Figure 1: Erase Parameters Dialog

If a device does not have an erase instruction, zeros are written to the specified range within the device. Otherwise, refer to the memory device data sheet for its erase behavior.

For more information about the Flash Center, please refer to the Flash Center User's Manual. For an overview of all our products, you can visit All Products. For a quick comparison to help make a selection, refer to our Product Selector Guide.

We hope this answers your question. If you have other questions about our Protocol Analyzers or other Total Phase products, feel free to email us at sales@totalphase.com or support@totalphase.com.

Leave a Reply