How do you avoid corrupted registers in flash memory during power loss?

Also, the mysteries of quad mode, decoding part numbers, and just how long will that device be supported, anyway?


Q:  Regarding the Spansion S25FL-S flash memory device, I understand there are risks of corrupting the configuration and status registers if a power loss or system reset occurs when the system is modifying non-volatile and OTP bits.  Are there precautions I can take to help minimize that risk?


A:  Yes, there are some recommendations that you should follow to help minimize risks and issues should a system reset or power loss occur when modifying those bits. First, let me provide some background. The Spansion S25FL-S flash memory product family offers status registers (SR1 and SR2) and configuration registers (CR1) to query the device status, control the features of the device, and permit user configuration.  Some of these bits can be modified while others are read only; some are volatile while others are non volatile.  Further, some bits can be programmed only once, while others may be programmed back and forth as a logical 0 or 1.


The Write Registers (WRR) command is used to modify the contents of the status register (SR1) and configuration register (CR1) at the same time.  As you would suspect, it’s critical to maintain a stable operating condition while the command is executed since these registers control the lock status and I/O configuration. Any power loss or system reset during this operation may corrupt the register settings, possibly resulting in a locked or misconfigured device. If this occurs, the user application may be unrecoverable.


One recommendation to help reduce the risk of corruption is to minimize the number of program operations that use the WRR command. If the flash configuration registers are set to a permanent state during production, as is commonly done, they’re unlikely to be modified during the product life cycle, therefore helping to reduce the use of the WRR command.


Furthermore, maintaining a stable power supply condition is very important, so you’ll want to ensure that a large load on the power supply is not connected or disconnected immediately upon issuing the WRR command. In addition, once the WRR command issued, the device should not undergo any reset operations until the operation is completed. To ensure the operation is completed, you can monitor the WIP bit for verification, and/or wait at least the maximum time allowed (500 ms) for the operation to complete.  Always refer to the latest datasheet for the specifications for your device.


Finally, depending on which bit of the status register (SR1) and configuration register (CR1) is to be modified, you may also consider using the freeze bit.  The freeze bit CR1[0] is used to lock the state of the block protection bits along with the state of the configuration register TBPARM bit CR1[2], TBPROT bit CR1[5], and the secure silicon region (OTP) area.  You can find this information referenced in the respective datasheet for your device.


Q:  I’m currently using a Spansion S25FL512S and am wondering if it’s possible to use the 03h (serial) read command when this device is configured in quad mode.


A: Yes, it’s possible to configure not only your specific device in quad mode, but other Spansion S25FL-x devices as well.  In order to enable the quad mode capability of your device, the quad bit of the configuration register must be set as follows:  CR Bit1 = 1. The quad bit is non-volatile and sets the pin-out of the device to quad mode such that W#/ACC becomes IO2 and HOLD# becomes IO3. The instructions for serial, dual output, and dual I/O reads function as normal. Note that the W#/ACC and HOLD# functionality does not work when the device is set in quad mode.


In summary, yes, the instructions for serial, as well as for dual output and dual I/O read operations, will function as normal in quad mode. For more details, please refer to the section “Quad Output Read (QOR 6Bh or 4QOR 6Ch)” in the S25FL512S datasheet, or your specific S25FL-x datasheet on


Q: I am beginning a new design and am considering using a Spansion NOR flash memory device.  I need to be sure that the device will be available for the next several years.  Where can I find information on whether it’s recommended for new designs, and if there is any product change notification/advance change notification (PCN/CAN) documentation regarding end-of-life (EOL) for the device I’m planning to use? 


A:  It’s certainly critical to plan for long-term hardware supply and support for each of the devices in your project.  For Spansion NOR flash memory devices, both serial and parallel, you’ll have supply of these for at least 10 years from the initial production date.  (More can be found about the Spansion longevity program here.)


To determine whether your specific device is recommended for new designs, you can either do a quick search on for your specific product or click through from the Products tab to Memory, then to either the Parallel NOR flash or Serial NOR flash pages. There, you will see the listing of each device number and its product status. Devices will be classed as:

  • For new designs
  • Production
  • EOL issued
  • Not recommended for new designs

This page will also provide additional details for other device recommendations. The PCN/ACN, also known as obsolescence or EOL notices, are issued with six months notice for last-time orders and an additional six months for last-time shipments, which amounts to a full 12 months of support following the issuance of the respective PCN/ACN. Click here to learn more.


Q: What are Spansion’s storage recommendations for flash devices?


A: Spansion always recommends that packaged parts be kept in an environmentally controlled area (less than 40°C and 90 percent relative humidity), as indicated on the label adhered to the MBB bag.  The devices should also be in proper containers and vacuum sealed, whenever possible.


Spansion parts have a standard warranty support length of 12 months.  Although support may be limited for products that exceed that timeframe, Spansion is dedicated to its customers and will work to assist in any way possible should device issues arise after that time.


The “Storage KGD KGW” application note may provide additional helpful information for you.


Q: Regarding Spansion’s microcontroller devices, what do the last several characters of the OPN MB90F549GPF-GE1xxx specify?


A: The last several characters of the above OPN, specifically the GPF-GE1xxx portion, provide the following differentiations:

  • First ‘G’ after root OPN denotes that it is a G-step version.
  • ‘PF’ denotes the package type is a plastic quad flat pack (QFP).
  • The next ‘G’ after package type denotes that the device quality grade is general purpose.
  • E1 denotes it is lead free and RoHS compliant.

In addition, you may see the following OPN indicators:

  • ‘GS’ denotes standard quality grade.
  • ‘GT’ denotes the part is safety-critical automotive grade.
  • ‘E2’ indicates that it is it is lead free, halogen-free, and RoHS compliant.


Get More from Core & Code Subscribe

Leave a Reply

Your email address will not be published. Required fields are marked *

Other stories in this issue

Looking Ahead

Speech recognition for industrial applications

ARM Cortex M-based MCUs take industrial applications hands-free.