JP2006155144A - Data storage method for nonvolatile memory, computer program and portable terminal - Google Patents
Data storage method for nonvolatile memory, computer program and portable terminal Download PDFInfo
- Publication number
- JP2006155144A JP2006155144A JP2004343698A JP2004343698A JP2006155144A JP 2006155144 A JP2006155144 A JP 2006155144A JP 2004343698 A JP2004343698 A JP 2004343698A JP 2004343698 A JP2004343698 A JP 2004343698A JP 2006155144 A JP2006155144 A JP 2006155144A
- Authority
- JP
- Japan
- Prior art keywords
- sector
- data
- sectors
- bank
- memory
- 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
Links
Images
Abstract
Description
本発明は、携帯電話機を代表とする携帯端末、特にその不揮発性メモリへのデータ保存の方法、そのコンピュータプログラムおよびこれを使用する携帯端末に関する。 The present invention relates to a portable terminal typified by a cellular phone, and more particularly to a method for storing data in a nonvolatile memory thereof, a computer program thereof, and a portable terminal using the same.
携帯電話機は近年、高機能化が進み、単なる通話機能だけでなく、電子メール送受信機能、ウェブ閲覧機能、GPS機能、非接触ICカード機能、等種々の機能を搭載するようになってきている。 In recent years, mobile phones have become more sophisticated and have various functions such as an e-mail transmission / reception function, a web browsing function, a GPS function, and a non-contact IC card function, as well as a simple call function.
携帯端末においては、端末固有の端末ID等の他、このような各種機能に対応するアプリケーション(プログラム)の動作に必要な初期的なデータやパラメータを、電源遮断中にも保持できるように、再書き込み可能な不揮発性(NV: Non-Volatile)メモリに保存している。本明細書では、NVメモリに格納するデータやパラメータをNVアイテムと呼ぶ。再書き込み可能な不揮発性メモリとしては例えばフラッシュメモリが知られている。 In the portable terminal, in addition to the terminal ID unique to the terminal, the initial data and parameters necessary for the operation of the application (program) corresponding to these various functions can be retained even while the power is shut off. It is stored in a writable non-volatile (NV) memory. In this specification, data and parameters stored in the NV memory are referred to as NV items. As a rewritable nonvolatile memory, for example, a flash memory is known.
図13に、従来知られているNVメモリシステムの構成を示す。この従来システムでは、NV領域のサイズに対する厳しい制限を課さないために、ファイルシステム上に構築されている。すなわち、アプリケーションからの要求に応じてNVタスクを実行するNVシステムは、埋込みファイルシステムを用いてデバイスドライバによりNVメモリをアクセスする。 FIG. 13 shows a configuration of a conventionally known NV memory system. This conventional system is built on a file system in order not to place strict restrictions on the size of the NV area. That is, an NV system that executes an NV task in response to a request from an application accesses the NV memory by a device driver using an embedded file system.
他方、NVドライバ(デバイスドライバ)を用いて直接NVメモリ上のNVアイテムにアクセスする手法も考えられる。この場合、NVドライバでNVメモリに対してデータ(NVアイテム)を読み書きする処理単位をセクタと呼ぶ。セクタのサイズは固定(例えば8Kバイト)であり、すべてのNVアイテムは1セクタ内に格納される。この構成により、複雑な処理プログラムであるファイルシステムを不要とすることができる。 On the other hand, a method of directly accessing an NV item on the NV memory using an NV driver (device driver) is also conceivable. In this case, a processing unit for reading / writing data (NV item) from / to the NV memory by the NV driver is called a sector. The sector size is fixed (for example, 8 Kbytes), and all NV items are stored in one sector. With this configuration, a file system that is a complicated processing program can be eliminated.
ファイルシステムを用いずNVドライバで直接NVメモリをアクセスする手法において、NVメモリに設けられるセクタとしては、その用途の違いにより、携帯端末の工場出荷時に書き込まれた後は読み出し専用となるRO(Read Only)セクタと、読み出し及び書き込みが許されるRW(Read Write)セクタとが設けられる。 In the method of directly accessing the NV memory using the NV driver without using the file system, the sector provided in the NV memory is a read-only RO (Read only) after it is written at the time of shipment from the portable terminal due to the difference in its use. Only) sectors and RW (Read Write) sectors that are allowed to be read and written are provided.
図14に示すように、NVアイテムを格納するためのセクタは、通常複数(図では8個、1個あたり8Kバイト)設けられる。これは、NVメモリへのデータの書き込み動作中の電源断などの理由によりデータが破損するような場合の対策として、直前の書き込み時のデータが残存するように、同サイズの複数のセクタを用意しておき、新たなデータの書き込み時には別のセクタに書き込むためである。また、セクタの許容書き込み回数は有限なので、セクタ数を多くすることにより1セクタ当たりの書き込み頻度を軽減し、不揮発性メモリの使用可能な時間を延ばすことができる。 As shown in FIG. 14, a plurality of sectors for storing NV items are usually provided (8 in the figure, 8 Kbytes per sector). This is because as a countermeasure against data corruption due to power interruption during data write operation to NV memory, multiple sectors of the same size are prepared so that the data at the previous write remains. This is because when writing new data, it writes to another sector. In addition, since the allowable number of write operations for a sector is limited, by increasing the number of sectors, the write frequency per sector can be reduced, and the usable time of the nonvolatile memory can be extended.
NVメモリに複数のセクタを用意した場合でも、1時点では有効なセクタが1つだけ存在し、これをアクティブセクタと呼ぶ。このアクティブセクタは全てのNVアイテムの最新の値を記憶している。 Even when a plurality of sectors are prepared in the NV memory, there is only one effective sector at one time point, and this is called an active sector. This active sector stores the latest values of all NV items.
例えば携帯電話機の場合、通常、その機能の追加、新たなデジタル通信技術(例えば高速データ通信サービスのサポート)の採用等の要因により、NVメモリに必要とされるデータ容量は増加していく。 For example, in the case of a mobile phone, the data capacity required for the NV memory usually increases due to factors such as addition of functions and adoption of a new digital communication technology (for example, support for high-speed data communication service).
NVメモリのメモリ容量の節約のみならず、セクタ消去や書き込みに要する時間の短縮の観点、ひいては端末の動作効率の観点からはセクタサイズは小さいことが好ましい。反面、NVアイテムが増加していき、当該セクタサイズに収納しきれない状態となったとき、これは端末の動作上、重大な支障となる。 It is preferable that the sector size is small from the viewpoint of not only saving the memory capacity of the NV memory but also shortening the time required for sector erasing and writing, and in view of the operation efficiency of the terminal. On the other hand, when the number of NV items increases and cannot be accommodated in the sector size, this becomes a serious obstacle to the operation of the terminal.
したがって、セクタサイズはNVアイテムの総データ容量に応じて定めることが好ましい。しかし、端末開発の初期の段階で、NVメモリに将来必要となる最大容量を適正に判断することは、極めて困難である。 Therefore, the sector size is preferably determined according to the total data capacity of the NV item. However, it is extremely difficult to properly determine the maximum capacity required for the NV memory in the early stages of terminal development.
本発明は、このような背景においてなされたものであり、その目的は、不揮発性メモリに保存すべきデータのデータ量の変化に応じて、必要なデータ容量の確保と端末のシステム全体の効率との適切なバランスをとることができる不揮発性メモリのデータ保存方法、コンピュータプログラムおよび携帯端末を提供することにある。 The present invention has been made in such a background, and its purpose is to ensure the necessary data capacity and the efficiency of the entire system of the terminal in accordance with the change in the amount of data to be stored in the nonvolatile memory. It is an object of the present invention to provide a nonvolatile memory data storage method, a computer program, and a portable terminal capable of achieving an appropriate balance.
本発明による不揮発性メモリのデータ保存方法は、携帯端末において利用されるデータを携帯端末内の再書き込み可能な不揮発性メモリに保存するための方法であって、不揮発性メモリ上に、第1のセクタサイズの複数のセクタからなる第1のバンクと、前記第1のセクタサイズより大きいセクタサイズの複数のセクタからなる第2のバンクとを確保するステップと、前記第1のバンクの複数のセクタのうち一時に1つのセクタをアクティブセクタと決定するとともに、前記不揮発性メモリへのデータの書き込みの度に前記第1のバンクの複数のセクタ間でアクティブセクタを更新していくステップと、不揮発性メモリへのデータの書き込みの際に1セクタ内に保存する総データ量をチェックするステップと、チェックされた総データ量が前記第1のセクタサイズのセクタ内に収納しきれないと判断されたとき、前記第2のバンクの複数のセクタの中からアクティブセクタを決定するステップと、不揮発性メモリへのデータの書き込みの際に前記アクティブセクタにデータを書き込むステップとを備えたことを特徴とする。 A non-volatile memory data storage method according to the present invention is a method for storing data used in a mobile terminal in a rewritable non-volatile memory in the mobile terminal. Securing a first bank comprising a plurality of sectors of sector size and a second bank comprising a plurality of sectors having a sector size larger than the first sector size; and a plurality of sectors in the first bank One sector at a time as an active sector, and updating the active sector among a plurality of sectors of the first bank each time data is written to the nonvolatile memory; A step of checking the total amount of data stored in one sector when writing data to the memory, and the total amount of data checked is When it is determined that it cannot be stored in a sector of the first sector size, an active sector is determined from the plurality of sectors of the second bank, and data is written to the nonvolatile memory And writing data into the active sector.
すなわち、本発明では、不揮発性メモリにセクタサイズの異なる複数のセクタからなる第1および第2のバンクを用意しておき、初期的には小サイズのセクタからなる第1のバンクを利用することにより、セクタ消去時間やメモリ書き込み時間の増加によるシステム効率の低下を防止する。これとともに、セクタに保存するデータの総量が小サイズのセクタに収納しきれなくなった段階で、使用するバンクを大サイズのセクタからなる第2のバンクに切り替える。 That is, in the present invention, first and second banks composed of a plurality of sectors having different sector sizes are prepared in the nonvolatile memory, and the first bank composed of small-sized sectors is used initially. This prevents a decrease in system efficiency due to an increase in sector erase time and memory write time. At the same time, when the total amount of data stored in the sector cannot be stored in the small size sector, the bank to be used is switched to the second bank consisting of the large size sector.
本発明は、携帯端末において利用されるデータを携帯端末内の再書き込み可能な不揮発性メモリに保存するためのコンピュータプログラムとしても把握することができる。このコンピュータプログラムはメモリに格納され、CPUにより読み出されて実行される。 The present invention can also be understood as a computer program for storing data used in a portable terminal in a rewritable nonvolatile memory in the portable terminal. This computer program is stored in the memory, and is read and executed by the CPU.
本発明による携帯端末は、再書き込み可能な不揮発性メモリと、バッファメモリと、不揮発性メモリ上に、第1のセクタサイズの複数のセクタからなる第1のバンクと、前記第1のセクタサイズより大きいセクタサイズの複数のセクタからなる第2のバンクとを確保する手段と、前記第1のバンクの複数のセクタのうち一時に1つのセクタをアクティブセクタと決定するとともに、前記不揮発性メモリへのデータの書き込みの度に前記第1のバンクの複数のセクタ間でアクティブセクタを更新していく手段と、不揮発性メモリへのデータの書き込みの際に1セクタ内に保存する総データ量をチェックする手段と、チェックされた総データ量が前記第1のセクタサイズのセクタ内に収納しきれないと判断されたとき、前記第2のバンクの複数のセクタの中からアクティブセクタを決定する手段と、電源立ち上げ時に前記アクティブセクタの内容を前記バッファメモリに格納する手段と、不揮発性メモリへのデータの書き込みの際に、バッファメモリに書き込み対象のデータを書き込んだ後、当該バッファメモリの内容を前記アクティブセクタに書き込む手段と、データの読み出し時にバッファメモリから読み出し対象のデータを読み出す手段とを備えたことを特徴とする。 A portable terminal according to the present invention includes a rewritable nonvolatile memory, a buffer memory, a first bank composed of a plurality of sectors having a first sector size on the nonvolatile memory, and the first sector size. Means for securing a second bank comprising a plurality of sectors of a large sector size; and determining one sector at a time among the plurality of sectors of the first bank as an active sector; Means for updating the active sector among a plurality of sectors of the first bank each time data is written, and the total amount of data stored in one sector at the time of data writing to the nonvolatile memory is checked. And when it is determined that the total amount of data checked cannot be stored in a sector of the first sector size, A means for determining an active sector from the memory, a means for storing the contents of the active sector in the buffer memory when the power is turned on, and data to be written to the buffer memory when data is written to the nonvolatile memory. After the data is written, there is provided means for writing the contents of the buffer memory into the active sector, and means for reading data to be read from the buffer memory when reading data.
本発明によれば、初期的には小サイズのセクタからなる第1のバンクを利用することにより、セクタ消去時間やメモリ書き込み時間の増加によるシステム効率の低下を防止するとともに、セクタに保存するデータの総量が小サイズのセクタに収納しきれなくなった段階で、使用するバンクを大サイズのセクタからなる第2のバンクに切り替えることにより、保存対象のデータの増加に対処することができる。 According to the present invention, by using the first bank consisting of small-sized sectors in the initial stage, it is possible to prevent a decrease in system efficiency due to an increase in sector erase time and memory write time, and to store data in the sector When the total amount of data cannot be stored in the small size sector, the increase in data to be stored can be dealt with by switching the bank to be used to the second bank consisting of large size sectors.
以下、本発明の好適な実施の形態について、詳細に説明する。 Hereinafter, preferred embodiments of the present invention will be described in detail.
まず、図1に、本発明の不揮発性メモリのデータ保存方法を利用する携帯端末の一例としての携帯電話機100のハードウェア構成を示す。
First, FIG. 1 shows a hardware configuration of a
この携帯電話機100は、電話機能に関連した部位として、アンテナ101、デュプレクサ(Duplexer)102、受信部103、送信部104、スピーカ105、デジタル信号処理部DSP(Digital Signal Processor)106、マイク107、イヤレシーバ108を含む。携帯電話機100は、さらに、この携帯電話機の制御に関連した部位として、CPU(Central Processing Unit)を含む制御部110、ROM(Read Only Memory)111、RAM(Random Access Memory)112、液晶ディスプレイ等を含む表示部114、テンキーなどの各種キーやジョグダイヤルなどの操作部を有する入力操作部115、現在の日付や時間を管理するRTC(Real Time Clock)部116、等を有する。制御部110は中央処理装置(CPU)などから構成される。入力操作部115は携帯端末の各種キーやボタン、ジョグダイヤル等に相当する。ROM111は、本実施の形態の後述する動作を実現するための制御プログラムや必要なデータが格納されている不揮発性メモリであり、本発明に係る再書き込み可能な不揮発性メモリ(NVメモリ)40を含む。NVメモリ40は、後述する第1のバンク(#1)41および第2のバンク(#2)42を含んでいる。本実施の形態におけるNVメモリ40はフラッシュメモリ、特にNOR型のフラッシュメモリを用いている。フラッシュメモリとしては、NOR型とNAND型が知られている。NOR型はNAND型に比べて小容量であるが、バイトやワード単位の読み出しが可能である(NAND型はページ単位の読み出しのみ)。また、いずれの型のフラッシュメモリもそのデータの消去は、所定のサイズ(ブロック)単位の消去となる。RAM112はCPUによる作業領域やデータの一時記憶領域を提供するメモリである。本実施の形態では、RAM112内に、特に、NVメモリ40に保存されたNVアイテムのコピーを格納するNVバッファ113を有している。このNVバッファ113は、NVメモリ40の遅い処理速度を補償するための高速のキャッシュメモリとして機能する。
The
なお、図1には示していないが、GPS受信部、メモリカードを装着するためのメモリカードインタフェース部、非接触ICカード機能部等、他の機能部を備えてもよい。 Although not shown in FIG. 1, other functional units such as a GPS receiving unit, a memory card interface unit for mounting a memory card, and a non-contact IC card functional unit may be provided.
図2に、本発明のNVメモリシステム200のソフトウェア構成を示す。
FIG. 2 shows a software configuration of the
アプリケーション(または上位システム)10は、本発明のNVメモリシステム200を介してNVメモリ40にアクセスする。NVメモリシステム200は図1の制御部110のプログラム制御によって実現される。NVメモリシステム200は、アプリケーションが直接NVメモリを制御することがないように、そのインタフェースを提供している。
The application (or host system) 10 accesses the
NVメモリシステム200は、NV制御部20とNVドライバ30とにより構成される。NV制御部20は、アプリケーションからの要求に応じてNVメモリ40への所定の動作を行うよう、NVドライバ30を制御する機能を有する。この具体的な処理については後に詳述する。
The
NVドライバ30はNVメモリ40にアクセスして、その具体的な制御(書き込み、読み出し、消去等)を行うデバイスドライバである。このデバイスドライバとしては、好ましくは、NVメモリのメーカ毎にデバイスドライバを複数用意しておく。
The
図3は、NV制御部20の内部構成例を示している。NV制御部20は、NVインタフェース部21、NVエンジン部22、およびデバイス制御インタフェース部23を有している。
FIG. 3 illustrates an internal configuration example of the
NVインタフェース部21は、アプリケーション(または上位システム)に対して、本NVメモリシステムの機能を利用させるため部位である。これにより、アプリケーションはNVメモリの実際のデバイスを意識することなく、NVアイテムの書き込みおよび読み出しを行うことができる。なお、端末の製造工程や調整時にのみ必要な機能と、その後の通常の機能とは異なるので、両者のインタフェースを別々に用意してもよい。
The
NVエンジン部22は、本NVメモリシステム200の種々の機能を実現するために必要な共通関数を有する部位である。共通関数としては、初期化時の動作を行うための初期化関数221、セクタの読み出しを行うためのセクタリード関数222、セクタの書き込みを行うためのセクタライト関数223、現在どのセクタがアクティブとなっているかを確認するためのアクティブセクタ取得関数225、新たにアクティブセクタとすべきセクタを決定する新アクティブセクタ取得関数226、本発明に係るセクタサイズの切替を行うためのバンク切替関数227、等を有する。
The
デバイス制御インタフェース部23は、種々の製造メーカのNVメモリデバイスに対応できるように、初期化時にデバイスの形式を自動確認して、対応するメーカのNVドライバを選択できるようにするものである。
The device
ここで、本実施の形態におけるセクタの内容および構成について説明する。 Here, the contents and configuration of the sector in the present embodiment will be described.
本実施の形態におけるセクタの属性としては、前述したと同様に、読み出し専用のROセクタと、読み出しおよび書き込みが可能なRWセクタがある。本実施の形態におけるNVメモリ内に用意されるNVアイテムを格納するためのセクタの総数は8に設定される。これら8つのセクタの内容は、図4に示す通りである。 As described above, the sector attributes in the present embodiment include a read-only RO sector and a read / write RW sector. The total number of sectors for storing NV items prepared in the NV memory in this embodiment is set to 8. The contents of these eight sectors are as shown in FIG.
セクタ0(RO): このセクタは、工場出荷時の初期値、調整値等の若干数のNVアイテムが書き込まれ、以後は読み出し専用として利用されるセクタである。 Sector 0 (RO): This sector is a sector in which some NV items such as initial values and adjustment values at the time of factory shipment are written, and thereafter used as read-only.
セクタ1(RO): 端末にとって重要な若干数のNVアイテム(例えば端末IDなど)を格納するための読み出し専用のセクタである。 Sector 1 (RO): A read-only sector for storing a few NV items (for example, a terminal ID) important for the terminal.
セクタ2〜6(RW): 通常のNVアイテムを格納するための読み出し/書き込み可能なセクタである。
セクタ7(RW): 特別NVアイテム(例えばメモリカードのセキュリティキー)を格納するための読み出し/書き込み可能なセクタである。 Sector 7 (RW): A readable / writable sector for storing a special NV item (for example, a security key of a memory card).
このように、本実施の形態では、全8つのセクタのうちセクタ2〜6が通常のNVアイテムを格納するために使用される通常のセクタである。セクタ7については、本発明に直接関係しないので、ここでは詳述しない。
As described above, in the present embodiment,
図5に、セクタ2〜6の各セクタの構成を示す。セクタ400は、セクタヘッダ部401とユーザデータ部402とセクタフッタ部403とからなる。セクタヘッダ部401は、保存データを管理するためのデータ領域であり、セクタのデータ保存の有無、セクタ属性、セクタ管理ID、書き込み時間データ(年月日日時分秒)、保存データ長等を保持する。ユーザデータ部402は、実際のユーザデータとしてのNVアイテムを格納する領域である。セクタフッタ部403は、当該セクタのデータのチェックサム、全セクタのエラー情報等を格納する。全セクタのエラー情報はアクティブセクタ内のもののみが有効となる。
FIG. 5 shows the configuration of each sector of sectors 2-6. The
前述のように、セクタ2〜6のうち一時に1つのセクタのみがアクティブとなり、このアクティブセクタが全てのNVアイテムの最新の値を記憶する。他の通常のセクタは、データの書き込み動作中の電源断などの理由によりデータが破損するような場合の対策として、NVデータのバックアップのために使われる。
As described above, only one of the
本実施の形態では、図6に示すように、NVメモリ40のNVアイテムを格納するNV領域として、第1のバンク#1と第2のバンク#2を用意する。図中の各セクタ内の数値はそのセクタの開始アドレスを示している。それぞれ8セクタを有するが、第2のバンクの1セクタのサイズはそれより大きいサイズ(ここでは8倍)としている。具体的には次の通りである。
バンク#1:ベースアドレス(0x01FF0000)、セクタサイズ8Kバイト
バンク#2:ベースアドレス(0x0lE00000)、セクタサイズ64Kバイト
In the present embodiment, as shown in FIG. 6, a
Bank # 1: Base address (0x01FF0000), sector size 8K bytes Bank # 2: Base address (0x0lE00000), sector size 64K bytes
携帯電話機の例では、経験的に、NVアイテムの全データ量が初期的に8Kバイトを上回ることはないので、NV領域は通常小さいセクタサイズを有するバンク#1を利用するように設定される。その後、携帯電話機の機能追加等に応じて、NVアイテムの種類やデータ量が増加していったとき、NVデータの総データ量はバンク#1のセクタサイズ(ここでは8Kバイト)を越える場合がある。このような場合には、アクティブセクタを、より大きいセクタサイズ(64Kバイト>8Kバイト)のバンク#2のセクタから選択する。
In the example of the cellular phone, since the total data amount of the NV item does not initially exceed 8 Kbytes by experience, the NV area is usually set to use the
以下、本実施の形態における具体的な動作についてフローチャート等を参照しながら説明する。 Hereinafter, specific operations in the present embodiment will be described with reference to flowcharts and the like.
図7は、図2に示したNVメモリシステム200のNV制御部20が実行するNVタスクの処理例を示している。端末電源立ち上げ時等に起動されるNVタスクは、まず、デバイスドライバ(NVドライバ)の初期化を行う(S11)。この処理の詳細については後述する。ついで、NVタスクの初期化を行う(S12)。初期値が必要なNVアイテムについては、このステップで設定される。例えば、送受信部(RF)に関連したNVアイテム、バッテリに関連したNVアイテム、GPSに関連してNVアイテム等がある。なお、これらの初期値の設定の有無を示すフラグを記憶し、各フラグに基づいて初期値設定の要否を判断するようにしてもよい。
FIG. 7 shows a processing example of the NV task executed by the
その後、アプリケーション(または上位システム)からコマンドを受信したら(S13,Yes)、そのコマンドを判別する(S14)。コマンドが読み出しであればNVアイテムの読み出し処理を行う(S15)。コマンドが“NVWrite”であればNVアイテムの書き込み処理を行う(S16)。本実施の形態における読み出しコマンドには、NVバッファ113からデータを読み出すReadコマンドとNVメモリ40からデータを読み出すDevReadコマンドとがある。その他のコマンドについては、当該その他のコマンド処理を実行する(S17)。
Thereafter, when a command is received from the application (or higher system) (S13, Yes), the command is determined (S14). If the command is read, NV item read processing is performed (S15). If the command is “NVWrite”, NV item write processing is performed (S16). The read commands in the present embodiment include a Read command for reading data from the
図8は図7のステップS11のデバイスドライバ初期化のステップを詳細を示している。まず、NVバッファ113をクリア(消去)するとともに(S21)、デバイスドライバを初期状態とする(S22)。ついで、このNVタスクの起動が当該端末での初めての起動であれば(S23,Yes)、NVメモリを全クリア(消去)して(S25)、製造工程を開始する(S26)。製造工程開始処理では、NVバッファのセクタ0、1、7のクリア、およびその後の初期値の設定、書き込みを行う。初めての起動でなければ、NVメモリ40のアクティブセクタの全内容をNVバッファ113に読み出す(S24)。
FIG. 8 shows details of the device driver initialization step of step S11 of FIG. First, the
図9は、図7のステップS15のNVアイテム読み出し処理の処理例を示している。図10は、図9に対応するNVアイテム読み出し処理においてReadコマンドを受信した場合とDevReadコマンドを受信した場合の要求およびデータの流れを示している。まず、読み出しコマンドがReadコマンドかDevReadコマンドかをチェックする(S31)。Readコマンドであれば、NVタスク22aが直接NVバッファ113からそのNVアイテムを読み出す(S32)。DevReadコマンドであれば、NVタスク22aは、NVドライバ30経由で、NVメモリ40のアクティブセクタから当該NVアイテムを読み出す(S33)。
FIG. 9 shows a processing example of the NV item reading process in step S15 of FIG. FIG. 10 shows a flow of requests and data when a Read command is received and a DevRead command is received in the NV item read process corresponding to FIG. First, it is checked whether the read command is a Read command or a DevRead command (S31). If it is a Read command, the
図11は、図7のステップS16のNVアイテム書き込み処理の処理例を示している。また、この処理は、図7のステップS16に限らず、図8の製造工程(S27)でのNVアイテム書き込み処理、開発段階でのNVアイテム書き込み処理として利用できる。図12は、図11の処理に対応したNVタスク22aとNVドライバ30とNVバッファ113とNVメモリ40の間の、要求およびデータの流れを示している。
FIG. 11 shows a processing example of the NV item writing process in step S16 of FIG. Further, this process is not limited to step S16 in FIG. 7, but can be used as an NV item writing process in the manufacturing process (S27) in FIG. 8 and an NV item writing process in the development stage. FIG. 12 shows a flow of requests and data among the
まず、NVタスク22aは、書き込み対象のNVアイテムを含む全NVアイテムの総データ量を確認する(S41)。この総データ量が予め定めた閾値(ここでは8Kバイト)を越えた場合には(S42,Yes)、NVメモリのバンク切り替え、すなわち、バンク#1からバンク#2への切替を行う(S43)。これに伴って、アクティブセクタをバンク#1からバンク#2のセクタに移動させる。なお、ここでは総データ量が増加するときに閾値を越える場合を想定しているが、総データ量が減少したときに閾値を逆向きに越える場合に逆の切替を行うことも可能である。
First, the
次いで、書き込み対象のNVアイテムをNVバッファ113に書き込む(S44)。そこで、アクティブセクタを新たなセクタに更新する(S45)。この更新のアルゴリズムは特にここでは言及しないが、有効なセクタについて順番に選択する等のアルゴリズムを利用することができる。決定された新たなアクティブセクタを消去した後(S46)、このアクティブセクタに対してNVバッファ113の内容を書き込む(S47)。
Next, the NV item to be written is written in the NV buffer 113 (S44). Therefore, the active sector is updated to a new sector (S45). Although this update algorithm is not particularly mentioned here, an algorithm such as selecting effective sectors in order can be used. After erasing the determined new active sector (S46), the contents of the
以上、本発明の好適な実施の形態について説明したが、上記で言及した以外にも種々の変形、変更を行うことが可能である。すなわち、上述した具体的なセクタサイズ、セクタ数、アドレス値、処理ステップ等はすべて例示であり、本発明はそれらに限定されるものではない。 The preferred embodiments of the present invention have been described above, but various modifications and changes other than those mentioned above can be made. That is, the specific sector size, the number of sectors, the address value, the processing steps, etc. described above are all examples, and the present invention is not limited to them.
また、セクタの管理は、実際の物理的なアドレスに対応するセクタでなく、これに論理的に対応づけられた論理セクタで行ってもよい。 Further, the sector management may be performed not by a sector corresponding to an actual physical address but by a logical sector logically associated therewith.
NVアイテムによっては、電源オン/オフの度、基地局からの所定の信号の受信時等、NVメモリへの書き込みが高頻度に行われるものも存在しうる。それらの書き込みが発生する度にNVメモリへ書き込みを行っていると、デバイスが老朽化したり、電源オン/オフ時間が長くなってしまう。そこで、そのような書き込み頻度の高いNVアイテムについては初期的にNVメモリに書き込むと共にバッテリバックアップされた小容量のSRAM(Static Random Access Memory)に書き込み、以後はSRAMを読み書きし、NVメモリの更新は最小限にとどめるなどの措置をとってもよい。 Some NV items may be frequently written into the NV memory, such as when a predetermined signal is received from the base station every time the power is turned on / off. If writing to the NV memory is performed each time such writing occurs, the device becomes obsolete or the power on / off time becomes long. Therefore, such NV items with high writing frequency are initially written in the NV memory and written in a small-capacity SRAM (Static Random Access Memory) backed up by the battery. Thereafter, the SRAM is read and written, and the NV memory is updated. Measures such as minimizing may be taken.
20…制御部、21…インタフェース部、22…エンジン部、22a…タスク、23…デバイス制御インタフェース部、30…NVドライバ、40…NVメモリ、100…携帯電話機、101…アンテナ、103…受信部、104…送信部、105…スピーカ、106…デジタル信号処理部(DSP)、107…マイク、108…イヤレシーバ、110…制御部、113…バッファ、114…表示部、115…入力操作部、116…RTC部、200…メモリシステム、400…セクタ、401…セクタヘッダ部、402…ユーザデータ部、403…セクタフッタ部
DESCRIPTION OF
Claims (4)
不揮発性メモリ上に、第1のセクタサイズの複数のセクタからなる第1のバンクと、前記第1のセクタサイズより大きいセクタサイズの複数のセクタからなる第2のバンクとを確保するステップと、
前記第1のバンクの複数のセクタのうち一時に1つのセクタをアクティブセクタと決定するとともに、前記不揮発性メモリへのデータの書き込みの度に前記第1のバンクの複数のセクタ間でアクティブセクタを更新していくステップと、
不揮発性メモリへのデータの書き込みの際に1セクタ内に保存する総データ量をチェックするステップと、
チェックされた総データ量が前記第1のセクタサイズのセクタ内に収納しきれないと判断されたとき、前記第2のバンクの複数のセクタの中からアクティブセクタを決定するステップと、
不揮発性メモリへのデータの書き込みの際に前記アクティブセクタにデータを書き込むステップと
を備えたことを特徴とする不揮発性メモリのデータ保存方法。 A method for storing data used in a mobile terminal in a rewritable nonvolatile memory in the mobile terminal,
Securing a first bank composed of a plurality of sectors having a first sector size and a second bank composed of a plurality of sectors having a sector size larger than the first sector size on a nonvolatile memory;
Of the plurality of sectors in the first bank, one sector is determined as an active sector at a time, and an active sector is defined between the plurality of sectors in the first bank each time data is written to the nonvolatile memory. The steps to update,
Checking the total amount of data stored in one sector when writing data to the non-volatile memory;
Determining an active sector from a plurality of sectors of the second bank when it is determined that the checked total data amount cannot be stored in a sector of the first sector size;
A method for storing data in a non-volatile memory, comprising: writing data into the active sector when writing data into the non-volatile memory.
不揮発性メモリ上に、第1のセクタサイズの複数のセクタからなる第1のバンクと、前記第1のセクタサイズより大きいセクタサイズの複数のセクタからなる第2のバンクとを確保するステップと、
前記第1のバンクの複数のセクタのうち一時に1つのセクタをアクティブセクタと決定するとともに、前記不揮発性メモリへのデータの書き込みの度に前記第1のバンクの複数のセクタ間でアクティブセクタを更新していくステップと、
不揮発性メモリへのデータの書き込みの際に1セクタ内に保存する総データ量をチェックするステップと、
チェックされた総データ量が前記第1のセクタサイズのセクタ内に収納しきれないと判断されたとき、前記第2のバンクの複数のセクタの中からアクティブセクタを決定するステップと、
不揮発性メモリへのデータの書き込みの際に前記アクティブセクタにデータを書き込むステップと
を実行することを特徴とするコンピュータプログラム。 A computer program for storing data used in a mobile terminal in a rewritable nonvolatile memory in the mobile terminal,
Securing a first bank composed of a plurality of sectors having a first sector size and a second bank composed of a plurality of sectors having a sector size larger than the first sector size on a nonvolatile memory;
Of the plurality of sectors in the first bank, one sector is determined as an active sector at a time, and an active sector is defined between the plurality of sectors in the first bank each time data is written to the nonvolatile memory. The steps to update,
Checking the total amount of data stored in one sector when writing data to the non-volatile memory;
Determining an active sector from a plurality of sectors of the second bank when it is determined that the checked total data amount cannot be stored in a sector of the first sector size;
And a step of writing data to the active sector when writing data to the nonvolatile memory.
バッファメモリと、
不揮発性メモリ上に、第1のセクタサイズの複数のセクタからなる第1のバンクと、前記第1のセクタサイズより大きいセクタサイズの複数のセクタからなる第2のバンクとを確保する手段と、
前記第1のバンクの複数のセクタのうち一時に1つのセクタをアクティブセクタと決定するとともに、前記不揮発性メモリへのデータの書き込みの度に前記第1のバンクの複数のセクタ間でアクティブセクタを更新していく手段と、
不揮発性メモリへのデータの書き込みの際に1セクタ内に保存する総データ量をチェックする手段と、
チェックされた総データ量が前記第1のセクタサイズのセクタ内に収納しきれないと判断されたとき、前記第2のバンクの複数のセクタの中からアクティブセクタを決定する手段と、
電源立ち上げ時に前記アクティブセクタの内容を前記バッファメモリに格納する手段と、
不揮発性メモリへのデータの書き込みの際に、前記バッファメモリに書き込み対象のデータを書き込んだ後、当該バッファメモリの内容を前記アクティブセクタに書き込む手段と、
データの読み出し時に前記バッファメモリから読み出し対象のデータを読み出す手段と
を備えたことを特徴とする携帯端末。 Rewritable non-volatile memory;
Buffer memory,
Means for securing, on a non-volatile memory, a first bank composed of a plurality of sectors having a first sector size and a second bank composed of a plurality of sectors having a sector size larger than the first sector size;
Of the plurality of sectors in the first bank, one sector is determined as an active sector at a time, and an active sector is defined between the plurality of sectors in the first bank each time data is written to the nonvolatile memory. Means to update,
Means for checking the total amount of data stored in one sector when data is written to the nonvolatile memory;
Means for determining an active sector from a plurality of sectors of the second bank when it is determined that the checked total data amount cannot be stored in a sector of the first sector size;
Means for storing the contents of the active sector in the buffer memory at power-up;
Means for writing the contents of the buffer memory to the active sector after writing the data to be written to the buffer memory when writing the data to the nonvolatile memory;
Means for reading data to be read from the buffer memory when reading data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004343698A JP4565981B2 (en) | 2004-11-29 | 2004-11-29 | Nonvolatile memory data storage method, computer program, and portable terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004343698A JP4565981B2 (en) | 2004-11-29 | 2004-11-29 | Nonvolatile memory data storage method, computer program, and portable terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2006155144A true JP2006155144A (en) | 2006-06-15 |
JP4565981B2 JP4565981B2 (en) | 2010-10-20 |
Family
ID=36633381
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004343698A Expired - Fee Related JP4565981B2 (en) | 2004-11-29 | 2004-11-29 | Nonvolatile memory data storage method, computer program, and portable terminal |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4565981B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112817527A (en) * | 2021-01-21 | 2021-05-18 | 深圳市显控科技股份有限公司 | Power failure data storage method, single chip microcomputer and computer readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06504155A (en) * | 1991-08-16 | 1994-05-12 | マルティチップ テクノロジー インコーポレイテッド | High performance dynamic memory system |
JP2001511559A (en) * | 1997-07-28 | 2001-08-14 | ネグザビット・ネットワークス,リミテッド・ライアビリティー・カンパニー | Multi-port internal cache DRAM |
JP2002541665A (en) * | 1999-04-06 | 2002-12-03 | ペレグリン・セミコンダクター・コーポレイション | EEPROM cell on SOI |
JP2004088792A (en) * | 1990-09-10 | 2004-03-18 | Starsight Telecast Inc | User interface for television program list |
-
2004
- 2004-11-29 JP JP2004343698A patent/JP4565981B2/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004088792A (en) * | 1990-09-10 | 2004-03-18 | Starsight Telecast Inc | User interface for television program list |
JPH06504155A (en) * | 1991-08-16 | 1994-05-12 | マルティチップ テクノロジー インコーポレイテッド | High performance dynamic memory system |
JP2001511559A (en) * | 1997-07-28 | 2001-08-14 | ネグザビット・ネットワークス,リミテッド・ライアビリティー・カンパニー | Multi-port internal cache DRAM |
JP2002541665A (en) * | 1999-04-06 | 2002-12-03 | ペレグリン・セミコンダクター・コーポレイション | EEPROM cell on SOI |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112817527A (en) * | 2021-01-21 | 2021-05-18 | 深圳市显控科技股份有限公司 | Power failure data storage method, single chip microcomputer and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
JP4565981B2 (en) | 2010-10-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100393619B1 (en) | Memory apparatus and therefor controling method for mobile station | |
US6392925B2 (en) | Mobile communication device having integrated embedded flash and SRAM memory | |
EP1643506B1 (en) | System and method for automatically saving memory contents of a data processing device on power failure | |
US8954649B2 (en) | Garbage collection in storage devices based on flash memories | |
US20060069849A1 (en) | Methods and apparatus to update information in a memory | |
EP1632858B1 (en) | Semiconductor memory device and access method and memory control system for same | |
US7149844B2 (en) | Non-volatile memory device | |
US20100017558A1 (en) | Memory device operable in read-only and re-writable modes of operation | |
WO2006067923A1 (en) | Memory controller, nonvolatile storage, nonvolatile storage system, and memory control method | |
JP5019567B2 (en) | Memory management method and portable terminal device | |
JP3212960B2 (en) | Data management method using flash memory | |
US20010051519A1 (en) | Portable telephone set | |
US20060002197A1 (en) | Method and apparatus to detect invalid data in a nonvolatile memory following a loss of power | |
KR20030073824A (en) | A method and apparatus for upgrading a system firmware by using an universal serial bus | |
JP4565981B2 (en) | Nonvolatile memory data storage method, computer program, and portable terminal | |
JP2006126919A (en) | Data management device for flash memory and control method of flash memory | |
KR100613071B1 (en) | Method for managing memory in a mobile communication terminal | |
JP2005174468A (en) | Access control method of flash memory | |
JP2003203007A (en) | Nonvolatile area control method for memory of mobile phone | |
JP6456795B2 (en) | Electronics | |
WO2008054132A1 (en) | Terminal having platform library dynamic linking function and method of controlling the same | |
JPH0784886A (en) | Method and unit for cache memory control | |
JP2011175428A (en) | Storage device | |
JP2009009390A (en) | Memory management method and portable terminal equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20070829 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20100420 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100615 |
|
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: 20100803 |
|
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: 20100803 |
|
R150 | Certificate of patent (=grant) or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130813 Year of fee payment: 3 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |