TotalPhase-Blog-Erlebniswelten

Programming of QSPI Flash with the Promira Serial Platform

Introduction

Programming Quad SPI storage 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 programming EEPROM and Flash devices easier. With one click on the Flash Center, the user can erase, program and check an entire device. This article is about programming Quad SPI Flash using Flash Center and a Promira platform. Although the following describes the 1.8V SOIC 8 of the Micron SPI Flash N25Q032A installed on the Flash SOIC-8 socket board 10/34, similar steps can be used for other devices. This article shows 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 mounted on the Flash SOIC-8 socket board - 10/34 is the SPI slave.

It is helpful first to understand the various operating options that Flash Center can offer. In particular, there are three programming modes: Program + Check, Program and Program (no erase). In addition, there are operations for reading devices, checking, and erasing.

Program + Verify - Writes data to one or more attached storage devices and then reads them back to verify that they are correct. If the device is an SPI flash, an erase cycle is performed first. Erasing only covers the sectors that are being written. Note that it is possible to erase more data than is being written if a write ends in the middle of a sector. In this case a warning is logged. If the data to be written is large enough to require the entire device to be erased and the storage device has an Erase All instruction, the software uses an 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 is first carried out with the same restrictions as with Program + Check.


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 several memory images are to be programmed onto 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 process, it will not perform the verification step.


Read device - Reads the content of the selected device and replaces it with the current content in the data buffer.


Verify- Checks the contents of the selected devices against the contents of the data buffer.


Erase - Allows the user to erase all or part of the storage device. For partial erasure, users can specify the starting address and length in the Erase Parameters dialog box as either a decimal value or a hexadecimal value.

N25Q32A Details

The SPI Flash N25Q032A has 32 Mbit (4 MByte) or 64 sectors. Each sector has 16 subsectors or 65,536 (64 KB, 0x10000) bytes. Each subsector is 4 Kbytes. Therefore, the memory has 1024 subsectors or 4,194,304 (0x400000) bytes. The entire memory can be erased at the same time, one sector or one subsector at a time. Below are some of the N25Q032A commands. Figure 1 shows part of the N25Q032A command list. Figure 2 shows the memory allocation of the N25Q032A. Refer to the N25Q032A datasheet for more information.

N25Q032A_command_list
N25Q032Q_memory_Map

Write Enable Command

The write enable command N25Q032A (0x06) sets the write enable latch bit. The write enable latch bit must be set before each write command (programming, erasing and writing).

N25Q00AA_Write_Enable

Command for fast programming with four inputs

The four-input (0x32) quick program command N25Q032A is used to program quad SPI data.

N25Q032A_QUAD_INPUT_FAST_PROGRAM_Commandb

Quick read command with four outputs

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

N25Q032A_QUAD_OUTPUT_FAST_READ_Commanda

Steps for memory programming & readout

1.) Connect the USB port of the Promira platform to the USB port of the PC.
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 I2C / SPI connector of the Promira platform to the Flash SOIC-8 socket board - 10/34 using the 34-34 cable (see Figures 8 and 9). On the Flash SOIC-8 socket board - 10/34, install the jumper on the VDD SEL connector: VLvl. (?)
5.) Start Flash Center. (?)
6.) Connect the Promira platform to Flash Center. (?)
     a.) Click on Adapter> Add Adapter.
     b.) Select the Promira platform.
     c.) Click on Add to establish a connection to the Promira platform.
7.) Configure the target power supply (pin 4, 6) to deactivated. I / O power (pin 22, 24) to level shift, level shift to 1.8 V. Activate the target power. (?)
8.) Click on Operations> Select Target and select "Micron N25Q032A 32-Mbit 1.8V". (?)
9.) Configure the bit rate to 8 MHz. (?)
10.) Configure the SPI I / O mode to Quad. (?)
11.) Read the storage device (?).
a.) Click on Operations> Read Target.

Promira_Flash_Center_N25Q032A_Read

12.) Program the N25Q032 and read (?).
       a.) Click on Operations> Program + Review.
       b.) Click on Operations> Read Target.

Promira_Flash_Center_N25Q032A_Write_Read

SPI Development Tools

Aardvark I2C/SPI Host AdapterAardvark I2C/SPI Host Adapter
Aardvark I2C/SPI Host Adapter
TP240141
Erase, program, verify Memory Devices - The Aardvark I2C/SPI Host Adapter is a fast and powerful I2C bus and SPI bus host adapter through USB.

€309.00*
Beagle I2C/SPI Protokoll Analyzer - Total Phase
Beagle I2C/SPI Protocol Analyzer
TP320121
The versatile Beagle I2C/SPI Protocol Analyzer is the ideal tool for the embedded engineer who is developing an I2C, SPI, or MDIO based product.

€369.00*
Promira I2C/ SPI/ eSPI Platform
TP500110-S
Promira is a universal hardware platform usable for a variety of applications, like I2C, SPI and eSPI.

Variants from €900.00*
€1,060.00*