JP5754316B2 - Electronic control unit - Google Patents

Electronic control unit Download PDF

Info

Publication number
JP5754316B2
JP5754316B2 JP2011201987A JP2011201987A JP5754316B2 JP 5754316 B2 JP5754316 B2 JP 5754316B2 JP 2011201987 A JP2011201987 A JP 2011201987A JP 2011201987 A JP2011201987 A JP 2011201987A JP 5754316 B2 JP5754316 B2 JP 5754316B2
Authority
JP
Japan
Prior art keywords
data
value
representative value
management information
flash 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.)
Expired - Fee Related
Application number
JP2011201987A
Other languages
Japanese (ja)
Other versions
JP2013065080A (en
Inventor
吉隆 加勢田
吉隆 加勢田
田中 敬
敬 田中
雅也 廣田
雅也 廣田
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.)
Denso Corp
Original Assignee
Denso 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 Denso Corp filed Critical Denso Corp
Priority to JP2011201987A priority Critical patent/JP5754316B2/en
Publication of JP2013065080A publication Critical patent/JP2013065080A/en
Application granted granted Critical
Publication of JP5754316B2 publication Critical patent/JP5754316B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、フラッシュメモリのような不揮発性メモリを備える電子制御装置に関する。   The present invention relates to an electronic control device including a nonvolatile memory such as a flash memory.

コンピュータ等の電子機器あるいは車両用の電子制御装置(ECUともいう)で用いられるデータを記憶させておく記憶媒体として、フラッシュメモリのような書換え可能な不揮発性メモリの使用が広がっている。   The use of a rewritable nonvolatile memory such as a flash memory is spreading as a storage medium for storing data used in electronic devices such as computers or electronic control devices (also referred to as ECUs) for vehicles.

フラッシュメモリでは、動作原理上、消去状態を書き込み状態にする書き込み処理は、アドレス単位あるいはビット単位で実行できるが、書き込み状態を消去状態にする消去処理については、メモリセルブロック単位(セクタ単位)で一括して行われ、アドレス単位あるいはビット単位で実行することはできない。   In the flash memory, the write process for setting the erase state to the write state can be executed in units of addresses or bits, but the erase process for changing the write state to the erase state is performed in units of memory cell blocks (sector units). It is performed in a lump and cannot be executed in units of addresses or bits.

このため、不揮発性半導体記憶装置では、一般的に、所定のメモリセルブロック(以下、単に「ブロック」ということもある)に既に書き込まれているデータの全部または一部を更新する場合、更新後のデータを一括消去処理済みのメモリセルブロック(更新先メモリセルブロックともいう)に書き込む書き込み処理を実行した後、更新前のデータが記憶された更新元メモリセルブロックを一括消去する一括消去処理を実行するデータ更新処理を実行している。   For this reason, in a nonvolatile semiconductor memory device, in general, when all or a part of data already written in a predetermined memory cell block (hereinafter sometimes simply referred to as “block”) is updated, After executing the write process to write the data in the memory cell block (also called the update destination memory cell block) that has been batch erased, the batch erase process to erase the update source memory cell block storing the pre-update data in a batch The data update process to be executed is being executed.

そこで、フラッシュメモリへの書込みが必要かどうかを判断してから、フラッシュメモリへの書込み実行を判断することで、不要なフラッシュメモリへの書込みを抑制することが可能となり、処理時間の向上、書込み回数の低減により信頼性を向上させることが可能なフラッシュメモリ制御方法が考案されている(特許文献1参照)。   Therefore, by determining whether or not writing to the flash memory is necessary, it is possible to suppress unnecessary writing to the flash memory by determining execution of writing to the flash memory, improving processing time and writing. A flash memory control method that can improve reliability by reducing the number of times has been devised (see Patent Document 1).

特開2007−304920号公報JP 2007-304920 A

特許文献1の構成では、フラッシュメモリの全領域について一律にゼロのような初期値を書き込むことを想定している。つまり、装置の通常動作時のフラッシュメモリの個別の書込み対象データに対する書込み抑制はされておらず、一律の初期値を用いて初期化した値と書き込みデータを比べても、書込み回数の抑制にはならないという問題がある。   In the configuration of Patent Document 1, it is assumed that an initial value such as zero is uniformly written for all areas of the flash memory. In other words, there is no write suppression for individual write target data in the flash memory during normal operation of the device, and even if the write data is compared with the value initialized using a uniform initial value, the number of writes can be suppressed. There is a problem of not becoming.

上記問題点を背景として、本発明の課題は、フラッシュメモリへの書込み対象データに対する書込み抑制をより効率よく行うことが可能な電子制御装置を提供することにある。   Against the background of the above problems, an object of the present invention is to provide an electronic control device that can more efficiently suppress writing to data to be written to a flash memory.

課題を解決するための手段および発明の効果Means for Solving the Problems and Effects of the Invention

上記課題を解決するための電子制御装置は、データを特定するデータIDと、そのデータの値であるデータ値とを記憶するフラッシュメモリと、予め定められた書き込みタイミングで、フラッシュメモリにデータIDとデータ値とを関連付けて書き込むデータ書込部と、データID毎に対応した代表値IDが定められ、その代表値ID毎に予め定められた代表値を記憶する代表値記憶部と、データID毎に、対応するデータ値と代表値のいずれを該データIDに対応する値として使用するかを表すデータ管理情報を記憶するデータ管理情報記憶部と、データ書込部がデータ値を書き込む際に、データID毎に、書き込むデータ値と代表値とが同一か否かを比較する比較部と、書き込むデータ値と代表値とが同一のときには、データ管理情報を、データIDに対応する値として代表値を使用する代表値使用状態を表すものとするとともに、データ書込部によるフラッシュメモリへの該データIDに対応するデータ値の書き込みを抑制する書込制御部と、を備えることを特徴とする。 An electronic control device for solving the above problems includes a flash memory that stores a data ID that identifies data and a data value that is the value of the data, and a data ID that is stored in the flash memory at a predetermined write timing. A data writing unit that writes data values in association with each other, a representative value ID corresponding to each data ID is determined, a representative value storage unit that stores a predetermined representative value for each representative value ID, and each data ID A data management information storage unit for storing data management information indicating which of the corresponding data value and the representative value is used as a value corresponding to the data ID, and when the data writing unit writes the data value, For each data ID, when the data value to be written and the representative value are the same, the comparison unit for comparing whether or not the data value to be written is the same as the representative value. A write control unit that represents a representative value use state in which a representative value is used as a value corresponding to the data ID, and suppresses writing of the data value corresponding to the data ID to the flash memory by the data writing unit; It is characterized by providing.

上記構成によって、初期値書き込み時(すなわち、フラッシュメモリ初期化時)以外にも、装置の通常動作時のフラッシュメモリの個別の書込み対象データに対する書込み抑制を行うことができ、個別のデータの上書きのできないフラッシュメモリへの書き込みデータ量を抑制することができる。   With the above configuration, it is possible to suppress writing to individual write target data in the flash memory during the normal operation of the apparatus other than when initial values are written (that is, when the flash memory is initialized), and overwriting of individual data is possible. The amount of data that cannot be written to the flash memory can be suppressed.

また、本発明の電子制御装置における代表値は、データ値が得る値のうち、得る頻度のより高いものが定められる。   In addition, the representative value in the electronic control device of the present invention is determined to have a higher frequency of obtaining the data value.

上記構成によって、データ値として、より出現頻度の高い値を代表値とすると、フラッシュメモリへの書き込みの機会もより多くなるため、より効率よくフラッシュメモリへデータ値の書き込みを抑制することができる。   With the above configuration, if a value having a higher appearance frequency is used as a representative value as the data value, the number of opportunities for writing to the flash memory is increased, so that writing of the data value to the flash memory can be more efficiently suppressed.

また、本発明の電子制御装置は、代表値IDに、複数のデータIDが関連付けられている。   In the electronic control device of the present invention, a plurality of data IDs are associated with the representative value ID.

上記構成によって、代表値の記憶領域を低減することができる。   With the above configuration, the storage area of the representative value can be reduced.

また、本発明の電子制御装置は、書き込みタイミング時に、書き込むデータ値が代表値と異なる値に変化しているとき、書込制御部は、データ書込部によるフラッシュメモリへの、当該データIDに対応するデータ値の書き込みの抑制を解除し、データ管理情報記憶部は、データIDに対応するデータ管理情報を、データIDに対応する値としてフラッシュメモリに記憶されたデータ値を使用することを表すデータ値使用状態とする。   In the electronic control device of the present invention, when the data value to be written is changed to a value different from the representative value at the write timing, the write control unit assigns the data ID to the flash memory by the data writing unit. The suppression of the writing of the corresponding data value is canceled, and the data management information storage unit indicates that the data value stored in the flash memory is used as the value corresponding to the data ID for the data management information corresponding to the data ID. Use data values.

上記構成によって、データ値が代表値と異なる値に変化したときのみ、フラッシュメモリに書き込むことができるので、フラッシュメモリへの書き込みデータ量を抑制することができる。   With the above configuration, writing to the flash memory can be performed only when the data value changes to a value different from the representative value, so that the amount of data written to the flash memory can be suppressed.

また、本発明の電子制御装置は、データ管理情報がデータ値使用状態を表すとき、書き込みタイミング時に、データ値が代表値と同じ値に変化しているとき、書込制御部は、データ管理情報を代表値使用状態として、データ書込部によるフラッシュメモリへの、当該データIDに対応するデータ値の書き込みを抑制する。   Further, the electronic control device of the present invention, when the data management information represents the data value use state, when the data value is changed to the same value as the representative value at the write timing, the write control unit Is used as a representative value use state, and writing of the data value corresponding to the data ID to the flash memory by the data writing unit is suppressed.

上記構成によって、データ値が代表値と同じ値に変化したとき、代表値をフラッシュメモリに書き込むことを防ぐことができる。   With the above configuration, when the data value changes to the same value as the representative value, writing the representative value to the flash memory can be prevented.

また、本発明の電子制御装置は、予め定められた読み出しタイミングで、データIDに対応するデータ値を読み出すデータ値読出部を備え、データ値読出部は、データ管理情報が代表値使用状態を表すときに、データIDに対応する代表値IDの代表値を代表値記憶部から読み出す。
The electronic control device of the present invention further includes a data value reading unit that reads a value of data corresponding to the data ID at a predetermined reading timing, and the data value reading unit indicates that the data management information indicates the representative value use state. When representing, the representative value of the representative value ID corresponding to the data ID is read from the representative value storage unit.

上記構成によって、データIDに対応する最新かつ適切なデータ(すなわち、代表値)を読み出すことができる。   With the above configuration, the latest and appropriate data (that is, the representative value) corresponding to the data ID can be read.

また、本発明の電子制御装置は、予め定められた読み出しタイミングで、データIDに対応するデータ値を読み出すデータ値読出部を備え、データ値読出部は、データ管理情報がデータ値使用状態を表すときに、データIDに対応するデータ値をフラッシュメモリから読み出す。   The electronic control device of the present invention further includes a data value reading unit that reads a data value corresponding to the data ID at a predetermined reading timing, and the data value reading unit indicates that the data management information indicates a data value use state. Sometimes, the data value corresponding to the data ID is read from the flash memory.

上記構成によっても、データIDに対応する最新かつ適切なデータ(すなわち、データ値)を読み出すことができる。   Also with the above configuration, the latest and appropriate data (that is, the data value) corresponding to the data ID can be read.

電子制御装置の構成を示すブロック図。The block diagram which shows the structure of an electronic controller. 代表値記憶部の構成例を示す図。The figure which shows the structural example of a representative value memory | storage part. データ管理情報記憶部の構成例を示す図。The figure which shows the structural example of a data management information storage part. フラッシュメモリにおけるデータ記憶領域の一例を示す図。The figure which shows an example of the data storage area in flash memory. データ書込抑制処理を説明するフロー図。The flowchart explaining a data writing suppression process. データ読出処理を説明するフロー図。The flowchart explaining a data read-out process. 代表値記憶部の構成の別例を示す図。The figure which shows another example of a structure of a representative value memory | storage part. データ管理情報記憶部の構成の別例を示す図。The figure which shows another example of a structure of a data management information storage part.

以下、本発明の電子制御装置について、図面を用いて説明する。まず、図1に、本発明の電子制御装置(以下、「ECU」と称する)1の構成例を示す。ECU1は、例えば車両のエンジン制御、エアコン制御等の車載機器の制御に用いられる。ECU1は、CPU10,ROM11,RAM12,フラッシュメモリ13を備え、CPU10が、ROM11あるいはフラッシュメモリ13に記憶された制御プログラムを実行することにより、ECU1の各種機能を実現する。RAM12は、CPU10による制御プログラムの実行において生成される各種データを一時的に記憶する。   The electronic control device of the present invention will be described below with reference to the drawings. First, FIG. 1 shows a configuration example of an electronic control device (hereinafter referred to as “ECU”) 1 of the present invention. The ECU 1 is used for controlling in-vehicle devices such as vehicle engine control and air conditioner control. The ECU 1 includes a CPU 10, a ROM 11, a RAM 12, and a flash memory 13. The CPU 10 executes various control functions of the ECU 1 by executing control programs stored in the ROM 11 or the flash memory 13. The RAM 12 temporarily stores various data generated when the CPU 10 executes the control program.

また、ECU1は、例えば、回転センサ,温度センサのようなセンサ16からのデータの取得、あるいは他のECUからのデータ受信を行うための入力I/F14と、例えば、モータ,ソレノイドのようなアクチュエータ17に対する動作制御指令値の出力、あるいは他のECUへのデータ送信を行うための出力I/F15を備えている。   The ECU 1 includes an input I / F 14 for obtaining data from a sensor 16 such as a rotation sensor or a temperature sensor or receiving data from another ECU, and an actuator such as a motor or a solenoid. 17 includes an output I / F 15 for outputting an operation control command value to 17 or transmitting data to another ECU.

フラッシュメモリ13は、例えば周知のメモリセルブロックを1以上備え、ECU1の動作に必要なデータを記憶する。CPU10は、ECU1の動作状態あるいはフラッシュメモリ13の各メモリセルブロックのデータ記憶状態に応じて、フラッシュメモリ13に対し、メモリセルブロック単位での一括消去処理、所定アドレス数の記憶領域単位またはビット単位での書き込み処理、および、メモリセルブロック単位でのデータ更新処理等の制御を行う。   The flash memory 13 includes, for example, one or more known memory cell blocks, and stores data necessary for the operation of the ECU 1. The CPU 10 performs batch erasure processing in units of memory cell blocks, a storage area unit of a predetermined address number or a bit unit for the flash memory 13 according to the operation state of the ECU 1 or the data storage state of each memory cell block of the flash memory 13. And the like, and control such as data update processing in units of memory cell blocks.

上記構成により、ECU1は、センサ16あるいは他のECUから取得したデータ、およびアクチュエータ17の動作状態に基づいて、動作制御指令値を演算し、アクチュエータ17に出力する。   With the above configuration, the ECU 1 calculates an operation control command value based on the data acquired from the sensor 16 or another ECU and the operation state of the actuator 17 and outputs the operation control command value to the actuator 17.

図2に、ROM11における代表値記憶部11aの構成例を示す。代表値記憶部には、代表値ID毎に、対応する代表値が予め記憶されている。代表値は以下のうちのいずれかを用いる。なお、本実施例では、データIDが代表値IDと同じで、データIDと代表値IDとは一対一の関係となっている。また、本実施例では、データ値は、データ長が1バイトの16進数である。
・CPU10による処理演算において得られるデータ値のうち、最も出現頻度の高い値。
・デフォルト値:データID毎に定められ、例えば、CPU10による処理演算において得られるデータ値が所定範囲に含まれないときに代用するフェイルセーフ値。または初期化時の値。
FIG. 2 shows a configuration example of the representative value storage unit 11 a in the ROM 11. In the representative value storage unit, a corresponding representative value is stored in advance for each representative value ID. Any of the following is used as the representative value. In this embodiment, the data ID is the same as the representative value ID, and the data ID and the representative value ID have a one-to-one relationship. In this embodiment, the data value is a hexadecimal number having a data length of 1 byte.
A value having the highest appearance frequency among data values obtained in the processing calculation by the CPU 10.
Default value: a fail-safe value that is determined for each data ID, and is substituted when, for example, a data value obtained by processing calculation by the CPU 10 is not included in a predetermined range. Or the value at initialization.

図3に、RAM12におけるデータ管理情報記憶部12aの構成例を示す。データ管理情報記憶部には、データID毎に、データ値として、ROM11の代表値か、フラッシュメモリ13に記憶されているデータ値のうちのいずれを用いるかを表すデータ管理情報が記憶されている。データ管理情報記憶部は、書き換えの頻度が比較的高いので、アドレス単位あるいはビット単位で書き換えが可能なRAM12内に領域を設定することが望ましい。
・代表値(代表値使用状態):データIDに対応するデータ値として、ROM11に記憶された、対応する代表値IDの代表値を使用する。
・データ値(データ値使用状態):データIDに対応するデータ値として、フラッシュメモリ13に記憶されたデータ値を使用する。
FIG. 3 shows a configuration example of the data management information storage unit 12a in the RAM 12. The data management information storage unit stores, for each data ID, data management information indicating which one of the representative value of the ROM 11 or the data value stored in the flash memory 13 is used as the data value. . Since the data management information storage unit has a relatively high frequency of rewriting, it is desirable to set an area in the RAM 12 that can be rewritten in address units or bit units.
Representative value (representative value usage state): The representative value of the corresponding representative value ID stored in the ROM 11 is used as the data value corresponding to the data ID.
Data value (data value use state): The data value stored in the flash memory 13 is used as the data value corresponding to the data ID.

図4に、フラッシュメモリ13におけるデータ記憶領域13aの一例を示す。データは、データIDとデータ値とが対応付けられて記憶される。なお、データID0,2,5のデータでは、データ値は書き込まれているが、上述のデータ管理情報がデータ値使用状態を表していない状態であるため、該データ値は使用していない。   FIG. 4 shows an example of the data storage area 13 a in the flash memory 13. Data is stored in association with a data ID and a data value. In the data of the data IDs 0, 2, and 5, data values are written, but the data values are not used because the above-described data management information does not represent the data value use state.

フラッシュメモリ13は、アドレス単位あるいはビット単位で消去・上書きができないため、記憶されているデータの更新が行われたとき、あるいは新たにデータを追加するときは、この空き領域に順次追記される。例えば、データID1のデータの値が0x01から0x10に変化したときには、データID7のデータの記憶領域より後の空き領域に新たなデータが記憶される。   Since the flash memory 13 cannot be erased or overwritten in address units or bit units, when the stored data is updated or when new data is added, the flash memory 13 is sequentially added to this empty area. For example, when the data value of data ID1 changes from 0x01 to 0x10, new data is stored in a free area after the data storage area of data ID7.

また、フラッシュメモリ13に、RAM12のデータ管理情報記憶部12aのバックアップ領域13bを設けてもよい。ECU1の動作停止時に、これに先立って、データ管理情報記憶部12aの内容を(一括消去後の)バックアップ領域13bにコピーする。そして、ECU1の動作開始時(例えば、イニシャル時)に、バックアップ領域13bから読み出してデータ管理情報記憶部12aに戻す。無論、バックアップ領域13bの上書きは、アドレス単位あるいはビット単位ではできないので、バックアップ領域13bが含まれるメモリセルブロックは、データ記憶領域13aが含まれるメモリセルブロックとは別のものとすることが望ましい。   The flash memory 13 may be provided with a backup area 13b of the data management information storage unit 12a of the RAM 12. Prior to this, when the operation of the ECU 1 is stopped, the contents of the data management information storage unit 12a are copied to the backup area 13b (after the batch erasure). Then, when the operation of the ECU 1 is started (for example, at the initial time), the data is read from the backup area 13b and returned to the data management information storage unit 12a. Of course, since overwriting of the backup area 13b cannot be performed in units of addresses or bits, it is desirable that the memory cell block including the backup area 13b is different from the memory cell block including the data storage area 13a.

図5を用いて、ROM11に記憶された制御プログラムに含まれ、CPU10が実行するデータ書込抑制処理について説明する。まず、例えば、CPU10での演算の結果、あるデータのデータ値が変化したときのような、データ書き込みタイミングが到来したか否かを判定する。つまり、データ書込抑制処理は、フラッシュメモリの初期化以外のタイミングでも行われる。なお、データの演算結果は、例えばRAM12に一時記憶される。   The data write suppression process included in the control program stored in the ROM 11 and executed by the CPU 10 will be described with reference to FIG. First, for example, it is determined whether or not the data write timing has arrived as when the data value of certain data has changed as a result of the calculation by the CPU 10. That is, the data write suppression process is performed at a timing other than the initialization of the flash memory. The data calculation result is temporarily stored in the RAM 12, for example.

データ書き込みタイミングが到来しないとき(S11:No)、データ書き込みタイミングが到来するまで待つ。本処理を終了してもよい。一方、データ書き込みタイミングが到来したとき(S11:Yes)、RAM12に一時記憶されているデータ値を参照する(S12)。そして、ROM11に記憶されている、そのデータ値のデータIDに対応する代表値IDの代表値を参照し(S13)、両者を比較する。   When the data write timing does not arrive (S11: No), the process waits until the data write timing comes. This process may be terminated. On the other hand, when the data write timing arrives (S11: Yes), the data value temporarily stored in the RAM 12 is referred to (S12). Then, the representative value of the representative value ID corresponding to the data ID of the data value stored in the ROM 11 is referred to (S13), and both are compared.

比較の結果、データ値が代表値と同一のとき(S14:Yes)、該データIDのデータ値をフラッシュメモリ13には書き込まない、すなわちデータ書き込みを抑制する(S15)。そして、RAM12のデータ管理情報記憶部12aの、該データIDに対応するデータ管理情報を、代表値使用状態を表すもの(図3では、「代表値ID0」等と表記)とし、(S16)本処理を終了する。   As a result of the comparison, when the data value is the same as the representative value (S14: Yes), the data value of the data ID is not written to the flash memory 13, that is, the data writing is suppressed (S15). The data management information corresponding to the data ID in the data management information storage unit 12a of the RAM 12 is assumed to represent the representative value usage state (indicated as “representative value ID0” in FIG. 3), and (S16) The process ends.

一方、データ値が代表値と同一でないとき(S14:No)、データ管理情報記憶部12aの、該データIDに対応するデータ管理情報を参照する(S17)。そして、該データ管理情報がデータ値使用状態を表す(図3では、「データ値」と表記)とき(S18:Yes)、フラッシュメモリ13に記憶された該データIDに対応するデータ値を参照する(S19)。そして、これら2つのデータ値を比較する。   On the other hand, when the data value is not the same as the representative value (S14: No), the data management information corresponding to the data ID in the data management information storage unit 12a is referred to (S17). When the data management information indicates the data value usage state (indicated as “data value” in FIG. 3) (S18: Yes), the data value corresponding to the data ID stored in the flash memory 13 is referred to. (S19). Then, these two data values are compared.

比較の結果、2つのデータ値が同一のとき(S20:Yes)、何もせずに、すなわちデータ書き込みを抑制して本処理を終了する。一方、2つのデータ値が異なるとき(S20:No)、フラッシュメモリ13に新しいデータ値とそのデータIDとを記憶し(S22)、本処理を終了する。   As a result of the comparison, when the two data values are the same (S20: Yes), nothing is done, that is, the data writing is suppressed, and this processing is terminated. On the other hand, when the two data values are different (S20: No), the new data value and its data ID are stored in the flash memory 13 (S22), and this process is terminated.

つまり、上述の構成は、書き込みタイミング時に、書き込むデータ値が代表値と異なる値に変化しているとき、かつ、フラッシュメモリに既に記憶されている対応するデータ値が等しいとき、書込制御部は、データ書込部による、書き込むデータ値の前記フラッシュメモリへの書き込みを抑制するものである。   That is, in the above configuration, when the write data value changes to a value different from the representative value at the write timing, and when the corresponding data value already stored in the flash memory is equal, the write control unit The writing of data values to be written to the flash memory by the data writing unit is suppressed.

また、一方、データ管理情報がデータ値使用状態ではなく代表値使用状態を表すとき(S18:No)、該データ管理情報を、データ値使用状態を表すものとする(S21)。そして、フラッシュメモリ13に新しいデータ値とそのデータIDとを記憶し(S22)、本処理を終了する。   On the other hand, when the data management information represents not the data value use state but the representative value use state (S18: No), the data management information represents the data value use state (S21). Then, the new data value and its data ID are stored in the flash memory 13 (S22), and this process is terminated.

上述の、図5のデータ書込抑制処理の具体例について、図2〜図4を用いて説明する。RAM12のデータ管理情報記憶部12aのデータ管理情報(図3参照)が代表値ID0(すなわち、代表値使用状態)となっているデータID0のデータ値が、演算の結果、代表値ID0の0x05(図2参照)とは異なる0x80となったとき、データ管理情報をデータ値(すなわち、データ値使用状態)に書き換える。さらに、フラッシュメモリ13に既に記憶されているデータ値は0x00(図4参照)であり、新しいデータ値と異なるので、データID7の記憶領域の後の空き領域に、データID:0およびデータ値:0x80を書き込む。また、データID0のデータが書き込まれていないときには、新たに領域を確保して書き込む。   A specific example of the above-described data writing suppression process of FIG. 5 will be described with reference to FIGS. The data value of the data ID0 in which the data management information (see FIG. 3) of the data management information storage unit 12a of the RAM 12 is the representative value ID0 (that is, the representative value usage state) is 0x05 of the representative value ID0 as a result of the calculation. When 0x80, which is different from FIG. 2), the data management information is rewritten with the data value (that is, the data value use state). Further, since the data value already stored in the flash memory 13 is 0x00 (see FIG. 4), which is different from the new data value, the data ID: 0 and the data value: Write 0x80. Further, when the data of data ID 0 is not written, a new area is secured and written.

一般に、フラッシュメモリでは、メモリセルブロックの先頭からデータを書き込んでいくので、同じデータIDのデータが複数記憶されているときには、メモリセルブロックのより後方に記憶されているデータを読み出すようになっている。   In general, in flash memory, data is written from the beginning of the memory cell block, so when a plurality of data with the same data ID is stored, the data stored behind the memory cell block is read out. Yes.

また、データ管理情報記憶部12aのデータ管理情報(図3参照)が代表値ID2(すなわち、代表値使用状態)となっているデータID2のデータ値が、演算の結果、代表値ID2の0xAA(図2参照)とは異なる0xCCとなったとき、データ管理情報をデータ値(すなわち、データ値使用状態)に書き換える。このとき、フラッシュメモリ13に既に記憶されているデータ値が0xCC(図4参照)であり、新しいデータ値と同じであるので、フラッシュメモリ13への書き込みは行わない。   In addition, the data value of the data ID2 in which the data management information (see FIG. 3) in the data management information storage unit 12a is the representative value ID2 (that is, the representative value use state) is 0xAA ( When the value becomes 0xCC different from that shown in FIG. 2, the data management information is rewritten to the data value (that is, the data value use state). At this time, the data value already stored in the flash memory 13 is 0xCC (see FIG. 4), which is the same as the new data value, and therefore writing to the flash memory 13 is not performed.

また、データ管理情報記憶部12aのデータ管理情報(図3参照)がデータ値(すなわち、データ値使用状態)となっているデータID3のデータ値0x7Fが、演算の結果、代表値と同じ0x80となったとき、データ管理情報を代表値ID3(すなわち、代表値使用状態)に書き換える。このとき、フラッシュメモリ13への書き込みは行わない。   Further, the data value 0x7F of the data ID3 in which the data management information (see FIG. 3) of the data management information storage unit 12a is the data value (that is, the data value usage state) is 0x80, which is the same as the representative value as a result of the calculation. When this happens, the data management information is rewritten to the representative value ID3 (that is, the representative value usage state). At this time, writing to the flash memory 13 is not performed.

図6を用いて、ROM11に記憶された制御プログラムに含まれ、CPU10が実行するデータ読出処理について説明する。なお、本処理は、CPU10は各種演算を行う際に必要となるデータ値を読み出すときのような、データ値を読み出す条件が成立したときに実行される。   A data reading process included in the control program stored in the ROM 11 and executed by the CPU 10 will be described with reference to FIG. This process is executed when a condition for reading a data value is satisfied, such as when the CPU 10 reads a data value necessary for performing various calculations.

まず、RAM12のデータ管理情報記憶部12aの、読み出したいデータIDに対応するデータ管理情報を参照する(S31)。次に、該データ管理情報が代表値使用状態を表すものであるとき(S32:Yes)、ROM11に記憶されている、該データIDに対応する代表値を読み出し(S33)、本処理を終了する。一方、該データ管理情報が代表値使用状態ではなくデータ値使用状態を表すものであるとき(S32:No)、フラッシュメモリ13に記憶されている、該データIDに対応するデータ値を読み出し(S34)、本処理を終了する。   First, the data management information corresponding to the data ID to be read in the data management information storage unit 12a of the RAM 12 is referred to (S31). Next, when the data management information indicates the representative value use state (S32: Yes), the representative value corresponding to the data ID stored in the ROM 11 is read (S33), and this process is terminated. . On the other hand, when the data management information represents not the representative value use state but the data value use state (S32: No), the data value corresponding to the data ID stored in the flash memory 13 is read (S34). ), This process is terminated.

上述の、図6の具体例について、図2〜図4を用いて説明する。データID0のデータは、データ管理情報(図3参照)が代表値使用状態を表しているので、データはROM11に記憶されている0x05(図2参照)が読み出される。また、データID4のデータは、データ管理情報(図3参照)がデータ値使用状態を表しているので、データはフラッシュメモリ13に記憶されている0x00(図4参照)が読み出される。   The specific example of FIG. 6 will be described with reference to FIGS. Since the data management information (see FIG. 3) represents the representative value usage state, the data of data ID 0 is read as 0x05 (see FIG. 2) stored in the ROM 11. In addition, since the data management information (see FIG. 3) indicates the data value use state, the data of the data ID 4 is read as 0x00 (see FIG. 4) stored in the flash memory 13.

図7に、図2の代表値記憶部11aの構成の別例を示す。これは、複数のデータIDで代表値を共有するものである。これにより、代表値記憶部11aの領域を少なくすることができる。図7の例では、代表値IDとデータIDとの間には、図2のような一対一の関係はなく、代表値ID毎に、代表値およびその代表値を用いるデータIDが関連付けられている。また、データ値のデータ長が1バイトの16進数であるとき、代表値の数は、データ(データID)の数に関係なく最大256個である。   FIG. 7 shows another example of the configuration of the representative value storage unit 11a of FIG. In this case, a representative value is shared by a plurality of data IDs. Thereby, the area | region of the representative value memory | storage part 11a can be decreased. In the example of FIG. 7, there is no one-to-one relationship as shown in FIG. 2 between the representative value ID and the data ID, and a representative value and a data ID using the representative value are associated with each representative value ID. Yes. When the data length of the data value is a 1-byte hexadecimal number, the number of representative values is 256 at the maximum regardless of the number of data (data ID).

例えば、データID0〜2は、それぞれ代表値ID0〜2の代表値に対応付けられている。また、データID3,5,7は、代表値ID10の代表値0x80に対応付けられている。また、データID4,6は、代表値ID11の代表値0x12に対応付けられている。   For example, the data IDs 0 to 2 are associated with the representative values of the representative values ID0 to 2, respectively. The data IDs 3, 5, and 7 are associated with the representative value 0x80 of the representative value ID10. The data IDs 4 and 6 are associated with the representative value 0x12 of the representative value ID11.

図8に、図7の構成におけるデータ管理情報記憶部12aの構成を示す。データID0〜2は、図3と同様であるが、データID5は、代表値ID10の代表値0x80を使用することを示している。   FIG. 8 shows the configuration of the data management information storage unit 12a in the configuration of FIG. The data IDs 0 to 2 are the same as in FIG. 3, but the data ID 5 indicates that the representative value 0x80 of the representative value ID10 is used.

なお、図7,図8の構成においても、データ書込抑制処理,データ読出処理は、それぞれ図5,図6と同様である。   7 and FIG. 8, the data write suppression process and the data read process are the same as those in FIGS. 5 and 6, respectively.

車両以外に用いられる電子制御装置にも適用可能である。   The present invention can also be applied to an electronic control device used other than a vehicle.

以上、本発明の実施の形態を説明したが、これらはあくまで例示にすぎず、本発明はこれらに限定されるものではなく、特許請求の範囲の趣旨を逸脱しない限りにおいて、当業者の知識に基づく種々の変更が可能である。   Although the embodiments of the present invention have been described above, these are merely examples, and the present invention is not limited to these embodiments, and the knowledge of those skilled in the art can be used without departing from the spirit of the claims. Various modifications based on this are possible.

1 ECU
10 CPU(データ書込部,比較部,書込制御部,データ読出部)
11 ROM(代表値記憶部)
12 RAM(データ管理情報記憶部)
13 フラッシュメモリ
1 ECU
10 CPU (data writing unit, comparison unit, write control unit, data reading unit)
11 ROM (Representative value storage)
12 RAM (data management information storage unit)
13 Flash memory

Claims (7)

データを特定するデータIDと、そのデータの値であるデータ値とを記憶するフラッシュメモリと、
予め定められた書き込みタイミングで、前記フラッシュメモリに前記データIDと前記データ値とを関連付けて書き込むデータ書込部と、
前記データID毎に対応した代表値IDが定められ、その代表値ID毎に予め定められた代表値を記憶する代表値記憶部と、
前記データID毎に、対応する前記データ値と前記代表値のいずれを該データIDに対応する値として使用するかを表すデータ管理情報を記憶するデータ管理情報記憶部と、
前記データ書込部が前記データを書き込む際に、書き込むデータ値と前記代表値とが同一か否かを比較する比較部と、
前記書き込むデータ値と前記代表値とが同一のときには、前記データ管理情報を、前記データIDに対応する値として前記代表値を使用する代表値使用状態を表すものとするとともに、前記データ書込部による前記フラッシュメモリへの該データIDに対応するデータ値の書き込みを抑制する書込制御部と、
を備えることを特徴とする電子制御装置。
A flash memory that stores a data ID that identifies data and a data value that is a value of the data;
A data writing unit for writing the data ID and the data value in association with the flash memory at a predetermined write timing;
A representative value ID corresponding to each data ID is determined, and a representative value storage unit that stores a predetermined representative value for each representative value ID;
Said each data ID, any corresponding said data value to said representative value storing data management information indicating whether to use as a value corresponding to the data ID data management information storage unit,
A comparison unit that compares whether the data value to be written and the representative value are the same when the data writing unit writes the data;
When the data value to be written and the representative value are the same, the data management information represents a representative value use state in which the representative value is used as a value corresponding to the data ID, and the data writing unit A write control unit that suppresses writing of a data value corresponding to the data ID to the flash memory by
An electronic control device comprising:
前記代表値は、前記データ値が得る値のうち、得る頻度のより高いものが定められる請求項1に記載の電子制御装置。   The electronic control device according to claim 1, wherein the representative value is determined more frequently among values obtained by the data value. 前記代表値IDに、複数の前記データIDが関連付けられている請求項1または請求項2に記載の電子制御装置。   The electronic control device according to claim 1, wherein a plurality of the data IDs are associated with the representative value ID. 前記書き込みタイミング時に、前記書き込むデータ値が前記代表値と異なる値に変化しているとき、
前記書込制御部は、前記データ書込部による前記フラッシュメモリへの、当該データIDに対応する前記データ値の書き込みの抑制を解除し、
前記データ管理情報記憶部は、前記データIDに対応するデータ管理情報を、前記データIDに対応する値として前記フラッシュメモリに記憶されたデータ値を使用することを表すデータ値使用状態とする請求項1ないし請求項3のいずれか1項に記載の電子制御装置。
At the time of writing, when the data value to be written is changed to a value different from the representative value,
The write control unit cancels suppression of writing of the data value corresponding to the data ID to the flash memory by the data writing unit;
The data management information storage unit sets the data management information corresponding to the data ID to a data value use state indicating that the data value stored in the flash memory is used as a value corresponding to the data ID. The electronic control device according to any one of claims 1 to 3.
前記データ管理情報が前記データ値使用状態を表すとき、前記書き込みタイミング時に、前記データ値が前記代表値と同じ値に変化しているとき、
前記書込制御部は、前記データ管理情報を前記代表値使用状態として、前記データ書込部による前記フラッシュメモリへの、当該データIDに対応するデータ値の書き込みを抑制する請求項4に記載の電子制御装置。
When the data management information represents the data value use state, at the time of the writing, when the data value is changed to the same value as the representative value,
5. The write control unit according to claim 4, wherein the write control unit suppresses writing of a data value corresponding to the data ID to the flash memory by the data writing unit with the data management information as the representative value use state. Electronic control device.
予め定められた読み出しタイミングで、前記データIDに対応するデータ値を読み出すデータ読出部を備え、
前記データ読出部は、前記データ管理情報が前記代表値使用状態を表すときに、前記データIDに対応する代表値IDの代表値を前記代表値記憶部から読み出す請求項1ないし請求項5のいずれか1項に記載の電子制御装置。
A data reading unit for reading a value of data corresponding to the data ID at a predetermined read timing;
6. The data reading unit according to claim 1, wherein when the data management information indicates the representative value usage state, the data reading unit reads a representative value of a representative value ID corresponding to the data ID from the representative value storage unit. The electronic control device according to claim 1.
予め定められた読み出しタイミングで、前記データIDに対応するデータ値を読み出すデータ読出部を備え、
前記データ読出部は、前記データ管理情報が前記データ値使用状態を表すときに、前記データIDに対応するデータ値を前記フラッシュメモリから読み出す請求項4または請求項5に記載の電子制御装置。
A data reading unit for reading a data value corresponding to the data ID at a predetermined read timing;
6. The electronic control device according to claim 4, wherein the data reading unit reads a data value corresponding to the data ID from the flash memory when the data management information indicates the data value use state.
JP2011201987A 2011-09-15 2011-09-15 Electronic control unit Expired - Fee Related JP5754316B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011201987A JP5754316B2 (en) 2011-09-15 2011-09-15 Electronic control unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011201987A JP5754316B2 (en) 2011-09-15 2011-09-15 Electronic control unit

Publications (2)

Publication Number Publication Date
JP2013065080A JP2013065080A (en) 2013-04-11
JP5754316B2 true JP5754316B2 (en) 2015-07-29

Family

ID=48188555

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011201987A Expired - Fee Related JP5754316B2 (en) 2011-09-15 2011-09-15 Electronic control unit

Country Status (1)

Country Link
JP (1) JP5754316B2 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03108040A (en) * 1989-09-22 1991-05-08 Hitachi Ltd Data storage device with improved same data repeated write mechanism
JPH07295894A (en) * 1994-04-20 1995-11-10 Toshiba Corp Data preservation device
JP2007304920A (en) * 2006-05-12 2007-11-22 Matsushita Electric Ind Co Ltd Flash memory control method
JP5317689B2 (en) * 2008-12-27 2013-10-16 株式会社東芝 Memory system

Also Published As

Publication number Publication date
JP2013065080A (en) 2013-04-11

Similar Documents

Publication Publication Date Title
JP5661227B2 (en) Memory controller
US8055859B2 (en) Apparatus and method for providing atomicity with respect to request of write operation for successive sector
US8327064B2 (en) Data processor with flash memory, and method for accessing flash memory
JP2019192316A (en) Nonvolatile storage device, memory control device, and memory control method
JP5695112B2 (en) Data storage device, data storage method, and in-vehicle control device
JP5754316B2 (en) Electronic control unit
US20100077131A1 (en) Updating control information in non-volatile memory to control selection of content
US20130080690A1 (en) Method to emulate eeprom using flash memory
JP5590069B2 (en) Microcomputer
CN109147847B (en) Semiconductor device and flash memory control method
JP5520880B2 (en) Flash memory device
US20160275011A1 (en) Microcomputer with built-in flash memory, method for writing data to built-in flash memory of microcomputer, and program for writing data to flash memory
US9773562B2 (en) Storage apparatus, flash memory control apparatus, and program
US11797230B2 (en) Bios variables storage
JP5787095B2 (en) Method for storing data in non-volatile memory
US11137937B2 (en) Information processing device and control method determining valid data in multiple memory areas based on multiple valid flags
CN111966363A (en) Method for initializing and reading configuration word, control device and vehicle
US9852064B2 (en) Method, apparatus and computer program for management of flash memory
CN107025144B (en) Method for writing and reading a data set
JP2015011524A (en) Electronic control device and method of controlling writing data into non-volatile memory
CN116893825A (en) Microcontroller and updating method of microcontroller
JP2018142211A (en) Vehicle controller
JP6317653B2 (en) Electronic control device for automobile and data storage method
JP2002268907A (en) Memory controller
JP2018160018A (en) Data processing device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140613

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150109

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150218

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150408

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: 20150428

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150511

R151 Written notification of patent or utility model registration

Ref document number: 5754316

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

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