NANDFLASH management method based on FAT file system

A management method and file system technology, applied in the field of NANDFLASH management based on the FAT file system, can solve the problems of consuming CPU resources, slowing down the system speed, and increasing the storage space, so as to improve reliability and stability, shorten the development cycle, The effect of simple method

Inactive Publication Date: 2010-03-10
IPGOAL MICROELECTRONICS (SICHUAN) CO LTD
0 Cites 7 Cited by

AI-Extracted Technical Summary

Problems solved by technology

[0011] 1. Due to the problem of the bad block table and the mapping table, its algorithm becomes relatively complicated, and the amount of code increases, which consumes a l...
View more

Abstract

The invention discloses an NANDFLASH management method based on an FAT file system, which comprises the following steps: firstly, detecting each block in an NANDFLASH, finding out a failed block; secondly, processing the failed block, converting a physical address of the failed block into a cluster number; thirdly, making the cluster number of the failed block in an FAT table, wherein the marked value is more than the biggest cluster number in the FAT table. A failed block table and a mapping list are established independently, but the information of the failed block is marked on the FAT table, the method for processing on the file system is suitable for equipment based on the FAT file system, is simple, has less code amount and shorter development period without consuming large CPU resources and storage space and can effectively improve the reliability and the stability of the system.

Application Domain

Special data processing applications

Technology Topic

File systemPhysical address +2

Image

  • NANDFLASH management method based on FAT file system

Examples

  • Experimental program(2)

Example Embodiment

[0026] Example 1
[0027] Such as figure 1 As shown, a NANDFLASH management method based on the FAT file system is to first detect each block in the NANDFLASH, find the bad block, then process the bad block, convert the physical address of the bad block into a cluster number, and finally The cluster number of the bad block is marked in the FAT table; the value of the mark must be greater than the largest cluster number in the FAT table, so that the mark value does not overlap with the valid cluster number, and in this case, it will always be written to the file. Will not write to this cluster.
[0028] The physical address of the bad block is converted into a cluster number by the bad block processing program, and the converted code is:
[0029] for(i=0; i
[0030] {
[0031] BadClusNum[i]=BadBlkNum*ClusPerBlk+2;
[0032] }
[0033] Among them, ClusPerBlk represents the number of clusters per block; BadClusNum represents the cluster number corresponding to the bad block; BadBlkNum represents the address of the bad block, and +2 is because the cluster number in the FAT table starts from 2. Assuming that each block of a piece of NANDFLASH has 4 clusters (the specific number of clusters in each block needs to be determined by the computer according to the capacity of NANDFLASH, here is just an assumption), if the second block is detected as a bad block, then according to the above conversion code We know that the cluster numbers corresponding to this block are clusters 10, 11, 12, and 13; finally, mark the position corresponding to the cluster number in the FAT table, and update the FAT table after the marking is completed.
[0034] The detection is to erase the block first. When the erase block is unsuccessful, it means that it is a bad block. When the erase is successful, data is written to the block, and then the written data is read out and the original data is compared. The difference between the two indicates that the block is a bad block.
[0035] Below is a part of a typical FAT table.
[0036] offset
[0037] F8 FF FF FF is the start mark of the FAT table.
[0038] 00 00 indicates a free cluster.
[0039] FF FF is the end of file mark.
[0040] For example, if you want to read a file, suppose its starting cluster is the 5th cluster, the content of the 5th cluster on the FAT table is 0800, then it will reach the 8th cluster, the 8th cluster is 0C00, and then it will reach the 12th cluster. Cluster, the content of the 12th cluster is FFFF, which means that the last data of this file is less than one cluster, and reading the file ends here (that is, the data of this file is located on the 5th, 8th, and 12th clusters). If we want to write a file, first look for a free directory in the root directory area, and then query the free cluster on the FAT table (query the free flag 0000), and erase the physical block corresponding to the cluster after finding it. If the erasing fails, the cluster corresponding to the block is marked with FE FF to indicate that it is not available. Otherwise, write data to this cluster, and then read it after writing, and then perform data error correction, if the data after error correction If the data is different from the original data, the cluster corresponding to the block is marked with FE FF to indicate that it is not available. After marking, continue to search for free clusters until the file is written, and then update the FAT table.

Example Embodiment

[0041] Example 2
[0042] When the NANDFLASH is formatted, the computer will calculate the relevant information according to the FLASH capacity and put it into the DBR. FAT divides the FLASH space according to a certain number of sectors, each sector is 512Bytes, and multiple sectors form a " cluster". The following structure is the detailed information in DBR:
[0043] #define UINT8 unsigned char
[0044] #define UINT16 unsigned int
[0045] #define UINT32 unsigned long
[0046] typedef struct
[0047] {
[0048] UINT8 jmpBoot[3]; /*Jump instruction */
[0049] UINT8 OEMName[8]; /*vendor name */
[0050] UINT16 BytsPerSec; /*Bytes per sector */
[0051] UINT8 SecPerClus; /*Number of sectors per cluster */
[0052] UINT16 RsvdSecCnt; /*Number of reserved sectors */
[0053] UINT8 NumFATs; /*Number of FAT tables */
[0054] UINT16 RootEntCnt; /*Maximum number of root directory files, 0 in FAT32 */
[0055] UINT16 TotSec16; /*Total number of sectors, 0 in FAT32 */
[0056] UINT8 Media; /*Media descriptor */
[0057] UINT16 FATSz16; /*Number of sectors per FAT */
[0058] UINT16 SecPerTrk; /*Number of sectors per track */
[0059] UINT16 NumHeads; /*Number of heads (number of sides) */
[0060] UINT32 HiddSec; /*The number of hidden sectors */
[0061] UINT32 TotSec32; /*If BPB_TotSec16=0, record the total number of sectors */
[0062] UINT8 DrvNum; /*drive of interrupt 13 */
[0063] UINT8 Reserved1; /*Reserved */
[0064] UINT8 BootSig; /*Extended boot flag */
[0065] UINT32 VolID; /*Volume serial number */
[0066] UINT8 VolLab[11]; /*Volume label */
[0067] UINT8 FilSysType[8]; /*File system type */
[0068] UINT8 Code[448]; /*boot code */
[0069] UINT16 Over; /*End flag */
[0070] }DBRINFO;
[0071] Take Samsung K9K8G08U1M as an example. It has 4096 blocks, each block contains 64 pages, and each page is composed of 4 sectors and a 64-byte spare area. The total size is 512M+16M (16M is spare area). The following is the DBR area information of the FAT file system established on this block of NANDFLASH.
[0072] 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
[0073] 01: EB 3C 90 4D 53 57 49 4E 34 2E 31 00 02 10 01 00
[0074] 02: 02 00 02 00 00 F8 F9 00 20 00 3E 00 20 00 00 00
[0075] 03: 00 86 0F 00 80 00 29 22 96 1B 00 61 61 61 00 00
[0076] 04: 00 00 00 00 00 00 46 41 54 31 36 20 20 20 FA 33
[0077] 05: C0 8E D0 BC 00 7C 16 07 BB 78 00 36 C5 37 1E 56
[0078] 06: 16 53 BF 3E 7C B9 0B 00 FC F3 A4 06 1F C6 45 FE
[0079] 07: 0F 8B 0E 18 7C 88 4D F9 89 47 02 C7 07 3E 7C FB
[0080] 08: CD 13 72 79 33 C0 39 06 13 7C 74 08 8B 0E 13 7C
[0081] 09: 89 0E 20 7C A0 10 7C F7 26 16 7C 03 06 1C 7C 13
[0082] 10: 16 1E 7C 03 06 0E 7C 83 D2 00 A3 50 7C 89 16 52
[0083] 11: 7C A3 49 7C 89 16 4B 7C B8 20 00 F7 26 11 7C 8B
[0084] 12: 1E 0B 7C 03 C3 48 F7 F3 01 06 49 7C 83 16 4B 7C
[0085] 13:00 BB 00 05 8B 16 52 7C A1 50 7C E8 92 00 72 1D
[0086] 14: B0 01 E8 AC 00 72 16 8B FB B9 0B 00 BE E6 7D F3
[0087] 15: A6 75 0A 8D 7F 20 B9 0B 00 F3 A6 74 18 BE 9E 7D
[0088] 16: E8 5F 00 33 C0 CD 16 5E 1F 8F 04 8F 44 02 CD 19
[0089] 17: 58 58 58 EB E8 8B 47 1A 48 48 8A 1E 0D 7C 32 FF
[0090] 18: F7 E3 03 06 49 7C 13 16 4B 7C BB 00 07 B9 03 00
[0091] 19: 50 52 51 E8 3A 00 72 D8 B0 01 E8 54 00 59 5A 58
[0092] 20: 72 BB 05 01 00 83 D2 00 03 1E 0B 7C E2 E2 8A 2E
[0093] 21:15 7C 8A 16 24 7C 8B 1E 49 7C A1 4B 7C EA 00 00
[0094] 22: 70 00 AC 0A C0 74 29 B4 0E BB 07 00 CD 10 EB F2
[0095] 23: 3B 16 18 7C 73 19 F7 36 18 7C FE C2 88 16 4F 7C
[0096] 24: 33 D2 F7 36 1A 7C 88 16 25 7C A3 4D 7C F8 C3 F9
[0097] 25: C3 B4 02 8B 16 4D 7C B1 06 D2 E6 0A 36 4F 7C 8B
[0098] 26: CA 86 E9 8A 16 24 7C 8A 36 25 7C CD 13 C3 0D 0A
[0099] 27: 4E 6F 6E 2D 53 79 73 74 65 6D 20 64 69 73 6B 20
[0100] 28: 6F 72 20 64 69 73 6B 20 65 72 72 6F 72 0D 0A 52
[0101] 29: 65 70 6C 61 63 65 20 61 6E 64 20 70 72 65 73 73
[0102] 30: 20 61 6E 79 20 6B 65 79 20 77 68 65 6E 20 72 65
[0103] 31: 61 64 79 0D 0A 00 49 4F 20 20 20 20 20 20 53 59
[0104] 32: 53 4D 53 44 4F 53 20 20 2053 59 53 00 00 55 AA
[0105] The underlined part in the above table is the BPB information of 53 bytes. From the table, you can know:
[0106] Number of bytes per sector: BytesPerSector = 0x0200;
[0107] The number of sectors per cluster: SecPerClus=0x10;
[0108] The total number of sectors: TotSec32=0xF8600;
[0109] Since SecPerBlock=256.
[0110] So the number of clusters per block can be calculated:
[0111] ClusPerBlock=SecPerBlock/SecPerClus=16.
[0112] The following table is a sector of the FAT table after bad block processing (bad block mark has been made in the table):
[0113] 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
[0114] 01: F8 FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00
[0115] 02: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0116] 03: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0117] 04: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0118] 05: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0119] 06:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0120] 07: 00 00 00 00 FE FF FE FF FE FF FE FF FE FF FE FF
[0121] 08: FE FF FE FF FE FF FE FF FE FF FE FF FE FF FE FF
[0122] 09: FE FF FE FF 00 00 00 00 00 00 00 00 00 00 00 00 00
[0123] 10:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0124] 11:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0125] 12: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0126] 13:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0127] 14:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0128] 15:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0129] 16:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0130] 17:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0131] 18:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0132] 19:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0133] 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0134] 21: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0135] 22:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0136] 23:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0137] 24: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0138] 25: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0139] 26: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0140] 27: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0141] 28: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0142] 29: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0143] 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0144] 31: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[0145] 32: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.

Similar technology patents

Chromatic dispersion shear image surface interference hyper spectrum imaging device and method

ActiveCN103063304Asimple methodhigh target resolution
Owner:NANJING UNIV OF SCI & TECH

Magazine quick-release blocking apparatus and method

ActiveUS20110010977A1inexpensive kit and apparatussimple method
Owner:QUIS TOMAS

Classification and recommendation of technical efficacy words

  • simple method
  • Reduce the amount of code

Method for producing electronic job pages

InactiveUS7443418B2simple methodimprove retrieval and utilization
Owner:MONUMENT PEAK VENTURES LLC

Aluminum-silicon alloy refining agent and preparation thereof

InactiveCN101343699Asimple methodeasy to implement
Owner:营口经济技术开发区金达合金铸造有限公司

Method and system for obtaining data from a plurality of data pool

ActiveCN101145163AReduce the amount of codeCode maintenance is small
Owner:KINGDEE SOFTWARE(CHINA) CO LTD

Method and device for calling application program component

ActiveCN103677777AReduce the amount of codeLess development tasks
Owner:TENCENT TECH (SHENZHEN) CO LTD

Device and method for intensively controlling WEB page event and state

InactiveCN102654831Aease of workReduce the amount of code
Owner:BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD

User authority authentication method and apparatus

ActiveCN106789989AReduce the amount of codeAvoid missing permission judgments
Owner:WUHAN DOUYU NETWORK TECH CO LTD

Method and device used for normalizing feedback information of hardware perception layer of Internet of Things

InactiveCN107402565AReduce the amount of codeReduce server pressure
Owner:重庆九钰智慧科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products