Method of managing blocks fo flash memory suitable for flexible correspondence between logic block and physical block

Information

  • Patent Application
  • 20080071968
  • Publication Number
    20080071968
  • Date Filed
    September 18, 2006
    18 years ago
  • Date Published
    March 20, 2008
    16 years ago
Abstract
A method of managing blocks of a flash memory device suitable for a flexible correspondence between logic blocks and physical blocks of the flash memory device is provided. First, a sum of good physical blocks and defective physical blocks is calculated. Next, the good physical blocks and the defective physical blocks are distributed into a number of predetermined sectors of a flash memory, wherein each predetermined sector has a predetermined number of temporary blocks in order to equalize the sum of logic blocks and the temporary blocks with the physical blocks in each predetermined sector. The distribution information is recorded into a good physical block. When executing to initialize said flash memory, a control chip locates and reads the block where the distribution information is stored and stores the distribution information into a SRAM of said control chip to create a block correspondence chart in the predetermined sector to manage said flash memory.
Description

BRIEF DESCRIPTION OF THE DRAWING


FIG. 1 is a view showing a block calculation method of the present invention.



FIG. 2 is a view a block management of the present invention.



FIG. 3 is a flowchart of a method of initializing of the flash memory of the present invention.





DETAIL DESCRIPTION OF THE EMBODIMENTS

Referring to FIG. 1 and 2, a flash memory 1 comprises a control chip (not shown) for calculating the sum of the good physical blocks 11 and the sum of the defective physical blocks 12 in order to distribute them among the predetermined sectors of the flash memory 1. Each predetermined sector has a predetermined number of temporary blocks so as to equalize the number of the logic blocks and the temporary blocks with the defective physical blocks 12 therein. The distribution information including the number of the predetermined sectors, the number of the good physical blocks 11 and a border information is stored in one of the good physical blocks 11. When the flash memory 1 is in the initialization stage, the control chip locates the good physical block 11 in which the distribution information including the number of predetermined sectors, the number of good physical blocks 11 and the border information of the predetermined sectors is stored and then reads the distribution information from the good physical block 11 and then stores this information into the SRAM of the chip. When initiating each defined sector, the control chip creates a correspondence chart of the block in the sector corresponding to the information stored in the SRAM to enable the logic blocks correspondence with the defective physical blocks 12. Accordingly, regardless whether or not the defective physical blocks 12 accumulate in one or a plurality of sectors, the flash memory 1 can still be managed effectively.


According to the above method, for example, the flash memory 1 with 4096 blocks may be divided into 4 predetermined sectors with each predetermined sector having 1024 physical blocks, wherein when there are 80 defective physical blocks 12 evenly distributed in the flash memory 1, each predetermined sector will have 1004 good physical blocks 11, 992 logic blocks and 12 temporary blocks. Thus, there will be more number of good physical blocks 11 than the logic blocks so as to enable the flash memory 1 to function normally.


When the defective physical blocks 12 accumulate in one sector, based on the principle that the number of the logic blocks is non-proportional, such that each predetermined sector has 1024 physical blocks, 944 good physical blocks 11 and 932 logic blocks. Accordingly, there are 12 temporary blocks, 1024 good physical blocks 11 and 1012 logic blocks in another sector to maintain 12 temporary blocks. As shown in the Figure, there is greater number of the good physical blocks 11 than the logic blocks. Thus, there are sufficient number of temporary blocks, and the flash memory 1 can function normally.


Hereinafter, the procedure of initialization of the flash memory 1 with reference to FIG. 1, 2 and 3 as follows.


At step 300, the sum of all the good physical blocks 11 and the sum of the defective physical blocks 12 are calculated.


At step 301, the good and defective physical blocks 11, 12 are distributed among the defined sectors of the flash memory 1, wherein each predetermined sector has a predetermined number of temporary blocks to equalize the number of the logic blocks and the temporary blocks with the physical blocks therein.


At step 302, the distribution information is recorded into a good physical block 11.


At step 303, the initialization to the flash memory 1 is executed.


At step 304, the block where the definition of the sector information, the number of good physical blocks 11 and the border information of the predetermined sectors are stored is located, and then this information is stored into the SRAM of the control chip.


At step 305, a border and the predetermined sector in the flash memory 1 are built according to the border information and the predetermined sectors information stored in the SRAM.


At step 306, the number of the good physical blocks 11 in each block is determined.


At step 307, a block correspondence chart is created in the predetermined sector.


As can be seen from above description that when the flash memory 1 has too many defective physical blocks 12, the number of the good physical blocks 11 and the number of the logic blocks can be adjusted according to the non-proportionality principle by including a predetermined number of temporary blocks (for example 12 temporary blocks) in order to manage the flexibly flash memory.


Accordingly, the method of managing blocks of the flash memory of the present invention can overcome the disadvantages of the conventional art. According to the present invention, the sum of number of the good and defective blocks is calculated and then the blocks are distributed in the predetermined sectors in the flash memory, wherein each predetermined sector has a predetermined number of temporary blocks in order to equalize the number of the logic blocks and the temporary blocks with the physical blocks in the predetermined sector. This information is stored into the SRAM of the control chip so that the control chip can create a block correspondence chart in the predetermined sector during execution to initialize the flash memory. Accordingly, each predetermined sector has the number of the logic blocks non-proportional to the number of physical blocks, wherein the temporary blocks may be utilized to effectively operate the flash memory. Thus, the logic blocks and the physical blocks can be managed according to the method of the present invention regardless of whether the defective physical blocks accumulate in one or a plurality of predetermined sectors, or in one or a plurality of sectors of one or a plurality of flash memories. Thus, there will not be many invalid physical blocks.


While the invention has been described in conjunction with a specific best mode, it is to be understood that many alternatives, modifications, and variations will be apparent to those skilled in the art in light of the foregoing description. Accordingly, it is intended to embrace all such alternatives, modifications, and variations in which fall within the spirit and scope of the included claims. All matters set forth herein or shown in the accompanying drawings are to be interpreted in an illustrative and non-limiting sense.

Claims
  • 1. A method of managing blocks of a flash memory device suitable for a flexible correspondence between logic blocks and physical blocks of the flash memory device, comprising: calculating a sum of good physical blocks and a sum of defective physical blocks; anddistributing the good physical blocks and the defective physical blocks into a number of predetermined sectors of a flash memory, wherein each predetermined sector has a predetermined number of temporary blocks in order to equalize the sum of said logic blocks and said temporary blocks with said physical blocks in each predetermined sector, the distribution information is recorded into a good physical block, and wherein when executing to initialize said flash memory, a control chip locates said block where said distribution information is stored and reads said distribution information and then stores said distribution information into a SRAM of said control chip so as to create a block correspondence chart in said predetermined sector to manage said flash memory.
  • 2. The method of managing blocks of a flash memory device suitable for a flexible correspondence between logic blocks and physical blocks of the flash memory device according to claim 1, wherein said distribution information comprises a number of predetermined sectors, a number of good physical blocks in each predetermined sector and a boarder information.
  • 3. The method of managing blocks of a flash memory device suitable for a flexible correspondence between logic blocks and physical blocks of the flash memory device according to claim 1, wherein said flash memory device comprises a single or a plurality of flash memories.