JP2008047155A - Batch erasable nonvolatile memory and mobile phone - Google Patents

Batch erasable nonvolatile memory and mobile phone Download PDF

Info

Publication number
JP2008047155A
JP2008047155A JP2007279010A JP2007279010A JP2008047155A JP 2008047155 A JP2008047155 A JP 2008047155A JP 2007279010 A JP2007279010 A JP 2007279010A JP 2007279010 A JP2007279010 A JP 2007279010A JP 2008047155 A JP2008047155 A JP 2008047155A
Authority
JP
Japan
Prior art keywords
data
address information
area
data writing
block
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.)
Granted
Application number
JP2007279010A
Other languages
Japanese (ja)
Other versions
JP4794530B2 (en
Inventor
Hironao Nagayoshi
弘尚 永吉
Shinichi Ishimoto
真一 石本
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 Technology Corp
Renesas Solutions Corp
Original Assignee
Renesas Technology Corp
Renesas Solutions 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 Technology Corp, Renesas Solutions Corp filed Critical Renesas Technology Corp
Priority to JP2007279010A priority Critical patent/JP4794530B2/en
Publication of JP2008047155A publication Critical patent/JP2008047155A/en
Application granted granted Critical
Publication of JP4794530B2 publication Critical patent/JP4794530B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Read Only Memory (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To obtain a batch erasable nonvolatile memory capable of storing data written with high frequency. <P>SOLUTION: The memory includes an address information storing means for storing address information about blank areas in a cluster consisting of a plurality of sectors; a data write means for executing, when receiving a write request of data, processing of writing the data into at least one of the blank areas referring to the address information about the blank areas; and an address information update means for updating the address information associated with the at least one of the blank areas after the data write means completes execution of writing the data. When the sector includes a plurality of data blocks, the data write means refers to a used state flag which is stored in a header area of the sector for indicating a used state of the data block, and executes the process of writing the data into a blank area of the data block. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

この発明は、不揮発データを記録するフラッシュEEPROM(以下、フラッシュメモリという)などの一括消去型不揮発性メモリおよび携帯電話に関するものである。   The present invention relates to a batch erasing nonvolatile memory such as a flash EEPROM (hereinafter referred to as a flash memory) for recording nonvolatile data and a mobile phone.

現在の携帯電話などの組込型システムにおいては、システムのプログラムを格納する場合、ランダムアクセスが可能なフラッシュメモリを用いる一方、書き換え頻度が多いデータや比較的データ量が小さい不揮発データを記録する場合にはEEPROMを用い、また、大規模な不揮発データを記録する場合には、シリアル書き込みによるフラッシュメモリまたはバックアップ電源付きSRAMを用いるようにしている。   In current embedded systems such as mobile phones, when storing system programs, a flash memory that can be randomly accessed is used, while data that is frequently rewritten or non-volatile data that has a relatively small amount of data is recorded. In this case, an EEPROM is used, and when a large amount of nonvolatile data is recorded, a flash memory by serial writing or an SRAM with a backup power source is used.

ここで、EEPROMは、フラッシュメモリに比べて、ビットあたりの記憶素子数が多くビットあたりの単価が増大する。また、バックアップ電源付きSRAMにおいては電源を付けているためコストが増大する。上記の別々に記憶していたデータをフラッシュメモリで記憶することでデバイスの実装面積、及びコストが減少するメリットが生まれる。   Here, the EEPROM has a larger number of storage elements per bit than the flash memory, and the unit price per bit increases. In addition, the SRAM with a backup power supply increases the cost because it is powered. By storing the data stored separately in the flash memory, there is an advantage that the mounting area and cost of the device are reduced.

組込型システムにおける従来のフラッシュメモリは、システムプログラムの書込処理の実行中に、他のシステムプログラムを読み込むことができず、システムプログラムの書き込み時は特殊な処理を施してプログラムを書き込んでいたが、最近、データの書込処理の実行中に、他の書込をしていないエリアからデータを読み込むことができる一括消去型不揮発性メモリ(以下、BGOフラッシュメモリと呼ぶ)の出現により、データを格納していたフラッシュメモリをプログラムが格納されているフラッシュメモリに取り込むことが可能となった。   The conventional flash memory in the embedded system cannot read other system programs during the execution of the system program writing process, and writes the program by performing a special process when writing the system program. However, recently, with the advent of a batch erasable nonvolatile memory (hereinafter referred to as a BGO flash memory) that can read data from other areas where data has not been written during the execution of data writing processing, It is now possible to load the flash memory that stores the program into the flash memory that stores the program.

フラッシュメモリにデータを格納する使用例として特公平7−50558号公報に示すような半導体ディスクがある(図14を参照)。このシステムでは、フラッシュメモリ4を半導体ディスクとして使用し、この半導体ディスクの制御を行うために制御装置1、RAM2、バス制御部3及び内部バス5が設けられているが、フラッシュメモリ4はEEPROMやSRAMにない制限がある。   As a use example of storing data in a flash memory, there is a semiconductor disk as shown in Japanese Patent Publication No. 7-50558 (see FIG. 14). In this system, a flash memory 4 is used as a semiconductor disk, and a control device 1, a RAM 2, a bus control unit 3, and an internal bus 5 are provided to control the semiconductor disk. There are limitations that SRAM does not have.

即ち、データの書き込みが0から1、または、1から0の一方通行である。このため、一度書き込みが完了した場所に再書き込みをする場合は、書き込みたい場所を含むブロックの全体を一括消去して、ブロック全体を0または1にした後、データの書き込みを行う必要がある。このため、EEPROMやSRAMのようにバイト単位で書き込みを行うことが難しい。   That is, data writing is one-way from 0 to 1 or 1 to 0. For this reason, when rewriting to a place where writing has been completed once, it is necessary to erase the entire block including the place to be written at once and set the entire block to 0 or 1 before writing data. For this reason, it is difficult to perform writing in byte units as in EEPROM and SRAM.

従来の一括消去型不揮発性メモリは以上のように構成されているので、データの書込処理が実行された場所を含むブロックの全体を一括消去すれば、再度、同一の場所にデータを書き込むことができるが、フラッシュメモリの消去可能回数はEEPROMと比較して、10分の1程度しか保証されておらず、書換頻度の高いデータの記憶には対応することが困難であるなどの課題があった。   Since the conventional batch erasing type nonvolatile memory is configured as described above, if the entire block including the place where the data writing process is executed is batch erased, the data is written again to the same location. However, the number of erasable times of the flash memory is only guaranteed about one-tenth that of an EEPROM, and there is a problem that it is difficult to cope with storing data with a high rewrite frequency. It was.

この発明は上記のような課題を解決するためになされたもので、書換頻度の高いデータの記憶にも対応することができる一括消去型不揮発性メモリを得ることを目的とする。   The present invention has been made to solve the above-described problems, and an object of the present invention is to obtain a collective erasing nonvolatile memory that can cope with storage of data with high rewrite frequency.

上述した課題を解決し、目的を達成するために、本発明は、複数のセクタから構成されるクラスタにおける未使用領域のアドレス情報を格納するアドレス情報格納手段と、データの書込要求を受けると、その未使用領域のアドレス情報を参照して、その未使用領域に当該データの書込処理を実行するデータ書込手段と、上記データ書込手段がデータの書込処理を実行すると、その未使用領域のアドレス情報を更新するアドレス情報更新手段とを備え、前記データ書込手段は、セクタが複数のデータブロックから構成される場合、セクタのヘッダ領域内に格納されているデータブロックの使用状況を示す使用状況フラグを参照して、そのデータブロックの未使用領域にデータの書込処理を実行することを特徴とする。   In order to solve the above-described problems and achieve the object, the present invention receives address information storage means for storing address information of unused areas in a cluster composed of a plurality of sectors, and a data write request. Referring to the address information of the unused area, the data writing means for executing the data writing process in the unused area, and when the data writing means executes the data writing process, the data writing means Address information updating means for updating address information of the use area, and when the sector is composed of a plurality of data blocks, the data writing means uses the data block stored in the header area of the sector A data write process is executed in an unused area of the data block with reference to the use status flag indicating “.”

以上説明したとおり、この発明によれば、セクタが複数のデータブロックから構成される場合、セクタのヘッダ領域内に格納されているデータブロックの使用状況を示す使用状況フラグを参照して、そのデータブロックの未使用領域にデータの書込処理を実行するように構成したので、1バイトから8バイトの単位で、最大254種類のデータを自由に書き換えることができる効果がある。   As described above, according to the present invention, when a sector is composed of a plurality of data blocks, the data is referred to the usage status flag indicating the usage status of the data block stored in the header area of the sector. Since the data writing process is executed in the unused area of the block, there is an effect that up to 254 types of data can be freely rewritten in units of 1 to 8 bytes.

以下、この発明の実施の一形態を説明する。
実施の形態1.
図1はこの発明の実施の形態1による一括消去型不揮発性メモリを示す構成図であり、図において、11は複数のセクタを有するクラスタから構成されるBGOフラッシュメモリ(アドレス情報格納手段)であり、BGOフラッシュメモリ11の先頭のセクタには未使用領域のアドレス情報が格納されている。12はBGOフラッシュメモリ11を制御するマイクロコンピュータ、13はマイクロコンピュータ12のRAM、14はマイクロコンピュータ12のCPUであり、CPU14は未使用領域のアドレス情報をBGOフラッシュメモリ11の先頭のセクタに格納するアドレス情報格納手段と、データの書込要求を受けると、そのクラスタにおける未使用領域のアドレス情報を参照して、その未使用領域にデータの書込処理を実行するデータ書込手段と、その未使用領域のアドレス情報を更新するアドレス情報更新手段と、各クラスタにIDを登録するID管理手段と、ポインタ構築手段とを構成する。なお、図1のシステムの周辺には、本システムを使用する携帯電話などの周辺デバイスが接続される。
An embodiment of the present invention will be described below.
Embodiment 1 FIG.
FIG. 1 is a block diagram showing a batch erase type nonvolatile memory according to Embodiment 1 of the present invention. In FIG. 1, reference numeral 11 denotes a BGO flash memory (address information storage means) composed of clusters having a plurality of sectors. In the first sector of the BGO flash memory 11, address information of unused areas is stored. Reference numeral 12 denotes a microcomputer that controls the BGO flash memory 11, reference numeral 13 denotes a RAM of the microcomputer 12, and reference numeral 14 denotes a CPU of the microcomputer 12. The CPU 14 stores address information of unused areas in the head sector of the BGO flash memory 11. When the address information storage means receives the data write request, the address information storage means refers to the address information of the unused area in the cluster, and the data writing means executes data write processing in the unused area. Address information updating means for updating the address information of the used area, ID management means for registering an ID in each cluster, and pointer construction means are configured. 1 is connected to peripheral devices such as a mobile phone using the system.

次に動作について説明する。最初に、図2を参照しながらBGOフラッシュメモリ11の物理アドレス、クラスタ管理エリア及びアプリケーションエリアについて説明する。ただし、BGOフラッシュメモリ11は、データを消去するとFFhになり、データの書き換え方向は1から0であるとする。   Next, the operation will be described. First, the physical address, cluster management area, and application area of the BGO flash memory 11 will be described with reference to FIG. However, it is assumed that the BGO flash memory 11 becomes FFh when data is erased, and the data rewrite direction is 1 to 0.

クラスタ管理エリアのクラスタIDは、1バイトで表現され、00h及びFFhを除いた254通りの表現が可能である(アプリケーションが使用するクラスタにはユニークなIDが登録される)。また、FFhが初期状態のためFFhが未使用クラスタID(FFhは書込可能なクラスタであることを示す)、00hが無効クラスタID(00hは書込不可能なクラスタであることを示す)となる。図2の3個のクラスタIDには同じ値が格納され、2以上のクラスタIDが一致するとき、クラスタIDが有効であると判断する。   The cluster ID of the cluster management area is expressed by 1 byte and can be expressed in 254 ways excluding 00h and FFh (a unique ID is registered in the cluster used by the application). Also, since FFh is in an initial state, FFh is an unused cluster ID (FFh indicates a writable cluster), 00h is an invalid cluster ID (00h indicates a non-writable cluster), and Become. The same value is stored in the three cluster IDs in FIG. 2, and when two or more cluster IDs match, it is determined that the cluster ID is valid.

3個のクラスタIDの次にはコピーフラグが1バイト確保され、消去ブロックのクラスタ管理エリアの4バイトを除いたエリアがアプリケーションエリアとなる。このアプリケーションエリアは、アプリケーションが自由に使用することができるエリアである。   Next to the three cluster IDs, 1 byte of the copy flag is secured, and the area excluding the 4 bytes of the cluster management area of the erase block becomes the application area. This application area is an area that an application can use freely.

各アプリケーションは、自分のデータが格納されているアドレスを直接保持することはなく、自分のアプリケーションIDを保持している。制約事項として、このアプリケーションIDは、システムを使用する全てのアプリケーションにおいて唯一のものでなければならない。実際にアプリケーションがBGOフラッシュメモリ11を使用する場合は、自分のアプリケーションIDに一致するクラスタIDを検索して、自分の使用している物理アドレスを検索し、そこからさらに、自分の読み書きしたいデータのアドレスを計算する。   Each application does not directly hold an address where its own data is stored, but holds its own application ID. As a restriction, this application ID must be unique for all applications using the system. When an application actually uses the BGO flash memory 11, it searches for a cluster ID that matches its own application ID, searches for a physical address used by itself, and further determines the data that it wants to read / write. Calculate the address.

BGOフラッシュメモリ11は、データの消去をブロック単位で行う必要があるため、ブロック内のあるエリアのみを消去する場合は、必要データの待避、ブロックの消去、必要データの書き込みを行う必要がある。必要データの待避をRAM13に行うことは、コストの面、BGOフラッシュメモリ11を使う意味、及びデータの信頼性からも望ましいものではない。このためデータの待避は必然的にBGOフラッシュメモリ11上に行うが、そのためにはデータが書き込まれていない未使用領域、即ち、ブランクエリアが必要である。上記操作をデータリクレームと呼び、BGOフラッシュメモリ11において避けて通ることのできない処理である。   Since the BGO flash memory 11 needs to erase data in units of blocks, when erasing only an area in the block, it is necessary to save necessary data, erase the block, and write necessary data. Saving the necessary data to the RAM 13 is not desirable in terms of cost, meaning of using the BGO flash memory 11, and data reliability. For this reason, data is inevitably saved on the BGO flash memory 11, but for this purpose, an unused area in which no data is written, that is, a blank area is required. The above operation is called data reclaim and is a process that cannot be avoided in the BGO flash memory 11.

ここで、図3及び図4を参照しながらデータリクレーム時の処理を説明する。例えば、クラスタAのデータリクレームが必要になると(ステップST1)、クラスタAのアプリケーションは、BGOフラッシュメモリ11上のブランクエリアを検索する(ステップST2)。例えば、クラスタDがブランクエリアである場合には、クラスタDのクラスタIDを参照して、ブランクエリアのアドレスを取得する(ステップST4)。ただし、ブランクエリアが存在しない場合には、無効クラスタを一括消去してブランクエリアを作成し(ステップST3)、そのブランクエリアのアドレスを取得する(ステップST4)。   Here, processing at the time of data reclaim will be described with reference to FIGS. 3 and 4. For example, when data reclaim for cluster A becomes necessary (step ST1), the application of cluster A searches for a blank area on the BGO flash memory 11 (step ST2). For example, if the cluster D is a blank area, the address of the blank area is acquired with reference to the cluster ID of the cluster D (step ST4). However, if there is no blank area, the invalid cluster is erased collectively to create a blank area (step ST3), and the address of the blank area is acquired (step ST4).

そして、ブランクエリアのアドレスを取得すると、クラスタAのアプリケーションは、現在使用中であるクラスタAのコピーフラグを01hにして(ステップST5)、ブランクエリア(クラスタD)に自分のアプリケーションID(1hのID)を登録する(ステップST6)。(図4の中段を参照)   When the address of the blank area is acquired, the application of cluster A sets the copy flag of cluster A currently in use to 01h (step ST5), and its own application ID (ID of 1h) is assigned to the blank area (cluster D). ) Is registered (step ST6). (Refer to the middle of Figure 4)

クラスタAのアプリケーションは、ブランクエリア(クラスタD)に自分のアプリケーションIDを登録すると、必要データをブランクエリアにコピーし(ステップST7)、コピーが完了すると、古いエリアであるクラスタAを一括消去または無効化して、処理を終了する(ステップST8,ST9)。(図4の下段を参照)   When the application of cluster A registers its own application ID in the blank area (cluster D), the necessary data is copied to the blank area (step ST7). When the copying is completed, the cluster A which is the old area is erased or invalidated. And the process ends (steps ST8 and ST9). (See the lower part of Fig. 4)

ただし、データリクレーム中に電源遮断などの障害が発生すると、クラスタIDが同一のクラスタが存在してしまう場合がある。このような場合は、アプリケーションに割り振られたクラスタIDは重複できないという制約事項があるため、システム起動時に取り除く必要がある。   However, if a failure such as power interruption occurs during data reclaim, a cluster with the same cluster ID may exist. In such a case, there is a restriction that the cluster ID assigned to the application cannot be duplicated, so it is necessary to remove it when the system is started.

このため、システム起動時に、重複クラスタの存在をチェックするが、重複クラスタを検出すると、重複クラスタのうち、コピーフラグがFFhであるものを削除する。その理由は、一括消去またはデータの無効化をする前に、システムの障害が発生すると、データリクレームの処理がどこまで完了したかを見極めることが困難である。そのため、コピーフラグを見てコピー元を判断し、コピー先を削除する。コピー元を保持しておけば、データの内容が壊れて書き込みが不可能になる不具合を回避することができるからである。   For this reason, the presence of duplicate clusters is checked when the system is activated. If duplicate clusters are detected, those having a copy flag of FFh among the duplicate clusters are deleted. The reason is that it is difficult to determine how far the data reclaim processing has been completed if a system failure occurs before batch erasure or data invalidation. Therefore, the copy source is determined by looking at the copy flag, and the copy destination is deleted. This is because if the copy source is held, it is possible to avoid a problem that the data contents are broken and cannot be written.

次に、データの書き込み時にデバイスエラー(書込エラー)が発生すると、再度、データの書込処理を実行する必要がある。そのような場合に対処するために、ブランクエリアを2エリア以上用意しておくようにする。また、データの書込エラーが発生すると、書込エラーが発生したクラスタIDを無効クラスタに変更して、新しいブランククラスタを取得し、リクレーム処理を実行する。無効クラスタにおいても、一旦、一括消去を行うと、クラスタの状態が元の正常な状態に戻る場合があるため、電源投入時や、システムが暇な時などに無効エリアを一括消去する。これは、デバイスの突発的なエラーに対して有効な手段である。   Next, when a device error (write error) occurs during data writing, it is necessary to execute data writing processing again. In order to cope with such a case, two or more blank areas are prepared. When a data write error occurs, the cluster ID in which the write error has occurred is changed to an invalid cluster, a new blank cluster is acquired, and reclaim processing is executed. Even in the invalid cluster, once the collective erasure is performed, the cluster state may return to the original normal state. Therefore, the invalid area is erased collectively when the power is turned on or the system is idle. This is an effective means against sudden errors in the device.

図5はアプリケーションにおける内部データを示す構造図である。クラスタはnページのセクタから構成されており、0ページ目にヘッダが確保され、1ページ目以降にデータエリアが確保されている。このうち0ページの先頭4バイトはクラスタIDとコピー用フラグとして使用され、その後ろに32バイトの格納ページ情報が格納される。書き込むデータ長はシステムにて予め決定され、そのシステム内においては不変である。   FIG. 5 is a structural diagram showing internal data in the application. The cluster is composed of sectors of n pages, a header is secured on the 0th page, and a data area is secured on and after the first page. Of these, the first 4 bytes of page 0 are used as a cluster ID and a copy flag, followed by 32 bytes of stored page information. The length of data to be written is predetermined by the system and is not changed in the system.

図7はデータの読み込み手順を示すものであるが、アプリケーションは、クラスタIDを参照して格納ページ情報を読み出し、データが格納されているセクタであるページ番号を取得する。アプリケーションは、例えば、データがxページ目に格納されていることを認識すると、xページ目の先頭位置に格納されている格納位置オフセット情報を参照し、xページの何処にデータが格納されているかを認識する。   FIG. 7 shows a data reading procedure. The application reads the storage page information with reference to the cluster ID, and acquires the page number that is the sector in which the data is stored. For example, when the application recognizes that the data is stored in the x page, the application refers to the storage position offset information stored in the head position of the x page, and where the data is stored in the x page. Recognize

ここで、格納ページ情報と格納位置オフセット情報は、ビットマップフィールドで表記され、両者とも32バイトのエリアを確保し、ビットが256個存在する。各ビットの値は、セクタの使用状態が変化するごとに、1から0に変更される。   Here, the storage page information and the storage position offset information are represented by a bitmap field, both of which secure an area of 32 bytes and have 256 bits. The value of each bit is changed from 1 to 0 every time the use state of the sector changes.

即ち、格納ページ情報については、例えば、1ページ目からxページ目までデータが格納されると、LSBからxビットまで、ビット値が1から0に変更され、0の数のトータルが指定ページに対応する。一方、格納位置オフセット情報については、図6に示すように、データ領域の1バイトと、格納位置オフセット情報の1ビットが対応し、データ領域の先頭バイトから順次データが格納されるごとに、格納位置オフセット情報のLSBから順次1ビットが1から0に変更される。   That is, for the stored page information, for example, when data is stored from the first page to the x page, the bit value is changed from 1 to 0 from LSB to x bit, and the total number of 0 is stored in the designated page. Correspond. On the other hand, as shown in FIG. 6, the storage position offset information corresponds to one byte of the data area and one bit of the storage position offset information, and is stored every time data is sequentially stored from the first byte of the data area. One bit is sequentially changed from 1 to 0 from the LSB of the position offset information.

これにより、アプリケーションは、格納ページ情報における0のビットの合計からデータが格納されているページ番号を認識すると、格納位置オフセット情報のLSBから順次ビットの値をサーチして、データ領域の先頭からどこまでデータが格納されているかを認識する。例えば、格納位置オフセット情報のLSBから24ビットまでが0の場合には、データ領域の先頭から24バイトまでデータが格納されていると認識する。そして、アプリケーションは、データが格納されている最終位置を認識すると、そこからデータ長分前に戻った位置がデータの先頭アドレスであるので、その先頭アドレスからデータを読み出す処理を実行する。   As a result, when the application recognizes the page number in which the data is stored from the total of 0 bits in the stored page information, the application sequentially searches for the value of the bit from the LSB of the storage position offset information, and from where it starts from the beginning of the data area. Recognizes whether data is stored. For example, when the storage position offset information from the LSB to 24 bits is 0, it is recognized that data is stored from the head of the data area to 24 bytes. Then, when the application recognizes the final position where the data is stored, since the position returned by the data length from that position is the start address of the data, the application executes a process of reading data from the start address.

図8はデータの書込手順を示すフローチャートである。まず、アプリケーションは、データの読み出し時と同じ手順で、データが格納されている最終位置を認識すると、そのページ内にブランクエリア(未使用領域)が存在するか否かを調査する(ステップST11)。   FIG. 8 is a flowchart showing a data writing procedure. First, when the application recognizes the final position where data is stored in the same procedure as when reading data, it checks whether or not a blank area (unused area) exists in the page (step ST11). .

ブランクエリアが存在する場合は、データが格納されている最終位置の次の位置を先頭アドレスとして、書込要求に係るデータの書込処理を実行するとともに、格納位置オフセット情報を更新する(ステップST12)。即ち、データが格納されている最終位置の次の位置に対応するビットを1から0に変更する。   If there is a blank area, the next position after the last position where the data is stored is used as the head address, the data writing process related to the write request is executed, and the storage position offset information is updated (step ST12). ). That is, the bit corresponding to the position next to the final position where data is stored is changed from 1 to 0.

一方、現在のページ内にブランクエリアが存在しない場合、クラスタ内に次のページが存在するか否かを調査する(ステップST13)。次のページが存在する場合には、次のページの格納位置オフセット情報を参照して、次のページがブランクであるか否かを調査する(ステップST14)。これは、次のページにおける過去のデータ書込時において、電源遮断等の障害が発生したことがあると、書込途中のデータが残っていることがあるからである(書込途中のデータが残っていると、新たなデータを書き込むことができない不具合が発生する)。   On the other hand, if there is no blank area in the current page, it is investigated whether or not the next page exists in the cluster (step ST13). If the next page exists, the storage position offset information of the next page is referred to and it is checked whether or not the next page is blank (step ST14). This is because during the past data writing in the next page, if a failure such as a power interruption has occurred, the data being written may remain (the data being written is If it remains, there will be a problem that new data cannot be written.)

アプリケーションは、次のページがブランクである場合には、データ領域の先頭位置に、書込要求に係るデータの書込処理を実行するとともに、格納位置オフセット情報を更新する(ステップST15)。また、アプリケーションは、格納ページ情報も更新する(ステップST16)。即ち、次のページに対応するビットを1から0に変更する。   If the next page is blank, the application executes the data write processing related to the write request at the start position of the data area and updates the storage position offset information (step ST15). The application also updates the stored page information (step ST16). That is, the bit corresponding to the next page is changed from 1 to 0.

次のページがブランクでない場合には、更に次のページがブランクであるか否かを調査するが、次のページが存在しなくなると、上述したデータリクレームを実行して、他の未使用クラスタにおける1ページ目のデータ領域の先頭位置に、書込要求に係るデータの書込処理を実行する(ステップST17)。   If the next page is not blank, it is further investigated whether the next page is blank, but if the next page does not exist, the above-mentioned data reclaim is executed and another unused cluster is checked. In step ST17, data write processing relating to the write request is executed at the head position of the data area of the first page.

以上で明らかなように、この実施の形態1によれば、データの書込要求を受けると、未使用領域のアドレス情報を参照して、その未使用領域にデータの書込処理を実行するように構成したので、クラスタに未使用領域が存在する場合には、当該クラスタを一括消去することなく、データの書き込みが可能になり、その結果、BGOフラッシュメモリ11の書換回数が増加する効果を奏する。   As is apparent from the above, according to the first embodiment, when a data write request is received, the address information of the unused area is referred to and the data write process is executed in the unused area. Thus, when an unused area exists in a cluster, data can be written without erasing the cluster at once, and as a result, the number of rewrites of the BGO flash memory 11 is increased. .

実施の形態2.
上記実施の形態1では、ページ内にブランクエリアが存在する場合、既に書き込まれているデータの後ろに詰めて最新のデータを書き込むものについて示したが、即ち、ページ内には複数のデータを格納する領域を確保して、最後に格納されたデータ(最新データ)のみを有効にするものについて示したが、図9に示すように、セクタ(ページ)内に複数のデータブロックを構成し、セクタのヘッダエリア内に格納されているデータブロックの使用状況を示す使用状況フラグ(ページ内使用中ブロックフラグ、ページ内使用済ブロックフラグ)を参照して、各データブロックの未使用領域にデータの書込処理を実行するようにしてもよい。
Embodiment 2. FIG.
In the first embodiment, when there is a blank area in the page, the latest data is written after the already written data. That is, a plurality of data is stored in the page. As shown in FIG. 9, a plurality of data blocks are configured in a sector (page) as shown in FIG. 9, and only the last stored data (latest data) is validated. Referring to the usage flag (in-page used block flag, in-page used block flag) indicating the usage status of the data block stored in the header area, data is written to the unused area of each data block. May be executed.

図9はアプリケーションにおける内部データを示す構造図である。クラスタの全てにページヘッダと、複数個のデータブロックを作成する。ページヘッダにはクラスタIDと、コピー用フラグを先頭におき、その後ろにページ内使用中ブロックフラグを3バイト、ページ内使用済ブロックフラグを3バイトおく。なお、データブロック内には、データNOとデータ領域使用状況を1バイトずつおき、その後ろ8バイトをデータ領域として使用する。   FIG. 9 is a structural diagram showing internal data in the application. Create page headers and multiple data blocks for all clusters. In the page header, a cluster ID and a copy flag are placed at the head, followed by an in-page in-use block flag of 3 bytes and an in-page used block flag of 3 bytes. In the data block, the data NO and the data area usage status are set 1 byte each, and the subsequent 8 bytes are used as the data area.

図10はページ内使用中ブロックフラグ及びページ内使用済ブロックフラグとデータブロックの対応図である。使用中のブロックを検索するには、ページ内使用中ブロックフラグとページ内使用済ブロックフラグの排他的論理和を求め、その結果が1のビットに対応するデータブロックが使用中のデータブロックになる(図10の例では、データブロックP)。   FIG. 10 is a correspondence diagram of the in-page in-use block flag, the in-page used block flag, and the data block. To search for a block in use, an exclusive OR of the in-page in-use block flag and the in-page in-use block flag is obtained, and the data block corresponding to the 1 bit becomes the in-use data block. (Data block P in the example of FIG. 10).

データの読み書きは、データIDを指定することにより行う。このうち、00hは使用済データIDとし、FFhはブランクデータIDとする。その他、254種類のデータIDをとることができる。各IDに割り振られるデータサイズは1バイトから8バイトまでの値をとることができ、プログラム中では、データサイズを変えることがないものとする。   Data is read and written by designating a data ID. Of these, 00h is used data ID, and FFh is blank data ID. In addition, 254 types of data IDs can be taken. The data size allocated to each ID can take a value from 1 byte to 8 bytes, and the data size is not changed in the program.

また、アプリケーションのポインタ構築手段がデータ検索用のポインタ(データを格納しているデータブロックのブロック位置を示すポインタ)をRAM13に作成する。ポインタの内部にはページ番号及びデータエリアのブロック番号を格納する。これを電源投入時などRAM13の内容が消えてしまったときに、全てのデータエリアをサーチして検索し、内容を保持する。   In addition, the pointer construction means of the application creates a pointer for data retrieval (a pointer indicating the block position of the data block storing the data) in the RAM 13. The page number and the block number of the data area are stored inside the pointer. When the contents of the RAM 13 have disappeared, such as when the power is turned on, all data areas are searched and searched, and the contents are retained.

読み出し時は、アプリケーションがデータIDのポインタが示すデータブロックを検索し、データ領域使用状況(図11を参照)を参照してデータの読込処理を実行する。即ち、データ領域使用状況の8ビットがデータ領域の8バイトの使用状況に対応しており、データ領域使用状況のビットが0の場所が使用済の場所である。   At the time of reading, the application searches for the data block indicated by the pointer of the data ID, and executes the data reading process with reference to the data area usage status (see FIG. 11). That is, 8 bits in the data area usage status correspond to the usage status of 8 bytes in the data area, and a location where the data area usage status bit is 0 is a used location.

図12はデータ検索用ポインタの初期ルーチンを示すフローチャートである。電源投入時などの初期ルーチンにおいては、アプリケーションが使用クラスタのアドレスを検索し、ページ内にデータがある場合には、ポインタのデータを更新する(ステップST21〜ST23)。ページ内の使用データの検索方法であるが、全てのブロックを検索すると非常にデータ数が多いため、データの読込時と同様に、ページヘッダのページ内使用中ブロックフラグとページ内使用済ブロックフラグを参照して、使用データを検索する。そして、全てのページの検索が終了するまで、上記の処理を繰り返し(ステップST24,ST25)、最後のページの検索が終了した時点でポインタの作成が完了する。   FIG. 12 is a flowchart showing an initial routine for a data search pointer. In an initial routine such as when the power is turned on, the application searches for the address of the cluster to be used, and if there is data in the page, the pointer data is updated (steps ST21 to ST23). This is a search method for the used data in the page, but if all the blocks are searched, the number of data is very large. Refer to and search for usage data. Then, the above process is repeated until the search for all pages is completed (steps ST24 and ST25), and the creation of the pointer is completed when the search for the last page is completed.

図13はデータの書込手順を示すフローチャートである。まず、アプリケーションは、データが格納されているデータブロックのブランクエリアを検索し、データを書き込むことができるブランクエリアがデータエリア内に存在する場合には、そのデータブロックのデータエリア(ブランクエリア)内にデータの書込処理を実行する(ステップST31,ST32)。   FIG. 13 is a flowchart showing a data writing procedure. First, the application searches for a blank area of a data block in which data is stored. If there is a blank area in the data area where data can be written, the application stores the data block (blank area) in the data block. The data writing process is executed (steps ST31 and ST32).

一方、データを書き込むことができるブランクエリアがデータエリア内に存在しない場合には、他の新しいデータブロックを取得できるか否かを判断する(ステップST33)。新しいデータブロックが取得できた場合、新しいデータブロックにデータNO、データ領域及びページ内使用中ブロックフラグを書き込む処理を実行する(ステップST34,ST35)。また、ページ内使用済ブロックフラグ及びデータブロックのIDの書込も同時に実行する(ステップST36,ST37)。なお、データブロックを新しく取得できない場合には、データリクレームを実行する(ステップST38)。   On the other hand, if there is no blank area in the data area where data can be written, it is determined whether another new data block can be acquired (step ST33). When a new data block can be acquired, a process of writing the data NO, the data area, and the in-page in-use block flag to the new data block is executed (steps ST34 and ST35). The in-page used block flag and the data block ID are simultaneously written (steps ST36 and ST37). If a new data block cannot be acquired, data reclaim is executed (step ST38).

以上で明らかなように、この実施の形態2によれば、セクタが複数のデータブロックから構成される場合、セクタのヘッダ領域内に格納されているデータブロックの使用状況を示す使用状況フラグ(ページ内使用中ブロックフラグ、ページ内使用済ブロックフラグ)等を参照して、そのデータブロックの未使用領域にデータの書込処理を実行するように構成したので、1バイトから8バイトの単位で、最大254種類のデータを自由に書き換えることができる効果を奏する。   As is apparent from the above, according to the second embodiment, when a sector is composed of a plurality of data blocks, a usage status flag (page) indicating the usage status of the data block stored in the header area of the sector. (In-use block flag, in-page used block flag), etc., so that the data write processing is executed in the unused area of the data block, so in units of 1 to 8 bytes, There is an effect that a maximum of 254 types of data can be freely rewritten.

実施の形態3.
上記実施の形態1及び実施の形態2では、BGOフラッシュメモリ11にデータを書き込むものについて示したが、これに限るものではなく、その他の一括消去型不揮発性メモリにおいても使用可能であることは言うまでもない。
Embodiment 3 FIG.
In the first embodiment and the second embodiment, the data write to the BGO flash memory 11 has been described. However, the present invention is not limited to this, and it is needless to say that the present invention can also be used in other batch erasable nonvolatile memories. Yes.

この発明の実施の形態1による一括消去型不揮発性メモリを示す構成図である。BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a configuration diagram showing a batch erase nonvolatile memory according to a first embodiment of the present invention. BGOフラッシュメモリの内部構造及びクラスタ管理エリアを示す説明図である。It is explanatory drawing which shows the internal structure and cluster management area of a BGO flash memory. データリクレームの処理を示すフローチャートである。It is a flowchart which shows the process of a data reclaim. データリクレーム時におけるクラスタIDの割り当てを示す説明図である。It is explanatory drawing which shows allocation of cluster ID at the time of a data reclaim. アプリケーションにおける内部データを示す構造図である。It is a structural diagram which shows the internal data in an application. 格納位置オフセット情報とデータの対応関係を示す説明図である。It is explanatory drawing which shows the correspondence of storage position offset information and data. データの読み込み手順を示す説明図である。It is explanatory drawing which shows the reading procedure of data. データの書込手順を示すフローチャートである。It is a flowchart which shows the writing procedure of data. アプリケーションにおける内部データを示す構造図である。It is a structural diagram which shows the internal data in an application. ページ内使用中ブロックフラグ及びページ内使用済ブロックフラグとデータブロックの対応図である。FIG. 4 is a correspondence diagram of an in-page in-use block flag and an in-page used block flag and a data block. データ領域使用状況とデータ領域の対応図である。It is a correspondence figure of a data area use condition and a data area. データ検索用ポインタの初期ルーチンを示すフローチャートである。It is a flowchart which shows the initial routine of the pointer for a data search. データの書込手順を示すフローチャートである。It is a flowchart which shows the writing procedure of data. フラッシュメモリにデータを格納する半導体ディスクを示す構成図である。It is a block diagram which shows the semiconductor disk which stores data in flash memory.

符号の説明Explanation of symbols

11 BGOフラッシュメモリ(アドレス情報格納手段)、14 CPU(アドレス情報格納手段、データ書込手段、アドレス情報更新手段、ID管理手段、ポインタ構築手段)。   11 BGO flash memory (address information storage means), 14 CPU (address information storage means, data writing means, address information update means, ID management means, pointer construction means).

Claims (4)

複数のセクタから構成されるクラスタにおける未使用領域のアドレス情報を格納するアドレス情報格納手段と、
データの書込要求を受けると、その未使用領域のアドレス情報を参照して、その未使用領域に当該データの書込処理を実行するデータ書込手段と、
上記データ書込手段がデータの書込処理を実行すると、その未使用領域のアドレス情報を更新するアドレス情報更新手段とを備え、
前記データ書込手段は、セクタが複数のデータブロックから構成される場合、セクタのヘッダ領域内に格納されているデータブロックの使用状況を示す使用状況フラグを参照して、そのデータブロックの未使用領域にデータの書込処理を実行することを特徴とする一括消去型不揮発性メモリ。
Address information storage means for storing address information of unused areas in a cluster composed of a plurality of sectors;
When receiving a data write request, referring to the address information of the unused area, data writing means for executing the data writing process in the unused area,
An address information updating unit that updates address information of the unused area when the data writing unit executes data writing processing;
When the sector is composed of a plurality of data blocks, the data writing means refers to the usage status flag indicating the usage status of the data block stored in the header area of the sector, and the data block is not used. A batch erasing nonvolatile memory characterized by executing a data writing process in an area.
データ書込手段は、データブロックに未使用領域が存在しない場合には、他のデータブロックの未使用領域にデータの書込処理を実行することを特徴とする請求項1記載の一括消去型不揮発性メモリ。   2. The collective erasing type nonvolatile memory according to claim 1, wherein the data writing means executes a data writing process in an unused area of another data block when there is no unused area in the data block. Sex memory. データを格納しているデータブロックのブロック位置を示すポインタを揮発性メモリに構築するポインタ構築手段を設けたことを特徴とする請求項2記載の一括消去型不揮発性メモリ。   3. The batch erase type nonvolatile memory according to claim 2, further comprising pointer construction means for constructing a pointer indicating a block position of a data block storing data in the volatile memory. 一括消去型不揮発性メモリを備える携帯電話であって、
前記一括消去型不揮発性メモリは、
複数のセクタから構成されるクラスタにおける未使用領域のアドレス情報を格納するアドレス情報格納手段と、
データの書込要求を受けると、その未使用領域のアドレス情報を参照して、その未使用領域に当該データの書込処理を実行するデータ書込手段と、
上記データ書込手段がデータの書込処理を実行すると、その未使用領域のアドレス情報を更新するアドレス情報更新手段とを備え、
前記データ書込手段は、セクタが複数のデータブロックから構成される場合、セクタのヘッダ領域内に格納されているデータブロックの使用状況を示す使用状況フラグを参照して、そのデータブロックの未使用領域にデータの書込処理を実行することを特徴とする携帯電話。
A mobile phone equipped with a batch erasing nonvolatile memory,
The batch erasing nonvolatile memory is
Address information storage means for storing address information of unused areas in a cluster composed of a plurality of sectors;
When receiving a data write request, referring to the address information of the unused area, data writing means for executing the data writing process in the unused area,
An address information updating unit that updates address information of the unused area when the data writing unit executes data writing processing;
When the sector is composed of a plurality of data blocks, the data writing means refers to the usage status flag indicating the usage status of the data block stored in the header area of the sector, and the data block is not used. A cellular phone characterized by executing a data writing process in an area.
JP2007279010A 2007-10-26 2007-10-26 Semiconductor device and mobile phone Expired - Fee Related JP4794530B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007279010A JP4794530B2 (en) 2007-10-26 2007-10-26 Semiconductor device and mobile phone

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007279010A JP4794530B2 (en) 2007-10-26 2007-10-26 Semiconductor device and mobile phone

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP35503598A Division JP4046877B2 (en) 1998-12-14 1998-12-14 Batch erase nonvolatile memory and mobile phone

Publications (2)

Publication Number Publication Date
JP2008047155A true JP2008047155A (en) 2008-02-28
JP4794530B2 JP4794530B2 (en) 2011-10-19

Family

ID=39180758

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007279010A Expired - Fee Related JP4794530B2 (en) 2007-10-26 2007-10-26 Semiconductor device and mobile phone

Country Status (1)

Country Link
JP (1) JP4794530B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8171208B2 (en) 2008-03-01 2012-05-01 Kabushiki Kaisha Toshiba Memory system
JP2014509003A (en) * 2011-02-02 2014-04-10 マイクロン テクノロジー, インク. Control arrangement and method for accessing block oriented non-volatile memory
CN110688084A (en) * 2019-10-14 2020-01-14 深圳市蓝度汽车电控技术有限公司 First-in first-out FLASH data storage method, system and terminal
US11107539B2 (en) 2018-12-26 2021-08-31 Renesas Electronics Corporation Semiconductor device and its power supply control method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0993523A (en) * 1995-09-28 1997-04-04 Canon Inc Electronic camera
JPH0997217A (en) * 1995-09-28 1997-04-08 Canon Inc Method and device for managing flash rom and computer control equipment
JPH1050084A (en) * 1996-07-31 1998-02-20 Canon Inc Memory controller and memory access method
JPH10124384A (en) * 1996-08-28 1998-05-15 Toshiba Corp Method for controlling non-volatile semiconductor memory
JPH10124381A (en) * 1996-10-21 1998-05-15 Mitsubishi Electric Corp Semiconductor storage device
JPH1185629A (en) * 1997-07-15 1999-03-30 Fujitsu Ltd Managing system for flash memory
JPH11110283A (en) * 1997-08-08 1999-04-23 Toshiba Corp Control method for nonvolatile semiconductor memory system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0993523A (en) * 1995-09-28 1997-04-04 Canon Inc Electronic camera
JPH0997217A (en) * 1995-09-28 1997-04-08 Canon Inc Method and device for managing flash rom and computer control equipment
JPH1050084A (en) * 1996-07-31 1998-02-20 Canon Inc Memory controller and memory access method
JPH10124384A (en) * 1996-08-28 1998-05-15 Toshiba Corp Method for controlling non-volatile semiconductor memory
JPH10124381A (en) * 1996-10-21 1998-05-15 Mitsubishi Electric Corp Semiconductor storage device
JPH1185629A (en) * 1997-07-15 1999-03-30 Fujitsu Ltd Managing system for flash memory
JPH11110283A (en) * 1997-08-08 1999-04-23 Toshiba Corp Control method for nonvolatile semiconductor memory system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8171208B2 (en) 2008-03-01 2012-05-01 Kabushiki Kaisha Toshiba Memory system
JP2014509003A (en) * 2011-02-02 2014-04-10 マイクロン テクノロジー, インク. Control arrangement and method for accessing block oriented non-volatile memory
US11107539B2 (en) 2018-12-26 2021-08-31 Renesas Electronics Corporation Semiconductor device and its power supply control method
CN110688084A (en) * 2019-10-14 2020-01-14 深圳市蓝度汽车电控技术有限公司 First-in first-out FLASH data storage method, system and terminal

Also Published As

Publication number Publication date
JP4794530B2 (en) 2011-10-19

Similar Documents

Publication Publication Date Title
JP4046877B2 (en) Batch erase nonvolatile memory and mobile phone
JP4524309B2 (en) Memory controller for flash memory
JP3692313B2 (en) Nonvolatile memory control method
JP4037605B2 (en) Nonvolatile memory unit controller, memory system having the controller, and nonvolatile memory unit control method
JP4633802B2 (en) Nonvolatile storage device, data read method, and management table creation method
US8762661B2 (en) System and method of managing metadata
USRE45222E1 (en) Method of writing of writing to a flash memory including data blocks and log blocks, using a logical address having a block address portion and page identifying portion, a block address table and a page table
US6865658B2 (en) Nonvolatile data management system using data segments and link information
US10838629B2 (en) Solid state device with fast boot after ungraceful shutdown
JP4245585B2 (en) Memory controller, flash memory system, and flash memory control method
JP2004152302A (en) Method and device for executing block cache in nonvolatile memory system
KR20080037283A (en) System comprising flash memory device and data recovery method thereof
JP4301301B2 (en) Nonvolatile semiconductor memory device and management method thereof
JP2006243780A (en) Memory controller, flash memory system and control method of flash memory
JP2009211215A (en) Memory system
JP5874525B2 (en) Control device, storage device, and storage control method
JP4794530B2 (en) Semiconductor device and mobile phone
JP4242245B2 (en) Flash ROM control device
JP5066894B2 (en) Storage medium control device
JP4661369B2 (en) Memory controller
JPH11272569A (en) Data restoration system for outer storage device using flash memory
JP3826115B2 (en) Storage device, memory management method, and program
JP2004326523A (en) Storage device with rewritable nonvolatile memory, and control method of nonvolatile memory for storage device
JP6040895B2 (en) Microcomputer and non-volatile memory block management method
JP2012037971A (en) Memory controller, nonvolatile memory system provided with memory controller, and method for controlling nonvolatile memory

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20071214

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20100609

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100914

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20101109

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110208

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110328

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110719

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110726

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140805

Year of fee payment: 3

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees