Operation method, device and equipment of nor flash memory and computer readable storage medium
By traversing the Nor flash sectors when the embedded device is powered on, identifying and erasing abnormal sectors, and transferring normal file blocks, the problem of file system corruption caused by sudden power failure of embedded devices is solved, and support for data integrity and complex operations is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAMEN FOUR FAITH COMM TECH
- Filing Date
- 2022-09-07
- Publication Date
- 2026-05-29
AI Technical Summary
Embedded devices are prone to file system corruption in the event of a sudden power outage, and existing Nor flash memory is difficult to handle complex CRUD operations and store large amounts of sensor data.
Upon power-up, all sectors in the flash memory are traversed, sectors that are abnormal are identified and erased, and then set as free sectors. File blocks in normal sectors are traversed, file blocks with abnormal write flags are deleted, and normal file blocks are moved to new sectors.
It solves the problem of file system corruption caused by sudden power loss in embedded devices, ensuring data integrity and system stability, and supporting complex data operations.
Smart Images

Figure CN115346582B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of flash memory technology, and in particular to a method, apparatus, device, and computer-readable storage medium for operating NOR flash memory. Background Technology
[0002] Nor flash memory is a simple and easy-to-use storage solution that can perform data storage operations without complex drivers. However, due to its lower write / erase cycles (one-tenth that of NAND) and longer sector erase time (NOR requires 100ms while NAND only requires 4ms), storing dynamic data is more difficult. Furthermore, NAND typically has a capacity of more than 64MB, and its drivers are more complex and expensive.
[0003] In IoT devices and embedded applications, NOR flash memory with less than 8MB of memory is commonly used due to its simple and inexpensive drivers. However, these applications often require storing large amounts of sensor data and performing CRUD operations. Simple data writing to flash memory is insufficient to handle these complex operations. Furthermore, the possibility of sudden power outages in embedded devices must be considered, which could lead to file system corruption.
[0004] In view of the above, this application is hereby submitted. Summary of the Invention
[0005] This invention discloses a method, apparatus, device, and computer-readable storage medium for operating NOR flash memory, aiming to solve the problem of file system corruption caused by sudden power outages in embedded devices.
[0006] The first embodiment of the present invention provides a method for operating NOR flash memory, including:
[0007] When a power-on action is detected, all sectors in the flash memory are traversed.
[0008] When the traversal is detected to be complete, the presence of any abnormalities in the sector is determined based on the sector header.
[0009] If so, erase the abnormal sector and set the abnormal sector as an idle sector;
[0010] If not, iterate through the file blocks in each normal sector and delete the file blocks whose write flags indicate an error.
[0011] Preferably, the step of traversing all sectors in the flash memory specifically involves:
[0012] Create a sector mapping table;
[0013] The hash function is called to perform calculations on the read data, and the hash value generated by the calculation and the actual sector mapping are saved to the sector mapping table.
[0014] Preferably, the step of determining whether a sector is abnormal based on the sector header specifically involves:
[0015] Obtain the sector header of each sector and identify sectors with the same sector number;
[0016] Activate the flags of the sectors with the same sector number, and determine whether the flags of the sectors are available;
[0017] If so, define it as a normal sector;
[0018] If not, define it as an abnormal sector.
[0019] Preferably, after traversing the file blocks in each normal sector and deleting the file blocks with abnormal write flags, the method further includes:
[0020] Generate the counter difference between the free sector with the largest erase counter value and the non-free sector with the smallest erase counter value, and determine whether the counter difference is greater than a preset value;
[0021] If so, defragment the non-idle sector with the smallest erase counter value;
[0022] If not, obtain the sector with the highest recycling coefficient among the non-free sectors and defragment it. The defragmentation includes moving file blocks with normal write flags to new sectors and deleting the original sectors.
[0023] Preferably, it further includes:
[0024] When a file closing action is detected, a final sector number is generated based on the file name.
[0025] The sector mapping table is queried. If the final sector number is found to exist in the sector mapping table, cache data is written in ascending order according to the file index of that sector, and the file index is updated.
[0026] Preferably, the step of generating the final sector number based on the file name specifically involves:
[0027] The filename is processed using a hash function to generate a hash value;
[0028] Perform a modulo operation on the said Hihar value to generate a sector number;
[0029] Determine the file block index based on the file offset of the file;
[0030] The final sector number is generated based on the sector number and the file block index.
[0031] Preferably, it further includes:
[0032] When a file deletion action is detected, the file name is obtained to determine the sector where the file is located;
[0033] Traverse the sectors, obtain the file index of the last file block in the sector, set the deletion flag, and update the file block index in the sector.
[0034] A second embodiment of the present invention provides an operating device for NOR flash memory, comprising:
[0035] The traversal unit is used to traverse all sectors in the flash memory when a power-on action is detected;
[0036] The judgment unit is used to determine whether there is an anomaly in the sector based on the sector header when the traversal is detected to be complete.
[0037] An erasing unit is used to erase abnormal sectors and set the abnormal sectors as free sectors;
[0038] The file block deletion unit is used to traverse the file blocks in each normal sector and delete the file blocks whose write flags are abnormal.
[0039] The third embodiment of the present invention provides an operating device for NOR flash memory, including a memory and a processor. The memory stores a computer program, which can be executed by the processor to implement an operating method for NOR flash memory as described in any of the above embodiments.
[0040] A third embodiment of the present invention provides a computer-readable storage medium storing a computer program, the computer program being executable by a processor of the device in which the computer-readable storage medium is located, to implement a NOR flash memory operation method as described in any of the above claims.
[0041] Based on the operating method, apparatus, device, and computer-readable storage medium of NOR flash memory provided by this invention, when a power-on operation is detected, all sectors in the flash memory are traversed, and abnormal sectors are analyzed according to the sector header of each sector. The abnormal sectors are erased and set as free sectors. At the same time, the file blocks in each normal sector are traversed, and file blocks with abnormal write flags are deleted, while file blocks with normal write flags are moved to new sectors. The original sectors are deleted at the same time. This solves the problem of file system corruption caused by sudden power failures in embedded devices. Attached Figure Description
[0042] Figure 1 This is a flowchart illustrating an operation method for NOR flash memory provided in the first embodiment of the present invention;
[0043] Figure 2 This is a schematic diagram illustrating the updating of file blocks to new sectors provided by the present invention;
[0044] Figure 3 This is a schematic diagram of a module of an operating device for a NOR flash memory provided in the second embodiment of the present invention; Detailed Implementation
[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0046] To better understand the technical solution of the present invention, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0047] It should be understood that the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0048] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0049] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0050] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."
[0051] The terms "first" and "second" used in the embodiments are merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first" and "second" can be interchanged in a specific order or sequence where permissible. It should be understood that the objects distinguished by "first" and "second" can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein.
[0052] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0053] This invention discloses a method, apparatus, device, and computer-readable storage medium for operating NOR flash memory, aiming to solve the problem of file system corruption caused by sudden power outages in embedded devices.
[0054] Please see Figure 1 The first embodiment of the present invention provides a method for operating NOR flash memory, which can be executed by an operating device for NOR flash memory (hereinafter referred to as the operating device), specifically, by one or more processors within the operating device, to achieve the following steps:
[0055] S101, when a power-on action is detected, all sectors in the flash memory are traversed;
[0056] In this embodiment, the operating device may be an embedded device or other terminal with data processing and analysis capabilities. The operating device may be equipped with a corresponding operating system and application software, and the functions required in this embodiment are realized through the combination of the operating system and application software.
[0057] It should be noted that the inventors discovered that embedded devices using NOR flash memory may experience incomplete data blocks after a power outage.
[0058] Specifically, in this embodiment, a sector mapping table can be created when a power-on action is detected;
[0059] The hash function is called to perform calculations on the read data, and the hash value generated by the calculation and the actual sector mapping are saved to the sector mapping table.
[0060] It should be noted that the sector mapping table is stored in memory and is used to quickly locate the position of data. The sector mapping table may include:
[0061] Sector ID: Unique, ranging from 0 to 65535, and can be calculated using a hash function.
[0062] Reclaim factor: Indicates how many data blocks within a sector can be reclaimed, used to achieve wear leveling.
[0063] Full data flag: Indicates that the sector contains only valid data.
[0064] Available flag: Indicates that the sector is usable.
[0065] Relative erase counter: The erase counter for the sector, used to achieve wear leveling.
[0066] It should be noted that, to ensure the sector header information is valid, during traversal, if any untraversed sectors are found, it is determined whether they need to be formatted. The first file block of each sector stores sector information (sector header), which includes a sector identifier to indicate that a formatted sector should be used; if a sector is already formatted, it does not need to be formatted again. The sector header may include:
[0067] Sector ID: Unique, ranging from 0 to 65535, and can be calculated using a hash function;
[0068] Available indicator: Indicates that the sector is usable (power-off protection);
[0069] Erase Counter: Records the number of sector erases;
[0070] Free block mask: 8 bytes and 64 bits represent the usage status of 63 file blocks within a sector. A bit being 0 indicates that the corresponding file block has been allocated.
[0071] Deletion mask: 8 bytes and 64 bits represent the usage status of 63 file blocks within a sector. A bit being 0 indicates that the corresponding file block has been deleted.
[0072] First block mask: Indicates whether this file block is the first block of file data, used to speed up the search;
[0073] Regression mask: Used to maximize the use of all blocks in a sector and improve storage lifespan;
[0074] Sector identifier: Indicates that this sector is a sector in HTFS;
[0075] When the device is powered on, all sector headers in all memories are traversed to generate a sector mapping table.
[0076] S102, when the traversal is detected to be complete, determine whether there is an anomaly in the sector based on the sector header;
[0077] Specifically, in this embodiment, sectors with the same sector number can be determined by obtaining the sector header of each sector;
[0078] Activate the flags of the sectors with the same sector number, and determine whether the flags of the sectors are available;
[0079] If so, define it as a normal sector;
[0080] If not, define it as an abnormal sector.
[0081] S103, if so, erase the abnormal sector and set the abnormal sector as an idle sector;
[0082] It should be noted that in this embodiment, if there are duplicate sector numbers, the activation flag can be used to determine this. Inactive sectors are erased and set as free sectors, thus avoiding duplicate sector numbers.
[0083] S104, If not, iterate through the file blocks in each normal sector and delete the file blocks whose write flags indicate an error (e.g., ...). Figure 2 (As shown).
[0084] It should be noted that the write flag indicates whether the current file block has been written normally. If the write flag is not set, it means that the file block has not been written normally and needs to be deleted. The file block includes:
[0085] File block index: Indicates which block the current block is in the file;
[0086] Available flag: The current block is valid (power-down protection);
[0087] File verification: CRC check of the file content;
[0088] Block length: The length of data within a file block;
[0089] Write flag: Indicates that the current block has been written.
[0090] In one possible embodiment of the present invention, after traversing the file blocks in each normal sector and deleting the file blocks whose write flags show an error, the method further includes:
[0091] Generate the counter difference between the free sector with the largest erase counter value and the non-free sector with the smallest erase counter value, and determine whether the counter difference is greater than a preset value;
[0092] If so, defragment the non-idle sector with the smallest erase counter value;
[0093] If not, obtain the sector with the highest recycling coefficient among the non-free sectors and defragment it. The defragmentation includes moving file blocks with normal write flags to new sectors and deleting the original sectors.
[0094] It should be noted that the sector with the fewest erase counters is obtained. If the difference between the sector with the fewest erase counters and the sector with the most erase counters is greater than 127 (of course, the value can be set according to the actual situation, and is not limited to this), then it is moved to an idle sector. This can prevent uneven wear caused by a sector being used or not used at all.
[0095] It should be noted that the deletion mask when there is no data is 0x7FFFFFFFFFFFFFFF. When deleting a block, the mask is set to 0. Deleting the first 4 data blocks will result in 0x7FFFFFFFFFFFFFF0. Deleting all blocks will result in 0x0000000000000000. As long as the result is 0, it means that the sector is a dirty sector and needs to be reclaimed.
[0096] In one possible embodiment of the present invention, it further includes:
[0097] When a file closing action is detected, a final sector number is generated based on the file name.
[0098] The sector mapping table is queried. If the final sector number is found to exist in the sector mapping table, cache data is written in ascending order according to the file index of that sector, and the file index is updated.
[0099] It should be noted that cached data is written when the file is closed, and the writes to the cache are in ascending order of file block index. The first file block containing the file length is written first, so that even in the event of a sudden power outage, some file data can be recovered.
[0100] It should be noted that when it is determined that the final sector number exists in the sector mapping table, a new sector can be requested, and the sector number can be written after the request is successful. The file index update includes: checking whether there is a free block in the free mask. If there is no free block, the sector number is incremented by 1. If there is a free block, the data block is updated, and the file block index is incremented by 1.
[0101] In one possible embodiment of the present invention, generating the final sector number based on the file name specifically involves:
[0102] The filename is processed using a hash function to generate a hash value;
[0103] It's important to note that a hash table is a data structure that allows direct access based on a key value. In other words, it accesses records by mapping the key value to a location in the table, thus speeding up the search process. This mapping function is called a hash function, and the array storing the records is called a hash table. The hash function can generate a 64-bit hash value from the filename.
[0104] Perform a modulo operation on the said Hihar value to generate a sector number;
[0105] $$File block index = round up (file read position / 48)\\sector number = (hash function (file name) + file block index)\mod(65536)\\sector physical address = sector mapping table (sector number)$$, where the 64-bit hash value is modulo 65536 to obtain the sector number.
[0106] Determine the file block index based on the file offset of the file;
[0107] The final sector number is generated based on the sector number and the file block index.
[0108] In one possible embodiment of the present invention, it may further include:
[0109] When a file deletion action is detected, the file name is obtained to determine the sector where the file is located;
[0110] Traverse the sectors, obtain the file index of the last file block in the sector, set the deletion flag, and update the file block index in the sector.
[0111] It should be noted that deleting files mainly involves setting a deletion mask at the sector header, and deleting file blocks starting from the last block to avoid file system corruption (file blocks losing their association) caused by sudden power outages.
[0112] In one possible embodiment of the present invention, when a file is written, it is not written immediately but stored in a cache, and then written when the file is closed. Specifically:
[0113] When writing data, the file block index can be obtained through the file offset, where the sector number = the sector number calculated by the file offset + the file block index;
[0114] When querying the sector mapping table and finding that a file block index exists, the system further traverses the file blocks within the sector to check if a corresponding file block exists.
[0115] If so, read the data into the cache and compare the new and old data in the cache to see if an update is needed;
[0116] When an update is detected, an update flag is set, data is written to the cache, and the file block index is incremented by 1.
[0117] When it is determined that no update is needed, the file block index is incremented by 1.
[0118] In one possible embodiment of the present invention, file reading specifically includes:
[0119] 1. Obtain the file hash value by file name
[0120] 2. Obtain the sector number using the file hash value and the file block index to be read.
[0121] 3. Obtain the sector address by querying the sector mapping table using the sector number.
[0122] 4. Check if the hash value and file block index of the file blocks within the sector are consistent.
[0123] Please see Figure 3 The second embodiment of the present invention provides an operating device for NOR flash memory, comprising:
[0124] Traversal unit 201 is used to traverse all sectors in flash memory when a power-on action is detected;
[0125] The judgment unit 202 is used to determine whether there is an anomaly in the sector based on the sector header when the traversal is detected to be complete.
[0126] Erasing unit 203 is used to erase abnormal sectors and set the abnormal sectors as free sectors;
[0127] The file block deletion unit 204 is used to traverse the file blocks in each normal sector and delete the file blocks whose write flags are abnormal.
[0128] The third embodiment of the present invention provides an operating device for NOR flash memory, including a memory and a processor. The memory stores a computer program, which can be executed by the processor to implement an operating method for NOR flash memory as described in any of the above embodiments.
[0129] A third embodiment of the present invention provides a computer-readable storage medium storing a computer program, the computer program being executable by a processor of the device in which the computer-readable storage medium is located, to implement a NOR flash memory operation method as described in any of the above claims.
[0130] Based on the operating method, apparatus, device, and computer-readable storage medium of NOR flash memory provided by this invention, when a power-on operation is detected, all sectors in the flash memory are traversed, and abnormal sectors are analyzed according to the sector header of each sector. The abnormal sectors are erased and set as free sectors. At the same time, the file blocks in each normal sector are traversed, and file blocks with abnormal write flags are deleted, while file blocks with normal write flags are moved to new sectors. The original sectors are deleted at the same time. This solves the problem of file system corruption caused by sudden power failures in embedded devices.
[0131] Exemplary examples show that the computer program described in the third and fourth embodiments of the present invention can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the operating device implementing a NOR flash memory. For example, the apparatus described in the second embodiment of the present invention.
[0132] The processor referred to can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the aforementioned NOR flash memory operation method, connecting the various parts of the entire method for operating NOR flash memory using various interfaces and lines.
[0133] The memory can be used to store the computer program and / or modules. The processor implements various functions of a NOR flash memory operation method by running or executing the computer program and / or modules stored in the memory and calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, text conversion function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, text message data, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0134] If the implemented module is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0135] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0136] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for operating NOR flash memory, characterized in that, include: When a power-on action is detected, all sectors in the flash memory are traversed. When the traversal is detected to be complete, the presence of any abnormal sectors is determined based on the sector headers. Specifically, this involves: obtaining the sector header of each sector and identifying sectors with the same sector number; activating the flag of the sector with the same sector number and determining whether the flag is available; if yes, defining it as a normal sector; otherwise, defining it as an abnormal sector. If so, erase the abnormal sector and set the abnormal sector as an idle sector; If not, iterate through the file blocks in each normal sector and delete the file blocks whose write flags indicate an error.
2. The method for operating a NOR flash memory according to claim 1, characterized in that, The process of traversing all sectors in the flash memory specifically involves: Create a sector mapping table; The hash function is called to perform calculations on the read data, and the hash value generated by the calculation and the actual sector mapping are saved to the sector mapping table.
3. The method for operating a NOR flash memory according to claim 1, characterized in that, The step of traversing the file blocks in each normal sector and deleting file blocks whose write flags indicate an error also includes: Generate the counter difference between the free sector with the largest erase counter value and the non-free sector with the smallest erase counter value, and determine whether the counter difference is greater than a preset value; If so, defragment the non-idle sector with the smallest erase counter value; If not, obtain the sector with the highest recycling coefficient from the non-free sectors and perform defragmentation. The defragmentation process includes moving file blocks with normal write flags to new sectors while deleting the original sectors.
4. The method for operating a NOR flash memory according to claim 1, characterized in that, Also includes: When a file closing action is detected, a final sector number is generated based on the file name. The sector mapping table is queried. If the final sector number is found to exist in the sector mapping table, cache data is written in ascending order according to the file index of that sector, and the file index is updated.
5. The method for operating a NOR flash memory according to claim 4, characterized in that, The step of generating the final sector number based on the file name is as follows: The filename is processed using a hash function to generate a hash value; Perform a modulo operation on the said Hihar value to generate a sector number; Determine the file block index based on the file offset of the file; The final sector number is generated based on the sector number and the file block index.
6. The method for operating a NOR flash memory according to claim 4, characterized in that, Also includes: When a file deletion action is detected, the file name is obtained to determine the sector where the file is located; Traverse the sectors, obtain the file index of the last file block in the sector, set the deletion flag, and update the file block index in the sector.
7. An operating device for NOR flash memory, characterized in that, include: The traversal unit is used to traverse all sectors in the flash memory when a power-on action is detected; The judgment unit is used to determine whether there is an anomaly in the sector based on the sector header when the traversal is detected to be complete; specifically, it is used to: obtain the sector header of each sector, determine the sectors with the same sector number; activate the flag of the sector with the same sector number, and determine whether the flag of the sector is available; if yes, it is defined as a normal sector; if no, it is defined as an abnormal sector. An erasing unit is used to erase abnormal sectors and set the abnormal sectors as free sectors; The file block deletion unit is used to traverse the file blocks in each normal sector and delete the file blocks whose write flags are abnormal.
8. An operating device for NOR flash memory, characterized in that, The device includes a memory and a processor, wherein the memory stores a computer program that can be executed by the processor to implement a method for operating a NOR flash memory as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The device contains a computer program that can be executed by a processor of the device in which the computer-readable storage medium is located to implement a method of operating a NOR flash memory as described in any one of claims 1 to 6.