JP2006127232A - Controller for nonvolatile memory - Google Patents

Controller for nonvolatile memory Download PDF

Info

Publication number
JP2006127232A
JP2006127232A JP2004316092A JP2004316092A JP2006127232A JP 2006127232 A JP2006127232 A JP 2006127232A JP 2004316092 A JP2004316092 A JP 2004316092A JP 2004316092 A JP2004316092 A JP 2004316092A JP 2006127232 A JP2006127232 A JP 2006127232A
Authority
JP
Japan
Prior art keywords
data
nonvolatile memory
determined
checksum
detection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2004316092A
Other languages
Japanese (ja)
Other versions
JP2006127232A5 (en
Inventor
Keiichi Enomoto
恵一 榎本
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.)
Jidosha Denki Kogyo KK
Original Assignee
Jidosha Denki Kogyo KK
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 Jidosha Denki Kogyo KK filed Critical Jidosha Denki Kogyo KK
Priority to JP2004316092A priority Critical patent/JP2006127232A/en
Publication of JP2006127232A publication Critical patent/JP2006127232A/en
Publication of JP2006127232A5 publication Critical patent/JP2006127232A5/ja
Pending legal-status Critical Current

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide the controller for a nonvolatile memory for surely prolonging the life of a nonvolatile memory. <P>SOLUTION: This controller of a nonvolatile memory for controlling the storage and erasure of data for a nonvolatile memory is configured to carry out data erasure processing (step S5) for reading detection data where a storage region in the non-volatile memory is classified from data and check sum from a non-volatile memory, and for updating only the value of the detection data, and for carrying out data storage processing (step S9) for reading the updated detection data, and for calculating a check sum by using the detection data and the data to be stored, and for writing the check sum and the data to be stored for reducing the number of times of write in each predetermined processing cycle into one time by each power supply or predetermined processing cycle. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、各種情報が書き込み及び読み出しされる不揮発性メモリの制御装置に関する。   The present invention relates to a control device for a nonvolatile memory in which various information is written and read.

従来より、EEPROM等の不揮発性メモリの各種情報の書き込み及び読み出しを制御する技術としては、下記の特許文献1に記載されているようなものが知られている。この特許文献1に記載された技術は、車両用開閉体の絶対動作位置を更新記憶するメモリとして、不揮発性メモリを使用し、車両の電源がオフとなっても、データを記憶保持する。また、特許文献1に記載された技術では、エンジン等の始動時の電圧降下に起因して、制御装置がリセットされて、不揮発性メモリのデータが適正ではなくなる不具合を防止している(段落番号0022,図3参照)。   Conventionally, as a technique for controlling writing and reading of various types of information in a nonvolatile memory such as an EEPROM, a technique described in Patent Document 1 below is known. The technique described in Patent Document 1 uses a nonvolatile memory as a memory for updating and storing the absolute operation position of the vehicle opening / closing body, and stores and holds data even when the vehicle is turned off. In addition, the technique described in Patent Document 1 prevents a problem that the data in the nonvolatile memory is not appropriate because the control device is reset due to a voltage drop at the start of the engine or the like (paragraph number). 0022, see FIG.

特開2002−2293号公報Japanese Patent Laid-Open No. 2002-2293

ところで、不揮発性メモリの異常に対処するためには、図6に示すように、電源投入時に、制御装置によって、不揮発性メモリのデータ判定を行う(ステップS101)。   By the way, in order to cope with the abnormality of the nonvolatile memory, as shown in FIG. 6, when the power is turned on, the controller determines data of the nonvolatile memory (step S101).

不揮発性メモリの異常の有無の判定は、図7に示すように、先ず不揮発性メモリからデータD1〜Dn及びチェックサムAを読み出し(ステップS111)、チェックサムAに対してデータD1〜Dnが正常であるか否かを判定する(ステップS112)。これにより、不揮発性メモリに書き込まれているデータが正常であるか、又は、データが異常であるかを判断する。   As shown in FIG. 7, first, the data D1 to Dn and the checksum A are read from the nonvolatile memory (step S111), and the data D1 to Dn are normal with respect to the checksum A, as shown in FIG. It is determined whether or not (step S112). Thereby, it is determined whether the data written in the nonvolatile memory is normal or the data is abnormal.

そして、図6に示すように、データ判定処理によって異常と判定された場合には、異常警告を出す等の対処を行う(ステップS102)。   Then, as shown in FIG. 6, when it is determined that there is an abnormality by the data determination process, a countermeasure such as issuing an abnormality warning is performed (step S102).

次に、データの消去(ステップS104)、通常処理(ステップS105)、データ保存(ステップS106)を行い、処理再開するか否かを判定し(ステップS107)、処理再開する場合には、ステップS104〜ステップS106の処理を繰り返し、処理再開しない場合には、電源を切断する。   Next, data erasure (step S104), normal processing (step S105), and data storage (step S106) are performed, and it is determined whether or not the processing is to be resumed (step S107). When the process of step S106 is repeated and the process is not resumed, the power is turned off.

このデータ消去処理(ステップS104)は、図8に示すように、データD1〜Dn及びチェックサムAの一部又は全てに、データ読み出し時にチェックサムAに対してデータD1〜Dnが異常と判定されるようなデータを書き込む。この異常と判定するデータを書き込むことは、不揮発性メモリのデータを消去することを意味する。具体的には、不揮発性メモリ内のデータを消去又は適当な固定データを書き込んだり、チェックサムAとデータD1〜Dnとの整合性がなくなるように、読み出したデータに対して書込データを可変させる。   In this data erasure process (step S104), as shown in FIG. 8, data D1 to Dn and checksum A are partly or all of data D1 to Dn are determined to be abnormal with respect to checksum A when data is read. Write such data. Writing the data determined to be abnormal means erasing the data in the nonvolatile memory. Specifically, the write data can be changed with respect to the read data so that the data in the nonvolatile memory is erased or appropriate fixed data is written, or the consistency between the checksum A and the data D1 to Dn is lost. Let

データ保存(ステップS106)は、図9に示すように、先ず保存するデータD1〜Dn、上述の例で言えば車両用開閉体の絶対動作位置からチェックサムAを算出し(ステップS121)、データD1〜DnとチェックサムAを不揮発性メモリに書き込む(ステップS122)。   In the data storage (step S106), as shown in FIG. 9, first, the checksum A is calculated from the data D1 to Dn to be stored, the absolute operation position of the vehicle opening / closing body in the above example (step S121). D1 to Dn and checksum A are written to the nonvolatile memory (step S122).

しかしながら、上述の図6〜図9を参照して説明した処理では、データ消去処理(ステップS104)とデータ保存処理(ステップS106)とで同一記憶領域に対して各2回の書込を行う必要があった。したがって、書込回数によって不揮発性メモリの寿命が決まるために、出来る限り書込回数を低減させることが要望されている。   However, in the processing described with reference to FIGS. 6 to 9 described above, it is necessary to write twice in the same storage area in the data erasure processing (step S104) and the data storage processing (step S106). was there. Therefore, since the lifetime of the nonvolatile memory is determined by the number of times of writing, it is desired to reduce the number of times of writing as much as possible.

なお、上述の図6〜図9を参照して説明した処理では、急な電源切断や回路故障によってデータ保存を行えない可能性があるので、通常処理後にデータ保存を行っているが、通常処理からデータ保存処理までの間に何らかの原因によって、不揮発性メモリへのデータ未書込が発生すると、データ判定処理において、不揮発性メモリ自体の異常と、未書込による異常との区別ができず、同じデータ消去処理を実行していたのが実状である。これは、現状として、正確に不揮発性メモリ自体の異常と、未書込とが区別されていないためにである。   In the processing described with reference to FIGS. 6 to 9 described above, there is a possibility that data cannot be stored due to sudden power-off or circuit failure, so data is stored after normal processing. If data is not written to the non-volatile memory due to some reason between the data storage process and the data storage process, the data determination process cannot distinguish between an abnormality of the non-volatile memory itself and an abnormality due to unwriting, The actual situation is that the same data erasing process was executed. This is because, at present, the abnormality of the nonvolatile memory itself is not accurately distinguished from the unwritten state.

そこで、本発明は、上述した実情に鑑みて提案されたものであり、不揮発性メモリの異常と未書込を区別する手段を提供し、且つ不揮発性メモリの寿命を確実に長くすることができる不揮発性メモリの制御装置を提供することを目的とする。   Therefore, the present invention has been proposed in view of the above-described circumstances, and provides a means for distinguishing between abnormality and non-writing of the nonvolatile memory, and can reliably extend the lifetime of the nonvolatile memory. An object of the present invention is to provide a control device for a nonvolatile memory.

本発明は、不揮発性メモリに対するデータの保存及び消去を制御する不揮発性メモリの制御装置であって、電源投入時又は所定処理サイクルごとに、前記不揮発性メモリから、当該不揮発性メモリ内の記憶領域が前記データ及びチェックサムから区分された検出データを読み出し、当該検出データの値のみを更新するデータ消去手段と、前記データ消去手段で更新された前記検出データを読み出し、この検出データと保存対象のデータとを用いて前記チェックサムを算出して、このチェックサム及び前記保存対象のデータを書き込むデータ保存手段とを備えることによって、上述の課題を解決する。   The present invention is a non-volatile memory control device that controls storage and erasure of data in a non-volatile memory, and from the non-volatile memory to a storage area in the non-volatile memory at power-on or every predetermined processing cycle Reads out the detection data divided from the data and the checksum, reads out the detection data updated by the data erasing means, the data erasing means for updating only the value of the detection data, and the detection data and the storage target The above-mentioned problem is solved by providing a data storage means for calculating the checksum using data and writing the checksum and the data to be stored.

本発明に係る不揮発性メモリの制御装置によれば、データ消去時には、検出データのみを更新し、データ保存時には検出データと保存対象のデータとを用いてチェックサムを算出して、このチェックサム及び保存対象のデータを書き込むので、データ消去及びデータ保存からなる1回の処理サイクルでの書込回数を記憶領域毎に各1回とすることが出来、不揮発性メモリの寿命を確実に長くすることができる。   According to the nonvolatile memory control device of the present invention, at the time of erasing data, only the detected data is updated, and at the time of saving the data, a checksum is calculated using the detected data and the data to be saved. Since the data to be saved is written, the number of times of writing in one processing cycle consisting of data erasure and data saving can be set once for each storage area, and the life of the nonvolatile memory is surely increased. Can do.

以下、本発明の実施の形態について図面を参照して説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

本発明は、不揮発性メモリの異常が、不揮発性メモリ自体の異常によるものか、不揮発性メモリへの未書込によるものかを正確に区別すると共に、不揮発性メモリの寿命を確実に長くするメモリ制御装置に適用される。   The present invention accurately discriminates whether an abnormality of a nonvolatile memory is due to an abnormality of the nonvolatile memory itself or an unwritten state in the nonvolatile memory, and reliably increases the lifetime of the nonvolatile memory Applies to control devices.

[メモリ制御装置の構成]
このメモリ制御装置は、例えば車両に搭載され、図1に示すように、ECU1に、バッテリ電源2及びIGNスイッチ3が接続されて構成されている。ECU1は、バッテリ電源2に接続された電源回路11と、IGNスイッチ3に接続された入力I/F12と、各種の演算処理及びメモリ制御を行うMPU13と、不揮発性メモリであるEEPROM14とからなる。
[Configuration of memory controller]
This memory control device is mounted on a vehicle, for example, and is configured by connecting a battery power source 2 and an IGN switch 3 to an ECU 1 as shown in FIG. The ECU 1 includes a power supply circuit 11 connected to the battery power supply 2, an input I / F 12 connected to the IGN switch 3, an MPU 13 that performs various arithmetic processes and memory control, and an EEPROM 14 that is a nonvolatile memory.

このメモリ制御装置は、用途の一例を挙げると、例えばディーゼルエンジンによって走行する車両に搭載され、ディーゼルエンジン車両から排出される排気ガス中のNOxを水と窒素に分解する尿素SCR触媒用尿素水の尿素濃度を検出する検出回路(図示せず)と接続され、尿素濃度の検出値をMPU13によって入力してEEPROM14に記憶制御し、排気ガス浄化システムを実現するものである。したがって、このメモリ制御装置は、車両の電源が投入されている時には、確実にEEPROM14に記憶した情報の更新を実現すると共に、車両の電源が切断された場合であっても、確実にEEPROM14に各種情報を保持する必要がある。   For example, this memory control device is mounted on a vehicle that is driven by a diesel engine, and urea water for urea SCR catalyst that decomposes NOx in exhaust gas discharged from the diesel engine vehicle into water and nitrogen. It is connected to a detection circuit (not shown) for detecting the urea concentration, and the detected value of the urea concentration is input by the MPU 13 and stored in the EEPROM 14 to realize an exhaust gas purification system. Therefore, this memory control device can reliably update the information stored in the EEPROM 14 when the vehicle is powered on, and can reliably store various information in the EEPROM 14 even when the vehicle is powered off. Information needs to be retained.

バッテリ電源2は、車両のバッテリをECU1に供給するか否かを制御する装置であり、IGNスイッチ3のON操作に応じてECU1に電力供給を開始し、IGNスイッチ3のOFF操作から所定の時間だけECU1への電力供給を維持した後、ECU1への電力供給を遮断する。このECU1への電力供給が維持される所定の時間は、ECU1がIGNスイッチ3のOFF操作の検出に要する時間と、OFF操作を検出してからEEPROM14へのデータの記録処理が終了するまでに要する時間とを加算した時間に対して、十分に長い時間である。バッテリ電源2は、ECU1に接続されている。IGNスイッチ3は、車両の運転者によってオンオフが操作される。   The battery power source 2 is a device that controls whether or not the battery of the vehicle is supplied to the ECU 1. The battery power source 2 starts supplying power to the ECU 1 in response to the ON operation of the IGN switch 3, and starts a predetermined time from the OFF operation of the IGN switch 3. Only after the power supply to the ECU 1 is maintained, the power supply to the ECU 1 is cut off. The predetermined time during which the power supply to the ECU 1 is maintained is the time required for the ECU 1 to detect the OFF operation of the IGN switch 3 and the time from the detection of the OFF operation to the end of the data recording process to the EEPROM 14. The time is sufficiently longer than the time obtained by adding the time. The battery power source 2 is connected to the ECU 1. The IGN switch 3 is turned on / off by the driver of the vehicle.

ECU1は、バッテリ電源2からの電力供給を電源回路11で受ける。電源回路11は、いわゆるスイッチング電源であり、バッテリ電源2の電源電圧をMPU13の作動電圧に変換して、MPU13及びEEPROM14に電力供給を行う。入力I/F12は、IGNスイッチ3のオンオフ状態を検出し、当該オンオフ状態をMPU13に通知する。   The ECU 1 receives power supply from the battery power supply 2 by the power supply circuit 11. The power supply circuit 11 is a so-called switching power supply, converts the power supply voltage of the battery power supply 2 into the operating voltage of the MPU 13, and supplies power to the MPU 13 and the EEPROM 14. The input I / F 12 detects the on / off state of the IGN switch 3 and notifies the MPU 13 of the on / off state.

MPU13は、図示しない尿素濃度検出回路と接続され、尿素濃度信号を受信する。そして、このMPU13は、電源回路11の電力供給を受けて作動し、入力I/F12からのIGN信号に従って、EEPROM14に対する書込及び読み込み動作を行う。   The MPU 13 is connected to a urea concentration detection circuit (not shown) and receives a urea concentration signal. The MPU 13 operates upon receiving power supply from the power supply circuit 11 and performs writing and reading operations on the EEPROM 14 according to the IGN signal from the input I / F 12.

MPU13は、入力I/F12の入力端子、EEPROM14の送信端子及び受信端子、クロック端子が設けられている。また、MPU13は、内部メモリに図示しないプログラムが記憶され、当該プログラムに従って、後述のメモリ制御処理を実行する。   The MPU 13 is provided with an input terminal of the input I / F 12, a transmission terminal and a reception terminal of the EEPROM 14, and a clock terminal. The MPU 13 stores a program (not shown) in the internal memory, and executes a memory control process described later according to the program.

[メモリ制御処理]
つぎに、上述したように構成されたメモリ制御装置において、MPU13によってEEPROM14に対する制御であるメモリ制御処理の処理手順について図2乃至図5を参照して説明する。
[Memory control processing]
Next, in the memory control apparatus configured as described above, the processing procedure of the memory control process, which is the control of the EEPROM 14 by the MPU 13, will be described with reference to FIGS.

このメモリ制御処理は、図2に示すようなステップS2,S3,S4,S5,S7,S9,S11の一連の処理によって、データ判定処理(ステップS2)、データ保存処理(ステップS9)及びデータ消去処理(ステップS5)を行うが、EEPROM14に保存及び消去された内容について説明するために、先ず、異常が発生していない場合のデータ保存処理(ステップS9)、データ消去処理(ステップS5)について説明する。なお、図2において、ステップS2〜ステップS4は、ECU1の電源投入時のみに実行され、ステップS5,S7,S9,S11は、EEPROM14に対するデータの保存及び消去時における所定処理サイクルごとに繰り返し実行される。   This memory control process is performed by a series of processes of steps S2, S3, S4, S5, S7, S9, and S11 as shown in FIG. 2, data determination process (step S2), data storage process (step S9), and data erasure. The processing (step S5) is performed. In order to explain the contents saved and erased in the EEPROM 14, first, the data saving processing (step S9) and the data erasing processing (step S5) when no abnormality has occurred will be explained. To do. In FIG. 2, steps S2 to S4 are executed only when the ECU 1 is turned on, and steps S5, S7, S9, and S11 are repeatedly executed for each predetermined processing cycle at the time of saving and erasing data in the EEPROM 14. The

データ保存処理(ステップS9)は、図5に示すように、先ず、MPU13により、EEPROM14に、予め後述のデータ消去処理において記憶しておいた検出データXを読み出す(ステップS51)。ここで、EEPROM14は、検出データXの記憶領域と、データD1〜Dnの記憶領域と、チェックサムAの記憶領域とに区分されている。この検出データXは、X1又はX2の何れかの値に設定されるデータであり、MPU13によるデータ消去処理で設定される。なお、このステップS51では、図2におけるデータ判定処理で読み出した値を検出データXとしてもよい。   In the data storage process (step S9), as shown in FIG. 5, first, the MPU 13 reads the detection data X previously stored in the EEPROM 14 in the data erasing process described later (step S51). Here, the EEPROM 14 is divided into a storage area for the detection data X, a storage area for the data D1 to Dn, and a storage area for the checksum A. This detection data X is data set to either X1 or X2, and is set by data erasure processing by the MPU 13. In step S51, the value read in the data determination process in FIG.

次にMPU13は、保存する対象となる尿素濃度信号であるデータD1〜Dnと、ステップS51で読み出した検出データXとから、チェックサムAを算出する(ステップS52)。このとき、MPU13は、データD1〜Dnと検出データXとの総和、或いは、データD1〜Dn及び検出データXを用いてCRCデータを作成する処理を行う。   Next, the MPU 13 calculates a checksum A from the data D1 to Dn, which are urea concentration signals to be stored, and the detection data X read in step S51 (step S52). At this time, the MPU 13 performs processing for creating CRC data using the sum of the data D1 to Dn and the detection data X or the data D1 to Dn and the detection data X.

次に、MPU13は、データD1〜Dnと、チェックサムAとをEEPROM14に書き込む。ここで、MPU13は、検出データXを書き込まない。   Next, the MPU 13 writes the data D1 to Dn and the checksum A into the EEPROM 14. Here, the MPU 13 does not write the detection data X.

データ消去処理(ステップS5)は、図4に示すように、MPU13により、先ずEEPROM14から、旧検出データXを取り出す(ステップS41)。なお、このステップS51では、図2におけるデータ判定処理で読み出した値を検出データXとしてもよい。   In the data erasing process (step S5), as shown in FIG. 4, the MPU 13 first takes out the old detection data X from the EEPROM 14 (step S41). In step S51, the value read in the data determination process in FIG.

次にMPU13は、ステップS41で読み出した旧検出データXの値を調べ、X2である場合には新検出データX’の値をX1に設定し(ステップS43)、X1である場合には新検出データX’の値をX2に設定する(ステップS44)。   Next, the MPU 13 checks the value of the old detection data X read in step S41, and if it is X2, sets the value of the new detection data X ′ to X1 (step S43), and if it is X1, the new detection data The value of data X ′ is set to X2 (step S44).

次にMPU13は、ステップS43又はステップS44で設定した新検出データX’をEEPROM14に保存する。   Next, the MPU 13 stores the new detection data X ′ set in step S43 or step S44 in the EEPROM 14.

このように、MPU13は、データD1〜Dn及びチェックサムAと独立して保存及び消去される検出データXを設定することによって、正常な場合と異常を検出した場合とで、データ保存処理と、データ消去処理とを切り換える。   As described above, the MPU 13 sets the detection data X that is stored and erased independently of the data D1 to Dn and the checksum A, so that the data storage process is performed in a normal case and an abnormal case. Switches between data erasure processing.

つぎに、図2に示すメモリ制御処理について説明する。   Next, the memory control process shown in FIG. 2 will be described.

このメモリ制御処理は、先ず電源が投入されると、EEPROM14に対する読み出し命令を行い、EEPROM14の内容が正常に読み出せた場合にはステップS2に処理を進める。   In the memory control process, when the power is first turned on, a read command is issued to the EEPROM 14, and if the contents of the EEPROM 14 can be normally read, the process proceeds to step S2.

ステップS2において、MPU13は、EEPROM14のデータ判定を行う。このデータ判定は、EEPROM14の異常の有無の判定(ステップS2a)と、EEPROM14が未書込か否かの判定(ステップS2b)の2つの判定からなる。   In step S <b> 2, the MPU 13 performs data determination on the EEPROM 14. This data determination includes two determinations: determination of whether the EEPROM 14 is abnormal (step S2a) and determination of whether the EEPROM 14 is unwritten (step S2b).

EEPROM14の異常の有無の判定は、図3に示すように、先ずEEPROM14からデータD1〜Dn及びチェックサムAを読み出すと共に、EEPROM14から検出データXを読み出し(ステップS21)、チェックサムAに対してデータD1〜Dn及び検出データXが正常であるか否かを判定する(ステップS22)。これにより、正常であると判定した場合には、図2のステップS2からステップS5に移行し、異常であると判定した場合には、図3のステップS24に処理を進める(ステップS23)。   As shown in FIG. 3, first, the data D1 to Dn and the checksum A are read from the EEPROM 14, and the detection data X is read from the EEPROM 14 (step S21). It is determined whether D1 to Dn and the detection data X are normal (step S22). Thus, when it is determined that the operation is normal, the process proceeds from step S2 in FIG. 2 to step S5. When it is determined that the operation is abnormal, the process proceeds to step S24 in FIG. 3 (step S23).

次に、MPU13は、図2におけるステップS2bの処理に相当するステップS24〜ステップS30に移行する。   Next, the MPU 13 proceeds to step S24 to step S30 corresponding to the process of step S2b in FIG.

ステップS24において、MPU13は、ステップS21で読み出した検出データXの値が、X1又はX2の何れか、又は、X1、X2のいずれでもないかを判定し、ステップS25において、X1又はX2の何れかであると判定した場合には、正常であるのでステップS26に処理を進める。   In step S24, the MPU 13 determines whether the value of the detection data X read in step S21 is either X1 or X2, or any of X1 and X2, and in step S25, either X1 or X2 is determined. If it is determined that it is normal, it is normal and the process proceeds to step S26.

一方、検出データXの値がX1、X2のいずれでもないと判定した場合には、MPU13におけるEEPROM14管理上の異常であると判定して、EEPROM14の自体の異常であると判定して、EEPROM14の異常による場合には、異常警告を出す等の対処を行う(ステップS3)。   On the other hand, when it is determined that the value of the detection data X is neither X1 nor X2, it is determined that the abnormality is in the management of the EEPROM 14 in the MPU 13, it is determined that the abnormality is in the EEPROM 14 itself, and the EEPROM 14 In case of an abnormality, countermeasures such as issuing an abnormality warning are performed (step S3).

次にMPU13は、ステップS26において、検出データXの値がX2である場合には、値をX1に修正した修正検出データX’に設定し(ステップS27)、検出データXの値がX1である場合には、値をX2に修正した修正検出データX’に設定する(ステップS28)。   Next, in step S26, when the value of the detection data X is X2, the MPU 13 sets the value to the corrected detection data X ′ corrected to X1 (step S27), and the value of the detection data X is X1. In this case, the value is set to the correction detection data X ′ corrected to X2 (step S28).

次にMPU13は、ステップS29において、修正検出データX’とデータD1〜Dnから、チェックサムAを算出して、この算出したチェックサムAとステップS21で読み出したチェックサムAとが一致しているか否かを判定することによって、データD1〜Dnが適正なデータか否かを判定する。そして、双方のチェックサムAが一致した場合にはこの判定が正常であると判定して、EEPROM14に対するデータD1〜Dnの未書込であると判定して図2のステップS4に処理を進め、そうでない場合には、EEPROM14自体の異常であると判定して、ステップS3に処理を進める。   Next, in step S29, the MPU 13 calculates a checksum A from the correction detection data X ′ and the data D1 to Dn, and whether the calculated checksum A matches the checksum A read in step S21. By determining whether or not the data D1 to Dn are appropriate data. If both checksums A match, it is determined that this determination is normal, it is determined that the data D1 to Dn are not yet written to the EEPROM 14, and the process proceeds to step S4 in FIG. If not, it is determined that the EEPROM 14 itself is abnormal, and the process proceeds to step S3.

このステップS4においては、図2の処理において、電源電圧が低下したことによる未書込(故障)であるために図1のIGNスイッチ3又は入力I/F12の異常であることを示す故障情報を出力する。   In this step S4, failure information indicating that the IGN switch 3 or the input I / F 12 in FIG. 1 is abnormal because the power supply voltage has dropped (failed) in the processing of FIG. Output.

次にMPU13は、ステップS2のデータ判定処理で正常で判定された後のステップS5においては、図4を参照して説明したステップS41〜ステップS45の処理を行う。これによって、データD1〜Dn及びチェックサムAの消去は行わずに、検出データXの更新のみを行う。なお、データ消去時の異常がなかった場合には、ステップS7に処理を進める。このデータ消去時の異常とは、バッテリ電源2の瞬断によってデータ消去処理が正常に行われずに、EEPROM14内の情報が異常なものとなることが挙げられる。   Next, MPU13 performs the process of step S41-step S45 demonstrated with reference to FIG. 4 in step S5 after having been normally determined by the data determination process of step S2. As a result, the data D1 to Dn and the checksum A are not erased, and only the detection data X is updated. If there is no abnormality during data erasure, the process proceeds to step S7. The abnormality at the time of erasing data includes that the data erasing process is not normally performed due to an instantaneous interruption of the battery power supply 2 and the information in the EEPROM 14 becomes abnormal.

次にMPU13は、ステップS7において通常処理を行う。   Next, the MPU 13 performs normal processing in step S7.

ステップS9において、MPU13は、図5を参照して説明したステップS51〜ステップS53の処理を行う。これによって、EEPROM14には、新たなデータD1〜Dn及びチェックサムAが書き込まれるが、検出データXの更新は行われない。なお、データ保存時の異常がなかった場合には、ステップS11に処理を進める。このデータ保存時の異常とは、違法無線送信器などの強力な電磁波によりMPU13からEEPROM14間の信号伝達に狂いが生じ、データ保存処理が正常に行われずに、EEPROM14内の情報が異常なものとなることが挙げられる。   In step S9, the MPU 13 performs the processes of steps S51 to S53 described with reference to FIG. As a result, new data D1 to Dn and checksum A are written in the EEPROM 14, but the detection data X is not updated. If there is no abnormality during data storage, the process proceeds to step S11. This abnormality at the time of data storage means that signal transmission between the MPU 13 and the EEPROM 14 is caused by a strong electromagnetic wave such as an illegal wireless transmitter, and the data storage processing is not normally performed, and the information in the EEPROM 14 is abnormal. It can be mentioned.

次にMPU13は、ステップS11において、処理再開するか否かを判定し(ステップS11)、処理再開する場合には、ステップS5〜ステップS11の処理を繰り返し、処理再開しない場合には、電源を切断する。   Next, in step S11, the MPU 13 determines whether or not the process is to be resumed (step S11). If the process is to be resumed, the process from step S5 to step S11 is repeated. If the process is not resumed, the power is turned off. To do.

以上詳細に説明したように、本発明を適用したメモリ制御装置によれば、電源投入時又は所定処理サイクルごとに、EEPROM14から、当該EEPROM14内の記憶領域がデータD1〜Dn及びチェックサムAから区分された検出データXを読み出し、当該検出データXの値のみを更新するデータ消去処理と、データ消去手段で更新された検出データXを読み出し、この検出データXと保存対象のデータD1〜Dnとを用いてチェックサムAを算出して、このチェックサムA及び保存対象のデータD1〜Dnを書き込むデータ保存処理とを行うので、ステップS5〜ステップS11からなる1回の処理サイクルでの書込回数をEEPROM14の記憶領域毎に各1回とすることが出来る。   As described above in detail, according to the memory control device to which the present invention is applied, the storage area in the EEPROM 14 is divided from the data D1 to Dn and the checksum A when the power is turned on or every predetermined processing cycle. The detected data X is read out, the data erasing process for updating only the value of the detected data X, and the detected data X updated by the data erasing means are read out, and the detected data X and the data D1 to Dn to be stored are read out. The checksum A is used to calculate the data and the data storage process for writing the checksum A and the data D1 to Dn to be stored is performed. Therefore, the number of times of writing in one processing cycle consisting of step S5 to step S11 is calculated. This can be done once for each storage area of the EEPROM 14.

したがって、このメモリ制御装置によれば、不揮発性メモリの寿命を確実に長くすることができる。   Therefore, according to this memory control device, the lifetime of the nonvolatile memory can be reliably extended.

また、このメモリ制御装置によれば、EEPROM14からデータD1〜Dn、検出データX及びチェックサムAを読み出して、このチェックサムAに対してデータD1〜Dn及び検出データXが正常な情報であるか否かを判定する処理(ステップS21,22,23)と、ステップS23によって正常ではないと判定された場合に、検出データXの値が、予め設定された何れかの値にも該当しないと判定した場合にEEPROM14自体の異常であることを判定する処理(ステップS24,25)と、ステップS25によって検出データXの値が正常であると判定した場合に、検出データXの値を予め設定された何れかの値に修正して、チェックサムAに対してデータD1〜Dn及び修正した検出データXが正常な情報であるか否かを判定して、正常であると判定した場合には、EEPROM14の未書込であると判定し、異常である判定した場合にはEEPROM14自体の異常であることを判定する処理とを行うので、確実に電源投入時の不揮発性メモリの異常が、不揮発性メモリ自体の異常か、未書込による異常かを判定することが出来る。   Further, according to this memory control device, the data D1 to Dn, the detection data X, and the checksum A are read from the EEPROM 14, and the data D1 to Dn and the detection data X are normal information with respect to the checksum A. When it is determined that the process is not normal (steps S21, 22, 23) and step S23, the value of the detection data X is determined not to correspond to any of the preset values. In this case, when the process determines that the EEPROM 14 itself is abnormal (steps S24 and S25) and the value of the detection data X is determined to be normal in step S25, the value of the detection data X is preset. Correct to any value and determine whether data D1 to Dn and corrected detection data X are normal information for checksum A If it is determined to be normal, it is determined that the EEPROM 14 has not been written, and if it is determined to be abnormal, processing for determining that the EEPROM 14 itself is abnormal is performed. It is possible to determine whether the abnormality of the nonvolatile memory at the time of loading is an abnormality of the nonvolatile memory itself or an abnormality due to unwriting.

なお、上述の実施の形態は本発明の一例である。このため、本発明は、上述の実施形態に限定されることはなく、この実施の形態以外であっても、本発明に係る技術的思想を逸脱しない範囲であれば、設計等に応じて種々の変更が可能であることは勿論である。   The above-described embodiment is an example of the present invention. For this reason, the present invention is not limited to the above-described embodiment, and various modifications can be made depending on the design and the like as long as the technical idea according to the present invention is not deviated from this embodiment. Of course, it is possible to change.

本発明を適用したメモリ制御装置の構成を示すブロック図である。It is a block diagram which shows the structure of the memory control apparatus to which this invention is applied. 本発明を適用したメモリ制御装置によるメモリ制御処理の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the memory control process by the memory control apparatus to which this invention is applied. 本発明を適用したメモリ制御装置によるデータ判定処理の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the data determination process by the memory control apparatus to which this invention is applied. 本発明を適用したメモリ制御装置によるデータ消去処理の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the data deletion process by the memory control apparatus to which this invention is applied. 本発明を適用したメモリ制御装置によるデータ保存処理の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the data preservation | save process by the memory control apparatus to which this invention is applied. 従来におけるメモリ制御処理の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the memory control process in the past. 従来におけるデータ判定処理の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the data determination process in the past. 従来におけるデータ消去処理の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the data erasing process in the past. 従来における保存処理の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the preservation | save process in the past.

符号の説明Explanation of symbols

1 ECU
2 バッテリ電源
3 IGNスイッチ
11 電源回路
12 入力I/F
13 MPU
1 ECU
2 Battery power 3 IGN switch 11 Power circuit 12 Input I / F
13 MPU

Claims (3)

不揮発性メモリに対するデータの保存及び消去を制御する不揮発性メモリの制御装置において、
電源投入時又は所定処理サイクルごとに、前記不揮発性メモリから、当該不揮発性メモリ内の記憶領域が前記データ及びチェックサムから区分された検出データを読み出し、当該検出データの値のみを更新するデータ消去手段と、
前記データ消去手段で更新された前記検出データを読み出し、この検出データと保存対象のデータとを用いて前記チェックサムを算出して、このチェックサム及び前記保存対象のデータを書き込むデータ保存手段と
を備えることを特徴とする不揮発性メモリの制御装置。
In a non-volatile memory control device that controls storage and erasure of data in a non-volatile memory,
Data erasure that reads the detection data in which the storage area in the nonvolatile memory is divided from the data and the checksum and updates only the value of the detection data from the nonvolatile memory at power-on or every predetermined processing cycle Means,
Data detection means for reading the detection data updated by the data erasure means, calculating the checksum using the detection data and data to be saved, and writing the checksum and the data to be saved A control device for a non-volatile memory, comprising:
電源投入時に前記不揮発性メモリに関する異常を検出するデータ判定手段を備え、
このデータ判定手段は、
前記不揮発性メモリからデータ、前記検出データ及び前記チェックサムを読み出して、このチェックサムに対してデータ及び検出データが正常な情報であるか否かを判定する第1判定処理と、
前記第1判定処理によって正常ではないと判定された場合に、前記第1判定処理で読み出した検出データの値が、予め設定された何れかの値にも該当しないと判定した場合に前記不揮発性メモリ自体の異常であることを判定する第2判定処理と、
前記第2判定処理によって前記検出データの値が正常であると判定した場合に、前記検出データの値を予め設定された何れかの値に修正して、前記チェックサムに対してデータ及び修正した検出データが正常な情報であるか否かを判定して、正常であると判定した場合には前記不揮発性メモリの未書込であると判定し、異常である判定した場合には前記不揮発性メモリ自体の異常であることを判定する第3判定処理と
を実行することを特徴とする請求項1に記載の不揮発性メモリの制御装置。
Comprising data determining means for detecting an abnormality relating to the non-volatile memory at power-on,
This data judgment means
A first determination process of reading data, the detection data, and the checksum from the nonvolatile memory, and determining whether the data and the detection data are normal information with respect to the checksum;
When it is determined by the first determination process that the detection data is not normal, the non-volatility is determined when it is determined that the value of the detection data read by the first determination process does not correspond to any preset value. A second determination process for determining that the memory itself is abnormal;
When it is determined by the second determination process that the value of the detected data is normal, the value of the detected data is corrected to any preset value, and the data and the corrected checksum are corrected. It is determined whether or not the detected data is normal information. When it is determined that the detected data is normal, it is determined that the nonvolatile memory is not yet written. When it is determined that the detected data is abnormal, the nonvolatile memory is determined. The non-volatile memory control device according to claim 1, further comprising: a third determination process that determines that the memory itself is abnormal.
前記データ消去手段は、前記データ判定手段によって異常と判定された場合に、前記データ、チェックサム及び検出データを含む前記不揮発性メモリに書き込まれている情報全体に、データ未書込と判定されるデータを書き込むことを特徴とする請求項2に記載の不揮発性メモリの制御装置。   When the data erasing means determines that the data determining means is abnormal, the data erasing means determines that the entire information written in the nonvolatile memory including the data, checksum, and detected data is unwritten. 3. The non-volatile memory control device according to claim 2, wherein data is written.
JP2004316092A 2004-10-29 2004-10-29 Controller for nonvolatile memory Pending JP2006127232A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004316092A JP2006127232A (en) 2004-10-29 2004-10-29 Controller for nonvolatile memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004316092A JP2006127232A (en) 2004-10-29 2004-10-29 Controller for nonvolatile memory

Publications (2)

Publication Number Publication Date
JP2006127232A true JP2006127232A (en) 2006-05-18
JP2006127232A5 JP2006127232A5 (en) 2006-12-21

Family

ID=36721921

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004316092A Pending JP2006127232A (en) 2004-10-29 2004-10-29 Controller for nonvolatile memory

Country Status (1)

Country Link
JP (1) JP2006127232A (en)

Similar Documents

Publication Publication Date Title
US7925843B2 (en) Memory controller having a plurality of memory regions for protection against power failure
JP4572751B2 (en) Electronic control unit
EP2040166B1 (en) Memory management apparatus
US9110842B2 (en) Control device for vehicle and error processing method in control device for vehicle
US7203581B2 (en) Electronic control unit for controlling updating of data in non-volatile memory
JP3097580B2 (en) Electronic control unit
JP3968876B2 (en) Electronic control unit
CN111090541B (en) Data anti-lost method and device of controller, driving computer equipment and storage medium
JP2002062956A (en) Service interruption processing method and service interruption processing device
JP2006127232A (en) Controller for nonvolatile memory
WO2008099276A1 (en) Vehicle control device
WO2018079537A1 (en) Electronic control unit and data protection method therefor
JP2005338955A (en) Electronic control device
JPH11250675A (en) Memory and method for controlling memory
JP2009116521A (en) Data rewriting method for memory
JP2003312387A (en) Self-shutoff abnormality detection device for vehicle
JP2009026183A (en) Electronic control apparatus for automobile
US20100083073A1 (en) Data processing apparatus, memory controlling circuit, and memory controlling method
JP2006293650A (en) Backup device for vehicle information
JP2007041798A (en) Information processor and memory rewriting method for information processor
US7230849B2 (en) Data write apparatus for nonvolatile memory
JPH08153397A (en) Eeprom data rewrite controller
JP2000192844A (en) Engine control device
JP2000257502A (en) Electronic controller for automobile
JP2004021520A (en) Electronic controller for vehicle

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061101

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20061207

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20071204

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090522

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090529

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20091005