TWI425514B - A nand flash memory and method for updating data in the nand flash memory - Google Patents
A nand flash memory and method for updating data in the nand flash memory Download PDFInfo
- Publication number
- TWI425514B TWI425514B TW98136774A TW98136774A TWI425514B TW I425514 B TWI425514 B TW I425514B TW 98136774 A TW98136774 A TW 98136774A TW 98136774 A TW98136774 A TW 98136774A TW I425514 B TWI425514 B TW I425514B
- Authority
- TW
- Taiwan
- Prior art keywords
- storage area
- flash memory
- nand flash
- header
- read
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims description 7
- 238000013507 mapping Methods 0.000 claims description 45
- 238000007726 management method Methods 0.000 claims description 11
- 238000010586 diagram Methods 0.000 description 5
- 238000004590 computer program Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
Description
本發明涉及一種NAND快閃記憶體及其資料更新管理方法。 The invention relates to a NAND flash memory and a data update management method thereof.
目前,以快閃記憶體作為儲存介質的嵌入式系統被廣泛應用。快閃記憶體是一種非易失性記憶體,市場上主流的快閃記憶體,按工藝可分為或非快閃記憶體(NOR flash memory)和與非快閃記憶體(NAND flash memory)。兩種類型各有優勢,NAND快閃記憶體的擦寫速度快,容量較大,價格較低,所以越來越多地用於移動終端中。 At present, embedded systems using flash memory as a storage medium are widely used. Flash memory is a kind of non-volatile memory. The mainstream flash memory on the market can be divided into NOR flash memory and NAND flash memory according to the process. . Both types have their own advantages. NAND flash memory has faster erasing speed, larger capacity and lower price, so it is increasingly used in mobile terminals.
NAND快閃記憶體中每個區塊只能允許一次性寫入資料,當需要對NAND快閃記憶體中區塊的資料進行更新時,需要清空原有的資料,然後再寫入新的資料。當將NAND快閃記憶體中區塊的資料清空而新的資料未完全寫入時,若NAND快閃記憶體發生意外終端,則NAND快閃記憶體中的嵌入式系統無法正常啟動。 Each block in the NAND flash memory can only be allowed to write data once. When the data of the block in the NAND flash memory needs to be updated, the original data needs to be cleared, and then the new data is written. . When the data in the block in the NAND flash memory is emptied and the new data is not completely written, if the NAND flash memory has an unexpected terminal, the embedded system in the NAND flash memory cannot be started normally.
鑒於以上內容,有必要提供一種NAND快閃記憶體及其資料更新管理方法,該NAND快閃記憶體的每個儲存區包括兩個格式相同的標頭,所述兩個標頭分別儲存在兩個不同的區塊中,當需要更新一區塊中的資料時,將更新後的資料儲存至另一區塊中,則若在更 新操作過程中意外中斷時,NAND快閃記憶體可利用未更新區塊中的資料啟動嵌入系統,提高了NAND快閃記憶體的性能。 In view of the above, it is necessary to provide a NAND flash memory and a data update management method thereof. Each storage area of the NAND flash memory includes two headers of the same format, and the two headers are respectively stored in two In different blocks, when it is necessary to update the data in one block, the updated data is stored in another block, and if more When the new operation is unexpectedly interrupted, the NAND flash memory can use the data in the unupdated block to start the embedded system, improving the performance of the NAND flash memory.
一種NAND快閃記憶體,該NAND快閃記憶體包括兩個儲存區,每個儲存區包括兩個格式相同的標頭,所述兩個標頭分別儲存在同一儲存區兩個不同的區塊中,每個區塊還儲存有映射檔,所述NAND快閃記憶體包括:讀取模組,用於從NAND快閃記憶體的每一個儲存區中讀取包含較小的標頭序號的標頭;識別模組,用於根據所讀取的標頭中的映射檔狀態旗標,識別各標頭所在的儲存區為主要儲存區還是次要儲存區;判斷模組,用於判斷NAND快閃記憶體中是否存在主要儲存區,當NAND快閃記憶體中存在主要儲存區時,判斷是否對NAND快閃記憶體中主要儲存區的資料進行更新;更新模組,用於當需要對NAND快閃記憶體中主要儲存區的資料進行更新時,對NAND快閃記憶體中主要儲存區的資料進行更新;啟動模組,用於當NAND快閃記憶體中存在主要儲存區時,根據主要儲存區中的映射檔啟動NAND快閃記憶體中嵌入式系統;所述判斷模組還用於當NAND快閃記憶體中不存在主要儲存區時,判斷NAND快閃記憶體中是否存在次要儲存區;所述啟動模組還用於當NAND快閃記憶體中存在次要儲存區時,根據次要儲存區中的映射檔啟動NAND快閃記憶體中嵌入式系統;提示模組,用於當NAND快閃記憶體中既不存在主要儲存區也不存在次要儲存區時,提示用戶NAND快閃記憶體中嵌入式系統啟動失敗。 A NAND flash memory, the NAND flash memory comprising two storage areas, each storage area comprising two headers of the same format, the two headers being respectively stored in two different blocks in the same storage area Each block also stores a mapping file, and the NAND flash memory includes: a reading module for reading a smaller header number from each storage area of the NAND flash memory. a header module, configured to identify, according to the mapped status flag in the read header, a storage area in which each header is located as a primary storage area or a secondary storage area; and a determination module for determining NAND Whether there is a main storage area in the flash memory, when there is a main storage area in the NAND flash memory, it is judged whether to update the data of the main storage area in the NAND flash memory; the update module is used when needed When the data of the main storage area in the NAND flash memory is updated, the data of the main storage area in the NAND flash memory is updated; the startup module is used when the main storage area exists in the NAND flash memory, according to In the main storage area The mapping file starts the embedded system in the NAND flash memory; the determining module is further configured to determine whether there is a secondary storage area in the NAND flash memory when the main storage area does not exist in the NAND flash memory; The startup module is further configured to start an embedded system in the NAND flash memory according to a mapping file in the secondary storage area when a secondary storage area exists in the NAND flash memory; the prompt module is used when the NAND is fast When there is neither a main storage area nor a secondary storage area in the flash memory, the user is prompted to fail to start the embedded system in the NAND flash memory.
一種NAND快閃記憶體資料更新管理方法,該NAND快閃記憶體包括兩個儲存區,每個儲存區包括兩個格式相同的標頭,所述兩個標頭分別儲存在同一儲存區兩個不同的區塊中,每個區塊還儲存有 映射檔,該方法包括如下步驟:(a)從NAND快閃記憶體的每一個儲存區中讀取包含較小的標頭序號的標頭;(b)根據所讀取的標頭中的映射檔狀態旗標,識別各標頭所在的儲存區為主要儲存區還是次要儲存區;(c)判斷NAND快閃記憶體中是否存在主要儲存區;(d)當NAND快閃記憶體中存在主要儲存區時,判斷是否對NAND快閃記憶體中主要儲存區的資料進行更新,當需要對NAND快閃記憶體中主要儲存區的資料進行更新時,對NAND快閃記憶體中主要儲存區的資料進行更新,並根據主要儲存區中的映射檔啟動NAND快閃記憶體中嵌入式系統;(e)當NAND快閃記憶體中不存在主要儲存區時,判斷NAND快閃記憶體中是否存在次要儲存區,當NAND快閃記憶體中存在次要儲存區時,根據次要儲存區中的映射檔啟動NAND快閃記憶體中嵌入式系統;(f)當NAND快閃記憶體中既不存在主要儲存區也不存在次要儲存區時,提示用戶NAND快閃記憶體中嵌入式系統啟動失敗。 A NAND flash memory data update management method, the NAND flash memory includes two storage areas, each storage area includes two headers of the same format, and the two headers are respectively stored in the same storage area. In different blocks, each block is also stored a mapping file, the method comprising the steps of: (a) reading a header containing a smaller header number from each storage area of the NAND flash memory; (b) mapping according to the read header a status flag that identifies whether the storage area in which each header is located is a primary storage area or a secondary storage area; (c) determines whether a primary storage area exists in the NAND flash memory; (d) exists in the NAND flash memory In the main storage area, it is judged whether the data of the main storage area in the NAND flash memory is updated, and when the data of the main storage area in the NAND flash memory needs to be updated, the main storage area in the NAND flash memory is used. The data is updated, and the embedded system in the NAND flash memory is started according to the mapping file in the main storage area; (e) when there is no main storage area in the NAND flash memory, it is judged whether the NAND flash memory is in the memory There is a secondary storage area. When there is a secondary storage area in the NAND flash memory, the embedded system in the NAND flash memory is activated according to the mapping file in the secondary storage area; (f) when in the NAND flash memory There is neither a main storage area nor a deposit When the secondary storage area, the user is prompted NAND flash memory in an embedded system fails to start.
相較於習知技術,本發明提供一種NAND快閃記憶體及其資料更新管理方法,該NAND快閃記憶體的每個儲存區包括兩個格式相同的標頭,所述兩個標頭分別儲存在兩個不同的區塊中,當需要更新一區塊中的資料時,將更新後的資料儲存至另一區塊中,則若在更新操作過程中意外中斷時,NAND快閃記憶體可利用未更新區塊中的資料啟動嵌入系統,提高了NAND快閃記憶體的性能。 Compared with the prior art, the present invention provides a NAND flash memory and a data update management method thereof. Each storage area of the NAND flash memory includes two headers of the same format, and the two headers are respectively Stored in two different blocks. When the data in one block needs to be updated, the updated data is stored in another block. If the data is accidentally interrupted during the update operation, the NAND flash memory is stored. The embedded system can be activated by using the data in the unupdated block to improve the performance of the NAND flash memory.
1‧‧‧NAND快閃記憶體 1‧‧‧NAND flash memory
100‧‧‧讀取模組 100‧‧‧Read module
101‧‧‧識別模組 101‧‧‧ Identification module
102‧‧‧判斷模組 102‧‧‧Judgement module
103‧‧‧更新模組 103‧‧‧Update Module
104‧‧‧啟動模組 104‧‧‧Starting module
105‧‧‧提示模組 105‧‧‧ prompt module
圖1係本發明NAND快閃記憶體中資料更新管理方法較佳實施例的應用環境圖。 1 is an application environment diagram of a preferred embodiment of a data update management method in a NAND flash memory of the present invention.
圖2係圖1中標頭的示意圖。 Figure 2 is a schematic illustration of the header of Figure 1.
圖3係圖1中NAND快閃記憶體的功能模組圖。 FIG. 3 is a functional block diagram of the NAND flash memory in FIG. 1.
圖4係本發明NAND快閃記憶體中資料更新管理方法較佳實施例的流程圖。 4 is a flow chart of a preferred embodiment of a method for updating data in a NAND flash memory of the present invention.
圖5係圖4中步驟S10的具體流程圖。 FIG. 5 is a specific flowchart of step S10 in FIG.
圖6係圖4中步驟S14的具體流程圖。 FIG. 6 is a specific flowchart of step S14 in FIG.
如圖1所示,係本發明NAND快閃記憶體中資料更新管理方法較佳實施例的應用環境圖。該方法應用於NAND快閃記憶體1中。在本實施例中,所述NAND快閃記憶體1包括儲存區A和儲存區B,儲存區A和儲存區B可分別儲存資料。 FIG. 1 is an application environment diagram of a preferred embodiment of a data update management method in a NAND flash memory of the present invention. This method is applied to the NAND flash memory 1. In this embodiment, the NAND flash memory 1 includes a storage area A and a storage area B, and the storage area A and the storage area B can respectively store data.
所述儲存區A包括兩個格式相同的標頭A1和標頭A2,所述標頭A1放置在儲存區A的區塊A1中,所述標頭A2放置在儲存區A的區塊A2中。其中,所述區塊A1還儲存有映射檔A1,區塊A2還儲存有映射檔A2。 The storage area A comprises two headers A1 and a header A2 of the same format, the header A1 is placed in the block A1 of the storage area A, and the header A2 is placed in the block A2 of the storage area A . The block A1 also stores a mapping file A1, and the block A2 also stores a mapping file A2.
所述儲存區B包括兩個格式相同的標頭B1和標頭B2,所述標頭B1放置在儲存區B的區塊B1中,所述標頭B2放置在儲存區B的區塊B2中。其中,所述區塊B1還儲存有映射檔B1,區塊B2還儲存有映射檔B2。 The storage area B includes two headers B1 and a header B2 of the same format, the header B1 is placed in the block B1 of the storage area B, and the header B2 is placed in the block B2 of the storage area B. . The block B1 also stores a mapping file B1, and the block B2 also stores a mapping file B2.
如圖2所示,係圖1中標頭的示意圖。所述標頭包括檢查和、映射檔狀態旗標和標頭序號。所述檢查和用於識別該檢查和所在標頭及該標頭所在區塊中的映射檔的正確性,例如:若標頭A1包括檢查和A1,則該檢查和A1用於識別標頭A1及映射文件A1的正確性。所述映射檔狀態旗標用於指示該映射檔狀態旗標所在區塊中儲存 的映射檔為主要映射檔,或者為次要映射檔。所述標頭序號可用阿拉伯數字來表示,例如:1、2、3。同一儲存區中包含較小的標頭序號的區塊所儲存的資料為最新的資料,例如,若標頭A1包含的標頭序號為1,標頭A2包含的標頭序號為2,則在儲存區A中,標頭A1為包含較小的標頭序號的標頭,標頭A1所儲存的資料為最新的資料。 As shown in FIG. 2, it is a schematic diagram of the header in FIG. The header includes a checksum, a map status flag, and a header number. The check and the correctness of the mapping file used to identify the check and the header and the block in which the header is located, for example, if the header A1 includes the checksum A1, the check and A1 are used to identify the header A1. And the correctness of the mapping file A1. The map file status flag is used to indicate that the map file status flag is stored in the block The mapping file is the primary mapping file or the secondary mapping file. The header number can be represented by an Arabic numeral, for example: 1, 2, 3. The data stored in the block containing the smaller header number in the same storage area is the latest data. For example, if the header A1 contains a header number of 1, and the header A2 contains a header number of 2, then In the storage area A, the header A1 is a header containing a smaller header number, and the data stored in the header A1 is the latest data.
如圖3所示,係圖1中所示NAND快閃記憶體1的功能模組圖。所述NAND快閃記憶體包括讀取模組100、識別模組101、判斷模組102、更新模組103、啟動模組104及提示模組105。本發明所稱的模組是完成一特定功能的電腦程式段,比程式更適合於描述軟體在電腦中的執行過程,因此在本發明以下對軟體描述中都以模組描述。 As shown in FIG. 3, it is a functional module diagram of the NAND flash memory 1 shown in FIG. 1. The NAND flash memory includes a reading module 100, an identification module 101, a determination module 102, an update module 103, a startup module 104, and a prompt module 105. The module referred to in the present invention is a computer program segment for performing a specific function, and is more suitable for describing the execution process of the software in the computer than the program. Therefore, the following description of the software is described in the module.
所述讀取模組100用於從NAND快閃記憶體1的每一個儲存區中讀取包含較小的標頭序號的標頭。例如:在儲存區A中,若標頭A1包含的標頭序號為1,標頭A2包含的標頭序號為2,則讀取模組100從儲存區A中讀取的標頭為標頭A1。 The reading module 100 is configured to read a header containing a smaller header number from each storage area of the NAND flash memory 1. For example, in the storage area A, if the header A1 includes a header number of 1, and the header A2 includes a header number of 2, the read module 100 reads the header from the storage area A as a header. A1.
所述識別模組101用於根據所讀取的標頭中的映射檔狀態旗標,識別各標頭所在的儲存區為主要儲存區還是次要儲存區。當所讀取的標頭中的映射檔狀態旗標指示的映射檔為主要映射檔,識別模組101識別所讀取的標頭所在的儲存區為主要儲存區;當所讀取的標頭中的映射檔狀態旗標指示的映射檔為次要映射檔,識別模組101識別所讀取的標頭所在的儲存區為次要儲存區。 The identification module 101 is configured to identify, according to the mapped status flag in the read header, whether the storage area where each header is located is a primary storage area or a secondary storage area. When the mapping file indicated by the mapping status flag in the read header is the primary mapping file, the identification module 101 identifies that the storage area where the read header is located is the primary storage area; when the read header is The mapping file indicated by the mapping status flag in the middle is a secondary mapping file, and the identification module 101 identifies that the storage area in which the read header is located is a secondary storage area.
所述判斷模組102用於判斷NAND快閃記憶體1中是否存在主要儲存區。 The determining module 102 is configured to determine whether a main storage area exists in the NAND flash memory 1.
所述判斷模組102用於當NAND快閃記憶體1中存在主要儲存區時,判斷是否對NAND快閃記憶體1中主要儲存區的資料進行更新。在本實施例中,當NAND快閃記憶體1開機或對NAND快閃記憶體1中的資料進行升級時,判斷模組102判斷對NAND快閃記憶體1中的資料進行更新。 The determining module 102 is configured to determine whether to update the data of the main storage area in the NAND flash memory 1 when the main storage area exists in the NAND flash memory 1. In the embodiment, when the NAND flash memory 1 is powered on or the data in the NAND flash memory 1 is upgraded, the determining module 102 determines to update the data in the NAND flash memory 1.
所述更新模組103用於對NAND快閃記憶體1中主要儲存區的資料進行更新。例如:在NAND快閃記憶體1中,若儲存區A為主要儲存區,則更新模組103對儲存區A中的資料進行更新。 The update module 103 is configured to update data of a main storage area in the NAND flash memory 1. For example, in the NAND flash memory 1, if the storage area A is the main storage area, the update module 103 updates the data in the storage area A.
所述啟動模組104用於當NAND快閃記憶體1中存在主要儲存區時,根據主要儲存區中的映射檔啟動系統。 The startup module 104 is configured to start the system according to the mapping file in the main storage area when the main storage area exists in the NAND flash memory 1.
所述判斷模組102還用於當NAND快閃記憶體1中不存在主要儲存區時,判斷NAND快閃記憶體1中是否存在次要儲存區。 The determining module 102 is further configured to determine whether there is a secondary storage area in the NAND flash memory 1 when there is no main storage area in the NAND flash memory 1.
所述啟動模組104還用於當NAND快閃記憶體1中存在次要儲存區時,根據次要儲存區中的映射檔啟動系統。 The startup module 104 is further configured to start the system according to the mapping file in the secondary storage area when the secondary storage area exists in the NAND flash memory 1.
所述提示模組105用於當NAND快閃記憶體1中既不存在主要儲存區也不存在次要儲存區時,提示用戶系統啟動失敗。 The prompting module 105 is configured to prompt the user system to fail to start when there is neither a primary storage area nor a secondary storage area in the NAND flash memory 1.
如圖4所示,係本發明NAND快閃記憶體中資料更新管理方法較佳實施例的流程圖。 As shown in FIG. 4, it is a flowchart of a preferred embodiment of a data update management method in the NAND flash memory of the present invention.
步驟S10,讀取模組100從NAND快閃記憶體1的每一個儲存區中讀取包含較小的標頭序號的標頭。 In step S10, the reading module 100 reads a header containing a smaller header number from each storage area of the NAND flash memory 1.
步驟S11,識別模組101根據所讀取的標頭中的映射檔狀態旗標,識別各標頭所在的儲存區為主要儲存區還是次要儲存區。當所讀 取的標頭中的映射檔狀態旗標指示的映射檔為主要映射檔,識別模組101識別所讀取的標頭所在的儲存區為主要儲存區;當所讀取的標頭中的映射檔狀態旗標指示的映射檔為次要映射檔,識別模組101識別所讀取的標頭所在的儲存區為次要儲存區。 In step S11, the identification module 101 identifies, according to the mapped status flag in the read header, whether the storage area where each header is located is a primary storage area or a secondary storage area. When read The mapping file indicated by the mapping status flag in the taken header is the primary mapping file, and the identification module 101 identifies that the storage area in which the read header is located is the primary storage area; when the mapping in the read header is The mapping file indicated by the file status flag is a secondary mapping file, and the identification module 101 identifies that the storage area in which the read header is located is a secondary storage area.
步驟S12,判斷模組102判斷NAND快閃記憶體1中是否存在主要儲存區。 In step S12, the determining module 102 determines whether the main storage area exists in the NAND flash memory 1.
步驟S13,當NAND快閃記憶體1中存在主要儲存區時,判斷模組102判斷是否對NAND快閃記憶體1中主要儲存區的資料進行更新。 In step S13, when the main storage area exists in the NAND flash memory 1, the determination module 102 determines whether to update the data of the main storage area in the NAND flash memory 1.
步驟S14,更新模組103對NAND快閃記憶體1中主要儲存區的資料進行更新。例如:在NAND快閃記憶體1中,若儲存區A為主要儲存區,則更新模組103對儲存區A中的資料進行更新。 In step S14, the update module 103 updates the data of the main storage area in the NAND flash memory 1. For example, in the NAND flash memory 1, if the storage area A is the main storage area, the update module 103 updates the data in the storage area A.
步驟S15,啟動模組104根據主要儲存區中的映射檔啟動系統。 In step S15, the startup module 104 starts the system according to the mapping file in the main storage area.
步驟S16,當NAND快閃記憶體1中不存在主要儲存區時,判斷模組102判斷NAND快閃記憶體1中是否存在次要儲存區。 In step S16, when there is no main storage area in the NAND flash memory 1, the determination module 102 determines whether there is a secondary storage area in the NAND flash memory 1.
步驟S17,當NAND快閃記憶體1中存在次要儲存區時,啟動模組104根據次要儲存區中的映射檔啟動系統。 In step S17, when there is a secondary storage area in the NAND flash memory 1, the startup module 104 starts the system according to the mapping file in the secondary storage area.
步驟S18,當NAND快閃記憶體1中既不存在主要儲存區也不存在次要儲存區時,提示模組105提示用戶系統啟動失敗。 In step S18, when neither the main storage area nor the secondary storage area exists in the NAND flash memory 1, the prompting module 105 prompts the user that the system startup fails.
如圖5所示,係圖4中步驟S10的具體流程圖。 As shown in FIG. 5, it is a specific flowchart of step S10 in FIG.
步驟S100,所述讀取模組100分別讀取同一儲存區的兩個標頭中的檢查和,例如:儲存區A的標頭A1中的檢查和A1,與標頭A2中的檢查和A2。 In step S100, the reading module 100 respectively reads the checksums in the two headers of the same storage area, for example, the check and A1 in the header A1 of the storage area A, and the check and A2 in the header A2. .
步驟S101,所述讀取模組100判斷所讀取的兩個檢查和是否都正確。 In step S101, the reading module 100 determines whether the two checksums read are correct.
步驟S102,當所讀取的兩個檢查和都正確時,所述讀取模組100讀取包含較小標頭序號的標頭。 In step S102, when the two checksums read are correct, the reading module 100 reads the header containing the smaller header number.
步驟S103,當所讀取的兩個檢查和不全都正確時,所述讀取模組100判斷所讀取的兩個檢查和是否有一個正確。 In step S103, when the two checks and the incomplete readings are correct, the reading module 100 determines whether one of the two checksums read is correct.
步驟S104,當所讀取的兩個檢查和有一個正確時,所述讀取模組100讀取包含正確檢查和的標頭。 In step S104, when the two checksums read are correct, the reading module 100 reads the header containing the correct checksum.
步驟S105,當所讀取的兩個檢查和全都不正確時,讀取模組100回報該儲存區為無效的儲存區。 In step S105, when the two checksums read are not correct, the reading module 100 reports that the storage area is an invalid storage area.
如圖6所示,係圖4中步驟S13的具體流程圖。 As shown in FIG. 6, it is a specific flowchart of step S13 in FIG.
在本實施例中,以更新映射檔狀態旗標為例進行說明。 In this embodiment, the update map status flag is taken as an example for description.
步驟S130,所述更新模組103分別讀取同一儲存區的兩個標頭中的檢查和,例如:儲存區A的標頭A1中的檢查和A1,與標頭A2中的檢查和A2。 In step S130, the update module 103 respectively reads the checksums in the two headers of the same storage area, for example, the checksum A1 in the header A1 of the storage area A, and the checksum A2 in the header A2.
步驟S131,所述更新模組103判斷所讀取的兩個檢查和是否都正確。步驟S132,當所讀取得兩個檢查和都正確時,更新模組103清空含有較大標頭序號的區塊的資料。步驟S133,更新模組103從含有較小標頭序號的區塊中讀取標頭序號和映射檔。步驟S134,更新模組103將所讀取的標頭序號更新為新的標頭序號。所述新的標頭序號是將所讀取得標頭序號根據預先設置遞減規則進行遞減得到的標頭序號,例如:若預先設置的遞減規則為每次遞減 1,所讀取得標頭序號為5,則新的標頭序號為4。步驟S135,更新模組103根據需更新的映射檔狀態旗標、新的標頭序號和所讀取的映射檔得到新的檢查和。步驟S136,更新模組103將所述新的標頭和所讀取的映射檔寫入所清空的區塊。所述新的標頭包括:需更新的映射檔狀態旗標、新的標頭序號及新的檢查和。步驟S137,更新模組103清空含有較小標頭序號的區塊中的資料。 In step S131, the update module 103 determines whether the two checksums read are correct. In step S132, when the two checksums read are correct, the update module 103 clears the data of the block containing the larger header number. In step S133, the update module 103 reads the header number and the map file from the block containing the smaller header number. In step S134, the update module 103 updates the read header number to a new header number. The new header number is a header number obtained by decrementing the read header number according to a preset decrement rule, for example, if the preset decrement rule is decremented each time. 1. If the number of the header to be read is 5, the new header number is 4. In step S135, the update module 103 obtains a new checksum according to the map status flag to be updated, the new header number, and the read map file. In step S136, the update module 103 writes the new header and the read map file to the cleared block. The new header includes: a map status flag to be updated, a new header number, and a new checksum. In step S137, the update module 103 clears the data in the block containing the smaller header number.
步驟S138,當所讀取得兩個檢查和不全都正確時,更新模組103判斷讀取的兩個檢查和是否有一個正確。步驟S139,當所讀取的兩個檢查和有一個正確時,更新模組103清空含有錯誤檢查和的區塊的資料。步驟S140,更新模組103從含有正確檢查和的區塊中讀取該區塊的標頭序號和映射檔。步驟S141,更新模組103將所讀取的標頭序號更新為新的標頭序號。步驟S142,更新模組103根據需更新的映射檔狀態旗標、新的標頭序號和所讀取的映射檔得到新的檢查和。步驟S143,更新模組103將所述新的標頭和所讀取的映射檔寫入所清空的區塊。所述新的標頭包括:需更新的映射檔狀態旗標、新的標頭序號及新的檢查和。步驟S144,更新模組103清空含有正確檢查和的區塊中的資料。 In step S138, when both of the read and the incomplete readings are correct, the update module 103 determines whether one of the two checksums read is correct. In step S139, when the two checksums read are correct, the update module 103 clears the data of the block containing the error checksum. In step S140, the update module 103 reads the header serial number and the mapping file of the block from the block containing the correct checksum. In step S141, the update module 103 updates the read header number to a new header number. In step S142, the update module 103 obtains a new checksum according to the map status flag to be updated, the new header number, and the read map file. In step S143, the update module 103 writes the new header and the read map file to the cleared block. The new header includes: a map status flag to be updated, a new header number, and a new checksum. In step S144, the update module 103 clears the data in the block containing the correct checksum.
步驟S145,當所讀取的兩個檢查和全都不正確時,更新模組103讀取第一區塊中所儲存的映射檔,所述第一區塊是指在儲存區中位置排序第一的區塊。步驟S146,更新模組103將該區塊的標頭序號設置為初始預設值。步驟S147,更新模組103根據需更新的映射檔狀態旗標、所設置的標頭序號和所讀取的映射檔得到新的檢查和。步驟S148,更新模組103清空第二區塊中的資料,所述第二區塊是指在儲存區中位置排序第二的區塊。步驟S149,更新 模組103將所述新的標頭和所讀取的映射檔寫入第二區塊。步驟S150,更新模組103清空第一區塊中的資料。 Step S145, when the two checksums that are read are all incorrect, the update module 103 reads the map file stored in the first block, where the first block refers to the first position in the storage area. Block. In step S146, the update module 103 sets the header number of the block to an initial preset value. In step S147, the update module 103 obtains a new checksum according to the map state flag to be updated, the set header number, and the read map file. In step S148, the update module 103 clears the data in the second block, and the second block refers to the second block in the storage area. Step S149, update Module 103 writes the new header and the read map file to the second block. In step S150, the update module 103 clears the data in the first block.
綜上所述,本發明符合發明專利要件,爰依法提出專利申請。惟,以上所述者僅為本發明之較佳實施例,本發明之範圍並不以上述實施例為限,舉凡熟悉本案技藝之人士援依本發明之精神所作之等效修飾或變化,皆應涵蓋於以下申請專利範圍內。 In summary, the present invention complies with the requirements of the invention patent and submits a patent application according to law. The above is only the preferred embodiment of the present invention, and the scope of the present invention is not limited to the above-described embodiments, and equivalent modifications or variations made by those skilled in the art in light of the spirit of the present invention are It should be covered by the following patent application.
1‧‧‧NAND快閃記憶體 1‧‧‧NAND flash memory
100‧‧‧讀取模組 100‧‧‧Read module
101‧‧‧識別模組 101‧‧‧ Identification module
102‧‧‧判斷模組 102‧‧‧Judgement module
103‧‧‧更新模組 103‧‧‧Update Module
104‧‧‧啟動模組 104‧‧‧Starting module
105‧‧‧提示模組 105‧‧‧ prompt module
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW98136774A TWI425514B (en) | 2009-10-29 | 2009-10-29 | A nand flash memory and method for updating data in the nand flash memory |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW98136774A TWI425514B (en) | 2009-10-29 | 2009-10-29 | A nand flash memory and method for updating data in the nand flash memory |
Publications (2)
Publication Number | Publication Date |
---|---|
TW201115579A TW201115579A (en) | 2011-05-01 |
TWI425514B true TWI425514B (en) | 2014-02-01 |
Family
ID=44934532
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW98136774A TWI425514B (en) | 2009-10-29 | 2009-10-29 | A nand flash memory and method for updating data in the nand flash memory |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI425514B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW200504507A (en) * | 2003-04-29 | 2005-02-01 | Ibm | Method, system and computer program product for implementing copy-on-write of a file |
US20050160217A1 (en) * | 2003-12-31 | 2005-07-21 | Gonzalez Carlos J. | Flash memory system startup operation |
TW200832132A (en) * | 2006-09-29 | 2008-08-01 | Sandisk Corp | Managing file allocation table information |
TW200844741A (en) * | 2006-12-26 | 2008-11-16 | Sandisk Corp | Managing a LBA interface in a direct data file memory system |
US20090271603A1 (en) * | 2008-04-28 | 2009-10-29 | Hon Hai Precision Industry Co., Ltd. | Embedded system and startup method thereof |
-
2009
- 2009-10-29 TW TW98136774A patent/TWI425514B/en not_active IP Right Cessation
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW200504507A (en) * | 2003-04-29 | 2005-02-01 | Ibm | Method, system and computer program product for implementing copy-on-write of a file |
US20050160217A1 (en) * | 2003-12-31 | 2005-07-21 | Gonzalez Carlos J. | Flash memory system startup operation |
TW200601151A (en) * | 2003-12-31 | 2006-01-01 | Sandisk Corp | Flash memory system startup operation |
TW200832132A (en) * | 2006-09-29 | 2008-08-01 | Sandisk Corp | Managing file allocation table information |
TW200844741A (en) * | 2006-12-26 | 2008-11-16 | Sandisk Corp | Managing a LBA interface in a direct data file memory system |
US20090271603A1 (en) * | 2008-04-28 | 2009-10-29 | Hon Hai Precision Industry Co., Ltd. | Embedded system and startup method thereof |
Also Published As
Publication number | Publication date |
---|---|
TW201115579A (en) | 2011-05-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102043651B (en) | NAND flash memory and data updating management method thereof | |
CN101650662B (en) | Memory device of embedded system and staring method and upgrading of firmware | |
JP4371771B2 (en) | Power management block used in non-volatile memory system | |
TWI384367B (en) | System of updating firmware and method thereof | |
US20120260244A1 (en) | Failsafe firmware updates | |
WO2008026466A1 (en) | File system | |
CN105260215A (en) | Method of updating vehicle-mounted automobile data recorder terminal by USB flash disk | |
CN111142911B (en) | Embedded system with abnormal recovery function and upgrading method thereof | |
JP2000105694A (en) | Flash memory, microcomputer equipped with flash memory, and method for storing program in flash memory | |
CN101567217A (en) | Flash memory safely writing method and data writing method | |
JP2008059228A (en) | File system | |
RU2248627C2 (en) | Method and device for changing content of memory devices of control blocks | |
CN112540725A (en) | Nonvolatile data storage method, embedded system and storage medium | |
CN112015447A (en) | System updating method and device for electronic equipment, electronic equipment and storage medium | |
CN113157303A (en) | Upgrading method, embedded system, terminal and computer storage medium | |
JP4158526B2 (en) | Memory card and data writing method to memory | |
CN108733517A (en) | SSD firmware upgrades guard method and device | |
CN114265603A (en) | System upgrading method and device based on asymmetric partition and electronic equipment | |
TWI425514B (en) | A nand flash memory and method for updating data in the nand flash memory | |
US20070233940A1 (en) | Method for updating data in flash memory | |
JP5660521B2 (en) | Nonvolatile semiconductor memory device and memory management method | |
CN113176891B (en) | Bootloader-based ECU (electronic control Unit) program programming method with backup function | |
CN111522686B (en) | Nonvolatile data reading and writing method and device | |
JP2009009602A (en) | Ic card and ic card program | |
CN110888605B (en) | EEPROM data writing method and device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MM4A | Annulment or lapse of patent due to non-payment of fees |