I2C SPI USB CAN eSPI Cable Testing View All Videos Quick Start Guides Software Downloads App Notes White Papers User Manuals Knowledge Base Sales Support About Us
Products Blog Sales Support Contact Search
Programming QSPI Flash Using the Promira Serial Platform and the Flash Center Software
Programming QSPI Flash Using the Promira Serial Platform and the Flash Center Software

Introduction

Programming Quad SPI memory devices is a common use case for the Promira™ Serial Platform with SPI Active - Level 1 and 2 Applications. There are several ways to do this with the Promira Serial Platform, including using Control Center™ Serial Software, Flash Center™ Software, or the Promira Software API. Using the Promira platform with the Flash Center Software makes it extremely easy to program EEPROM and flash devices. With one Flash Center click the user can erase, program, and verify an entire device. This article focuses on how to program Quad SPI flash with Flash Center and a Promira platform. Although the following describes the Micron SPI Flash N25Q032A 1.8V SOIC 8 assembled on the Flash SOIC-8 Socket Board - 10/34, similar steps can be used for other devices. The goal of this article is to demonstrate how to program Quad SPI flash and then read back the data

Overview

In this article the Promira platform erases, programs and reads the N25Q032A. Here the Promira platform is the SPI master and the Micron SPI Flash N25Q032A assembled on the Flash SOIC-8 Socket Board - 10/34 is the SPI slave.

It's first helpful to understand the different operations options provided by Flash Center. Specifically, there are three programming modes: Program + Verify, Program, and Program (No Erase). In addition there are Read Device, Verify, and Erase operations.

    • Program + Verify - Writes data to one or more attached memory devices and then reads back the data to verify it for correctness. If the device is an SPI Flash, an erase cycle will be performed first. The erase will cover only those sectors which will be written. Note that it is possible to erase more data than is written if a write ends in the middle of a sector. A warning will be logged if this is the case. Also, if the data to be written is large enough to require the entire device to be erase, and the memory device has an “erase all” instruction, the software will use the “erase all” instruction.

 

    • Program - Writes data to the device, but does not perform 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) - A special mode for SPI Flash devices. It writes data to the device, but does not perform an erase cycle. This is useful if multiple memory images are to be programmed to the device. Use FF as the pad value when loading each memory image to avoid corrupting previously written data. Because the device may have been programmed prior to this operation, it does not perform the verification step.

 

    • Read Device - Reads the contents of the selected device and replaces it in the current contents in the data buffer.

 

    • Verify - Verifies the contents of the selected devices against the contents of the data buffer.

 

    • Erase - Allows the user to erase the entire memory device or allows the erasure of portion of it. For partial erasure, users can specify the start addresses and length in the erase parameters dialog as either a decimal value or as a hexadecimal value.

 

N25Q32A Details

The SPI Flash N25Q032A has 32 Mbit (4M bytes) or 64 sectors. Each sector has 16 subsectors or 65,536 (64K, 0x10000) bytes. Each subsector has 4K bytes. Therefore, the memory has 1024 subsectors or 4,194,304 (0x400000) bytes. The whole memory can be erased at one time, a sector at a time, or a subsector at a time. For reference, listed below are several of the N25Q032A commands. Figure 1 shows partial of the N25Q032A commands list. Figure 2 shows the N25Q032A memory map. See the N25Q032A Datasheet for additional details.

Figure 1: N25Q032A Commands List

Figure 2: N25Q032A Memory Map

Write Enable Command

The N25Q032A write enable command (0x06) sets the write enable latch bit. The write enable latch bit must be set prior to any write command (Program, Erase and Write).

Figure 3: N25Q032A Write Enable Command

Quad Input Fast Program Command

The N25Q032A quad input fast program command (0x32) is used for programming quad SPI data.

Figure 4: N25Q032A Quad Input Fast Program Command

Quad Output Fast Read Command

The N25Q032A quad output fast read command (0x6B) is used for reading quad SPI data.

Figure 5: N25Q032A Quad Output Fast Read Command

Memory Programing and Reading Guidelines

  1. Connect the Promira platform USB connector to the PC USB connector.
  2. Follow the instructions in Section 4.2 - Connectivity of the Promira platform user manual to configure the Ethernet over USB interface.
  3. Download and unzip the latest version of Flash Center. (?)
  4. Connect the Promira platform I2C/SPI connector to the Flash SOIC-8 Socket Board - 10/34 through the 34-34 cable as shown in Figures 8 and 9. On the Flash SOIC-8 Socket Board - 10/34 install jumper on VDD SEL connector: VLvl. (?)
  5. Launch Flash Center. (?)
  6. Connect the Promira platform to Flash Center. (?)
    1. Click Adapters > Add Adapters.
    2. Select the Promira platform.
    3. Click Add to connect to the Promira platform.
  7. Configure Target Power (Pin 4, 6) to Disabled; IO Power (Pin 22, 24) to Level Shift, Level Shift to 1.8V. Enable Target Power. (?)
  8. Click Operations > Choose Target and choose "Micron N25Q032A 32-Mbit 1.8V". (?)
  9. Configure Bit Rate to 8 MHz. (?)
  10. Configure SPI I/O Mode to Quad. (?)
  11. Read the memory device (?).
    1. Click Operations > Read Target.

    Figure 6: Promira platform reads from N25Q032A

  12. Program the N25Q032, and read (?).
    1. Click Operations > Program + Verify.
    2. Click Operations > Read Target.

    Figure 7: Promira platform writes to N25Q032A and reads

    Figure 8: Promira platform system

    Figure 9: Flash Socket Board

Notes

For additional information, take a look at the Promira platform user manual, Flash Center manual and Flash Socket Board - 10/34 User Manual.