A kind of method extending flash memory serviceable lifeTechnical field
The present invention relates to ic manufacturing technology field, particularly relate to a kind of method extending flash memory serviceable life.
Background technology
The erasable minimum unit of NOR flash memory (Flash Memory) is sector (sector, be called for short sec), the minimum unit of programming is page (page), and NOR flash array structure is as shown in Figure 1a, wherein 1 represents sector, and 2 represent block.The write operation of any flash device can only be carried out in unit that is empty or that wiped, so in most cases, first must perform erasing before carrying out write operation.In NOR quick flashing, the maximum erasable number of times (durability) of each piece is 100,000 times.The operation of erasing-programming circulation repeatedly can cause the decline of storage unit, main manifestations is the increase in erasing time, as shown in Figure 1 b, wherein horizontal ordinate represents erasing times (Cycling No), and ordinate represents the erasing time (Sector ERS time (ms)) of single sector.
At present, most NOR flash memory user is when using this flash memory, customizing messages can be write specific memory block and constantly update this information, following problem can be caused like this: 1, continue to operate same block, accelerate the decline of this block, finally cause the mistake of data, and then substantially reduce the life-span of storer; 2, when continue carry out erasing-programming for a sector (sector) time, this sector can due to decline, as illustrated in figures 2 a-2b, sector 0 erasing time fails to 100ms from 40ms after the erasing of 30,000 times, and its erasing speed and other sectors differ greatly.During this time once user's instruction of using block (block) to wipe, block erase operation can carry out according to the slowest sector, other sector in so same piece there will be the situation of erasing (Over ERS), cannot recover, cause chip failure time serious.Wherein 101 expressions Sec1_init (distribution of sector 1 initial threshold voltage) in Fig. 2 b, 102 represent Sec1_BLK ERS, and (sector 0 is after 30k erasing, carry out block erasing again, the threshold voltage distribution of sector 1), ordinate represents storage unit number, and horizontal ordinate represents threshold voltage vt.Distributed can be found out by the threshold voltage of Fig. 2 b 102 sector 1, due to the decline of certain sector, then when carrying out block erase operation, other sectors with block there will be serious erasing phenomenon excessively.
Therefore how to find a kind of method to strengthen the data access of management and control flash memory, extend flash memory serviceable life and the reliability promoting data becomes the direction that those skilled in the art are devoted to study.
Summary of the invention
For above-mentioned Problems existing, the present invention discloses a kind of method extending flash memory serviceable life.
Extend the method in flash memory serviceable life, wherein, comprise the steps:
There is provided a flash memory, described flash memory comprises storage array and safe register, stores the decline information of each piece/sector in described flash memory in described safe register;
Upper once carry out programming operation before, select block/sector to programme according to the decline information of each piece/sector stored in described safe register.
The method in above-mentioned prolongation flash memory serviceable life, wherein, utilizes the erasing time to represent described decline information.
The method in above-mentioned prolongation flash memory serviceable life, wherein, described method also comprises:
There is provided a flash memory, described flash memory comprises storage array and safe register;
According to the number of block/sector in described flash memory, storage block is set in described safe register;
When at every turn carrying out erase operation to block/sector, calculating and recording erasing time of this block/sector, and by the erasing time of each piece/sector of record foundation specific format stored in described storage block.
The method in above-mentioned prolongation flash memory serviceable life, wherein, the erasing time of block/sector is shorter, then the Decline State of this block/sector is better.
The method in above-mentioned prolongation flash memory serviceable life, wherein, described method also comprises: upper once carry out programming operation before, select the best block/sector of decay state to programme according to the decline information of each piece/sector stored in described safe register.
The method in above-mentioned prolongation flash memory serviceable life, wherein, described decline information in units of block/sector stored in described safe register.
The method in above-mentioned prolongation flash memory serviceable life, wherein, the decline information of described each piece/sector with the formation of 1 byte stored in described safe register.
The method in above-mentioned prolongation flash memory serviceable life, wherein, described flash memory is NOR flash memory.
Foregoing invention tool has the following advantages or beneficial effect:
The invention discloses a kind of method extending flash memory serviceable life, calculated by the Decline State each to each piece/sector and be stored in the operable safe register of user, suitable block/sector (block/sector that prioritizing selection Decline State good) is selected to programme according to the Decline State of each piece/sector of record in upper once needs during programming (written information), thus effectively prevent the situation of the erasing-programming repeatedly in a certain piece/sector of flash memory, extend the serviceable life of flash memory and promote the reliability of data.
Concrete accompanying drawing explanation
By reading the detailed description done non-limiting example with reference to the following drawings, the present invention and feature, profile and advantage will become more apparent.Mark identical in whole accompanying drawing indicates identical part.Proportionally can not draw accompanying drawing, focus on purport of the present invention is shown.
Fig. 1 a is the structural representation of NOR flash memory;
Fig. 1 b is the relation schematic diagram of single sector erasing time and erasable number of times;
Fig. 2 a fails to the structural representation of 100ms from 40ms NOR flash memory sector 0 time after the erasing of 30,000 times;
Fig. 2 b is the schematic diagram that wiping appearred due to the decline of sector 0 in sector 1;
Fig. 3 is the method flow diagram extending flash memory serviceable life in the embodiment of the present invention;
Fig. 4 a-4b stores the schematic diagram that decline information is recorded in safe register in the embodiment of the present invention.
Embodiment
Below in conjunction with accompanying drawing and specific embodiment, the present invention is further illustrated, but not as limiting to the invention.
In flash memory, the decline main manifestations of storage unit is the increase in erasing time, the present invention is by piecemeal/sector record can use voluntarily in user in a particular form safe register of each erasing time, thus most suitable piece/sector can be chosen programme in programming operation subsequently, thus effectively can extend the serviceable life of flash memory.
As shown in Figure 3: the present embodiment relates to a kind of method extending flash memory serviceable life, specifically comprises the steps:
Step S1, provides a flash memory, and flash memory comprises storage array and safe register, and in an embodiment of the present invention, this flash memory can be NOR flash memory; Concrete, this safe register is the storage area that user that flash memory designs beyond storage array can use voluntarily.
Step S2, according to the number of block/sector in flash memory, arranges/opens up corresponding storage area (namely arranging a storage block in safe register) in safe register; Concrete, the corresponding block/sector of a byte (byte) can be defined; For the product of 32M, have 1024 sectors, two pages (512byte/page) just can record the decline information of all sectors; Namely in an embodiment of the present invention, both according to the number of block in flash memory, storage block can be set in safe register, also according to the number of sector in flash memory, storage block can be set in safe register.
Step S3, when at every turn carrying out erase operation to block/sector, calculating and recording the decline information of this block/sector, and by the decline information of each piece/sector of record foundation specific format stored in storage block.Concrete, if when carrying out erase operation to block at every turn, calculate and record the decline information of this block, and the decline information of each piece of record foundation specific format is arranged in storage block stored in the above-mentioned number according to block in flash memory in safe register; If when at every turn carrying out erase operation to sector, calculating and recording the decline information of this sector, and the decline information of each sector of record foundation specific format is arranged in storage block according to the number of sector in flash memory stored in above-mentioned in safe register.
In an optional embodiment, utilize the erasing time to represent decline information, and the erasing time of block/sector is shorter, then the Decline State of this block/sector is better; Concrete, when carrying out erase operation to block/sector at every turn, calculate and record erasing time of this block/sector, and by the erasing time of each piece/sector of record foundation specific format stored in the storage block of safe register; In an embodiment of the present invention, fail information in units of block/sector by the form of 1 byte stored in this storage block.
As shown in Figs. 4a and 4b, byte512 stores the decline information of sector 512, and content is " 00010011 ", then represent that the erasing time is 19*10ms; Byte511 stores the decline information of sector 511, and content is " 11111111 ", then represent that the erasing time is more than or equal to 255*10ms.
Step S4, upper once carry out programming operation before, select most suitable piece/sector (block/sector that such as prioritizing selection decay state is best i.e. erasing time the shortest block/sector) to programme according to the decline information of each piece/sector stored in safe register, namely most suitable piece (block that such as prioritizing selection decay state is best i.e. erasing time the shortest block) is selected to programme according to the decline information of each piece that stores in safe register, or select most suitable sector (sector that such as prioritizing selection decay state is best i.e. erasing time the shortest sector) to programme according to the decline information of each sector stored in safe register, to avoid repeatedly operating same region, avoid because other block/sectors occurred wiping the situation causing chip failure simultaneously, and then the life-span of storer can be extended to greatest extent, and ensure that the integrality of user data.Continue with reference to Fig. 4 a and 4b, the erasing time due to sector 512 is less than erasing time of sector 511, then programme in prioritizing selection sector 512.
The invention discloses a kind of method extending flash memory serviceable life, calculated by the Decline State each to each piece/sector and be stored in the operable safe register of user, most suitable piece/sector is selected to programme according to the decline information of each piece/sector of record in upper once needs during programming, used equably to make each block in flash memory, thus effectively prevent the situation of the erasing-programming repeatedly in a certain piece/sector of flash memory, extend the serviceable life of flash memory and promote the reliability of data, and the method is simple, practical.
It should be appreciated by those skilled in the art that those skilled in the art are realizing change case in conjunction with prior art and above-described embodiment, do not repeat at this.Such change case does not affect flesh and blood of the present invention, does not repeat them here.
Above preferred embodiment of the present invention is described.It is to be appreciated that the present invention is not limited to above-mentioned particular implementation, the equipment wherein do not described in detail to the greatest extent and structure are construed as to be implemented with the common mode in this area; Any those of ordinary skill in the art, do not departing under technical solution of the present invention ambit, the Method and Technology content of above-mentioned announcement all can be utilized to make many possible variations and modification to technical solution of the present invention, or being revised as the Equivalent embodiments of equivalent variations, this does not affect flesh and blood of the present invention.Therefore, every content not departing from technical solution of the present invention, according to technical spirit of the present invention to any simple modification made for any of the above embodiments, equivalent variations and modification, all still belongs in the scope of technical solution of the present invention protection.