Abstract: This paper introduces the public flash memory interface (CFI) structure of flash memory, and how the system software uses CFI to obtain various parameters of flash memory to implement various flash memoryProgramDesign.
Keywords: Flash Memory public flash interface CFI command User Interface Cui
Since Intel launched a non-volatile memory flash memory that can be quickly erased in 1988, the flash memory technology has developed rapidly. This is mainly because flash memory has the features of no storage capacitor, higher integration, lower manufacturing cost than dram, easy to use, flexible reading and writing, fast access, no information loss after power failure, etc.
Although flash memory is widely used, the operating command set and electrical parameters of flash memory products of different flash memory manufacturers vary widely due to the large number of Semiconductor manufacturers producing flash memory, this makes it inconvenient for flash memory developers and OEMs. To upgrade existing flash memory products or replace Flash memory products of other companies, you mustCodeAnd the hardware structure. To solve the problems caused by the above problems, flash memory manufacturers urgently need to propose a public standard solution. In this context, the common flash interface (Common flash Interface ), CFI is a public standard interface for reading data from flash memory devices. It allows system software to query various parameters of the installed flash memory device, including the device array structure parameters, electrical and time parameters, and features supported by the device. CFI can replace the old version with new and improved products without modifying system software. For example, if the erased time of the new flash memory version is only half that of the old version, the system software only needs to use CFI to read parameters such as the erased time of the new device and modify the timer time parameter. To fully and effectively use the functions provided by CFI, it is necessary to understand the following issues.
1. How flash memory works
All operations on the flash memory chip are implemented through the chip's command User Interface (Cui). The command user interface is the interface between the microprocessor or the microcontroller and the chip's internal operations. When writing different control commands through Cui, flash memory is transferred from one working state to another. Its common working states are as follows.
1.1 read storage unit operations
After the flash memory chip is powered on or returned from the deep low power consumption status, the chip is in the read storage unit status. You can use the write reset command to enter the read storage unit status. In this case, you can read the content of the flash memory chip storage unit. The operation of the read storage unit is the same as that of the SRAM, but the logic power supply voltage (VCC) of different companies is different.
1.2 Erasure
When flash memory chip is erased, each storage module can be erased independently because flash memory adopts an array structure with module partitions, when the given address is within the module address range and the module erasure command is written to the command user interface, the corresponding module is erased. There are three issues to note when performing the erasure operation: (1) Because flash memory adopts the Array Structure of the module partition, the number of modules of flash memory products of different models is different from that of each partition. (2) flash memory products of different models have different erasure voltages; (3) The erased time of the entire flash memory product of different models is different from that of each module partition.
1.3 Programming
The flash memory programming operation is automatic byte programming, which can be sequential writing or designated address writing. When writing a byte programming command to a user's command interface, the chip automatically performs the byte programming and programming verification. There are two issues to be aware of when performing programming operations: (1) the programming voltage varies with flash memory products of different models; (2) different flash memory product types have different bytes/word programming times. All these problems must be considered during system program design.
In addition to the three common operating methods mentioned above, flash memory also supports chip reset, read ID code, erasure pending, and erasure recovery, however, these methods almost do not need to be considered during programming. You only need to enter the correct command words, but the flash memory command control words of different companies are different. You can use CFI to solve all the problems encountered earlier. However, you must first ensure that the flash memory to be operated is a CFI enabling device.
2 CFI enable device identification
To determine whether a flash memory is a CFI-enabled flash memory device, system software must first write data 98 H to the Flash Memory Address 55 H through Cui, then, the contents of the three storage units are read continuously through the data bus from the device address for 10 h, if the three storage units returned by the data bus are 'Q', 'R', and 'y', the device is a CFI enabled flash memory device.
Because the Array Structure in flash memory is different, the address and quantity of the query character 'q' returned from the device are also different. Currently, there are three common internal flash memory arrays:
(1) Single Chip x 16 structure, which has 8-bit access capability, but can only operate in 16-bit bus mode;
(2) Dual-chip x 8/16 structure, each with 8-bit and 16-bit bus storage mode, but each with only 8-bit bus mode, the entire chip array is structured as a 16-bit bus;
(3) Dual-chip x 16 structure, each with only 8-bit bus storage mode, and each with only 8-bit bus mode, the entire chip array structure is 16-bit bus.
After determining that a flash memory is a CFI enabling device, the software program determines the Array Structure of the flash memory based on the number of query characters 'q' returned from the device, this ensures correct read/write operations on the device.
3 structure of public flash Interfaces
After identifying the CFI enable device, you can use the query command to read the CFI query structure or database. The address and meaning of the data are shown in table 1, in table 1, the address 13h is the manufacturer's command set and Control Interface ID. The meaning of the data is shown in table 2.
Table 1 addresses and definitions of CFI data structures (databases)
Table 2 manufacturer's command set and Control Interface ID definition table
4 CFI query operation software process
From table 1, we can see that CFI provides a public standard data information, system software can use the command set of different manufacturers, adjust the time for erasure and programming, and adjust the memory size according to the information of the erased block area. The system software needs to read the main data information provided by CFI in the CFI query operation. Using this information, it is easy to design various flash memory programs. The flowchart 1 of the CFI query operation is shown in.