JP2011175377A - Flash memory control device and method - Google Patents

Flash memory control device and method Download PDF

Info

Publication number
JP2011175377A
JP2011175377A JP2010037839A JP2010037839A JP2011175377A JP 2011175377 A JP2011175377 A JP 2011175377A JP 2010037839 A JP2010037839 A JP 2010037839A JP 2010037839 A JP2010037839 A JP 2010037839A JP 2011175377 A JP2011175377 A JP 2011175377A
Authority
JP
Japan
Prior art keywords
area
data
program
flash memory
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2010037839A
Other languages
Japanese (ja)
Inventor
Yosuke Yamanaka
陽介 山中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics Corp
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 Renesas Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2010037839A priority Critical patent/JP2011175377A/en
Publication of JP2011175377A publication Critical patent/JP2011175377A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To effectively use a flash memory, while increasing data rewriting frequency. <P>SOLUTION: A flash memory control device includes an arithmetic part and the flash memory. The flash memory has a plurality of areas DA1-DA3, PA1-PA3. The plurality of areas DA1-DA3, PA1-PA3 include: the program areas PA1-PA3 which store a program executed by the arithmetic part and wherein rewriting of data is not performed; and the data areas DA1-DA3 which store data and wherein rewriting of the data is performed. When a cumulative frequency at which the data are written reaches a maximum rewriting frequency, the arithmetic part executes exchange processing to a first area allocated as the data area DA3/DA1/DA2. In the exchange processing, the first area and a second area allocated as the program area PA3/PA2/PA1 are exchanged. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、フラッシュメモリを制御するフラッシュメモリ制御装置及び方法に関する。   The present invention relates to a flash memory control apparatus and method for controlling a flash memory.

電子機器にはフラッシュメモリを実装した製品が増加し、電子機器のメンテナンスやデータ領域としてフラッシュメモリを活用する場面が増えてきている。近年では、フラッシュメモリに対して、その有効活用やデータの書き換え回数の増加等の要求が高まってきている。   The number of products equipped with flash memory is increasing in electronic devices, and the number of scenes where flash memory is used as a maintenance and data area for electronic devices is increasing. In recent years, there has been an increasing demand for flash memory to be effectively used and increased in the number of data rewrites.

特開2000−020405号公報には、データの書き換え回数を増加させる技術(従来のフラッシュメモリ制御装置と称する)が記載されている。   Japanese Patent Application Laid-Open No. 2000-020405 describes a technique for increasing the number of data rewrites (referred to as a conventional flash memory control device).

図1は、従来のフラッシュメモリ制御装置101が適用される電子機器の構成を示している。   FIG. 1 shows the configuration of an electronic apparatus to which a conventional flash memory control device 101 is applied.

その電子機器は、従来のフラッシュメモリ制御装置101と、周辺機器103とを具備している。周辺機器103は、通信又は入力による文字、画像を含むデータを取得する。   The electronic device includes a conventional flash memory control device 101 and a peripheral device 103. The peripheral device 103 acquires data including characters and images by communication or input.

従来のフラッシュメモリ制御装置101は、CPU(Central Processing Unit)演算部102と、第1フラッシュメモリ(以下、第1FROMと称する)104と、第2フラッシュメモリ(以下、第2FROMと称する)105とを具備している。   A conventional flash memory control device 101 includes a CPU (Central Processing Unit) computing unit 102, a first flash memory (hereinafter referred to as a first FROM) 104, and a second flash memory (hereinafter referred to as a second FROM) 105. It has.

第1FROM104は、アドレス020000h〜03FFFFhのプログラム記憶エリアに割り当てられている。プログラム記憶エリアは、演算部102により実行されるプログラムが格納され、データの書き換えが行われない。   The first FROM 104 is assigned to the program storage area at addresses 020000h to 03FFFFh. The program storage area stores a program executed by the arithmetic unit 102, and data is not rewritten.

第2FROM105は、アドレス040000h〜05FFFFhの画情報記憶エリアに割り当てられている。画情報記憶エリアは、周辺機器により取得されたデータが格納され、データの書き換えが行われる。   The second FROM 105 is allocated to the image information storage area of addresses 040000h to 05FFFFh. In the image information storage area, data acquired by the peripheral device is stored, and data is rewritten.

演算部102は、第2FROM105が寿命になり、書き換え速度が遅くなった場合、第1FROM104でデータの書き換えを行う。この場合、演算部102は、入れ替え処理を実行する。   The arithmetic unit 102 rewrites data in the first FROM 104 when the second FROM 105 reaches the end of its life and the rewrite speed becomes slow. In this case, the calculation unit 102 performs a replacement process.

図2は、従来のフラッシュメモリ制御装置101の動作として、入れ替え処理を示すフローチャートである。図3Aは、入れ替え処理が実行される前に第1、2FROM104、105にそれぞれ割り当てられたプログラム記憶エリア、画情報記憶エリアを示している。   FIG. 2 is a flowchart showing replacement processing as the operation of the conventional flash memory control apparatus 101. FIG. 3A shows a program storage area and an image information storage area allocated to the first and second FROMs 104 and 105 before the replacement process is executed.

入れ替え処理において、まず、演算部102は、アドレス020000h〜03FFFFhのプログラム記憶エリアに格納されたプログラムを、アドレス040000h〜05FFFFhの画情報記憶エリアに格納する(ステップST401)。即ち、第1FROM104に格納されたプログラムを第2FROM105に格納する。   In the replacement process, first, the calculation unit 102 stores the program stored in the program storage area at addresses 020000h to 03FFFFh in the image information storage area at addresses 040000h to 05FFFFh (step ST401). That is, the program stored in the first FROM 104 is stored in the second FROM 105.

次に、演算部102は、画情報記憶エリア“アドレス040000h〜05FFFFh”、プログラム記憶エリア“アドレス020000h〜03FFFFh”をそれぞれ第1、2FROM104、105として割り当てる(ステップST402)。即ち、第1、2FROM104、105を入れ替える。   Next, the operation unit 102 assigns the image information storage area “addresses 040000h to 05FFFFh” and the program storage area “addresses 020000h to 03FFFFh” as the first and second FROMs 104 and 105, respectively (step ST402). That is, the first and second FROMs 104 and 105 are exchanged.

次に、演算部102は、アドレス040000h〜05FFFFhの画情報記憶エリアに格納されたプログラムを消去する(ステップST403)。即ち、第1FROM104に格納されたプログラムを消去する。   Next, arithmetic unit 102 deletes the program stored in the image information storage area at addresses 040000h to 05FFFFh (step ST403). That is, the program stored in the first FROM 104 is erased.

図3Bは、入れ替え処理が実行された後に第1、2FROM104、105にそれぞれ割り当てられた画情報記憶エリア、プログラム記憶エリアを示している。   FIG. 3B shows the image information storage area and the program storage area assigned to the first and second FROMs 104 and 105, respectively, after the replacement process is executed.

これにより、従来のフラッシュメモリ制御装置101では、第2FROM105が寿命になっても、第1FROM104でデータの書き換えを行うことができるため、フラッシュメモリの寿命を約2倍とすることができる。   Thus, in the conventional flash memory control device 101, even if the second FROM 105 reaches the end of its life, data can be rewritten by the first FROM 104, so that the life of the flash memory can be approximately doubled.

特開2000−020405号公報JP 2000-020405 A

通常、フラッシュメモリは複数の領域を有している。しかし、従来のフラッシュメモリ制御装置101では、第2FROM105の複数の領域の各々に対して最大書き換え回数まで使用しないで、第2FROM105が寿命と判断したときに、入れ替え処理を実行している。   Usually, the flash memory has a plurality of areas. However, in the conventional flash memory control device 101, the replacement process is executed when it is determined that the second FROM 105 has reached the end of life without using the maximum number of rewrites for each of the plurality of areas of the second FROM 105.

即ち、従来のフラッシュメモリ制御装置101では、複数の領域の各々に対して最大書き換え回数まで使用しているか否かを判断しないで、それぞれプログラム、データが格納された第1、2FROM104、105に対して入れ替え処理を実行し、プログラムを第2FROM105に格納している。このように、従来のフラッシュメモリ制御装置101では、2つのフラッシュメモリにより入れ替え処理を実行するため、フラッシュメモリを有効活用しているとはいえない。   That is, in the conventional flash memory control device 101, the first and second FROMs 104 and 105 in which the program and data are stored are determined without determining whether or not the maximum number of rewrites is used for each of the plurality of areas. The replacement process is executed, and the program is stored in the second FROM 105. Thus, in the conventional flash memory control apparatus 101, since the replacement process is executed by two flash memories, it cannot be said that the flash memory is effectively used.

このため、データの書き換え回数を増加させると共に、フラッシュメモリを有効活用することができるフラッシュメモリ制御装置が望まれる。   Therefore, there is a demand for a flash memory control device that can increase the number of data rewrites and can effectively use the flash memory.

以下に、発明を実施するための形態で使用される符号を括弧付きで用いて、課題を解決するための手段を記載する。この符号は、特許請求の範囲の記載と発明を実施するための形態の記載との対応を明らかにするために付加されたものであり、特許請求の範囲に記載されている発明の技術的範囲の解釈に用いてはならない。   In the following, means for solving the problems will be described using the reference numerals used in the embodiments for carrying out the invention in parentheses. This symbol is added to clarify the correspondence between the description of the claims and the description of the mode for carrying out the invention, and the technical scope of the invention described in the claims. Must not be used to interpret

本発明のフラッシュメモリ制御装置(1)は、演算部(2)と、フラッシュメモリ(4)とを具備している。フラッシュメモリ(4)は、複数の領域(DA1〜DA3、PA1〜PA3)を有している。複数の領域(DA1〜DA3、PA1〜PA3)は、演算部(2)により実行されるプログラムが格納され、データの書き換えが行われないプログラム領域(PA1〜PA3)と、データが格納され、データの書き換えが行われるデータ領域(DA1〜DA3)とを含んでいる。演算部(2)は、データ領域(DA3/DA1/DA2)として割り当てられた第1領域(“アドレス080000h〜08FFFFh”/“アドレス060000h〜06FFFFh”/“アドレス070000h〜07FFFFh”)に対して、データが書き込まれた累積回数が最大書き換え回数に達したときに、入れ替え処理を実行する。入れ替え処理では、第1領域(“アドレス080000h〜08FFFFh”/“アドレス060000h〜06FFFFh”/“アドレス070000h〜07FFFFh”)と、プログラム領域(PA3/PA2/PA1)として割り当てられた第2領域(“アドレス050000h〜05FFFFh”/“アドレス040000h〜04FFFFh”/“アドレス030000h〜03FFFFh”)とを入れ替える。   The flash memory control device (1) of the present invention includes a calculation unit (2) and a flash memory (4). The flash memory (4) has a plurality of areas (DA1 to DA3, PA1 to PA3). In a plurality of areas (DA1 to DA3, PA1 to PA3), a program executed by the arithmetic unit (2) is stored, data is not rewritten, data is stored, and data is stored. And data areas (DA1 to DA3) to be rewritten. The calculation unit (2) performs data for the first area ("address 080000h to 08FFFFh" / "address 060000h to 06FFFFh" / "address 070000h to 07FFFFh") assigned as the data area (DA3 / DA1 / DA2). The replacement process is executed when the cumulative number of times of writing reaches the maximum number of rewrites. In the replacement process, the first area (“address 080000h to 08FFFFh” / “address 060000h to 06FFFFh” / “address 070000h to 07FFFFh”) and the second area (“address”) assigned as the program area (PA3 / PA2 / PA1) "050,000h to 05FFFFh" / "address 040000h to 04FFFFh" / "address 030000h to 03FFFFh").

以上により、本発明のフラッシュメモリ制御装置(1)では、第1の効果として、1つのフラッシュメモリに対して、プログラム領域とデータ領域とを含む複数の領域に細分化し、複数の領域の各々に対して最大書き換え回数まで使用しているか否かを判断して入れ替え処理を実行するため、1つのフラッシュメモリだけで書き換え回数を増やすことができる。   As described above, in the flash memory control device (1) of the present invention, as a first effect, one flash memory is subdivided into a plurality of areas including a program area and a data area, and each of the plurality of areas is divided. On the other hand, since it is determined whether or not the maximum number of times of rewriting is used and the replacement process is executed, the number of times of rewriting can be increased with only one flash memory.

また、本発明のフラッシュメモリ制御装置(1)では、第2の効果として、1つのフラッシュメモリだけで入れ替え処理を実行するため、フラッシュメモリを有効活用しているといえる。   Further, in the flash memory control device (1) of the present invention, as a second effect, it can be said that the flash memory is effectively used because the replacement process is executed with only one flash memory.

このため、本発明のフラッシュメモリ制御装置(1)によれば、データ書き換え回数を増加させると共に、フラッシュメモリを有効活用することができる。   Therefore, according to the flash memory control device (1) of the present invention, the number of data rewrites can be increased and the flash memory can be used effectively.

図1は、従来のフラッシュメモリ制御装置101が適用される電子機器の構成を示している。FIG. 1 shows the configuration of an electronic apparatus to which a conventional flash memory control device 101 is applied. 図2は、従来のフラッシュメモリ制御装置101の動作として、入れ替え処理を示すフローチャートである。FIG. 2 is a flowchart showing replacement processing as the operation of the conventional flash memory control apparatus 101. 図3Aは、入れ替え処理が実行される前に第1、2FROM104、105にそれぞれ割り当てられたプログラム記憶エリア、画情報記憶エリアを示している。FIG. 3A shows a program storage area and an image information storage area allocated to the first and second FROMs 104 and 105 before the replacement process is executed. 図3Bは、入れ替え処理が実行された後に第1、2FROM104、105にそれぞれ割り当てられた画情報記憶エリア、プログラム記憶エリアを示している。FIG. 3B shows the image information storage area and the program storage area assigned to the first and second FROMs 104 and 105, respectively, after the replacement process is executed. 図4は、本発明の実施形態によるフラッシュメモリ制御装置1が適用される電子機器の構成を示している。FIG. 4 shows a configuration of an electronic apparatus to which the flash memory control device 1 according to the embodiment of the present invention is applied. 図5は、フラッシュメモリ4のデータ領域DA1〜DA3を示している。FIG. 5 shows the data areas DA1 to DA3 of the flash memory 4. 図6は、プログラム領域アドレス管理テーブル6を示している。FIG. 6 shows the program area address management table 6. 図7は、本発明の実施形態によるフラッシュメモリ制御装置1の動作を示すフローチャートである。FIG. 7 is a flowchart showing the operation of the flash memory control device 1 according to the embodiment of the present invention. 図8Aは、1回目の入れ替え処理が実行された後のプログラム領域アドレス管理テーブル6を示している。FIG. 8A shows the program area address management table 6 after the first replacement process is executed. 図8Bは、2回目の入れ替え処理が実行された後のプログラム領域アドレス管理テーブル6を示している。FIG. 8B shows the program area address management table 6 after the second replacement process is executed. 図8Cは、3回目の入れ替え処理が実行された後のプログラム領域アドレス管理テーブル6を示している。FIG. 8C shows the program area address management table 6 after the third replacement process is executed. 図9Aは、1回目の入れ替え処理が実行される前のフラッシュメモリ4の複数の領域PA1、PA2、PA3、DA1、DA2、DA3を示している。FIG. 9A shows a plurality of areas PA1, PA2, PA3, DA1, DA2, and DA3 of the flash memory 4 before the first replacement process is executed. 図9Bは、1回目の入れ替え処理が実行された後(2回目の入れ替え処理が実行される前)のフラッシュメモリ4の複数の領域PA1、PA2、DA3、DA1、DA2、PA3を示している。FIG. 9B shows a plurality of areas PA1, PA2, DA3, DA1, DA2, and PA3 of the flash memory 4 after the first replacement process is executed (before the second replacement process is executed). 図9Cは、2回目の入れ替え処理が実行された後(3回目の入れ替え処理が実行される前)のフラッシュメモリ4の複数の領域PA1、DA1、DA3、PA2、DA2、PA3を示している。FIG. 9C shows a plurality of areas PA1, DA1, DA3, PA2, DA2, and PA3 of the flash memory 4 after the second replacement process is executed (before the third replacement process is executed). 図9Dは、3回目の入れ替え処理が実行された後(4回目の入れ替え処理が実行される前)のフラッシュメモリ4の複数の領域DA2、DA1、DA3、PA2、PA1、PA3を示している。FIG. 9D shows a plurality of areas DA2, DA1, DA3, PA2, PA1, and PA3 of the flash memory 4 after the third replacement process is executed (before the fourth replacement process is executed). 図9Eは、最大書き換え回数まで使用されたフラッシュメモリ4の複数の領域DA2、DA1、DA3、PA2、PA1、PA3を示している。FIG. 9E shows a plurality of areas DA2, DA1, DA3, PA2, PA1, PA3 of the flash memory 4 used up to the maximum number of rewrites. 図10Aは、1回目の入れ替え処理が実行される前のフラッシュメモリ4の複数の領域PA1、PA2、DA1を示している。FIG. 10A shows a plurality of areas PA1, PA2, and DA1 of the flash memory 4 before the first replacement process is executed. 図10Bは、1回目の入れ替え処理が実行された後(2回目の入れ替え処理が実行される前)のフラッシュメモリ4の複数の領域PA1、PA2、DA1を示している。FIG. 10B shows a plurality of areas PA1, PA2, and DA1 of the flash memory 4 after the first replacement process is executed (before the second replacement process is executed). 図10Cは、2回目の入れ替え処理が実行された後(3回目の入れ替え処理が実行される前)のフラッシュメモリ4の複数の領域PA1、PA2、DA1を示している。FIG. 10C shows a plurality of areas PA1, PA2, and DA1 of the flash memory 4 after the second replacement process (before the third replacement process is executed). 図11Aは、複数の領域のうちのデータ領域が4セクタ(セクタS10〜S13)で構成されているものとし、1セクタが4KBである場合、16KBのデータ領域を示している。FIG. 11A shows that a data area of a plurality of areas is composed of four sectors (sectors S10 to S13), and when one sector is 4 KB, a data area of 16 KB is shown. 図11Bは、複数の領域のうちのデータ領域が4セクタ(セクタS20〜S27)で構成されているものとし、1セクタが4KBである場合、32KBのデータ領域を示している。FIG. 11B shows that a data area of a plurality of areas is composed of 4 sectors (sectors S20 to S27), and when one sector is 4 KB, a data area of 32 KB is shown.

以下に添付図面を参照して、本発明の実施形態によるフラッシュメモリ制御装置について詳細に説明する。   Hereinafter, a flash memory control device according to an embodiment of the present invention will be described in detail with reference to the accompanying drawings.

図4は、本発明の実施形態によるフラッシュメモリ制御装置1が適用される電子機器の構成を示している。   FIG. 4 shows a configuration of an electronic apparatus to which the flash memory control device 1 according to the embodiment of the present invention is applied.

その電子機器は、本発明の実施形態によるフラッシュメモリ制御装置1と、周辺機器とを具備している。周辺機器は、通信又は入力による文字、画像を含むデータを取得する。   The electronic device includes a flash memory control device 1 according to an embodiment of the present invention and peripheral devices. The peripheral device acquires data including characters and images by communication or input.

本発明の実施形態によるフラッシュメモリ制御装置1は、CPU(Central Processing Unit)である演算部2と、フラッシュメモリ4とを具備している。   A flash memory control device 1 according to an embodiment of the present invention includes a calculation unit 2 that is a CPU (Central Processing Unit) and a flash memory 4.

フラッシュメモリ4は複数の領域を有している。   The flash memory 4 has a plurality of areas.

複数の領域は、データの書き換えが行われないプログラム領域と、データの書き換えが行われるデータ領域とを含んでいる。   The plurality of areas include a program area where data is not rewritten and a data area where data is rewritten.

プログラム領域には、演算部2により実行されるプログラムが格納されている。   In the program area, a program executed by the calculation unit 2 is stored.

データ領域には、周辺機器103により取得されたデータが格納される。   Data acquired by the peripheral device 103 is stored in the data area.

以下、説明の都合上、フラッシュメモリ4の複数の領域のうちのデータ領域の個数を3とし、それぞれデータ領域DA1〜DA3と称する。同様に、フラッシュメモリ4の複数の領域のうちのプログラム領域の個数を3とし、それぞれプログラム領域PA1〜PA3と称する。   Hereinafter, for convenience of explanation, the number of data areas in the plurality of areas of the flash memory 4 is 3, which will be referred to as data areas DA1 to DA3, respectively. Similarly, the number of program areas in the plurality of areas of the flash memory 4 is 3, which will be referred to as program areas PA1 to PA3, respectively.

演算部2は、自身がデータを処理するときに参照するための書き換え回数管理テーブル5を備えている。図5は、書き換え回数管理テーブル5を示している。書き換え回数管理テーブル5には、複数の領域DA1〜DA3、PA1〜PA3の各々に対して、累積回数が格納されている。累積回数は、その初期値が0であり、且つ、データが書き込まれる回数を表している。   The calculation unit 2 includes a rewrite count management table 5 that is referred to when it itself processes data. FIG. 5 shows the rewrite count management table 5. The rewrite count management table 5 stores the cumulative count for each of the plurality of areas DA1 to DA3 and PA1 to PA3. The cumulative number represents the number of times the initial value is 0 and data is written.

演算部2は、自身がプログラムを実行するときに参照するためのプログラム領域アドレス管理テーブル6を備えている。図6は、プログラム領域アドレス管理テーブル6を示している。プログラム領域アドレス管理テーブル6には、プログラム領域PA1〜PA3のアドレスと、プログラムの長さ(レングス)を表す情報とが格納されている。   The calculation unit 2 includes a program area address management table 6 for reference when executing the program. FIG. 6 shows the program area address management table 6. The program area address management table 6 stores the addresses of the program areas PA1 to PA3 and information indicating the length (length) of the program.

演算部2は、フラッシュメモリ4のデータ領域DA1〜DA3として割り当てられた第1領域に対して、データが書き込まれた累積回数が最大書き換え回数に達したときに、第1領域と、プログラム領域PA1〜PA3として割り当てられた第2領域とを入れ替える入れ替え処理を実行する。   When the cumulative number of times the data has been written reaches the maximum number of rewrites with respect to the first area assigned as the data areas DA1 to DA3 of the flash memory 4, the calculation unit 2 and the program area PA1 A replacement process for replacing the second area assigned as .about.PA3 is executed.

図7は、本発明の実施形態によるフラッシュメモリ制御装置1の動作を示すフローチャートである。   FIG. 7 is a flowchart showing the operation of the flash memory control device 1 according to the embodiment of the present invention.

図9Aは、1回目の入れ替え処理が実行される前のフラッシュメモリ4の複数の領域PA1、PA2、PA3、DA1、DA2、DA3を示している。例えば、複数の領域PA1、PA2、PA3、DA1、DA2、DA3のアドレスは、それぞれ、030000h〜03FFFFh、040000h〜04FFFFh、050000h〜05FFFFh、060000h〜06FFFFh、070000h〜07FFFFh、080000h〜08FFFFhである。   FIG. 9A shows a plurality of areas PA1, PA2, PA3, DA1, DA2, and DA3 of the flash memory 4 before the first replacement process is executed. For example, the addresses of the plurality of areas PA1, PA2, PA3, DA1, DA2, and DA3 are 030000h to 03FFFFh, 040000h to 04FFFFh, 050000h to 05FFFFh, 060000h to 06FFFFh, 070000h to 07FFFFh, and 800000h to 08FFFFh, respectively.

(1回目の入れ替え処理)
演算部2は、データ領域DA3として割り当てられた第1領域“アドレス080000h〜08FFFFh”に最新のデータを順次書き込み、その第1領域に書き込みスペースがなくなったときにデータの消去を行い、書き込みスペースを確保する(ステップF1)。
(First replacement process)
The arithmetic unit 2 sequentially writes the latest data to the first area “addresses 800000h to 08FFFFh” assigned as the data area DA3, and erases the data when there is no more writing space in the first area. Secure (step F1).

演算部2は、そのときの書き込みの回数を、書き換え回数管理テーブル5に格納された第1領域“アドレス080000h〜08FFFFh”の累積回数に加算して、この回数を累積回数として第1領域“アドレス080000h〜08FFFFh”を更新する(ステップF2)。   The calculation unit 2 adds the number of times of writing at that time to the cumulative number of times of the first area “addresses 080000h to 08FFFFh” stored in the rewrite number management table 5, and uses this number as the cumulative number of times in the first area “address "080000h to 08FFFFh" are updated (step F2).

演算部2は、書き換え回数管理テーブル5を参照して、第1領域“アドレス080000h〜08FFFFh”の累積回数が最大書き換え回数に達しているか否かを判断する(ステップF3)。説明の都合上、最大書き換え回数を50とする。   The computing unit 2 refers to the rewrite count management table 5 to determine whether or not the cumulative number of the first area “addresses 080000h to 08FFFFh” has reached the maximum rewrite count (step F3). For convenience of explanation, the maximum number of rewrites is 50.

ここで、その累積回数が最大書き換え回数“50”に達していないときに(ステップF3−Yes)、演算部2は、再度、ステップF1を実行する。   Here, when the cumulative number does not reach the maximum number of rewrites “50” (step F3-Yes), the calculation unit 2 executes step F1 again.

一方、その累積回数が最大書き換え回数“50”に達したときに(ステップF3−No)、演算部2は、プログラム領域PA1〜PA3の中から、第1領域“アドレス080000h〜08FFFFh”と入れ替え可能な第2領域を選択する。プログラム領域PA1〜PA3のうちの第2領域の累積回数が0を表している場合、第2領域は第1領域“アドレス080000h〜08FFFFh”と入れ替え可能である。この場合、プログラム領域PA1〜PA3の累積回数は0を表しているため、第2領域はプログラム領域PA1〜PA3のどれでもよい。演算部2は、プログラム領域PA1〜PA3の中から、その累積回数が0を表しているプログラム領域PA3“アドレス050000h〜05FFFFh”を第2領域として選択する(ステップF4−Yes)。   On the other hand, when the cumulative number reaches the maximum number of rewrites “50” (step F3-No), the calculation unit 2 can replace the program area PA1 to PA3 with the first area “addresses 800000h to 08FFFFh”. A second region is selected. When the cumulative number of the second area among the program areas PA1 to PA3 represents 0, the second area can be replaced with the first area “addresses 800000h to 08FFFFh”. In this case, since the cumulative number of program areas PA1 to PA3 represents 0, the second area may be any of the program areas PA1 to PA3. The computing unit 2 selects, from the program areas PA1 to PA3, the program area PA3 “addresses 050000h to 05FFFFh” in which the cumulative number represents 0 as the second area (step F4-Yes).

この場合、演算部2は、入れ替え処理を実行する(ステップF5)。   In this case, the calculating part 2 performs a replacement process (step F5).

まず、演算部2は、第1領域“アドレス080000h〜08FFFFh”に格納されたデータを消去する。   First, the calculation unit 2 erases the data stored in the first area “addresses 800000h to 08FFFFh”.

次に、演算部2は、第2領域“アドレス050000h〜05FFFFh”に格納されたプログラムを第1領域“アドレス080000h〜08FFFFh”に格納する。即ち、プログラム領域PA3に格納されたプログラムをデータ領域DA3に格納する。   Next, the calculation unit 2 stores the program stored in the second area “addresses 050000h to 05FFFFh” in the first area “addresses 800000h to 08FFFFh”. That is, the program stored in the program area PA3 is stored in the data area DA3.

次に、演算部2は、第1領域“アドレス080000h〜08FFFFh”、第2領域“アドレス050000h〜05FFFFh”をそれぞれプログラム領域PA3、データ領域DA3として割り当てる。即ち、プログラム領域PA3、データ領域DA3を入れ替える。   Next, the calculation unit 2 allocates the first area “addresses 800000h to 08FFFFh” and the second area “addresses 050000h to 05FFFFh” as the program area PA3 and the data area DA3, respectively. That is, the program area PA3 and the data area DA3 are exchanged.

次に、演算部2は、第2領域“アドレス050000h〜05FFFFh”に格納されたプログラムを消去する。即ち、データ領域DA3に格納されたプログラムを消去する。   Next, the arithmetic unit 2 erases the program stored in the second area “addresses 050000h to 05FFFFh”. That is, the program stored in the data area DA3 is erased.

演算部2は、入れ替え処理を実行したとき、プログラム領域アドレス管理テーブル6に格納されたプログラム領域PA3のアドレスを第2領域のアドレス050000h〜05FFFFhから第1領域のアドレス080000h〜08FFFFhに変更する(ステップF6)。   When executing the replacement process, the arithmetic unit 2 changes the address of the program area PA3 stored in the program area address management table 6 from the address of the second area 050000h to 05FFFFh to the address of the first area 080000h to 08FFFFh (step) F6).

図8Aは、1回目の入れ替え処理が実行された後のプログラム領域アドレス管理テーブル6を示している。   FIG. 8A shows the program area address management table 6 after the first replacement process is executed.

図9Bは、1回目の入れ替え処理が実行された後(2回目の入れ替え処理が実行される前)のフラッシュメモリ4の複数の領域PA1、PA2、DA3、DA1、DA2、PA3を示している。複数の領域PA1、PA2、DA3、DA1、DA2、PA3のアドレスは、それぞれ、030000h〜03FFFFh、040000h〜04FFFFh、050000h〜05FFFFh、060000h〜06FFFFh、070000h〜07FFFFh、080000h〜08FFFFhである。   FIG. 9B shows a plurality of areas PA1, PA2, DA3, DA1, DA2, and PA3 of the flash memory 4 after the first replacement process is executed (before the second replacement process is executed). The addresses of the plurality of areas PA1, PA2, DA3, DA1, DA2, and PA3 are 030000h to 03FFFFh, 040000h to 04FFFFh, 050000h to 05FFFFh, 060000h to 06FFFFh, 070000h to 07FFFFh, and 800000h to 08FFFFh, respectively.

(2回目の入れ替え処理)
演算部2は、データ領域DA1として割り当てられた第1領域“アドレス060000h〜06FFFFh”に最新のデータを順次書き込み、その第1領域に書き込みスペースがなくなったときにデータの消去を行い、書き込みスペースを確保する(ステップF1)。
(Second replacement process)
The arithmetic unit 2 sequentially writes the latest data in the first area “address 060000h to 06FFFFh” assigned as the data area DA1, and erases the data when there is no more writing space in the first area. Secure (step F1).

演算部2は、そのときの書き込みの回数を、書き換え回数管理テーブル5に格納された第1領域“アドレス060000h〜06FFFFh”の累積回数に加算して、この回数を累積回数として第1領域“アドレス060000h〜06FFFFh”を更新する(ステップF2)。   The computing unit 2 adds the number of times of writing at that time to the cumulative number of times of the first area “address 060000h to 06FFFFh” stored in the rewrite count management table 5, and uses this number as the cumulative number of times in the first area “address” "060000h to 06FFFFh" are updated (step F2).

演算部2は、書き換え回数管理テーブル5を参照して、第1領域“アドレス060000h〜06FFFFh”の累積回数が最大書き換え回数“50”に達しているか否かを判断する(ステップF3)。   The computing unit 2 refers to the rewrite count management table 5 to determine whether or not the cumulative number of the first area “addresses 060000h to 06FFFFh” has reached the maximum rewrite count “50” (step F3).

ここで、その累積回数が最大書き換え回数“50”に達していないときに(ステップF3−Yes)、演算部2は、再度、ステップF1を実行する。   Here, when the cumulative number does not reach the maximum number of rewrites “50” (step F3-Yes), the calculation unit 2 executes step F1 again.

一方、その累積回数が最大書き換え回数“50”を超えたときに(ステップF3−No)、演算部2は、プログラム領域PA1〜PA3の中から、第1領域“アドレス060000h〜06FFFFh”と入れ替え可能な第2領域を選択する。プログラム領域PA1〜PA3のうちの第2領域の累積回数が0を表している場合、第2領域は第1領域“アドレス060000h〜06FFFFh”と入れ替え可能である。この場合、プログラム領域PA1、PA2の累積回数は0を表しているため、第2領域はプログラム領域PA1、PA2のどれでもよい。演算部2は、プログラム領域PA1〜PA3の中から、その累積回数が0を表しているプログラム領域PA2“アドレス040000h〜04FFFFh”を第2領域として選択する(ステップF4−Yes)。   On the other hand, when the cumulative number exceeds the maximum number of rewrites “50” (step F3-No), the calculation unit 2 can replace the program area PA1 to PA3 with the first area “addresses 060000h to 06FFFFh”. A second region is selected. When the cumulative number of the second area among the program areas PA1 to PA3 represents 0, the second area can be replaced with the first area “addresses 060000h to 06FFFFh”. In this case, since the cumulative number of program areas PA1 and PA2 represents 0, the second area may be any of the program areas PA1 and PA2. The calculation unit 2 selects, from the program areas PA1 to PA3, the program area PA2 “addresses 040000h to 04FFFFh” in which the cumulative number represents 0 as the second area (step F4-Yes).

この場合、演算部2は、入れ替え処理を実行する(ステップF5)。   In this case, the calculating part 2 performs a replacement process (step F5).

まず、演算部2は、第1領域
“アドレス060000h〜06FFFFh”に格納されたデータを消去する。
First, the calculation unit 2 erases the data stored in the first area “addresses 060000h to 06FFFFh”.

次に、演算部2は、第2領域“アドレス040000h〜04FFFFh”に格納されたプログラムを第1領域“アドレス060000h〜06FFFFh”に格納する。即ち、プログラム領域PA2に格納されたプログラムをデータ領域DA1に格納する。   Next, the calculation unit 2 stores the program stored in the second area “addresses 040000h to 04FFFFh” in the first area “addresses 060000h to 06FFFFh”. That is, the program stored in the program area PA2 is stored in the data area DA1.

次に、演算部2は、第1領域“アドレス060000h〜06FFFFh”、第2領域“アドレス040000h〜04FFFFh”をそれぞれプログラム領域PA2、データ領域DA1として割り当てる。即ち、プログラム領域PA2、データ領域DA1を入れ替える。   Next, the arithmetic unit 2 allocates the first area “addresses 060000h to 06FFFFh” and the second area “addresses 400000h to 04FFFFh” as the program area PA2 and the data area DA1, respectively. That is, the program area PA2 and the data area DA1 are exchanged.

次に、演算部2は、第2領域“アドレス040000h〜04FFFFh”に格納されたプログラムを消去する。即ち、データ領域DA1に格納されたプログラムを消去する。   Next, the arithmetic unit 2 erases the program stored in the second area “addresses 040000h to 04FFFFh”. That is, the program stored in the data area DA1 is erased.

演算部2は、入れ替え処理を実行したとき、プログラム領域アドレス管理テーブル6に格納されたプログラム領域PA2のアドレスを第2領域のアドレス040000h〜04FFFFhから第1領域のアドレス060000h〜06FFFFhに変更する(ステップF6)。   When executing the replacement process, the arithmetic unit 2 changes the address of the program area PA2 stored in the program area address management table 6 from the address of the second area 040000h to 04FFFFh to the address of the first area 060000h to 06FFFFh (step) F6).

図8Bは、2回目の入れ替え処理が実行された後のプログラム領域アドレス管理テーブル6を示している。   FIG. 8B shows the program area address management table 6 after the second replacement process is executed.

図9Cは、2回目の入れ替え処理が実行された後(3回目の入れ替え処理が実行される前)のフラッシュメモリ4の複数の領域PA1、DA1、DA3、PA2、DA2、PA3を示している。複数の領域PA1、DA1、DA3、PA2、DA2、PA3のアドレスは、それぞれ、030000h〜03FFFFh、040000h〜04FFFFh、050000h〜05FFFFh、060000h〜06FFFFh、070000h〜07FFFFh、080000h〜08FFFFhである。   FIG. 9C shows a plurality of areas PA1, DA1, DA3, PA2, DA2, and PA3 of the flash memory 4 after the second replacement process is executed (before the third replacement process is executed). The addresses of the plurality of areas PA1, DA1, DA3, PA2, DA2, and PA3 are 030000h to 03FFFFh, 040000h to 04FFFFh, 050000h to 05FFFFh, 060000h to 06FFFFh, 070000h to 07FFFFh, and 800000h to 08FFFFh, respectively.

(3回目の入れ替え処理)
演算部2は、データ領域DA2として割り当てられた第1領域“アドレス070000h〜07FFFFh”に最新のデータを順次書き込み、その第1領域に書き込みスペースがなくなったときにデータの消去を行い、書き込みスペースを確保する(ステップF1)。
(Third replacement process)
The calculation unit 2 sequentially writes the latest data to the first area “address 070000h to 07FFFFh” assigned as the data area DA2, and erases the data when there is no more writing space in the first area. Secure (step F1).

演算部2は、そのときの書き込みの回数を、書き換え回数管理テーブル5に格納された第1領域“アドレス070000h〜07FFFFh”の累積回数に加算して、この回数を累積回数として第1領域“アドレス070000h〜07FFFFh”を更新する(ステップF2)。   The calculation unit 2 adds the number of times of writing at that time to the cumulative number of times of the first area “address 070000h to 07FFFFh” stored in the rewrite count management table 5, and uses this number as the cumulative number of times in the first area “address” 070000h to 07FFFFh "are updated (step F2).

演算部2は、書き換え回数管理テーブル5を参照して、第1領域“アドレス070000h〜07FFFFh”の累積回数が最大書き換え回数“50”に達しているか否かを判断する(ステップF3)。   The computing unit 2 refers to the rewrite count management table 5 to determine whether or not the cumulative count of the first area “addresses 070000h to 07FFFFh” has reached the maximum rewrite count “50” (step F3).

ここで、その累積回数が最大書き換え回数“50”に達していないときに(ステップF3−Yes)、演算部2は、再度、ステップF1を実行する。   Here, when the cumulative number does not reach the maximum number of rewrites “50” (step F3-Yes), the calculation unit 2 executes step F1 again.

一方、その累積回数が最大書き換え回数“50”を超えたときに(ステップF3−No)、演算部2は、プログラム領域PA1〜PA3の中から、第1領域“アドレス070000h〜07FFFFh”と入れ替え可能な第2領域を選択する。プログラム領域PA1〜PA3のうちの第2領域の累積回数が0を表している場合、第2領域は第1領域“アドレス070000h〜07FFFFh”と入れ替え可能である。この場合、プログラム領域PA1の累積回数は0を表しているため、第2領域はプログラム領域PA1となる。即ち、演算部2は、プログラム領域PA1〜PA3の中から、その累積回数が0を表しているプログラム領域PA1“アドレス030000h〜03FFFFh”を第2領域として選択する(ステップF4−Yes)。   On the other hand, when the cumulative number exceeds the maximum number of rewrites “50” (step F3-No), the calculation unit 2 can replace the program area PA1 to PA3 with the first area “address 070000h to 07FFFFh”. A second region is selected. When the cumulative number of the second area among the program areas PA1 to PA3 represents 0, the second area can be replaced with the first area “address 070000h to 07FFFFh”. In this case, since the cumulative number of times for the program area PA1 represents 0, the second area becomes the program area PA1. That is, the computing unit 2 selects, from the program areas PA1 to PA3, the program area PA1 “address 030000h to 03FFFFh” in which the cumulative number represents 0 as the second area (step F4-Yes).

この場合、演算部2は、入れ替え処理を実行する(ステップF5)。   In this case, the calculating part 2 performs a replacement process (step F5).

まず、演算部2は、第1領域“アドレス070000h〜07FFFFh”に格納されたデータを消去する。   First, the calculation unit 2 erases the data stored in the first area “address 070000h to 07FFFFh”.

次に、演算部2は、第2領域“アドレス030000h〜03FFFFh”に格納されたプログラムを第1領域“アドレス070000h〜07FFFFh”に格納する。即ち、プログラム領域PA1に格納されたプログラムをデータ領域DA2に格納する。   Next, the arithmetic unit 2 stores the program stored in the second area “address 030000h to 03FFFFh” in the first area “address 070000h to 07FFFFh”. That is, the program stored in the program area PA1 is stored in the data area DA2.

次に、演算部2は、第1領域“アドレス070000h〜07FFFFh”、第2領域“アドレス030000h〜03FFFFh”をそれぞれプログラム領域PA1、データ領域DA2として割り当てる。即ち、プログラム領域PA1、データ領域DA2を入れ替える。   Next, the arithmetic unit 2 allocates the first area “addresses 070000h to 07FFFFh” and the second area “addresses 030000h to 03FFFFh” as the program area PA1 and the data area DA2, respectively. That is, the program area PA1 and the data area DA2 are exchanged.

次に、演算部2は、第2領域“アドレス030000h〜03FFFFh”に格納されたプログラムを消去する。即ち、データ領域DA2に格納されたプログラムを消去する。   Next, the calculation unit 2 erases the program stored in the second area “addresses 030000h to 03FFFFh”. That is, the program stored in the data area DA2 is erased.

演算部2は、入れ替え処理を実行したとき、プログラム領域アドレス管理テーブル6に格納されたプログラム領域PA1のアドレスを第2領域のアドレス030000h〜03FFFFhから第1領域のアドレス070000h〜07FFFFhに変更する(ステップF6)。   When executing the replacement process, the calculation unit 2 changes the address of the program area PA1 stored in the program area address management table 6 from the address of the second area from 030000h to 03FFFFh to the address of the first area from 070000h to 07FFFFh (step) F6).

図8Cは、3回目の入れ替え処理が実行された後のプログラム領域アドレス管理テーブル6を示している。   FIG. 8C shows the program area address management table 6 after the third replacement process is executed.

図9Dは、3回目の入れ替え処理が実行された後(4回目の入れ替え処理が実行される前)のフラッシュメモリ4の複数の領域DA2、DA1、DA3、PA2、PA1、PA3を示している。複数の領域PA1、DA1、DA3、PA2、DA2、PA3のアドレスは、それぞれ、“アドレス030000h〜03FFFFh”、“アドレス040000h〜04FFFFh”、“アドレス050000h〜05FFFFh”、“アドレス060000h〜06FFFFh”、“アドレス070000h〜07FFFFh”、“アドレス080000h〜08FFFFh”である。   FIG. 9D shows a plurality of areas DA2, DA1, DA3, PA2, PA1, and PA3 of the flash memory 4 after the third replacement process is executed (before the fourth replacement process is executed). The addresses of the plurality of areas PA1, DA1, DA3, PA2, DA2, and PA3 are “address 030000h to 03FFFFh”, “address 040000h to 04FFFFh”, “address 050000h to 05FFFFh”, “address 060000h to 06FFFFh”, and “address”, respectively. 070000h to 07FFFFh "and" Address 080000h to 08FFFFh ".

このように、本発明の実施形態によるフラッシュメモリ制御装置1では、演算部2がステップF1〜F6を繰り返すことにより、複数の領域PA1〜PA3、DA1〜DA3の全てに対して最大書き換え回数まで使用することができる。図9Eは、最大書き換え回数まで使用されたフラッシュメモリ4の複数の領域DA2、DA1、DA3、PA2、PA1、PA3を示している。この場合、複数の領域DA2、DA1、DA3、PA2、PA1、PA3の累積回数は全て“50”を表している(ステップF4−No)。   As described above, in the flash memory control device 1 according to the embodiment of the present invention, when the calculation unit 2 repeats steps F1 to F6, all the areas PA1 to PA3 and DA1 to DA3 are used up to the maximum number of rewrites. can do. FIG. 9E shows a plurality of areas DA2, DA1, DA3, PA2, PA1, PA3 of the flash memory 4 used up to the maximum number of rewrites. In this case, the cumulative number of the plurality of areas DA2, DA1, DA3, PA2, PA1, PA3 all represents “50” (step F4-No).

なお、上述では、複数の領域として、データ領域DA1〜DA3とプログラム領域PA1〜PA3とを例にして、データ領域とプログラム領域とが同数である場合について説明しているが、データ領域とプログラム領域との数が異なっていても実現できる。   In the above description, the data areas DA1 to DA3 and the program areas PA1 to PA3 are exemplified as the plurality of areas, and the case where the number of the data areas and the program areas is the same is described. It can be realized even if the number is different.

例えば、図10Aに示されるように、1回目の入れ替え処理が実行される前のフラッシュメモリ4の複数の領域が領域PA1、PA2、DA1であるものとする。この場合、1回目の入れ替え処理が実行される場合、図10Bに示されるように、演算部2は、プログラム領域PA2、データ領域DA1を入れ替え、2回目の入れ替え処理が実行される場合、図10Cに示されるように、演算部2は、プログラム領域PA1、データ領域DA1を入れ替えればよい。   For example, as shown in FIG. 10A, it is assumed that a plurality of areas of the flash memory 4 before the first replacement process is performed are areas PA1, PA2, and DA1. In this case, when the first replacement process is performed, as illustrated in FIG. 10B, the calculation unit 2 replaces the program area PA2 and the data area DA1, and when the second replacement process is performed, As shown in FIG. 4, the calculation unit 2 may replace the program area PA1 and the data area DA1.

ここで、データの書き換え回数を図11A、11Bを用いて説明する。   Here, the number of data rewrites will be described with reference to FIGS. 11A and 11B.

図11Aは、複数の領域のうちのデータ領域が4セクタ(セクタS10〜S13)で構成されているものとし、1セクタが4KBである場合、16KBのデータ領域を示している。これを(A)の場合と称する。   FIG. 11A shows that a data area of a plurality of areas is composed of four sectors (sectors S10 to S13), and when one sector is 4 KB, a data area of 16 KB is shown. This is referred to as (A).

例えば、セクタS11が、データの書き換え回数として“最悪”となる最大書き換え回数に達すると、入れ替え処理が実行される。セクタS11が書き換え最大書き換え回数である50回の書き換えを行うまでに、セクタS11以外の特性の良いセクタS11〜S13の書き換えが40回行われるものとすると、全書き換え回数は、
全書き換え回数=50回×1セクタ+40回×3セクタ=170回
(MAX:50回×4セクタ=200回)
により表される。
For example, when the sector S11 reaches the maximum number of rewrites that is “worst” as the number of data rewrites, the replacement process is executed. If rewriting of sectors S11 to S13 having good characteristics other than the sector S11 is performed 40 times before the rewriting of 50 times that is the maximum number of rewritings of the sector S11 is performed,
Total number of rewrites = 50 times × 1 sector + 40 times × 3 sectors = 170 times (MAX: 50 times × 4 sectors = 200 times)
It is represented by

図11Bは、複数の領域のうちのデータ領域が4セクタ(セクタS20〜S27)で構成されているものとし、1セクタが4KBである場合、32KBのデータ領域を示している。これを(B)の場合と称する。   FIG. 11B shows that a data area of a plurality of areas is composed of 4 sectors (sectors S20 to S27), and when one sector is 4 KB, a data area of 32 KB is shown. This is referred to as the case (B).

例えば、セクタS22が、データの書き換え回数として“最悪”となる最大書き換え回数に達すると、入れ替え処理が実行される。セクタS22が書き換え最大書き換え回数である50回の書き換えを行うまでに、セクタS22以外の特性の良いセクタS20、S21、S23〜S27の書き換えが40回行われるものとすると、全書き換え回数は、
全書き換え回数=50回×1セクタ+40回×7セクタ=330回
(MAX:50回×8セクタ=400回)
により表される。
For example, when the sector S22 reaches the maximum number of rewrites that is “worst” as the number of data rewrites, the replacement process is executed. If rewriting of sectors S20, S21, and S23 to S27 having good characteristics other than the sector S22 is performed 40 times before the sector S22 performs 50 rewritings, which is the maximum number of rewritings,
Total number of rewrites = 50 times × 1 sector + 40 times × 7 sectors = 330 times (MAX: 50 times × 8 sectors = 400 times)
It is represented by

このように、本発明の実施形態によるフラッシュメモリ制御装置1によれば、(A)、(B)の場合から、領域の数が増加すればするほど、データの書き換え回数が増加することが分かる。   Thus, according to the flash memory control device 1 according to the embodiment of the present invention, it can be seen from (A) and (B) that the number of data rewrites increases as the number of regions increases. .

また、従来のフラッシュメモリ制御装置101と本発明の実施形態によるフラッシュメモリ制御装置1との書き換え回数の差を具体的に挙げる。   Further, the difference in the number of rewrites between the conventional flash memory control device 101 and the flash memory control device 1 according to the embodiment of the present invention will be specifically described.

1セクタサイズ4KB、全フラッシュメモリ1MB、1セクタの書き換え回数100回、入れ替え領域512KBの1セクタ辺りの平均書き換え回数を95回とした場合、従来のフラッシュメモリ制御装置101では、トータルの書き換え回数が24320回(256セクタ×95回)であるのに対して、本発明の実施形態によるフラッシュメモリ制御装置1ではトータルの書き換え回数が25600回(256セクタ×100回)となる。   When one sector size is 4 KB, all flash memories are 1 MB, the rewrite frequency of one sector is 100 times, and the average rewrite frequency per sector of the replacement area 512 KB is 95 times, the conventional flash memory control device 101 has a total rewrite frequency of In contrast to the 24320 times (256 sectors × 95 times), in the flash memory control device 1 according to the embodiment of the present invention, the total number of rewrites is 25600 times (256 sectors × 100 times).

このように、本発明の実施形態によるフラッシュメモリ制御装置1によれば、データ領域とプログラム領域の数を増加することで、1つのフラッシュメモリだけで書き換え回数を増やすことができる。   Thus, according to the flash memory control device 1 according to the embodiment of the present invention, the number of rewrites can be increased with only one flash memory by increasing the number of data areas and program areas.

以上の説明により、本発明の実施形態によるフラッシュメモリ制御装置1では、第1の効果として、1つのフラッシュメモリに対して、プログラム領域とデータ領域とを含む複数の領域に細分化し、複数の領域の各々に対して最大書き換え回数まで使用しているか否かを判断して入れ替え処理を実行するため、1つのフラッシュメモリだけで書き換え回数を増やすことができる。   As described above, in the flash memory control device 1 according to the embodiment of the present invention, as a first effect, a single flash memory is subdivided into a plurality of areas including a program area and a data area, and a plurality of areas are divided. Therefore, it is possible to increase the number of times of rewriting with only one flash memory.

また、本発明の実施形態によるフラッシュメモリ制御装置1では、第2の効果として、1つのフラッシュメモリだけで入れ替え処理を実行するため、フラッシュメモリを有効活用しているといえる。   Moreover, in the flash memory control device 1 according to the embodiment of the present invention, as a second effect, it can be said that the flash memory is effectively utilized because the replacement process is executed with only one flash memory.

このため、本発明の実施形態によるフラッシュメモリ制御装置1によれば、データ書き換え回数を増加させると共に、フラッシュメモリを有効活用することができる。   Therefore, according to the flash memory control device 1 according to the embodiment of the present invention, the number of data rewrites can be increased and the flash memory can be used effectively.

1 フラッシュメモリ制御装置、
2 演算部(CPU)、
4 フラッシュメモリ、
5 書き換え回数管理テーブル、
6 プログラム領域アドレス管理テーブル、
101 フラッシュメモリ制御装置、
102 演算部(CPU)、
103 周辺機器、
104 フラッシュメモリ、
DA1〜DA3 データ領域、
PA1〜PA3 プログラム領域
1 Flash memory controller,
2 arithmetic unit (CPU),
4 Flash memory,
5 Rewrite count management table,
6 Program area address management table,
101 flash memory control device,
102 arithmetic unit (CPU),
103 peripheral equipment,
104 flash memory,
DA1-DA3 data area,
PA1 to PA3 program area

Claims (13)

演算部と、
前記演算部により実行されるプログラムが格納され、データの書き換えが行われないプログラム領域と、前記データが格納され、前記データの書き換えが行われるデータ領域とを含む複数の領域を有するフラッシュメモリと
を具備し、
前記演算部は、
前記データ領域として割り当てられた第1領域に対して、前記データが書き込まれた累積回数が最大書き換え回数に達したときに、前記第1領域と、前記プログラム領域として割り当てられた第2領域とを入れ替える入れ替え処理を実行する
フラッシュメモリ制御装置。
An arithmetic unit;
A flash memory having a plurality of areas including a program area in which a program executed by the arithmetic unit is stored and data is not rewritten, and a data area in which the data is stored and the data is rewritten Equipped,
The computing unit is
When the cumulative number of times the data has been written reaches the maximum number of rewrites with respect to the first area assigned as the data area, the first area and the second area assigned as the program area A flash memory control device that executes replacement processing for replacement.
前記演算部は、
前記第1領域に対して、前記データが書き込まれた累積回数が前記最大書き換え回数に達したときに、前記入れ替え処理の実行として、
前記第1領域に格納された前記データを消去し、
前記プログラム領域として割り当てられた前記第2領域に格納された前記プログラムを前記第1領域に格納し、
前記第1、2領域をそれぞれ前記プログラム領域、前記データ領域として割り当て、
前記第2領域に格納された前記プログラムを消去する
請求項1に記載のフラッシュメモリ制御装置。
The computing unit is
When the cumulative number of times the data has been written to the first area reaches the maximum number of rewrites, as the execution of the replacement process,
Erasing the data stored in the first area;
Storing the program stored in the second area allocated as the program area in the first area;
The first and second areas are assigned as the program area and the data area, respectively.
The flash memory control device according to claim 1, wherein the program stored in the second area is erased.
前記複数の領域の各々に対して、その初期値が0であり、且つ、前記データが書き込まれる回数を表す累積回数が格納され、前記演算部が前記データを処理するときに参照するための書き換え回数管理テーブル
を更に具備し、
前記演算部は、
前記第1領域の累積回数が前記最大書き換え回数に達していないときに、前記第1領域に前記データを書き込み、そのときの書き込みの回数を前記第1領域の累積回数に加算して、この回数を累積回数とし、
前記第1領域の累積回数が前記最大書き換え回数に達したときに、前記入れ替え処理を実行する
請求項2に記載のフラッシュメモリ制御装置。
For each of the plurality of areas, the initial value is 0, and the accumulated number of times indicating the number of times the data is written is stored, and the rewrite for reference when the arithmetic unit processes the data A frequency management table;
The computing unit is
When the cumulative number of times in the first area has not reached the maximum number of rewrites, the data is written into the first area, and the number of times of writing at that time is added to the cumulative number of times in the first area. Is the cumulative number of times,
The flash memory control device according to claim 2, wherein the replacement process is executed when the cumulative number of times in the first area reaches the maximum number of rewrites.
前記プログラム領域のうちの前記第2領域の累積回数が0を表している場合、前記第2領域は前記第1領域と入れ替え可能であり、
前記演算部は、
前記第1領域に対して、前記データが書き込まれた累積回数が前記最大書き換え回数に達したときに、前記プログラム領域の中から、その累積回数が0を表している前記第2領域を選択し、前記入れ替え処理を実行する
請求項2又は3に記載のフラッシュメモリ制御装置。
If the cumulative number of the second area of the program area represents 0, the second area can be replaced with the first area,
The computing unit is
When the cumulative number of times the data has been written reaches the maximum number of rewrites with respect to the first area, the second area in which the cumulative number represents 0 is selected from the program area. The flash memory control device according to claim 2, wherein the replacement process is executed.
前記プログラム領域のアドレスが格納され、前記演算部が前記プログラムを実行するときに参照するためのプログラム領域アドレス管理テーブル
を更に具備し、
前記入れ替え処理を実行したとき、前記プログラム領域アドレス管理テーブルに格納された前記プログラム領域のアドレスを前記第2領域のアドレスから前記第1領域のアドレスに変更する
請求項1〜4のいずれかに記載のフラッシュメモリ制御装置。
An address of the program area is stored, and further includes a program area address management table for reference when the arithmetic unit executes the program,
5. The address of the program area stored in the program area address management table is changed from the address of the second area to the address of the first area when the replacement process is executed. 6. Flash memory controller.
前記プログラム領域アドレス管理テーブルには、前記プログラム領域のアドレスに対応付けて、前記プログラムの長さを表す情報が更に格納されている
請求項5に記載のフラッシュメモリ制御装置。
6. The flash memory control device according to claim 5, wherein the program area address management table further stores information indicating the length of the program in association with the address of the program area.
請求項1〜6のいずれかに記載のフラッシュメモリ制御装置と、
通信又は入力による文字、画像を含む前記データを取得する周辺機器と
を具備する電子機器。
A flash memory control device according to any one of claims 1 to 6,
An electronic device comprising: a peripheral device that acquires the data including characters and images by communication or input.
演算部により実行されるプログラムが格納され、データの書き換えが行われないプログラム領域と、前記データが格納され、前記データの書き換えが行われるデータ領域とを含む複数の領域を有するフラッシュメモリを、前記演算部が制御する方法であって、
前記データ領域として割り当てられた第1領域に対して、前記データが書き込まれた累積回数が最大書き換え回数に達しているか否かを判断するステップと、
前記第1領域に対して、前記データが書き込まれた累積回数が最大書き換え回数に達したときに、前記第1領域と、前記プログラム領域として割り当てられた第2領域とを入れ替える入れ替え処理を実行するステップと
を具備するフラッシュメモリ制御方法。
A flash memory having a plurality of areas including a program area in which a program executed by the arithmetic unit is stored and data is not rewritten, and a data area in which the data is stored and the data is rewritten, A method controlled by a calculation unit,
Determining whether the cumulative number of times the data has been written has reached the maximum number of rewrites for the first area allocated as the data area;
When the cumulative number of times the data has been written reaches the maximum number of rewrites, the first area and the second area allocated as the program area are exchanged for the first area. And a flash memory control method.
前記入れ替え処理を実行するステップは、
前記第1領域に格納された前記データを消去するステップと、
前記プログラム領域として割り当てられた前記第2領域に格納された前記プログラムを前記第1領域に格納するステップと、
前記第1、2領域をそれぞれ前記プログラム領域、前記データ領域として割り当て、
前記第2領域に格納された前記プログラムを消去するステップと
を含む請求項8に記載のフラッシュメモリ制御方法。
The step of executing the replacement process includes:
Erasing the data stored in the first area;
Storing the program stored in the second area allocated as the program area in the first area;
The first and second areas are assigned as the program area and the data area, respectively.
The flash memory control method according to claim 8, further comprising: erasing the program stored in the second area.
前記演算部が前記データを処理するときに、前記複数の領域の各々に対して、その初期値が0であり、且つ、前記データが書き込まれる回数を表す累積回数が格納された書き換え回数管理テーブルを参照するステップと、
前記第1領域の累積回数が前記最大書き換え回数に達していないときに、前記第1領域に前記データを書き込むステップと、
そのときの書き込みの回数を前記第1領域の累積回数に加算して、この回数を累積回数として前記書き換え回数管理テーブルを更新するステップと、
前記第1領域の累積回数が前記最大書き換え回数に達したときに、前記入れ替え処理を実行するステップと
を更に具備する請求項9に記載のフラッシュメモリ制御方法。
When the arithmetic unit processes the data, the rewrite count management table in which the initial value is 0 for each of the plurality of areas and the accumulated count indicating the number of times the data is written is stored. A step of referring to
Writing the data in the first area when the cumulative number of times in the first area has not reached the maximum number of rewrites;
Adding the number of times of writing to the cumulative number of times in the first area, and updating the number of rewrites management table with this number as the cumulative number;
The flash memory control method according to claim 9, further comprising the step of executing the replacement process when the cumulative number of times in the first area reaches the maximum number of rewrites.
前記プログラム領域のうちの前記第2領域の累積回数が0を表している場合、前記第2領域は前記第1領域と入れ替え可能であり、
前記第1領域に対して、前記データが書き込まれた累積回数が前記最大書き換え回数に達したときに、前記プログラム領域の中から、その累積回数が0を表している前記第2領域を選択し、前記入れ替え処理を実行するステップと
を更に具備する請求項9又は10に記載のフラッシュメモリ制御方法。
If the cumulative number of the second area of the program area represents 0, the second area can be replaced with the first area,
When the cumulative number of times the data has been written reaches the maximum number of rewrites with respect to the first area, the second area in which the cumulative number represents 0 is selected from the program area. The flash memory control method according to claim 9, further comprising a step of executing the replacement process.
前記演算部は、前記プログラム領域のアドレスが格納され、前記演算部が前記プログラムを実行するときに参照するためのプログラム領域アドレス管理テーブルを備え、
前記入れ替え処理を実行するステップの後に、前記プログラム領域アドレス管理テーブルに格納された前記プログラム領域のアドレスを前記第2領域のアドレスから前記第1領域のアドレスに変更するステップ
を更に具備する請求項8〜11のいずれかに記載のフラッシュメモリ制御方法。
The arithmetic unit is provided with a program area address management table for storing an address of the program area and for reference when the arithmetic unit executes the program,
9. The method of claim 8, further comprising a step of changing the address of the program area stored in the program area address management table from the address of the second area to the address of the first area after the step of executing the replacement process. The flash memory control method according to any one of to 11.
前記プログラム領域アドレス管理テーブルには、前記プログラム領域のアドレスに対応付けて、前記プログラムの長さを表す情報が更に格納されている
請求項12に記載のフラッシュメモリ制御方法。
13. The flash memory control method according to claim 12, wherein the program area address management table further stores information indicating the length of the program in association with the address of the program area.
JP2010037839A 2010-02-23 2010-02-23 Flash memory control device and method Pending JP2011175377A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010037839A JP2011175377A (en) 2010-02-23 2010-02-23 Flash memory control device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010037839A JP2011175377A (en) 2010-02-23 2010-02-23 Flash memory control device and method

Publications (1)

Publication Number Publication Date
JP2011175377A true JP2011175377A (en) 2011-09-08

Family

ID=44688185

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010037839A Pending JP2011175377A (en) 2010-02-23 2010-02-23 Flash memory control device and method

Country Status (1)

Country Link
JP (1) JP2011175377A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014026511A (en) * 2012-07-27 2014-02-06 Denso Corp Write control method of nonvolatile semiconductor memory device and microcomputer

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000020405A (en) * 1998-06-29 2000-01-21 Matsushita Graphic Communication Systems Inc Device and method for controlling flash memory
JP2000035919A (en) * 1998-07-17 2000-02-02 Victor Co Of Japan Ltd Flash type memory, management device therefor and management method therefor
JP2005071124A (en) * 2003-08-26 2005-03-17 Matsushita Electric Ind Co Ltd Non-volatile memory system
JP2008065646A (en) * 2006-09-08 2008-03-21 Toshiba Corp Flash memory control system and control method thereof
JP2008225576A (en) * 2007-03-08 2008-09-25 Ricoh Co Ltd Control device of nand flash memory
JP2008276646A (en) * 2007-05-02 2008-11-13 Hitachi Ltd Storage device and data management method for storage device
JP2009537904A (en) * 2006-05-15 2009-10-29 サンディスク コーポレイション Nonvolatile memory system to calculate the final period

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000020405A (en) * 1998-06-29 2000-01-21 Matsushita Graphic Communication Systems Inc Device and method for controlling flash memory
JP2000035919A (en) * 1998-07-17 2000-02-02 Victor Co Of Japan Ltd Flash type memory, management device therefor and management method therefor
JP2005071124A (en) * 2003-08-26 2005-03-17 Matsushita Electric Ind Co Ltd Non-volatile memory system
JP2009537904A (en) * 2006-05-15 2009-10-29 サンディスク コーポレイション Nonvolatile memory system to calculate the final period
JP2008065646A (en) * 2006-09-08 2008-03-21 Toshiba Corp Flash memory control system and control method thereof
JP2008225576A (en) * 2007-03-08 2008-09-25 Ricoh Co Ltd Control device of nand flash memory
JP2008276646A (en) * 2007-05-02 2008-11-13 Hitachi Ltd Storage device and data management method for storage device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014026511A (en) * 2012-07-27 2014-02-06 Denso Corp Write control method of nonvolatile semiconductor memory device and microcomputer

Similar Documents

Publication Publication Date Title
JP6016137B2 (en) Solid state drive and method of operation thereof
JP4531742B2 (en) Storage device using nonvolatile memory as cache and operation method thereof
TWI442228B (en) Storage device wear leveling
JP4356686B2 (en) Memory device and memory control method
JP4356782B2 (en) MEMORY DEVICE, MEMORY CONTROL METHOD, AND PROGRAM
JP2007179545A (en) Storage device using nonvolatile memory as cache, and control method therefor
JP2008192154A (en) Memory mapping method and memory mapping system
CN110187832B (en) Data operation method, device and system
JP2012173778A (en) Management device and management method
JP5721901B2 (en) Encryption of memory devices with wear leveling
JP4665539B2 (en) MEMORY CONTROL DEVICE, MEMORY CONTROL METHOD, PROGRAM
JP2011186553A (en) Memory management device
US9037773B2 (en) Methods for processing and addressing data between volatile memory and non-volatile memory in an electronic apparatus
US10628301B1 (en) System and method for optimizing write amplification of non-volatile memory storage media
JP4966418B1 (en) Information processing apparatus and write control method
JP2008225576A (en) Control device of nand flash memory
JP2006011533A (en) Memory card, semiconductor device, and control method of semiconductor memory
JP2011175377A (en) Flash memory control device and method
JP4703753B2 (en) Information processing apparatus, semiconductor memory device, and program
JP2007233838A (en) Control method for memory system
CN107077420B (en) Overlay Erase Block mapping
US8706954B2 (en) Memory management apparatus and memory management method
JP2007199828A (en) Nonvolatile storage device and address management method
JP2013254357A (en) Information processing apparatus and method, and program
KR100514756B1 (en) Cash processing method for writing in flash memory using file system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120725

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130809

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130902

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20140107