CN100456263C - Method for treating broken block when using flash memory in tax-controlled cashing machine - Google Patents
Method for treating broken block when using flash memory in tax-controlled cashing machine Download PDFInfo
- Publication number
- CN100456263C CN100456263C CNB2005101211602A CN200510121160A CN100456263C CN 100456263 C CN100456263 C CN 100456263C CN B2005101211602 A CNB2005101211602 A CN B2005101211602A CN 200510121160 A CN200510121160 A CN 200510121160A CN 100456263 C CN100456263 C CN 100456263C
- Authority
- CN
- China
- Prior art keywords
- block
- piece
- flash memory
- stand
- tax
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 23
- 238000013507 mapping Methods 0.000 claims abstract description 15
- 238000012795 verification Methods 0.000 claims description 4
- 230000015572 biosynthetic process Effects 0.000 claims description 2
- 238000012545 processing Methods 0.000 abstract description 2
- 238000003672 processing method Methods 0.000 abstract 1
- 238000013461 design Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000000151 deposition Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
The invention relates to a bad block processing method using flash memory which is used in tax controlling cashier's machine, it resolves problems that the NANDFLASH can not be used in 8 bit singlechip system for its bad block, it adopts technique that during the processing cause, a mapping table between logic block and physical block is built, once there is bad block, new mapping will be formed in the head sector, when the p page of the programming logic X fails or unsuccessful to erasure some logic block Y, the bad block is identified first, then the max standby block BLK and its table address ADR are found out, programs or erasures BLK+1, the new physical address is filled into the mapping table. The method possesses advantages of simple practicality, easy to understand and realize few quantities of codes, fast running speed and stable, it is reliable to be used intax controlling cashier's machine.
Description
Technical field
The present invention relates to a kind of method of operating of in Single Chip Microcomputer (SCM) system, using flash memory, relate in particular to a kind of method of handling bad piece when in tax-control cash register, using flash memory.
Background technology
NANDFLASH is because its storage volume is big, wipe, writing rate is fast, in data storage system, used in a large number, because its interface class is similar to hard disk, to replacing the hard disk direction to develop, present electric board is as USB flash disk, DOC (disk on chip), smart card etc. all are to use NANDFLASH's.
At present, based on the system of 8 single-chip microcomputers, seldom have and to use NANDFLASH and do data storing.And based on 32 ARM kernels, the system of LINUX platform, the internal memory of use has several million even tens at least, also operation therein of program, dominant frequency is more than 70,000,000, and it is all masterly to run any algorithm.
That the chances are is such for its algorithm: at the 0th table of building a 2000*2, reserve 35 pieces from first BOB(beginning of block) and make stand-by block, list index points to the actual physical piece, but when having bad piece to take place, need read back the 0th 16K byte among the RAM, after in RAM, bad pointer being rewritten, wipe the 0th, the 16K byte is write back the 0th again.
And 8 bit single-chip systems, because the program quantitative limitation, the restriction of memory size, the restriction of frequency and can not being widely used.And NANDFLASH since the handling problem of bad piece can not well be applied on 8 bit single-chip systems.
Summary of the invention
The invention provides a kind of method of handling bad piece when in tax-control cash register, using flash memory for addressing the above problem, to realize that NANDFLASH is carried out bad block management.
Technical scheme provided by the invention is:, a kind of method of handling bad piece when in tax-control cash register, using flash memory, in the flash memory process process, set up the mapping table of a logical block and physical block in first sector, in case when having bad piece to take place, new mapping relations can directly be appended formation in first sector, when the failure of the P page or leaf of programmed logic piece X or wipe certain logical block Y when unsuccessful, make bad block identification earlier, find out current stand-by block BLK and table address ADR thereof again, to current standby the programming soon or erase operation, then current stand-by block BLK is added 1 if get nowhere, up to programming or wiping successfully, will replace the physical address of the stand-by block of described bad piece again and insert in the mapping table.
Further improvement in the technical proposal is: when the P page or leaf failure of programmed logic piece X, also comprise copy preceding P-1 page data to replace described bad piece stand-by block after, this piece number is write the step at ADR+2 place, also comprise and find out X*8 place page or leaf, from left to right begin to calculate, note the step of the piece number of the stand-by block of replacing described bad piece in the position that occurs FF at first.
Further improvement in the technical proposal is: also comprise that the piece that will replace the stand-by block of described bad piece number writes the step at ADR+2 place when unsuccessful wiping certain logical block Y, also comprise and find out Y*8 place page or leaf, from left to right begin to calculate, note the step of the piece number of the stand-by block of replacing described bad piece in the position that occurs FF at first.
Further improvement in the technical proposal is: also be included in a data field step that the flexible ECC of mistake carries out verification and corrects.
The invention has the beneficial effects as follows: based on the bad block management program of this method processing, procedure quantity is no more than 2K, the RAM use is no more than 30 bytes and is overlayable (not comprising the buffer zone that read data is used), do not need to do the relocating work of big data quantity, simple and practical, easy to understand and realization, it is few to take size of code, travelling speed is fast and stable, and this method is used on tax-control cash register, and system is solid.
Description of drawings
Fig. 1 is the process flow diagram of a programming embodiment of the present invention;
Fig. 2 is a process flow diagram of wiping embodiment of the present invention.
Embodiment
The invention will be further described below in conjunction with the drawings and specific embodiments
Be example with a capacity 32M flash memory now, this flash memory is divided into 2048 pieces, and every is divided into 32 pages again, the 512+16B byte is arranged on every page, and wherein preceding 512 bytes generally are used for store data, and back 16B is used for depositing check code and bad block mark.So Capacity design is become to have 2000 logical blocks, every 32 pages, every page 512 byte, special reason piece 0 is deposited mapping table, and last 47 are the mapping stand-by block.
The mapping table design of above-mentioned flash memory is as follows
A. rule: the physical block address of chip obtains by the mapping table in the 0th, if a slice chip has 47 bad pieces of surpassing, or certain corresponding blocks has been gone bad 4 times continuously and be not simultaneously bad, thinks that chip is bad;
B. the 0th has: 16384B, and each logical block takies 8 bytes, represents its first, the second, the three, the four stand-by block respectively, can only go bad at most four times for every thus;
C. in the following table, blueness is mapping block address (piece 0), and red is the physical block that this logical block shone upon;
D. the physical block of logical block 3 is 2001 (0x7d1), because of physical block 3 bad.
E. the physical block of logical block 2000 is 2005 (0x7d5), because of physical block 2000 and physics bad 2002 successively all bad.
F. used the largest block number of stand-by block with the 0th the 31st page back 256B record, as when formaing three bad pieces being arranged, then at 3F00, the value of 3F01 is 07H, D1H (2001); 3F02, the value of 3F03 is 07H, D2H (2002); 3F04, the value of 3F05 is 07H, D3H (2003) does not format the physical block after 2000, handles in the application (can not operate then after the mapping and abandon).
As shown in Figure 1, when the failure of the P page or leaf of programmed logic piece X, carry out bad block identification earlier, and finds out current stand-by block BLK and table address ADR thereof, the P page or leaf of this piece of programming, failure again with BLK+1 up to programming successfully.After copying preceding P-1 page data to replace bad piece stand-by block, this piece number is write the ADR+2 place.Find out X*8 place page or leaf simultaneously, from left to right begin to calculate, note the piece BLK value of the stand-by block of replacing bad piece in the position that occurs FF at first,, point out FLASH bad if 8 bytes are non-FF entirely.(because be to roll to have stored in using, the possibility that occurs in this situation practical application is extremely low), a flexible ECC of mistake carries out verification and corrects in the data field then.
In the another embodiment of the present invention, as shown in Figure 2, wiping certain logical block Y when unsuccessful, equally, make bad block identification earlier, find out current stand-by block BLK and table address ADR thereof again, wipe BLK+1 again up to success, the piece BLK+N that replaces the stand-by block of bad piece is write the ADR+2 place, find out Y*8 place page or leaf simultaneously, from left to right begin to calculate, note the value of BLK+N in the position that occurs FF at first, if 8 bytes are non-FF entirely, FLASH is bad in prompting, and a flexible ECC of mistake carries out verification and corrects in the data field then.
Claims (6)
1, a kind of method of handling bad piece when in tax-control cash register, using flash memory, in the flash memory process process, set up the mapping table of a logical block and physical block in first sector, in case when having bad piece to take place, new mapping relations can directly be appended formation in first sector, when the failure of the P page or leaf of programmed logic piece X or wipe certain logical block Y when unsuccessful, make bad block identification earlier, find out current stand-by block BLK and table address ADR thereof again, current stand-by block is programmed or erase operation, then current stand-by block BLK is added 1 if get nowhere,, will replace the physical address of the stand-by block of described bad piece again and insert in the mapping table up to programming or wiping successfully.
2. the method for handling bad piece when in tax-control cash register, using flash memory as claimed in claim 1, it is characterized in that: when the P page or leaf failure of programmed logic piece X, also comprise copy preceding P-1 page data to replace described bad piece stand-by block after, this piece number is write the step at ADR+2 place.
3, the method for handling bad piece when in tax-control cash register, using flash memory as claimed in claim 2, it is characterized in that: also comprise and find out X*8 place page or leaf, from left to right begin to calculate, note the step of the piece number of the stand-by block of replacing described bad piece in the position that occurs FF at first.
4, the method for handling bad piece when using flash memory in tax-control cash register as claimed in claim 1 is characterized in that: also comprise that the piece that will replace the stand-by block of described bad piece number writes the step at ADR+2 place when unsuccessful wiping certain logical block Y.
5, the method for handling bad piece when in tax-control cash register, using flash memory as claimed in claim 4, it is characterized in that: also comprise and find out Y*8 place page or leaf, from left to right begin to calculate, note the step of the piece number of the stand-by block of replacing described bad piece in the position that occurs FF at first.
6, as any one described method of handling bad piece when in tax-control cash register, using flash memory of claim 1-5, it is characterized in that: also be included in a data field step that the flexible ECC of mistake carries out verification and corrects.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2005101211602A CN100456263C (en) | 2005-12-30 | 2005-12-30 | Method for treating broken block when using flash memory in tax-controlled cashing machine |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2005101211602A CN100456263C (en) | 2005-12-30 | 2005-12-30 | Method for treating broken block when using flash memory in tax-controlled cashing machine |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1991788A CN1991788A (en) | 2007-07-04 |
CN100456263C true CN100456263C (en) | 2009-01-28 |
Family
ID=38214057
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2005101211602A Expired - Fee Related CN100456263C (en) | 2005-12-30 | 2005-12-30 | Method for treating broken block when using flash memory in tax-controlled cashing machine |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100456263C (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101441552B (en) * | 2007-11-19 | 2012-05-23 | 深圳市朗科科技股份有限公司 | Flash memory medium bad block processing method |
CN101593157B (en) * | 2008-05-27 | 2011-03-16 | 中兴通讯股份有限公司 | Bad block management (BBM) method and device for Nand Flash |
CN101944065B (en) * | 2010-08-24 | 2012-07-04 | 苏州国芯科技有限公司 | Flash memory bad block shielding method based on section |
CN102541676B (en) * | 2011-12-22 | 2014-03-05 | 福建新大陆通信科技股份有限公司 | Method for detecting and mapping states of NAND FLASH |
CN104166627B (en) * | 2014-09-02 | 2017-12-08 | 科大智能电气技术有限公司 | A kind of SCM Based NAND FLASH write operation methods |
CN108573735B (en) * | 2017-03-08 | 2020-12-11 | 北京兆易创新科技股份有限公司 | NAND-FLASH block repair method and device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6260156B1 (en) * | 1998-12-04 | 2001-07-10 | Datalight, Inc. | Method and system for managing bad areas in flash memory |
US20030225961A1 (en) * | 2002-06-03 | 2003-12-04 | James Chow | Flash memory management system and method |
KR20040072875A (en) * | 2003-02-11 | 2004-08-19 | 유비시스테크놀러지 주식회사 | Storage using nand flash memory |
KR20040087245A (en) * | 2003-04-04 | 2004-10-13 | 삼성전자주식회사 | Method and apparatus for managing bad block in flash memory |
CN1637721A (en) * | 2003-12-30 | 2005-07-13 | 三星电子株式会社 | Address mapping method and mapping information managing method for flash memory, and flash memory using the same |
CN1694068A (en) * | 2004-05-06 | 2005-11-09 | 三星电子株式会社 | Mobile communication terminal including NAND flash memory and method for booting the same |
-
2005
- 2005-12-30 CN CNB2005101211602A patent/CN100456263C/en not_active Expired - Fee Related
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6260156B1 (en) * | 1998-12-04 | 2001-07-10 | Datalight, Inc. | Method and system for managing bad areas in flash memory |
US20030225961A1 (en) * | 2002-06-03 | 2003-12-04 | James Chow | Flash memory management system and method |
KR20040072875A (en) * | 2003-02-11 | 2004-08-19 | 유비시스테크놀러지 주식회사 | Storage using nand flash memory |
KR20040087245A (en) * | 2003-04-04 | 2004-10-13 | 삼성전자주식회사 | Method and apparatus for managing bad block in flash memory |
CN1551243A (en) * | 2003-04-04 | 2004-12-01 | ���ǵ�����ʽ���� | Apparatus and method for managing bad blocks in a flash memory |
CN1637721A (en) * | 2003-12-30 | 2005-07-13 | 三星电子株式会社 | Address mapping method and mapping information managing method for flash memory, and flash memory using the same |
CN1694068A (en) * | 2004-05-06 | 2005-11-09 | 三星电子株式会社 | Mobile communication terminal including NAND flash memory and method for booting the same |
Non-Patent Citations (4)
Title |
---|
AN1819应用说明-单层控制单元NAND闪存的坏块管理. 意法半导体公司,1-7. 2005 |
AN1819应用说明-单层控制单元NAND闪存的坏块管理. 意法半导体公司,1-7. 2005 * |
Flash文件系统的研究与设计. 沈建华,罗悦怿.计算机应用研究,第2004年第12期. 2004 |
Flash文件系统的研究与设计. 沈建华,罗悦怿. 计算机应用研究,第2004年第12期. 2004 * |
Also Published As
Publication number | Publication date |
---|---|
CN1991788A (en) | 2007-07-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI643066B (en) | Method for reusing destination block related to garbage collection in memory device, associated memory device and controller thereof, and associated electronic device | |
US10915475B2 (en) | Methods and apparatus for variable size logical page management based on hot and cold data | |
KR101619569B1 (en) | Data transfer flows for on-chip folding | |
US8732388B2 (en) | Embedded mapping information for memory devices | |
US7783845B2 (en) | Structures for the management of erase operations in non-volatile memories | |
EP2605142B1 (en) | Lba bitmap usage | |
US10776264B2 (en) | Data storage device with power recovery procedure and method for operating non-volatile memory | |
CN108319433B (en) | Storage management method for NOR Flash of small-memory single chip microcomputer | |
CN104699413B (en) | Data management method, memory storage device and memory control circuit unit | |
CN107273058A (en) | Logical Address Offset | |
US20120198123A1 (en) | Systems and methods for redundantly storing metadata for non-volatile memory | |
CN109542675A (en) | Storage system and its operating method | |
CN101095121A (en) | High speed temporary storage block | |
CN104346290A (en) | Storage device, computer system and methods of operating same | |
CN101634967B (en) | Block management method, storage system and controller for flash memory | |
CN101625897B (en) | Data writing method, storage system and controller for flash memory | |
US20220318133A1 (en) | Control method of flash memory controller and associated flash memory controller and storage device | |
CN101630233B (en) | Data access method, storage system and controller for flash memory | |
CN107807886B (en) | Index management in flash memory | |
CN105224238B (en) | Memory management method, memory storage device, and memory control circuit unit | |
CN101625661B (en) | Data management method, storage system and controller for flash memory | |
US9727453B2 (en) | Multi-level table deltas | |
CN100456263C (en) | Method for treating broken block when using flash memory in tax-controlled cashing machine | |
US8972650B2 (en) | Methods and systems for performing efficient page reads in a non-volatile memory | |
CN101727397A (en) | Block management and replacement method, flash memory storage system and controller thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20090128 Termination date: 20181230 |
|
CF01 | Termination of patent right due to non-payment of annual fee |