JP2013065261A - Memory management device - Google Patents
Memory management device Download PDFInfo
- Publication number
- JP2013065261A JP2013065261A JP2011204833A JP2011204833A JP2013065261A JP 2013065261 A JP2013065261 A JP 2013065261A JP 2011204833 A JP2011204833 A JP 2011204833A JP 2011204833 A JP2011204833 A JP 2011204833A JP 2013065261 A JP2013065261 A JP 2013065261A
- Authority
- JP
- Japan
- Prior art keywords
- data
- eeprom
- memory
- memory device
- abnormality
- 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
Links
Images
Abstract
Description
本発明は、電源遮断時にデータを退避させ保存する不揮発性メモリの故障を判定するためのメモリ管理装置に関する。具体的には、RAMのデータをバックアップするEEPROMの故障を判定するためのメモリ管理装置として利用可能である。 The present invention relates to a memory management device for determining a failure of a nonvolatile memory that saves and stores data when power is shut off. Specifically, it can be used as a memory management device for determining a failure of an EEPROM that backs up RAM data.
従来、マイクロコンピュータを用いる制御装置では、一時記憶メモリ(例えばRAM)内のデータを、不揮発性メモリ(例えばEEPROM)に退避させることがある。この処理は、一時記憶メモリのデータに不良が生じた場合に、不揮発性メモリから一時記憶メモリへデータを戻すことにより、データの復元を可能としている。しかし、不揮発性メモリに記録されたデータにも不良が生じるおそれがある。そこで、不揮発性メモリのデータの良否を判定する技術が知られている。例えば、特許文献1は、不揮発性メモリに記録されたデータの良否を判定するために、サムデータを利用する装置を開示している。
Conventionally, in a control device using a microcomputer, data in a temporary storage memory (for example, RAM) is sometimes saved in a nonvolatile memory (for example, an EEPROM). In this process, when the data in the temporary storage memory is defective, the data can be restored by returning the data from the nonvolatile memory to the temporary storage memory. However, the data recorded in the nonvolatile memory may be defective. Therefore, a technique for determining the quality of data in a nonvolatile memory is known. For example,
従来技術では、一時記憶メモリと不揮発性メモリとにデータを冗長管理している為に種々の課題を生じた。例えば、不揮発性メモリへの前回の退避処理の成否を、制御装置の起動直後に検出することができないという問題があった。また、不揮発性メモリから一時記憶メモリへデータを戻すまで、すなわち一時記憶メモリのデータに不良が生じるまで不揮発性メモリへの書込みの異常を検出できないという問題があった。 In the prior art, various problems arise because data is redundantly managed in the temporary storage memory and the nonvolatile memory. For example, there is a problem that the success or failure of the previous saving process to the nonvolatile memory cannot be detected immediately after the control device is started. Further, there has been a problem that an abnormality in writing to the nonvolatile memory cannot be detected until the data is returned from the nonvolatile memory to the temporary storage memory, that is, until the data in the temporary storage memory is defective.
また、従来技術では、不揮発性メモリへのデータの退避が正常に終了することを前提としている。このため、不揮発性メモリへの書込みに異常があった場合、書込み損ねたデータを一時記憶メモリに戻すおそれがあった。 Further, the conventional technique is premised on that data saving to the nonvolatile memory is normally completed. For this reason, when there is an abnormality in writing to the non-volatile memory, there is a possibility that the data which has been written incorrectly is returned to the temporary storage memory.
さらに、一時記憶メモリから不揮発性メモリへの退避処理の途中、すなわち不揮発性メモリへの書込み処理の途中で電源が瞬断などの障害を生じると、不揮発性メモリの内容の一部に古い退避データが残るおそれがある。このような場合、古い退避データに基づいて誤判定が生じるおそれがあった。 Furthermore, if a failure such as a momentary power interruption occurs during the saving process from the temporary storage memory to the non-volatile memory, that is, during the writing process to the non-volatile memory, the old saved data is part of the contents of the non-volatile memory. May remain. In such a case, an erroneous determination may occur based on old saved data.
本発明は上記問題点に鑑みてなされたものであり、その目的は、データを保存するための不揮発性メモリの異常を検出することができるメモリ管理装置を提供することである。 The present invention has been made in view of the above problems, and an object thereof is to provide a memory management device capable of detecting an abnormality of a nonvolatile memory for storing data.
本発明の他の目的は、データを保存するための不揮発性メモリの異常を検出することができ、不揮発性メモリへの書込み処理の途中で電源が瞬断などの障害を生じた場合でも、誤判定を回避できるメモリ管理装置を提供することである。 Another object of the present invention is to detect an abnormality in a nonvolatile memory for storing data, and even if a power failure occurs during the writing process to the nonvolatile memory, an error may occur. To provide a memory management device that can avoid the determination.
本発明は上記目的を達成するために以下の技術的手段を採用する。 The present invention employs the following technical means to achieve the above object.
請求項1に記載の発明は、制御装置(1、2)によって一時記憶領域として利用される第1のメモリ装置(3、31)と、第1のメモリ装置に記憶されたデータを冗長的に保存する第2のメモリ装置(4、41、42)と、第1のメモリ装置のデータを第2のメモリ装置へ書込むことによりデータを退避させる退避処理手段(22、192)と、退避処理手段による書込処理が正常終了(OK)したか異常終了(NG)したかを判定し、判定結果を第1のメモリ装置に設けられた書込結果領域(31a)に記憶する書込判定手段(23、193−195)と、書込結果領域に記憶された判定結果に基づいて第2のメモリ装置の正常または異常を判定する異常判定手段(27、163−169)とを備えることを特徴とする。 According to the first aspect of the present invention, the first memory device (3, 31) used as a temporary storage area by the control device (1, 2) and the data stored in the first memory device are redundantly stored. Second memory device (4, 41, 42) to be saved, save processing means (22, 192) for saving data by writing data of the first memory device to the second memory device, and save processing Write determination means for determining whether the writing process by means has ended normally (OK) or abnormally ended (NG) and storing the determination result in the write result area (31a) provided in the first memory device (23, 193-195) and abnormality determination means (27, 163-169) for determining normality or abnormality of the second memory device based on the determination result stored in the write result area. And
この構成によると、第1のメモリ装置に記憶されたデータを第2のメモリ装置に退避させるために、第1のメモリ装置のデータが、第2のメモリ装置へ書込まれる。この退避処理において、第2のメモリ装置への書込処理が正常終了したか異常終了したかが判定される。さらに、この判定結果は、第1のメモリ装置に設けられた書込結果領域に記憶される。よって、メモリ管理装置は、書込結果領域に記憶された判定結果に基づいて、第2のメモリ装置の正常または異常を判定することができる。 According to this configuration, in order to save the data stored in the first memory device to the second memory device, the data in the first memory device is written into the second memory device. In this saving process, it is determined whether the writing process to the second memory device has ended normally or abnormally. Further, this determination result is stored in a write result area provided in the first memory device. Therefore, the memory management device can determine whether the second memory device is normal or abnormal based on the determination result stored in the write result area.
請求項2に記載の発明は、さらに、退避処理手段による書込処理の前に、書込結果領域(31a)を初期化する退避前処理手段(21、191)を有し、異常判定手段(27)は、書込結果領域が初期化状態である場合、第2のメモリ装置の正常または異常を判定しないことを特徴とする。この構成によると、退避処理の前に、書込結果領域が初期化される。退避処理のための第2のメモリ装置への書込み途中に電源供給が遮断され、再起動される場合がある。このような再起動時であっても、書込結果領域は初期化されているから、前回の正常終了または異常終了が検出されることが回避される。このため、誤判定を回避できる。 The invention described in claim 2 further includes pre-saving processing means (21, 191) for initializing the writing result area (31a) before the writing processing by the saving processing means, and an abnormality determination means ( 27) is characterized in that, when the write result area is in the initialized state, whether the second memory device is normal or abnormal is not determined. According to this configuration, the write result area is initialized before the save process. There is a case where the power supply is cut off and restarted during writing to the second memory device for the saving process. Even during such a restart, since the writing result area is initialized, the previous normal end or abnormal end is prevented from being detected. For this reason, erroneous determination can be avoided.
請求項3に記載の発明は、退避前処理手段は、書込結果領域に書込判定手段による判定がまだ完了していないことを示す未判定(NA)を示すデータを書込むことにより、書込結果領域(31a)を初期化することを特徴とする。この構成によると、未判定を示すデータが書き込まれることによって書込結果領域が初期化される。このため、データがない状態からも区別することができる。 According to a third aspect of the present invention, the save preprocessing means writes data indicating undetermined (NA) indicating that the determination by the write determining means is not yet completed in the write result area. The initialization result area (31a) is initialized. According to this configuration, the write result area is initialized by writing the data indicating the undecided. For this reason, it is possible to distinguish from a state where there is no data.
請求項4に記載の発明は、退避処理手段は、電源供給が遮断されるときにデータを退避させるように構成され、異常判定手段は、電源供給が開始されるときに第2のメモリ装置の異常を判定するように構成されていることを特徴とする。この構成によると、電源供給が遮断されるとき、すなわちシャットオフ時にデータの退避が実行される。また、電源供給が開始されるとき、すなわちパワーオン時に第2のメモリ装置の正常または異常が判定される。 According to a fourth aspect of the present invention, the save processing means is configured to save data when the power supply is cut off, and the abnormality determination means is configured to store the second memory device when the power supply is started. It is characterized by determining abnormality. According to this configuration, data saving is executed when the power supply is cut off, that is, at the time of shut-off. In addition, when power supply is started, that is, when the power is turned on, whether the second memory device is normal or abnormal is determined.
請求項5に記載の発明は、異常判定手段は、異常終了が継続して発生した回数が所定の閾値回数(Fth)を上回ると第2のメモリ装置の異常を判定するように構成されている(166−169)ことを特徴とする。この構成によると、異常終了が閾値回数を越えて継続的に繰り返されると、第2のメモリ装置の異常が判定される。 According to a fifth aspect of the present invention, the abnormality determining means is configured to determine an abnormality of the second memory device when the number of times that the abnormal termination has continued exceeds a predetermined threshold number of times (Fth). (166-169). According to this configuration, when the abnormal termination is continuously repeated exceeding the threshold number of times, the abnormality of the second memory device is determined.
請求項6に記載の発明は、第1のメモリ装置は、バッテリによってバックアップされたRAM(3)であり、第2のメモリ装置は、EEPROM(4)であることを特徴とする。この構成によると、EEPROMの正常または異常を判定することができる。 The invention described in claim 6 is characterized in that the first memory device is a RAM (3) backed up by a battery, and the second memory device is an EEPROM (4). According to this configuration, it is possible to determine whether the EEPROM is normal or abnormal.
請求項7に記載の発明は、さらに、第2のメモリ装置に記憶されたデータに基づいて第1のメモリ装置のデータを復元する復元処理手段(25、26、161、162)を備えることを特徴とする。この構成によると、第1のメモリ装置のデータを、第2のメモリ装置のデータによって復元することができる。 The invention described in claim 7 further includes a restoration processing means (25, 26, 161, 162) for restoring the data of the first memory device based on the data stored in the second memory device. Features. According to this configuration, the data in the first memory device can be restored by the data in the second memory device.
なお、特許請求の範囲および上記手段の項に記載した括弧内の符号は、ひとつの態様として後述する実施形態に記載の具体的手段との対応関係を示すものであって、本発明の技術的範囲を限定するものではない。 Note that the reference numerals in parentheses described in the claims and the above-described means indicate the correspondence with the specific means described in the embodiments described later as one aspect, and are technical terms of the present invention. It does not limit the range.
以下に、図面を参照しながら本発明を実施するための複数の形態を説明する。各形態において先行する形態で説明した事項に対応する部分には同一の参照符号を付して重複する説明を省略する場合がある。各形態において構成の一部のみを説明している場合は、構成の他の部分については先行して説明した他の形態を適用することができる。また、後続の実施形態においては、先行する実施形態で説明した事項に対応する部分に百以上の位だけが異なる参照符号を付することにより対応関係を示し、重複する説明を省略する場合がある。各実施形態で具体的に組合せが可能であることを明示している部分同士の組合せばかりではなく、特に組合せに支障が生じなければ、明示してなくとも実施形態同士を部分的に組み合せることも可能である。 A plurality of modes for carrying out the present invention will be described below with reference to the drawings. In each embodiment, parts corresponding to the matters described in the preceding embodiment may be denoted by the same reference numerals, and redundant description may be omitted. When only a part of the configuration is described in each mode, the other modes described above can be applied to the other parts of the configuration. Further, in the following embodiments, the correspondence corresponding to the matters corresponding to the matters described in the preceding embodiments is indicated by adding reference numerals that differ only by one hundred or more, and redundant description may be omitted. . Not only combinations of parts that clearly show that combinations are possible in each embodiment, but also combinations of the embodiments even if they are not explicitly stated unless there is a problem with the combination. Is also possible.
(第1実施形態)
図1は、本発明を適用した第1実施形態に係る制御装置(ECU)1を示すブロック図である。制御装置1は、車両用の制御装置である。制御装置1は、車両に搭載されている。制御装置1は、複数のセンサ(SNR)11からの信号を入力し、所定の制御処理を実行することにより複数のアクチュエータ(ACT)12を制御する。制御装置1は、車両のバッテリ13から給電される。制御装置1は、電源スイッチ14がオフ位置からオン位置に操作されることにより作動状態となる。制御装置1は、電源スイッチ14がオン位置からオフ位置に操作されることにより停止状態となる。
(First embodiment)
FIG. 1 is a block diagram showing a control device (ECU) 1 according to a first embodiment to which the present invention is applied. The
制御装置1は、コンピュータによって読み取り可能な記憶媒体を備えるマイクロコンピュータによって提供される。記憶媒体は、コンピュータによって読み取り可能なプログラムを非一時的に格納している。記憶媒体は、半導体メモリまたは磁気ディスクによって提供されうる。プログラムは、制御装置1によって実行されることによって、制御装置1をこの明細書に記載される装置として機能させ、この明細書に記載される制御方法を実行するように制御装置1を機能させる。制御装置1が提供する手段は、所定の機能を達成する機能的ブロック、またはモジュールとも呼ぶことができる。
The
制御装置1は、制御手段(CPU)2と、複数のメモリ装置3、4とを備える。CPU2は、中央演算装置であって、所定の制御処理を実行することによりメモリ管理装置を構成する。メモリ装置3、4は、両方とも不揮発性メモリである。メモリ装置3、4は、同じデータを記憶する冗長系を構成している。
The
メモリ装置3は、制御装置1において一時記憶領域として利用されるRAM3(Random Access Memory)である。RAM3は、一時記憶メモリとして利用されているが、制御装置1に内蔵された電池によって記憶状態をバックアップされている。よって、RAM3は、バックアップRAM(BU−RAM)とも呼ばれる。よって、RAM3も不揮発性メモリである。この実施形態では、RAM3は、第1不揮発性メモリとも呼ばれる。RAM3は、CPU2がそれ自身の演算処理において常用する常用領域31を備える。この常用領域31には、CPU2が実行する制御処理のためのデータが記憶される。常用領域31には、EEPROM4への書込み処理の結果を示すデータを記憶するための書込結果領域31aが含まれている。書込結果領域31aには、EEPROM4への書込み処理が正常に終了したことを示す「OK」のデータ、EEPROM4への書込み処理が正常に終了していないこと、すなわち異常が生じたことを示す「NG」のデータ、および、EEPROM4への書込み処理の正常または異常が未判定であることを示す「NA」のデータが記憶される。
The memory device 3 is a RAM 3 (Random Access Memory) used as a temporary storage area in the
メモリ装置4は、RAM3のデータをバックアップするために、RAM3のデータを冗長的に保存するEEPROM4(Electrically Erasable Programmable Read-OnlyMemory)である。EEPROM4は、制御装置1の電源が失われてもデータを保存することができる半導体メモリである。EEPROM4は、データ保存用、またはデータ退避用のメモリとして設けられている。EEPROM4は、RAM3の常用領域31をそっくりそのまま退避させるための複数の領域41、42を備える。EEPROM4は、少なくとも第1領域41と第2領域42とを備える。第1領域41と第2領域42とは、RAM3の書込結果領域31aを退避させるための書込結果領域41a、42aをそれぞれ含む。第1領域41と第2領域42とは、退避処理の度に交互に使用される。例えば、今回の退避処理において常用領域31から第1領域41への退避処理が実行された場合、第2領域42には、前回の退避処理により退避されたデータが残されている。
The memory device 4 is an EEPROM 4 (Electrically Erasable Programmable Read-Only Memory) that redundantly stores the data in the RAM 3 in order to back up the data in the RAM 3. The EEPROM 4 is a semiconductor memory that can store data even when the power of the
CPU2は、EEPROM4を管理するためのメモリ管理装置を構成する。CPU2は、退避処理の前に退避前処理を実行するための退避前処理手段21を備える。退避前処理手段21は、書込結果領域31aにデータ「NA」を書込むことにより、データ「NA」を記憶させる。データ「NA」は、後述するEEPROM書込判定手段23による判定がまだ完了していないことを示す。データ「NA」は、未判定を示す。退避前処理21は、退避処理が実行される前に、書込結果領域31aを初期化する初期化処理手段とも呼ぶことができる。この構成によると、未判定を示すデータが書き込まれることによって書込結果領域が初期化される。したがって、データがない状態からも区別することができる。
The CPU 2 constitutes a memory management device for managing the EEPROM 4. The CPU 2 includes pre-evacuation processing means 21 for executing the pre-evacuation processing before the save processing. The pre-save processing means 21 stores the data “NA” by writing the data “NA” in the
CPU2は、RAM3の常用領域31のデータをEEPROM4の第1領域41または第2領域42に退避するための退避処理手段22を備える。退避処理手段22は、電源供給が遮断されるときにデータを退避させるように構成されている。CPU2は、退避処理手段22によるEEPROM4への書込処理が正常に終了したか否かを判定するEEPROM書込判定手段23を備える。EEPROM書込判定手段23は、EEPROM4への書込処理が正常に終了した場合には、データ「OK」を出力する。EEPROM書込判定手段23は、EEPROM4への書込処理が正常に終了していない場合には、データ「NG」を出力する。CPU2は、EEPROM書込判定手段23による判定結果を、書込結果領域31aに書込むことにより、記憶させる退避後処理手段24を備える。退避後処理手段24は、データ「OK」またはデータ「NG」のいずれか一方だけを書込結果領域31aに書込む。この結果、RAM3には、退避処理におけるEEPROM4への書込処理に関して、データ「OK」、「NG」、または「NA」が書き込まれ、記憶される。CPU2が提供する複数の手段のうち、手段21−24は、電源スイッチ14がオン位置からオフ位置へ操作されたとき、すなわちシャットオフ時に実行される。これら手段21−24は、シャットオフ処理手段を提供する。
The CPU 2 includes save processing means 22 for saving data in the
CPU2は、RAM3のデータの異常を判定するRAMデータ判定手段25を備える。RAMデータ判定手段25は、チェックサムの値を検査するなどのデータ異常検出処理を実行する。CPU2は、EEPROM4に退避されているデータに基づいて、RAM3のデータを復元する復元処理手段26を備える。復元処理手段26は、第1領域41または第2領域42の最も新しいデータをEEPROM4から読み出し、常用領域31に書込むことによりRAM3のデータを復元する。復元処理手段26は、RAMデータ判定手段25によって常用領域31のデータに異常があることが判定されると、上述の復元処理を実行する。復元処理が実行されると、常用領域31のデータは、前回の退避処理により退避させられたデータに戻る。
The CPU 2 includes a RAM
さらに、CPU2は、EEPROM4に異常が生じているか否かを判定するEEPROM異常判定手段27を備える。EEPROM異常判定手段27は、RAM3の書込結果領域31aに書込まれたデータに基づいて、EEPROM4が異常であるか否かを判定する。EEPROM異常判定手段27は、電源供給が開始されるときにEEPROM4の異常を判定するように構成されている。EEPROM異常判定手段27は、複数回にわたって連続してデータ「NG」が検出された場合に、EEPROM4の異常を判定するように構成することができる。EEPROM異常判定手段27は、EEPROM4の異常を判定すると、EEPROM4の異常に対策するための対策処理も提供する。例えば、EEPROM異常判定手段27は、異常が判定された領域の使用を禁止する、EEPROM4全体の使用を禁止する、代替的な他の不揮発性メモリを使用するなどの対策処理を実行することができる。CPU2が提供する複数の手段のうち、手段25−27は、電源スイッチ14がオフ位置からオン位置へ操作されたとき、すなわちパワーオン時に実行される。これら手段25−27は、パワーオン処理手段を提供する。
Further, the CPU 2 includes an EEPROM abnormality determination means 27 that determines whether or not an abnormality has occurred in the EEPROM 4. The EEPROM abnormality determination means 27 determines whether or not the EEPROM 4 is abnormal based on the data written in the
図2は、電源スイッチ14のオン操作から電源スイッチ14のオフ操作までに実行される制御処理150の全体像を示すフローチャートである。制御処理150は、電源スイッチ14がオフ位置からオン位置に操作されることにより開始される。ステップ160では、パワーオン処理が実行される。ステップ170では、センサ11の信号に基づいてアクチュエータ12を制御するための制御処理が実行される。ステップ180では、電源スイッチ14がオン位置からオフ位置に操作されたか否かが判定される。電源スイッチ14がオフ操作されるまで、ステップ170の処理が繰り返される。ステップ190では、シャットオフ処理が実行される。
FIG. 2 is a flowchart showing an overview of the
図3は、パワーオン処理160を示すフローチャートである。ステップ161では、RAM3のデータが正常か否かが判定される。ステップ161によりRAMデータ判定手段25が提供される。RAM3のデータに異常がある場合、ステップ162に進む。ステップ162では、RAM3のデータを復元する復元処理が実行される。ステップ162により復元処理手段26が提供される。RAM3のデータが正常である場合、またはRAM3のデータが復元された場合には、ステップ163へ進む。ステップ163では、RAM3の書込結果領域31aのデータを参照することにより、データに応じて分岐する。
FIG. 3 is a flowchart showing the power-on
書込結果領域31aにデータ「OK」が記憶されている場合、ステップ164へ進む。記憶データが「OK」の場合、前回のシャットオフ処理においてEEPROM4への書込みが正常に終了したと考えられる。ステップ164では、異常カウンタFCの値をリセットする。ステップ165では、EEPROM4のための正常判定を実行する。これにより、EEPROM4は所期の目的どおりにデータ退避用に使用される。
If data “OK” is stored in the
書込結果領域31aにデータ「NG」が記憶されている場合、ステップ166へ進む。記憶データが「NG」の場合、前回のシャットオフ処理においてEEPROM4への書込みが正常に終了しなかったと考えられる。ステップ166では、異常カウンタFCの値を計数する。異常カウンタFCは、EEPROM4への書込異常の連続発生回数を数えるために使用される。ステップ167では、異常カウンタFCの値が、所定の閾値回数Fthを上回ったか否かを判定する。異常カウンタFCが閾値回数Fthを上回らない場合、ステップ168へ進む。ステップ168では、EEPROM4のための仮故障判定を実行する。この場合、EEPROM4に何らかの故障が発生している可能性が高い。そこで、ステップ168では、仮故障判定を実行する。また、ステップ168では、仮故障判定に応答して、EEPROM4の修復を図る処理、制御装置1の修理を利用者に推奨する処理、またはEEPROM4の使用を制限する処理などの対策処理を実行してもよい。
If data “NG” is stored in the
異常カウンタFCが閾値回数Fthを上回る場合、ステップ169へ進む。ステップ169では、EEPROM4のための故障判定を実行する。この場合、EEPROM4に何らかの故障が発生していることはほぼ確実である。そこで、ステップ169では、故障判定を実行する。また、ステップ169では、故障判定に応答して、EEPROM4の修復を図る処理、またはEEPROM4の使用を制限する処理などの故障処理を実行する。ステップ169では、例えば、EEPROM4の使用、特にEEPROM4からRAM3へのデータ転送、すなわち復元処理が禁止される。ステップ164−169により、RAM3に書込まれ、記憶されたデータ「OK」または「NG」に基づいて、EEPROM4の異常または正常を判定するEEPROM異常判定手段27が提供される。この手段によると、EEPROM4への書込み処理の正常「OK」と異常「NG」とをRAM3上の書込結果領域31aに書込み、記憶することによって、RAM3のデータをバックアップするEEPROM4の異常を検出することができる。また、ステップ166-169により、異常終了が継続して発生した回数FCが所定の閾値回数Fthを上回るとEEPROM4の異常を判定する異常判定手段27が提供される。また、ステップ163から分岐してステップ164−169をスキップする処理の流れは、書込結果領域31aが初期化状態である場合に、EEPROM4の正常または異常を判定しないための手段を提供する。
When the abnormality counter FC exceeds the threshold number Fth, the process proceeds to step 169. In
書込結果領域31aにデータ「NA」が記憶されている場合、後続の処理を飛ばしてパワーオン処理160を終了する。記憶データが「NA」の場合、前回のシャットオフ処理においてEEPROM4への書込みが終了する前に、何らかの原因により制御装置1が停止したと考えられる。この原因として、例えば、バッテリ13から制御装置1への給電ラインの異常に起因する瞬断を挙げることができる。このような場合、EEPROM4のデータの一部だけが書き換えられている場合がある。言い換えると、EEPROM4のデータの位置には、前々回のシャットダウン処理において退避されたデータが残っているおそれがある。よって、この場合には、EEPROM4に書込まれたデータの信頼度はきわめて低い。そこで、ステップ164−169の処理を飛ばすことにより、EEPROM4の異常または正常に関して、誤った判定が下されることが回避される。例えば、前回のシャットダウン処理において書込結果領域31aに書込まれたデータ「NG」が、瞬断の後に、再び異常カウンタを計数させてしまうことを回避できる。ステップ163−169により、RAM3に書込まれ、記憶されたデータ「OK」、「NG」または「NA」に基づいて、EEPROM4の異常または正常を判定するEEPROM異常判定手段27が提供される。この手段によると、書込結果領域31aに書込まれたデータ「NA」を利用して、EEPROM4への書込み処理の途中で電源が瞬断などの障害を生じた場合でも、誤判定を回避できる。
When the data “NA” is stored in the
図4は、シャットオフ処理190を示すフローチャートである。ステップ191では、書込結果領域31aにデータ「NA」を書込む。ステップ191の処理は、退避処理の前に、退避処理の実行前であることを記録する前処理を提供している。ステップ191は、退避前処理手段21を提供する。ステップ192では、常用領域31のデータをEEPROM4に退避させる。ステップ192は、退避処理手段22を提供する。ステップ192の退避処理が終了すると、ステップ193へ進む。ステップ193では、EEPROM4への書込処理が正常に終了したか否かが判定される。ここでは、例えば、常用領域31のデータが誤りなくEEPROM4に複写されたことを検証することによって正常終了か否かを判定することができる。ステップ193は、EEPROM書込判定手段23を提供する。書込処理が正常に終了した場合、ステップ194へ進む。ステップ194では、書込結果領域31aに正常終了を示すデータ「OK」を書込む。書込処理が正常に終了していない場合、ステップ195へ進む。ステップ195では、書込結果領域31aに異常終了を示すデータ「NG」を書込む。ステップ194および195の処理は、退避処理の後に、退避処理が完了したこと、さらには退避処理の正常または異常を記録する後処理を提供している。ステップ194および195は、退避後処理手段24を提供する。
FIG. 4 is a flowchart showing the shut-off
上記構成によると、以下のような作用効果が得られる。まず、RAM3とEEPROM4との両方が正常である場合、制御装置1は以下のように機能する。電源スイッチ14がオン操作されると、ステップ161からステップ163へ進む。前回のステップ193の処理においてEEPROM4への書込みが正常終了している場合、ステップ163からステップ164へ分岐する。この後、CPU2は、RAM3に記憶されたデータを利用して制御処理170を実行する。やがて、電源スイッチ14がオフ操作されると、ステップ191からステップ193を経由してステップ194に進む。EEPROM4には、RAM3のデータが退避され、保存される。書込結果領域31aにはデータ「OK」が書き込まれる。この結果、次に電源スイッチ14が再びオン操作された場合も、上記と同じように制御装置1は機能する。
According to the above configuration, the following operational effects can be obtained. First, when both the RAM 3 and the EEPROM 4 are normal, the
次に、RAM3のデータに異常が生じた場合、制御装置1は以下のように機能する。電源スイッチ14がオン操作されると、ステップ161からステップ162へ進む。ステップ162により、RAM3のデータはEEPROM4のデータに基づいて復元される。前回のステップ193の処理においてEEPROM4への書込みが正常終了している場合、ステップ163からステップ164へ分岐する。この後、CPU2は、RAM3に復元されたデータを利用して制御処理170を実行する。やがて、電源スイッチ14がオフ操作されると、ステップ191からステップ193を経由してステップ194に進む。EEPROM4には、RAM3のデータが再び退避され、保存される。書込結果領域31aにはデータ「OK」が書き込まれる。この結果、次に電源スイッチ14が再びオン操作された場合も、上記と同じように制御装置1は機能する。
Next, when an abnormality occurs in the data in the RAM 3, the
次に、EEPROM4への書込み処理が異常終了した場合、制御装置1は以下のように機能する。電源スイッチ14がオン操作されると、ステップ161からステップ163へ進む。前回のステップ193の処理においてEEPROM4への書込みが正常終了している場合、ステップ163からステップ164へ分岐する。この後、CPU2は、RAM3に記憶されたデータを利用して制御処理170を実行する。やがて、電源スイッチ14がオフ操作されると、ステップ191からステップ193を経由してステップ195に進む。この場合、EEPROM4への書込みが異常終了しているから、EEPROM4に保存されたデータは信頼性がない。書込結果領域31aにはデータ「NG」が書き込まれる。この結果、次に電源スイッチ14が再びオン操作された場合、ステップ163からステップ166へ分岐する。この後、電源スイッチ14のオフ操作とオン操作とが繰り返されるたびに異常カウンタFCが回数を計数する。やがて異常カウンタFCが閾値回数Fthを上回ると、ステップ169へ進む。これにより、EEPROM4の故障が判定され、故障処理が実行される。
Next, when the writing process to the EEPROM 4 ends abnormally, the
以上に述べたように、書込結果領域31aにデータ「NG」または「OK」が記憶されることによって、ステップ192の退避処理が完了したことが記録される。しかも、書込結果領域31aにデータ「OK」が記憶されている場合、EEPROM4は正常であると推定することができる。また、書込結果領域31aにデータ「NG」が記憶されている場合、EEPROM4は異常であると推定することができる。したがって、制御装置1は、前回のシャットオフ処理において判定されたEEPROM4への書込処理の正常終了または異常終了に基づいて、次回のパワーオン処理においてEEPROM4の正常または異常を判定することができる。
As described above, the data “NG” or “OK” is stored in the
以上に述べた作動において、EEPROM4への書込処理、すなわちステップ192の処理が完了するまでには、所定の時間を要する。このため、ステップ192の前後、またはステップ192の処理中に、何らかの原因によって制御装置1が停止し、制御処理の実行が停止され、さらに制御装置1が再起動されることがある。この原因として、例えば、バッテリ13から制御装置1への給電ラインの異常に起因する瞬断を挙げることができる。制御装置1が再起動されると、制御処理はステップ160に戻り、再びパワーオン処理160が実行される。上述のステップ191の処理は、退避処理の前に、退避処理の実行前であることを記録する前処理を提供している。よって、書込結果領域31aにデータ「NA」が記憶されている場合、ステップ192の周辺において何らかの異常が発生し、制御装置1が再起動されたと推定することができる。したがって、制御装置1は、前回のシャットオフ処理においてEEPROM4への書込処理が終了していないことを、次回のパワーオン処理において検出することができる。この結果、制御装置1は、次回のパワーオン処理においてEEPROM4の正常または異常に関する誤判定を回避することができる。
In the operation described above, a predetermined time is required until the writing process to the EEPROM 4, that is, the process of
(比較例)
図5は、比較例のパワーオン処理260を示すフローチャートである。パワーオン処理260は、第1実施形態のパワーオン処理160に代わって実行される。比較例においては、ステップ161とステップ162とだけが実行される。
(Comparative example)
FIG. 5 is a flowchart showing the power-on
図6は、比較例のシャットオフ処理290を示すフローチャートである。シャットオフ処理290は、第1実施形態のシャットオフ処理190に代わって実行される。比較例においては、ステップ192だけが実行される。
FIG. 6 is a flowchart showing the shut-off
この比較例では、RAM3のデータがEEPROM4に退避される。また、RAM4のデータに異常が生じた場合には、EEPROM4のデータに基づいてRAM3のデータが復元される。しかし、このような構成では、EEPROM4の異常を検出することができない。 In this comparative example, the data in the RAM 3 is saved in the EEPROM 4. If an abnormality occurs in the data in the RAM 4, the data in the RAM 3 is restored based on the data in the EEPROM 4. However, with such a configuration, the abnormality of the EEPROM 4 cannot be detected.
(他の実施形態)
以上、本発明の好ましい実施形態について説明したが、本発明は上述した実施形態に何ら制限されることなく、本発明の主旨を逸脱しない範囲において種々変形して実施することが可能である。上記実施形態の構造は、あくまで例示であって、本発明の範囲はこれらの記載の範囲に限定されるものではない。本発明の範囲は、特許請求の範囲の記載によって示され、さらに特許請求の範囲の記載と均等の意味及び範囲内での全ての変更を含むものである。
(Other embodiments)
The preferred embodiments of the present invention have been described above, but the present invention is not limited to the above-described embodiments, and various modifications can be made without departing from the spirit of the present invention. The structure of the said embodiment is an illustration to the last, Comprising: The scope of the present invention is not limited to the range of these description. The scope of the present invention is indicated by the description of the scope of claims, and further includes meanings equivalent to the description of the scope of claims and all modifications within the scope.
例えば、制御装置が提供する手段と機能は、ソフトウェアのみ、ハードウェアのみ、あるいはそれらの組合せによって提供することができる。例えば、制御装置をアナログ回路によって構成してもよい。 For example, the means and functions provided by the control device can be provided by software only, hardware only, or a combination thereof. For example, the control device may be configured by an analog circuit.
また、上記実施形態では、不揮発性メモリとして、電池によってバックアップされたRAM3、およびEEPROM4を使用した。しかし、メモリ装置の種類はこれらに限られるものではなく、RAM3またはEEPROM4と置換可能な既知の、または将来開発される種々のメモリ装置を利用することができる。 Moreover, in the said embodiment, RAM3 and EEPROM4 which were backed up by the battery were used as a non-volatile memory. However, the types of memory devices are not limited to these, and various known or later-developed memory devices that can replace the RAM 3 or the EEPROM 4 can be used.
1 制御装置(ECU)、
11 センサ、
12 アクチュエータ、
13 バッテリ、
14 電源スイッチ、
2 制御手段(CPU)、
21 退避前処理手段、
22 退避処理手段、
23 EEPROM書込判定手段、
24 退避後処理手段、
25 RAMデータ判定手段、
26 復元処理手段、
27 EEPROM異常判定手段、
3 第1不揮発性メモリ(RAM)、
31 常用領域、
31a 書込結果領域、
4 第2不揮発性メモリ(EEPROM)、
41 第1領域、
41a 書込結果領域、
42 第1領域、
42a 書込結果領域。
1 control unit (ECU),
11 sensor,
12 Actuator,
13 battery,
14 Power switch,
2 control means (CPU),
21. Pre-evacuation processing means,
22 evacuation processing means,
23 EEPROM writing determination means,
24 post-evacuation processing means,
25 RAM data determination means,
26 restoration processing means,
27 EEPROM abnormality determination means,
3 first non-volatile memory (RAM),
31 Service area,
31a Write result area,
4 Second non-volatile memory (EEPROM),
41 first region,
41a Write result area,
42 first region,
42a Write result area.
Claims (7)
前記第1のメモリ装置に記憶されたデータを冗長的に保存する第2のメモリ装置(4、41、42)と、
前記第1のメモリ装置のデータを前記第2のメモリ装置へ書込むことによりデータを退避させる退避処理手段(22、192)と、
前記退避処理手段による書込処理が正常終了(OK)したか異常終了(NG)したかを判定し、判定結果を前記第1のメモリ装置に設けられた書込結果領域(31a)に記憶する書込判定手段(23、193−195)と、
前記書込結果領域に記憶された判定結果に基づいて前記第2のメモリ装置の正常または異常を判定する異常判定手段(27、163−169)とを備えることを特徴とするメモリ管理装置。 A first memory device (3, 31) used as a temporary storage area by the control device (1, 2);
A second memory device (4, 41, 42) for redundantly storing data stored in the first memory device;
Save processing means (22, 192) for saving data by writing the data of the first memory device to the second memory device;
It is determined whether the writing process by the saving processing means has been normally completed (OK) or abnormally terminated (NG), and the determination result is stored in a write result area (31a) provided in the first memory device. Write determination means (23, 193-195);
A memory management device comprising: an abnormality determination means (27, 163-169) for determining normality or abnormality of the second memory device based on a determination result stored in the write result area.
前記異常判定手段(27)は、前記書込結果領域が初期化状態である場合、前記第2のメモリ装置の正常または異常を判定しないことを特徴とする請求項1に記載のメモリ管理装置。 Furthermore, it has pre-saving processing means (21, 191) for initializing the writing result area (31a) before the writing processing by the saving processing means,
2. The memory management device according to claim 1, wherein the abnormality determination unit does not determine whether the second memory device is normal or abnormal when the write result area is in an initialized state. 3.
前記異常判定手段は、電源供給が開始されるときに前記第2のメモリ装置の異常を判定するように構成されていることを特徴とする請求項1から請求項3のいずれかに記載のメモリ管理装置。 The save processing means is configured to save data when power supply is interrupted,
4. The memory according to claim 1, wherein the abnormality determination unit is configured to determine an abnormality of the second memory device when power supply is started. Management device.
前記第2のメモリ装置は、EEPROM(4)であることを特徴とする請求項1から請求項5のいずれかに記載のメモリ管理装置。 The first memory device is a RAM (3) backed up by a battery;
The memory management device according to any one of claims 1 to 5, wherein the second memory device is an EEPROM (4).
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011204833A JP2013065261A (en) | 2011-09-20 | 2011-09-20 | Memory management device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011204833A JP2013065261A (en) | 2011-09-20 | 2011-09-20 | Memory management device |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2013065261A true JP2013065261A (en) | 2013-04-11 |
Family
ID=48188683
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011204833A Pending JP2013065261A (en) | 2011-09-20 | 2011-09-20 | Memory management device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2013065261A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2016224937A (en) * | 2015-05-26 | 2016-12-28 | 華邦電子股▲ふん▼有限公司 | Methods and systems for nonvolatile memory data management |
JP2019133623A (en) * | 2018-01-30 | 2019-08-08 | 廣達電脳股▲ふん▼有限公司 | Computer system for preserving data in memory module and computer-implemented method using the same |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000035923A (en) * | 1998-07-17 | 2000-02-02 | Fujitsu Ten Ltd | Abnormality detecting method and abnormality detecting device |
JP2000105694A (en) * | 1998-09-28 | 2000-04-11 | Nec Ic Microcomput Syst Ltd | Flash memory, microcomputer equipped with flash memory, and method for storing program in flash memory |
JP2000257502A (en) * | 1999-03-05 | 2000-09-19 | Denso Corp | Electronic controller for automobile |
JP2002041367A (en) * | 2000-07-26 | 2002-02-08 | Denso Corp | Vehicle controller |
JP2004280198A (en) * | 2003-03-12 | 2004-10-07 | Ricoh Co Ltd | Information processor |
JP2005174232A (en) * | 2003-12-15 | 2005-06-30 | Olympus Corp | Data rewriting device |
JP2009289049A (en) * | 2008-05-29 | 2009-12-10 | Toyota Motor Corp | Memory control device |
-
2011
- 2011-09-20 JP JP2011204833A patent/JP2013065261A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000035923A (en) * | 1998-07-17 | 2000-02-02 | Fujitsu Ten Ltd | Abnormality detecting method and abnormality detecting device |
JP2000105694A (en) * | 1998-09-28 | 2000-04-11 | Nec Ic Microcomput Syst Ltd | Flash memory, microcomputer equipped with flash memory, and method for storing program in flash memory |
JP2000257502A (en) * | 1999-03-05 | 2000-09-19 | Denso Corp | Electronic controller for automobile |
JP2002041367A (en) * | 2000-07-26 | 2002-02-08 | Denso Corp | Vehicle controller |
JP2004280198A (en) * | 2003-03-12 | 2004-10-07 | Ricoh Co Ltd | Information processor |
JP2005174232A (en) * | 2003-12-15 | 2005-06-30 | Olympus Corp | Data rewriting device |
JP2009289049A (en) * | 2008-05-29 | 2009-12-10 | Toyota Motor Corp | Memory control device |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2016224937A (en) * | 2015-05-26 | 2016-12-28 | 華邦電子股▲ふん▼有限公司 | Methods and systems for nonvolatile memory data management |
US9720771B2 (en) | 2015-05-26 | 2017-08-01 | Winbond Electronics Corp. | Methods and systems for nonvolatile memory data management |
JP2019133623A (en) * | 2018-01-30 | 2019-08-08 | 廣達電脳股▲ふん▼有限公司 | Computer system for preserving data in memory module and computer-implemented method using the same |
US10872018B2 (en) | 2018-01-30 | 2020-12-22 | Quanta Computer Inc. | Memory data preservation solution |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108062259B (en) | MCU internal data storage ECC processing system and processing method thereof | |
JP4343945B2 (en) | Electronic control unit | |
EP2835739A1 (en) | Torn write mitigation | |
CN102298545B (en) | System startup boot processing method and device | |
US20130124917A1 (en) | Recovering from stack corruption faults in embedded software systems | |
JP4475320B2 (en) | Vehicle memory management device | |
KR101805234B1 (en) | Method, non-transitory computer readable storage medium, and auxiliary memory for monitoring a data memory | |
JP4227149B2 (en) | Information storage method for electronic control unit | |
JP4917604B2 (en) | Storage device configuration and driving method thereof | |
WO2010021632A1 (en) | Dual independent non volatile memory systems | |
JP2021531568A (en) | Memory scan operation according to common mode failure signal | |
JP5176405B2 (en) | Computer error detection and recovery method | |
JP2013065261A (en) | Memory management device | |
JP2010204851A (en) | Storage device and information processing apparatus | |
JP2009289049A (en) | Memory control device | |
CN110023911B (en) | Electronic control device and data protection method thereof | |
US8145951B2 (en) | Control device | |
CN101366009B (en) | Data processing system and a method for the operation thereof | |
JP5872982B2 (en) | Vehicle control device | |
JP2009025967A (en) | Backup system of duplicated firmware, method and operating system | |
JP4640697B2 (en) | Encoder device, parameter destruction self-reset device, and parameter destruction self-reset method | |
JP6363044B2 (en) | Control device | |
US20100162082A1 (en) | Control device, storage apparatus and controlling method | |
JP7166231B2 (en) | Information processing device and information processing system | |
JP4853083B2 (en) | Computer system, data normality confirmation method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20131114 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20140425 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20140513 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20140610 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20140729 |