KR101654709B1 - Apparatus and Method for writing and reading a data on flash memory - Google Patents

Apparatus and Method for writing and reading a data on flash memory Download PDF

Info

Publication number
KR101654709B1
KR101654709B1 KR1020150153241A KR20150153241A KR101654709B1 KR 101654709 B1 KR101654709 B1 KR 101654709B1 KR 1020150153241 A KR1020150153241 A KR 1020150153241A KR 20150153241 A KR20150153241 A KR 20150153241A KR 101654709 B1 KR101654709 B1 KR 101654709B1
Authority
KR
South Korea
Prior art keywords
data
flash area
flash
area
reading
Prior art date
Application number
KR1020150153241A
Other languages
Korean (ko)
Inventor
반동훈
이성훈
홍재승
박태상
이태영
Original Assignee
재단법인대구경북과학기술원
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 재단법인대구경북과학기술원 filed Critical 재단법인대구경북과학기술원
Priority to KR1020150153241A priority Critical patent/KR101654709B1/en
Application granted granted Critical
Publication of KR101654709B1 publication Critical patent/KR101654709B1/en

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C16/00Erasable programmable read-only memories
    • G11C16/02Erasable programmable read-only memories electrically programmable
    • G11C16/06Auxiliary circuits, e.g. for writing into memory
    • G11C16/26Sensing or reading circuits; Data output circuits
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C16/00Erasable programmable read-only memories
    • G11C16/02Erasable programmable read-only memories electrically programmable
    • G11C16/06Auxiliary circuits, e.g. for writing into memory
    • G11C16/08Address circuits; Decoders; Word-line control circuits
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C16/00Erasable programmable read-only memories
    • G11C16/02Erasable programmable read-only memories electrically programmable
    • G11C16/06Auxiliary circuits, e.g. for writing into memory
    • G11C16/34Determination of programming status, e.g. threshold voltage, overprogramming or underprogramming, retention
    • G11C16/3436Arrangements for verifying correct programming or erasure
    • G11C16/3454Arrangements for verifying correct programming or for detecting overprogrammed cells
    • G11C16/3459Circuits or methods to verify correct programming of nonvolatile memory cells

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Read Only Memory (AREA)

Abstract

The present invention relates to a control method for controlling data recording and reading in a flash memory, comprising: determining whether data stored in a RAM is stored in a flash memory according to a system operation; Increasing and storing the set count value when it is determined that there is data to be stored; Recording the data to be stored, the count value being incremented in a first flash area and a second flash area, respectively, of the flash memory; And reading the count values included in the data written respectively in the first flash area and the second flash area and reading the data recorded in the first flash area and the second flash area to compare the count value, Reading data in the first flash area in the same case and reading data in the first and second flash areas having a larger count value when they differ from each other due to an error.

Description

TECHNICAL FIELD [0001] The present invention relates to a control device and a control method for controlling data recording and reading of a flash memory,

The present invention relates to a control device and a control method for controlling data recording and reading in a flash memory, and more particularly, to a control device and a control method for controlling data recording and reading in a flash memory, which can double data storage in a flash memory, And a control device and a control method for controlling reading.

A flash memory is a memory device that has the advantages of a ROM that preserves stored data even when the power is turned off, and the advantage of a RAM that is free to input and output information. The flash memory is capable of writing and reading but unlike EEPROM, it can not be rewritten without erasing it during rewriting. Especially, it takes a long time to erase (it varies according to the product, but it is about 20 ~ 30ms).

Meanwhile, a control device for controlling data recording and reading of the flash memory according to the related art includes a data storage determination unit for determining whether there is data to be stored in the flash memory among the data stored in the RAM according to the system operation A data recording unit for redundantly recording data to be stored in a first flash area and a second flash area, respectively, of the flash memory, when it is determined that there is data; A data reading unit for comparing the data recorded in the first flash area and the second flash area with each other when reading data recorded in the first flash area and the second flash area, ; And a controller for controlling the data storage determination unit, the count value storage unit, the data recording unit, and the data reading unit.

However, if the data written in the first flash area and the second flash area are not the same data in the data reading part, it is possible to distinguish whether the data in the first flash area is the most recent effective data or the data in the second flash area is the latest valid data There is a problem that it is impossible to confirm which data is the final data.

Conventionally, for example, when data is recorded only in the first flash area and data is not recorded in the second flash area by power-off during data writing, data having a larger address may be determined as the final data, If the data is partially updated due to the influence of noise or electromagnetic waves, or if the address at which data is written to the first flash area and the second flash area due to cell failure of the storage area of the flash area is different, You will not be able to see it.

SUMMARY OF THE INVENTION The present invention has been made to solve the above problems and it is an object of the present invention to provide a flash memory in which data is written in a first flash area and a second flash area, Even if the address of the data to be written to the flash memory is changed, it is possible to more accurately check the latest data at the time of reading to improve the reliability.

According to an aspect of the present invention, there is provided a control apparatus for controlling data writing and reading of a flash memory, the method comprising: determining whether data stored in a RAM is data to be stored in a flash memory A data storage determination unit; A count value storing unit for storing the count value incremented when it is determined that there is data to be stored; A data recording unit for recording the data to be stored, the count values being incremented in a first flash area and a second flash area, respectively, of the flash memory; When the data recorded in the first flash area and the second flash area are read, the count value included in the data written respectively in the first flash area and the second flash area is read to compare the magnitude of the count value, A data reading unit for selecting the data and reading the selected data; And a controller for controlling the data storage determination unit, the count value storage unit, the data recording unit, and the data reading unit.

Here, the data recording unit may determine whether there is free space in the storage space for each of the first flash area and the second flash area, and sequentially record the data in the spare area starting from a position having a low address.

The data reading unit selects the data to be read by selecting the data of the first flash area when the count values of the first and second flash areas are the same, Data having a large count value can be selected in the flash area.

Particularly, in the case where there is no spare space in the first flash area, the data recording unit records data to be stored including the count value in a preset third flash area, erases all the storage space of the first flash area, The data to be stored including the incremented count value recorded in the third flash area is read and data is sequentially written in the first flash area starting from a position having a low address.

Likewise, if there is no spare space in the second flash area, the data recording unit erases all the storage space of the second flash area after recording the data to be stored including the count value in the preset fourth flash area, The data to be stored including the incremented count value recorded in the fourth flash area is read and the data is sequentially written in the second flash area starting from the low address.

Preferably, the data recording unit reads data recorded in the first flash area after sequentially recording data in the first flash area starting from a low address when the first flash area has no spare space, And determines whether or not the cell of the address of the first flash area in which the data is stored is faulty. If the data stored in the first flash area and the data stored in the RAM are different from each other, It is judged that the cell of the address of the first flash area in which the address of the first flash area is recorded is faulty and the address of the first flash area is increased to the next address determined and then data is sequentially written in the first flash area Can be repeatedly performed.

Similarly, when there is no spare space in the second flash area, the data recording unit reads data recorded in the second flash area sequentially from a position having a low address in the second flash area, And determines whether or not the cell of the address of the second flash area in which the data is stored is faulty. If the data stored in the compared second flash area is different from the data stored in the RAM, It is judged that the cell of the address of the second flash area is defective and the address of the second flash area is increased to the next address determined and then the process of sequentially writing the data in the second flash area Can be repeatedly performed.

When the count value included in the data recorded in each of the first flash area and the second flash area is read, if the storage space of the first flash area and the second flash area are all cleared, It is preferable to read the initialization data stored in the preset fifth flash area.

According to another aspect of the present invention, there is provided a control method of controlling data recording and reading of a flash memory, comprising: determining whether data stored in a RAM is data to be stored in a flash memory according to a system operation; Increasing and storing the set count value when it is determined that there is data to be stored; Recording the data to be stored, the count value being incremented in a first flash area and a second flash area, respectively, of the flash memory; And reading the count values included in the data written respectively in the first flash area and the second flash area and reading the data recorded in the first flash area and the second flash area to compare the count value, Reading data in the first flash area in the same case and reading data in the first and second flash areas having a larger count value when they differ from each other due to an error.

Here, the step of recording may include determining whether there is a free space among the storage spaces for each of the first flash area and the second flash area, and sequentially recording the data from a position having a low address in the free space.

In particular, in the recording step, if there is no spare space in the first flash area, recording data to be stored including the count value in a preset third flash area; Erasing all of the storage space of the first flash area; And reading the data to be stored including the incremented count value recorded in the third flash area, and sequentially recording data in the first flash area starting from a low address.

Similarly, in the recording step, if there is no spare space in the second flash area, recording the data to be stored including the count value in a preset fourth flash area; Erasing all the storage spaces of the second flash area; And reading data to be stored including an incremented count value recorded in the fourth flash area and sequentially recording data in a second flash area starting from a low address.

Preferably, in the recording step, when there is no free space in the first flash area, the step of sequentially recording data in the first flash area starting from a low address, Comparing the read data with data stored in the RAM to determine whether the cell of the address of the first flash area in which the data is stored is faulty; And if the data recorded in the first flash area and the data stored in the RAM differ from each other in the determining step, it is determined that the cell of the address of the first flash area in which the data is recorded is faulty, And moving the address to a step of sequentially writing data in the first flash area starting from a low address after incrementing the address to the next predetermined address.

Likewise, in the recording step, even when there is no spare space in the second flash area, data recorded in the second flash area is read out after sequentially recording data in the second flash area starting from a position having a low address Comparing the data stored in the RAM with data stored in the RAM to determine whether the cell of the address of the second flash area in which data is stored has failed; And if the data recorded in the second flash area and the data stored in the RAM are different from each other in the comparing step, it is determined that the cell of the address of the second flash area in which the data is recorded is faulty, The method may further include moving the address from the low address to the step of sequentially writing data to the second flash area after incrementing the address to the next address determined.

In the reading step, when the count values included in the data written respectively in the first flash area and the second flash area are read, if the storage areas of the first flash area and the second flash area are all cleared , It is preferable to read the initialization data stored in the fifth flash area set in advance.

According to the present invention, when data is dually written in the first flash area and the second flash area of the flash memory, even if the addresses of the data to be written in the first flash area and the second flash area are changed due to cell failure or the like , It is possible to determine the latest data by comparing the magnitude of the count value additionally included in the data upon reading, thereby further enhancing the reliability of data reading. In addition, even if the power is turned off at the time of data erasing, data can be prevented from being lost because data is stored in another area before erasing. In addition, even if all the data in the first flash area and the second flash area are erased due to an error, the initialization data can be used to prevent the failure of the system and improve the stability.

1 is a block diagram showing a configuration of a control device for controlling data recording and reading of a flash memory according to an embodiment of the present invention;
2 is a flowchart showing a flow of a control method of controlling data writing and reading of a flash memory according to an embodiment of the present invention.
3 is a flowchart showing a flow of writing data to a flash memory according to an embodiment of the present invention;
4 is a flowchart showing a flow of reading data recorded in a flash memory according to an embodiment of the present invention;
FIG. 5 is a diagram for explaining a structure of a flash memory, FIG. 5 (a) is a view for explaining a cell structure of a flash area, FIG. 5 (b) , And FIG. 5 (c) is a diagram for explaining the structure of data stored in the memory.

BRIEF DESCRIPTION OF THE DRAWINGS The advantages and features of the present invention, and the manner of achieving them, will be apparent from and elucidated with reference to the embodiments described hereinafter in conjunction with the accompanying drawings. The present invention may, however, be embodied in many different forms and should not be construed as being limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art. And is intended to enable a person skilled in the art to readily understand the scope of the invention, and the invention is defined by the claims. It is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. In the present specification, the singular form includes plural forms unless otherwise specified in the specification. It is noted that " comprises, " or "comprising," as used herein, means the presence or absence of one or more other components, steps, operations, and / Do not exclude the addition.

Hereinafter, a control device for controlling data recording and reading of the flash memory of the present invention will be described with reference to FIG. 1 is a block diagram showing a configuration of a control apparatus for controlling data writing and reading of a flash memory according to an embodiment of the present invention.

1, a control apparatus 100 for controlling data recording and reading of a flash memory according to an embodiment of the present invention includes a data storage determination unit 10, a count value storage unit 20, A recording unit 30, a data reading unit 40, and a control unit 50. [

The data storage determination unit 10 determines whether there is data to be stored in the flash memory 300 among the data stored in the RAM 200 according to the system operation. Here, the condition for judging that there is data to be stored may be a case where there is a change from the initial data or the previous data, or a case where there is data obtained for a predetermined time.

Here, the system refers to a system controlled by a computer system having a RAM and a flash memory, such as an automobile control system, a brake drive system, a motor drive system, an electric motorcycle control system, and the like.

Also, the count value storage unit 20 increases the set count value when it is determined that there is data to be stored.

In addition, the data recording unit 30 records data to be stored, which includes incremented count values in the first flash area and the second flash area that are preset in the flash memory 300, respectively. That is, the data including the count value is stored in different areas of the flash memory 300 in a double manner.

More specifically, the data recording section 30 judges whether there is a free space in the storage space for each of the first flash area and the second flash area, and sequentially records the data in the spare area starting from a low address.

At this time, if there is no free space in the first flash area, data to be stored including the count value in the preset third flash area is written, then all the storage space of the first flash area is erased, The data to be stored including the incremented count value is read and the data is sequentially written in the first flash area starting from the low address.

Similarly, if there is no free space in the second flash area, data to be stored including the count value in the preset fourth flash area is written, then all the storage space of the second flash area is erased, The data to be stored including the incremented count value is read, and the data is sequentially written in the second flash area starting from the low address.

Preferably, when there is no free space in the first flash area, the data recording section 30 reads the data recorded in the first flash area sequentially after writing data in the first flash area sequentially from a low address The data stored in the first flash area and the data stored in the RAM 200 are compared with each other to determine whether or not the cell of the address of the first flash area in which the data is stored is faulty, In other cases, it is determined that the cell of the address of the first flash area in which the data is recorded is faulty, and the address of the first flash area is increased to the next predetermined address. Thereafter, It can be repeatedly performed from the process of sequentially recording data.

Likewise, if there is no free space in the second flash area, data is recorded sequentially from a low-address position in the second flash area, then the data recorded in the second flash area is read out to be the same as the data stored in the RAM 200 If the data stored in the second flash area and the data stored in the RAM 200 are different from each other, it is determined whether or not the cell of the address of the second flash area in which the data is stored is faulty. It is judged that the cell of the address of the second flash area is defective and the address of the second flash area is incremented to the next address determined and then the process of sequentially writing the data in the second flash area from the address with low address is repeated Can be performed.

Accordingly, even if a corresponding cell in the flash area fails during data writing, it is possible to securely write data to the flash area at the next address by determining whether or not the cell is faulty.

When reading data recorded in the first flash area and the second flash area, the data reading unit 40 reads the count value included in the data written respectively in the first flash area and the second flash area, If the count values are the same, the data of the first flash area is read. If the count values are different due to the error, the data of the first and second flash areas having the larger count value is read. In the case where the count values are different from each other due to an error, data is recorded in the first flash area and then the power is turned off. When data is not stored in the second flash area, The value may change, and so on.

Preferably, when reading the count values included in the data written respectively in the first flash area and the second flash area, the data reading part 40 erases all of the storage areas of the first flash area and the second flash area The initialization data stored in the preset fifth flash area can be read.

Here, the first to fifth flash areas refer to areas preset in the flash memory for data writing and reading.

The control unit 50 is connected to the data storage determination unit 10, the count value storage unit 20, the data recording unit 30 and the data reading unit 40, .

For ease of understanding, the structure of the flash memory will be described with reference to FIG. FIG. 5 is a diagram for explaining a structure of a flash memory, FIG. 5 (a) is a view for explaining a cell structure of a flash area, FIG. 5 (b) , And FIG. 5 (c) is a diagram for explaining the structure of data stored in the memory.

For example, the first to fifth predetermined flash regions of the flash memory refer to sectors having a cell structure as shown in FIG. 5 (a). Also, as shown in Fig. 5B, the cell structure of each flash area is assigned an address. Accordingly, the data stored in the flash memory records data starting from a cell having a low address at the time of recording. Since the flash memory is not rewritten when data is stored at addresses 0, 1, 2, and 3, data is stored at addresses 4, 5, 6, and 7 at the next data write. In this way, when data is sequentially stored by incrementing the address, and all the data are stored up to the addresses 4092, 4093, 4094, and 4095, when the next data is recorded, the entire area of the flash area, that is, The entire area of addresses 0 to 4095 is erased, and data is again written from addresses 0, 1, 2, and 3. On the other hand, as shown in Fig. 5C, the structure of the data stored in the flash memory includes data information in the former part (Byte 1, Byte 2) and the remaining part (Byte 3, Byte 4 ) May include a count value. The information included in the data may include, for example, position information, speed information, operation state information of the system, error code information, system variable information, and the like. In Fig. 5 (c), although the data has a 4-byte structure, the data structure can be varied according to the setting, and the variable size of the count value can be made larger.

Next, with reference to FIG. 2, a control method for controlling data recording and reading of the flash memory according to the present invention will be described. 2 is a flowchart showing the flow of a control method for controlling data writing and reading of a flash memory according to an embodiment of the present invention.

As shown in FIG. 2, a control method of controlling data writing and reading of a flash memory according to an embodiment of the present invention is stored in the flash memory 300 among data stored in the RAM 200 according to system operation Determining whether there is data to be processed (S100); If it is determined that there is data to be stored, incrementing and storing the set count value (S 200); Recording (S 300) data to be stored that includes incremented count values in a first flash zone and a second flash zone, respectively, of the flash memory 300; And reading the count value included in the data written respectively in the first flash area and the second flash area and reading the data recorded in the first flash area and the second flash area to compare the count value, (S 400) of reading the data of the first flash area and reading out data having a larger count value among the first flash area and the second flash area when they are different due to the error.

Here, steps S100, S200, and S300 are processes for writing data in the flash memory, and step S400 is a process for reading data written in the flash memory.

3 and 4, a control method of controlling data recording and reading of a flash memory by dividing a process of writing data into the flash memory and a process of reading data recorded in the flash memory will be described in more detail . FIG. 3 is a flowchart showing a flow of writing data to a flash memory according to an embodiment of the present invention, FIG. 4 is a flowchart showing a flow of reading data recorded in a flash memory according to an embodiment of the present invention to be.

First, as shown in FIG. 3, the process of writing data to the flash memory is as follows.

The data storage determination unit 10 determines whether there is data to be stored in the flash memory among the data stored in the RAM (S110). If there is no data to be stored, the process for the recording process is terminated. If there is data to be stored, the count value storage unit 20 increases and stores the count value (S210). That is, the count value storage unit 20 increases the count value every time data to be stored is generated. Subsequently, the data recording unit 30 determines whether there is free space in the first flash area of the flash memory (S311). (Hereinafter, simply referred to as data) including an incremented count value in a third flash region of the flash memory in advance, from a low-address to a low-priority (S312). Subsequently, the entire area of the first flash area having no free space is erased (S313), data stored in the third flash area is read, and data is sequentially written in the first flash area starting from a low address (S314). Accordingly, even if the power is turned off when data is erased during data writing, data stored in the third flash area can be used, so that data loss can be prevented. On the other hand, if there is a free space in the first flash area in step S311, data is sequentially recorded in a spare area of the first flash area starting from a low address (S314). Then, the data in the first flash area is compared with the data stored in the RAM (i.e., data to be stored), and the data in the first flash area is stored It is determined whether the address cell is faulty (S316). At this time, when the data of the first flash area is different from the data stored in the RAM, it is determined that the cell of the address where the data of the first flash area is stored is defective and the data is again written to the next address among the spare areas of the first flash area (S317), and the process is repeated from step S314. On the other hand, if the data in the first flash area and the data stored in the RAM are identical in step S316, it is determined that it is not a cell fault, and the process moves to step S321. Then, data is written in the second flash area of the flash memory. More specifically, it is determined whether there is free space in the storage space of the second flash area of the flash memory (S321). If there is no spare space, data to be stored (hereinafter, simply referred to as data) including an incremented count value in a fourth flash area preset in the flash memory is sequentially (S322). Then, the entire area of the second flash area having no free space is erased (S323), the data stored in the fourth flash area is read, and the data is sequentially written in the second flash area starting from the low address (S324). On the other hand, if there is a spare space in the second flash area in step S321, data is sequentially recorded in a spare area of the second flash area starting from a low address (S324).

Then, the data in the second flash area is compared with the data stored in the RAM (i.e., data to be stored), and the data in the second flash area is stored (step S325) It is determined whether the cell of the address is faulty (S326). At this time, when the data of the second flash area is different from the data stored in the RAM, it is determined that the cell of the address storing the data of the second flash area is faulty and the data is again written to the next address among the spare areas of the second flash area (S317), and the process is repeated from step S324. On the other hand, if the data in the second flash area and the data stored in the RAM are identical in step S326, it is determined that the cell is not in failure and the data writing process is terminated.

Next, as shown in FIG. 4, the process of reading data recorded in the flash memory is as follows.

First, the data reading section 40 reads the data of the first flash area (S411). Subsequently, data of the second flash area is read (S412). Next, the count value included in the data stored in the first flash area and the second flash area is compared to determine the latest data (S413). The comparison formula may be, for example, the first count value of the data of the first flash area > the second count value of the data of the second flash area. In general, if there are no cell failures or other errors, the two count values are the same. However, the address of the data and the count value can be changed by an error such as a failure of the cell or a power-off. Therefore, if the first count value is equal to or greater than the second count value, the data of the first flash area including the first count value is used (S414). If the first count value is smaller than the second count value The second flash area including the second count value uses the data (S415).

Accordingly, even when an error occurs in reading data from the flash memory, the latest data can be reliably read and used.

On the other hand, when reading the data of the first flash area and the second flash area (S411 and S412), if there is no data to be read, that is, when storing the first flash area and the second flash area If all the spaces are erased, the initialization data stored in the fifth flash area preset in the flash memory can be read and used.

According to the present invention as described above, when data is doubly written in the first flash area and the second flash area of the flash memory, the address of the data written in the first flash area and the second flash area The reliability of data reading can be further increased since the latest data can be determined by comparing the magnitude of the count value additionally included in the data upon reading. In addition, even if the power is turned off at the time of data erasing, data can be prevented from being lost because data is stored in another area before erasing. In addition, even if all the data in the first flash area and the second flash area are erased due to an error, the initialization data can be used to prevent the failure of the system and improve the stability.

While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is to be understood that the invention is not limited to the disclosed embodiments, but, on the contrary, is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. Therefore, the scope of the present invention should not be limited by the illustrated embodiments, but should be determined by the scope of the appended claims and equivalents thereof.

10: Data storage determination unit 20: Count value storage unit
30: Data recording unit 40: Data reading unit
50: control unit 100: control device
200: RAM 300: Flash memory

Claims (14)

A control device for controlling data recording and reading of a flash memory,
A data storage determination unit that determines whether there is data to be stored in the flash memory among data stored in the RAM according to the system operation;
A count value storing unit for storing the count value incremented when it is determined that there is data to be stored;
A data recording unit for recording the data to be stored, the count values being incremented in a first flash area and a second flash area, respectively, of the flash memory;
When the data recorded in the first flash area and the second flash area are read, the count value included in the data written respectively in the first flash area and the second flash area is read to compare the magnitude of the count value, A data reading unit for selecting the data and reading the selected data; And
A control unit for controlling the data storage determination unit, the count value storage unit, the data recording unit,
/ RTI >
Wherein the data recording unit judges whether there is a free space in the storage space for each of the first flash area and the second flash area and sequentially records the data in a spare area starting from a low address
And a control unit for controlling the writing and reading of data in the flash memory.
The method according to claim 1,
The data reading unit selects data to be read,
The data of the first flash area is selected when the count values of the first and second flash areas are the same and the data of the first and second flash areas whose count value is larger is selected when they are different due to the error
And a control unit for controlling the writing and reading of data in the flash memory.
The method according to claim 1,
The data recording unit, when there is no free space in the first flash area,
After storing the data to be stored including the count value in the third flash area previously set, erasing all the storage space of the first flash area and storing the incremented count value recorded in the third flash area Data is read and data is sequentially recorded in a first flash area starting from a low address
And a control unit for controlling the writing and reading of data in the flash memory.
The method according to claim 1,
The data recording unit, when there is no free space in the second flash area,
After storing the data to be stored including the count value in the preset fourth flash area, erasing all the storage space of the second flash area and storing the incremented count value recorded in the fourth flash area Data is read and data is sequentially written in the second flash area starting from the address having a low address
And a control unit for controlling the writing and reading of data in the flash memory.
The method of claim 3,
The data recording unit, when there is no free space in the first flash area,
The method comprising the steps of reading data recorded in the first flash area and comparing the data stored in the first flash area with data stored in the first flash area, The cell is judged to be faulty,
When the data recorded in the compared first flash area is different from the data stored in the RAM, it is determined that the cell of the address of the first flash area in which the data is recorded is faulty and the address of the first flash area is set to the next address And thereafter repeatedly performing the process of sequentially writing data in the first flash area starting from a position having a low address
And a control unit for controlling the writing and reading of data in the flash memory.
5. The method of claim 4,
The data recording unit, when there is no free space in the second flash area,
After data is sequentially written in the second flash area starting from a low address, data recorded in the second flash area is read and compared with data stored in the RAM to determine whether the address of the second flash area The cell is judged to be faulty,
When the data recorded in the compared second flash area is different from the data stored in the RAM, it is determined that the cell of the address of the second flash area in which the data is recorded is faulty and the address of the second flash area is set to the next address And then repeatedly performing the process of sequentially writing data in the second flash area starting from a position having a low address
And a control unit for controlling the writing and reading of data in the flash memory.
The method according to claim 1,
The data reading unit reads,
When a count value included in data recorded in each of the first flash area and the second flash area is read, if the storage spaces of the first flash area and the second flash area are all cleared, Reading the stored initialization data
And a control unit for controlling the writing and reading of data in the flash memory.
A control method for controlling data recording and reading of a flash memory,
Determining whether there is data to be stored in the flash memory among the data stored in the RAM according to the system operation;
Increasing and storing the set count value when it is determined that there is data to be stored;
Recording the data to be stored, the count value being incremented in a first flash area and a second flash area, respectively, of the flash memory;
Wherein the count value included in the data recorded in each of the first flash area and the second flash area is read to compare the magnitude of the count value when the data recorded in the first flash area and the second flash area are read, Reading the data in the first flash area and reading data having a larger count value out of the first and second flash areas when they are different due to the error
And a control unit for controlling the writing and reading of data in the flash memory.
9. The method of claim 8,
Wherein the recording step comprises:
The first flash area and the second flash area are each judged whether there is a spare space in the storage space and the data is sequentially recorded in a spare space starting from a position having a low address
Wherein the data is read from the flash memory.
10. The method of claim 9,
In the recording step, when there is no free space in the first flash area,
Recording data to be stored including the count value in a preset third flash area;
Erasing all of the storage space of the first flash area;
Reading data to be stored including an incremented count value recorded in the third flash area and sequentially recording data in a first flash area starting from a position having a low address
And a control circuit for controlling the data writing and reading of the flash memory.
10. The method of claim 9,
In the recording step, when there is no free space in the second flash area,
Recording data to be stored including the count value in a preset fourth flash area;
Erasing all the storage spaces of the second flash area;
Reading data to be stored including an incremented count value recorded in the fourth flash area and sequentially recording data in a second flash area starting from a low address;
And a control circuit for controlling the data writing and reading of the flash memory.
11. The method of claim 10,
In the recording step, when there is no free space in the first flash area,
The method of claim 1, wherein the step of writing data in the first flash area sequentially from a low-address area is performed by comparing data stored in the first flash area with data stored in the RAM, Determining whether a cell of the address fails;
If it is determined in the determining step that the data recorded in the first flash area and the data stored in the RAM are different from each other, it is determined that the cell of the address of the first flash area in which the data is recorded is faulty and the address of the first flash area To a next address, and then to the step of sequentially writing data in the first flash area starting from a position having a low address
And a control unit for controlling the writing and reading of data in the flash memory.
12. The method of claim 11,
In the recording step, when there is no free space in the second flash area,
The method as claimed in claim 1, wherein the step of writing data in the second flash area sequentially from a position having a low address reads data recorded in the second flash area to compare the data stored in the second flash area with data stored in the RAM, Determining whether a cell of the address fails;
If the data recorded in the second flash area and the data stored in the RAM are different from each other in the determining step, it is determined that the cell of the address of the second flash area in which the data is recorded is faulty and the address of the second flash area To a next address, and then to the step of writing data to the second flash area sequentially from a low address
And a control unit for controlling the writing and reading of data in the flash memory.
9. The method of claim 8,
When reading the count value included in the data recorded in each of the first flash area and the second flash area in the reading step, if the storage areas of the first flash area and the second flash area are all cleared, Reading the initialization data stored in the set fifth flash area
Wherein the data is read from the flash memory.
KR1020150153241A 2015-11-02 2015-11-02 Apparatus and Method for writing and reading a data on flash memory KR101654709B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020150153241A KR101654709B1 (en) 2015-11-02 2015-11-02 Apparatus and Method for writing and reading a data on flash memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020150153241A KR101654709B1 (en) 2015-11-02 2015-11-02 Apparatus and Method for writing and reading a data on flash memory

Publications (1)

Publication Number Publication Date
KR101654709B1 true KR101654709B1 (en) 2016-09-06

Family

ID=56946268

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020150153241A KR101654709B1 (en) 2015-11-02 2015-11-02 Apparatus and Method for writing and reading a data on flash memory

Country Status (1)

Country Link
KR (1) KR101654709B1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070007265A (en) * 2003-12-30 2007-01-15 쌘디스크 코포레이션 Non-volatile memory and method with control data management
US8255762B2 (en) * 2007-10-03 2012-08-28 Kabushiki Kaisha Toshiba Semiconductor memory device with error correction
KR20130057789A (en) * 2011-11-24 2013-06-03 성균관대학교산학협력단 Storage system and method using double writing based on flash memory
US20140215277A1 (en) * 2013-01-29 2014-07-31 International Business Machines Corporation Selective restoration of data from non-volatile storage to volatile memory

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070007265A (en) * 2003-12-30 2007-01-15 쌘디스크 코포레이션 Non-volatile memory and method with control data management
US8255762B2 (en) * 2007-10-03 2012-08-28 Kabushiki Kaisha Toshiba Semiconductor memory device with error correction
KR20130057789A (en) * 2011-11-24 2013-06-03 성균관대학교산학협력단 Storage system and method using double writing based on flash memory
US20140215277A1 (en) * 2013-01-29 2014-07-31 International Business Machines Corporation Selective restoration of data from non-volatile storage to volatile memory

Similar Documents

Publication Publication Date Title
US6601132B2 (en) Nonvolatile memory and method of writing data thereto
US7774382B2 (en) Method and apparatus for configuring a control device, and corresponding control device
US8694855B1 (en) Error correction code technique for improving read stress endurance
US6405332B1 (en) Storage device and alternate processing method for defective sectors of the same
US8140216B2 (en) Method of detecting manipulation of a programmable memory device of a digital controller
US9311235B2 (en) Method of erasing information stored in a nonvolatile rewritable memory, storage medium and motor vehicle computer
JP4227149B2 (en) Information storage method for electronic control unit
JP4480815B2 (en) Memory rewriting method and computer system
US20130145082A1 (en) Memory access control apparatus and memory access control method
EP2148334B1 (en) Differential flash memory programming technique
US20050207232A1 (en) Access method for a NAND flash memory chip, and corresponding NAND flash memory chip
US9786373B2 (en) EEPROM backup method and device
EP2977907B1 (en) Data storage device, method for storing data, and onboard control device
JP4880105B2 (en) Memory function protection method for control device and control device
US7657795B2 (en) Method and apparatus for writing to a target memory page of a memory
CN112379843B (en) EEPROM data processing method, system, storage medium and terminal
US8225172B2 (en) Error correction scheme for non-volatile memory
KR101654709B1 (en) Apparatus and Method for writing and reading a data on flash memory
US7979736B2 (en) Method for updating nonvolatile memory
US20090077445A1 (en) Nonvolatile storage device, controller of nonvolatile memory, and nonvolatile storage system
CN110781031B (en) Controller data recovery method and device, controller and automobile
US8019931B2 (en) Method and control unit for operating a non-volatile memory, in particular for use in motor vehicles
US8095262B2 (en) Vehicular control apparatus and program storage medium
JP2019160080A (en) Controller and abnormality detection method
US10949128B2 (en) Data protection method

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20190701

Year of fee payment: 4