JP5835160B2 - Electronic control unit - Google Patents

Electronic control unit Download PDF

Info

Publication number
JP5835160B2
JP5835160B2 JP2012189139A JP2012189139A JP5835160B2 JP 5835160 B2 JP5835160 B2 JP 5835160B2 JP 2012189139 A JP2012189139 A JP 2012189139A JP 2012189139 A JP2012189139 A JP 2012189139A JP 5835160 B2 JP5835160 B2 JP 5835160B2
Authority
JP
Japan
Prior art keywords
data
abnormality
stored
abnormality detection
storage area
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.)
Active
Application number
JP2012189139A
Other languages
Japanese (ja)
Other versions
JP2014048744A (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 JP2012189139A priority Critical patent/JP5835160B2/en
Publication of JP2014048744A publication Critical patent/JP2014048744A/en
Application granted granted Critical
Publication of JP5835160B2 publication Critical patent/JP5835160B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Detection And Correction Of Errors (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • For Increasing The Reliability Of Semiconductor Memories (AREA)

Description

本発明は、ECC機能を搭載するメモリを備えた電子制御装置に関する。   The present invention relates to an electronic control device including a memory having an ECC function.

従来、例えばRAMのようにデータ書換え可能なメモリにおいて、書き込まれたデータの誤りを検出して訂正するためにECC(Error Correction Code)機能を搭載したものが知られている(例えば、特許文献1参照)。   2. Description of the Related Art Conventionally, in a rewritable memory such as a RAM, for example, an ECC (Error Correction Code) function for detecting and correcting an error in written data is known (for example, Patent Document 1). reference).

ECC機能は、データをメモリに書き込む時に誤り訂正符号を付加し、データをメモリから読み出すときに誤り訂正符号を用いてデータの誤りを検出および訂正する機能である。そしてECC機能では、1ビットの誤りを検出した場合には、その誤りを訂正することができる。但しECC機能では、複数ビットの誤りが発生した場合に、誤りを検出することができるが、その誤りを訂正することはできない。   The ECC function is a function that adds an error correction code when writing data to the memory and detects and corrects data errors using the error correction code when reading data from the memory. In the ECC function, when a 1-bit error is detected, the error can be corrected. However, the ECC function can detect an error when a multi-bit error occurs, but cannot correct the error.

そして、車両を制御する車両制御装置においては、車両制御装置に搭載されたメモリの異常を検出するために、メモリに記憶されているデータを読み出すことによりECC機能を作動させ、これにより2ビット以上の誤りを検出した場合に、フェールセーフ制御に移行させることが一般に行われている。   And in the vehicle control apparatus which controls a vehicle, in order to detect abnormality of the memory mounted in the vehicle control apparatus, the ECC function is actuated by reading data stored in the memory, thereby 2 bits or more When an error is detected, it is generally performed to shift to fail-safe control.

特開平9−288619号公報JP-A-9-288619

書き込み頻度が少ないデータは、このデータを書き込んでから次にこのデータを書き込むまでの期間(以下、データ保持期間という)が長くなる。
そして、例えば車両制御中のようにノイズが多い環境下で、書き込み頻度が少ないデータをメモリに書き込んだ時に2ビット以上の誤りが発生すると、2ビット以上の誤りが発生している状態が少なくとも上記データ保持期間継続する。これにより、データ保持期間中において、書き誤ったデータの読み出しが行われる毎にECC機能が作動し、2ビット以上の誤りを何度も検出することになる。
For data with a low writing frequency, a period (hereinafter referred to as a data holding period) from writing this data to the next writing is long.
For example, when an error of 2 bits or more occurs when data having a low write frequency is written to the memory in an environment where there is a lot of noise, such as during vehicle control, at least the state where the error of 2 bits or more has occurred Data retention period continues. As a result, during the data holding period, the ECC function operates every time reading of erroneously written data is performed, and errors of 2 bits or more are detected many times.

このため、2ビット以上の誤りを検出した回数が予め設定されたフェールセーフ判定回数以上となるとフェールセーフ制御に移行するという処理が車両制御装置で実行される場合には、データ書き換えにおける複数回の書き誤りの発生でフェールセーフ制御に移行することを意図しているにも関わらず、1回の書き誤りに起因してフェールセーフ制御に移行してしまうおそれがあった。   For this reason, when the process of shifting to fail-safe control is executed by the vehicle control device when the number of times that an error of 2 bits or more is detected exceeds the preset number of fail-safe determinations, multiple times in data rewriting are performed. In spite of the intention to shift to fail-safe control due to the occurrence of a writing error, there is a possibility of shifting to fail-safe control due to one writing error.

本発明は、こうした問題に鑑みてなされたものであり、1回の書き誤りに起因して異常を繰り返し検出してしまうのを抑制することを目的とする。   The present invention has been made in view of these problems, and an object thereof is to suppress the repeated detection of an abnormality due to a single writing error.

上記目的を達成するためになされた電子制御装置は、データを書き込むときには、書き込むデータに基づいて誤り訂正符号を生成して、対応する書き込みデータに誤り訂正符号を付加し、記憶されているデータを読み出すときには、読み出すデータに付加されている誤り訂正符号を用いて、記憶されているデータにおける1ビットの誤りを訂正することができるとともに、記憶されているデータにおける2ビット以上の誤りを検出することができ、且つ、2ビット以上の誤りを検出したときにその旨を示す異常検出情報を、内部に予め設定された異常記憶領域に記憶することができるECC(Error Correction Code)機能を搭載し、記憶されるデータの書き換えが可能である書換可能メモリを備え、読出手段が、書換可能メモリの記憶領域のうち予め設定された異常検出領域に記憶されているデータを読み出し、異常判断手段が、異常記憶領域に異常検出情報が記憶されているか否かを判断する。そして書込手段が、異常記憶領域に異常検出情報が記憶されていると異常判断手段が判断した場合に、書換可能メモリの異常検出領域に記憶されているデータを読み出し、その後に、読み出したデータを、読み出したときと同じアドレスに書き込む。 Is made the electronic control device in order to achieve the above object, when writing data, generates an error correcting code on the basis of the write data, corresponding adds an error correction code to the write data, stored data When reading data, an error correction code added to the read data can be used to correct a 1-bit error in the stored data and to detect an error of 2 bits or more in the stored data Equipped with an ECC (Error Correction Code) function that can store abnormality detection information indicating that when an error of 2 bits or more is detected in an abnormal storage area set in advance. Provided with a rewritable memory in which stored data can be rewritten, and the reading means has a storage area of the rewritable memory. Reading the data stored in the set abnormality detection area abnormality determining unit, the abnormality detection information to the abnormality storage area to determine whether it is stored. When the abnormality determination means determines that the abnormality detection information is stored in the abnormality storage area, the writing means reads out the data stored in the abnormality detection area of the rewritable memory, and then reads the read data Is written to the same address as when read.

このように構成された電子制御装置では、まず読出手段が、異常検出領域に記憶されているデータを読み出すことにより、書換可能メモリのECC機能が作動し、2ビット以上の誤りを検出したときに、書換可能メモリ内の異常記憶領域に異常検出情報が記憶される。このため異常判断手段が、異常記憶領域に異常検出情報が記憶されていると判断し、書込手段が、データの読み出し、その後に、読み出したデータを、読み出したときと同じアドレスに書き込む。これにより、書換可能メモリのECC機能が作動し、読み出したデータに基づいて誤り訂正符号が再度生成され、新たな誤り訂正符号が付加された状態で、データが書き込まれる。すなわち、次に、記憶されたデータを読み出したときには、2ビット以上の誤りがECC機能により検出されるという状況が解消されている。   In the electronic control device configured as described above, when the reading unit first reads out the data stored in the abnormality detection area, the ECC function of the rewritable memory operates to detect an error of 2 bits or more. The abnormality detection information is stored in the abnormality storage area in the rewritable memory. For this reason, the abnormality determining means determines that abnormality detection information is stored in the abnormality storage area, and the writing means reads the data, and then writes the read data to the same address as when it was read. As a result, the ECC function of the rewritable memory operates, an error correction code is generated again based on the read data, and the data is written with a new error correction code added. That is, when the stored data is read next, the situation where an error of 2 bits or more is detected by the ECC function is solved.

したがって、書き込み頻度が少ないデータを書き込むときに2ビット以上の誤りが発生した場合であっても、以降のデータ読み出し時にECC機能によって書換可能メモリ内の異常記憶領域に異常検出情報が記憶されてしまうといった状態が長時間継続するのを抑制することができる。すなわち、1回の書き誤りに起因して異常を繰り返し検出してしまうのを抑制することができる。   Therefore, even when an error of 2 bits or more occurs when writing data with low writing frequency, the abnormality detection information is stored in the abnormal storage area in the rewritable memory by the ECC function at the time of subsequent data reading. Such a state can be prevented from continuing for a long time. That is, it is possible to prevent the abnormality from being repeatedly detected due to one writing error.

このため、2ビット以上の誤りを検出した回数が予め設定されたフェールセーフ判定回数以上となるとフェールセーフ制御に移行するという処理が電子制御装置で実行される場合であっても、1回の書き誤りに起因してフェールセーフ制御に移行してしまうという事態の発生を抑制することができる。   For this reason, even if the process of shifting to fail-safe control is executed by the electronic control unit when the number of times that an error of 2 bits or more is detected exceeds the preset number of fail-safe determinations, one write operation is performed. Generation | occurrence | production of the situation which transfers to fail safe control resulting from an error can be suppressed.

ECU1の構成を示すブロック図である。2 is a block diagram showing a configuration of an ECU 1. FIG. 第1実施形態のモータ制御処理を示すフローチャートである。It is a flowchart which shows the motor control process of 1st Embodiment. 第1実施形態のRAM診断処理を示すフローチャートである。It is a flowchart which shows the RAM diagnostic process of 1st Embodiment. 第2実施形態の時間同期処理を示すフローチャートである。It is a flowchart which shows the time synchronization process of 2nd Embodiment. 第3実施形態のRAM診断処理を示すフローチャートである。It is a flowchart which shows RAM diagnostic processing of 3rd Embodiment. 第3実施形態のモータ制御処理を示すフローチャートである。It is a flowchart which shows the motor control process of 3rd Embodiment.

(第1実施形態)
以下に本発明の第1実施形態を図面とともに説明する。
本実施形態の電子制御装置(以下、ECUという)1は、車両に搭載され、図1に示すように、アクセルペダルの踏み込み量を検出するアクセル開度センサ(不図示)からのアクセル開度信号などを用いて、車両の走行用モータ2の制御を行う。
(First embodiment)
A first embodiment of the present invention will be described below with reference to the drawings.
An electronic control unit (hereinafter referred to as ECU) 1 of the present embodiment is mounted on a vehicle and, as shown in FIG. 1, an accelerator opening signal from an accelerator opening sensor (not shown) that detects the amount of depression of an accelerator pedal. Etc. are used to control the motor 2 for traveling the vehicle.

走行用モータ2は、直流電源+Bからリレー3を介して電源電圧が供給されると駆動する。またリレー3は、ECU1からの制御信号により、オン状態およびオフ状態の何れかに切り替えられる。   The traveling motor 2 is driven when a power supply voltage is supplied from the DC power supply + B via the relay 3. The relay 3 is switched to either an on state or an off state by a control signal from the ECU 1.

ECU1は、走行用モータ2を制御するための処理を実行するマイクロコンピュータ(以下、マイコンという)10を備える。
マイコン10は、CPU11、ROM12、RAM13、DMA(Direct Memory Access)コントローラ14、割込コントローラ15および入出力ポート16と、これらを相互に接続するバス17とを備え、ROM12に記憶されたプログラムをCPU11が実行することにより各種処理を実行する。
The ECU 1 includes a microcomputer (hereinafter referred to as a microcomputer) 10 that executes processing for controlling the traveling motor 2.
The microcomputer 10 includes a CPU 11, a ROM 12, a RAM 13, a DMA (Direct Memory Access) controller 14, an interrupt controller 15, an input / output port 16, and a bus 17 for interconnecting them, and a program stored in the ROM 12 is stored in the CPU 11. Execute various processes by executing.

これらのうちRAM13は、RAM13に記憶されているデータの誤りを検出および訂正するためにECC(Error Correction Code)機能を搭載している。
ECC機能を搭載するRAM13は、まず、RAM13へデータを書き込む時に、書き込むデータに基づいて、誤り訂正用のデータとなる誤り訂正符号(以下、ECC(Error Correction Code)という)を生成する。以下、ECCの生成の際に用いられたデータを元データという。そしてRAM13は、生成したECCと元データとを対応付けてRAM13に書き込む。なお元データは、RAM13内に設けられたデータ記憶領域131に記憶され、ECCは、RAM13内に設けられたECC記憶領域132に記憶される。
Of these, the RAM 13 has an ECC (Error Correction Code) function for detecting and correcting errors in data stored in the RAM 13.
First, when writing data to the RAM 13, the RAM 13 equipped with the ECC function generates an error correction code (hereinafter referred to as ECC (Error Correction Code)) serving as error correction data based on the written data. Hereinafter, the data used in generating the ECC is referred to as original data. The RAM 13 writes the generated ECC and the original data in the RAM 13 in association with each other. The original data is stored in a data storage area 131 provided in the RAM 13, and the ECC is stored in an ECC storage area 132 provided in the RAM 13.

その後RAM13は、RAM13から元データを読み出す時に、この元データとともに、対応するECCを読み出す。そしてRAM13は、読み出したECCと、読み出した元データを用いて生成したECCとを比較することにより、誤りが発生したか否かを検出する。   Thereafter, when reading the original data from the RAM 13, the RAM 13 reads the corresponding ECC together with the original data. Then, the RAM 13 detects whether or not an error has occurred by comparing the read ECC and the ECC generated using the read original data.

そしてRAM13は、誤りが発生していないと検出結果に基づいて判断した場合には、読み出した元データをそのまま外部へ出力する。またRAM13は、1ビットの誤りを検出した場合には、読み出したECCを用いて、読み出した元データを訂正して、訂正後の元データを外部へ出力する。またRAM13は、2ビット以上の誤りを検出した場合には、異常を検出した旨を示す異常検出情報を、RAM13内に設けられたECCエラー記憶レジスタ133に記憶する。   If the RAM 13 determines that no error has occurred based on the detection result, the RAM 13 outputs the read original data to the outside as it is. In addition, when detecting a 1-bit error, the RAM 13 corrects the read original data using the read ECC, and outputs the corrected original data to the outside. Further, when detecting an error of 2 bits or more, the RAM 13 stores abnormality detection information indicating that an abnormality has been detected in an ECC error storage register 133 provided in the RAM 13.

またDMAコントローラ14は、CPU11からDMA転送要求信号を入力すると、入出力ポート16に入力した特定のデータを、CPU11の処理を介すことなくRAM13へ転送してRAM13に記憶させる機能を有する。   Further, the DMA controller 14 has a function of transferring specific data input to the input / output port 16 to the RAM 13 without being processed by the CPU 11 and storing it in the RAM 13 when a DMA transfer request signal is input from the CPU 11.

また割込コントローラ15は、様々な割り込み要因の発生を示す信号を入力し、入力した信号が示す割り込み要因毎に予め設定された優先度に基づいて、優先度が最も高い割り込み要因に対応した割込要求信号をCPU11に出力する機能を有する。さらに割込コントローラ15は、入力した信号が示す割り込み要因の優先度とCPU11が実行中の処理の優先度とを比較して、割り込み要因の優先度のほうが高い場合に、割込要求信号をCPU11に出力する機能を有する。   Further, the interrupt controller 15 receives signals indicating the occurrence of various interrupt factors, and based on the priority set in advance for each interrupt factor indicated by the input signal, the interrupt controller 15 corresponding to the interrupt factor having the highest priority. A function to output a request signal to the CPU 11. Further, the interrupt controller 15 compares the priority of the interrupt factor indicated by the input signal with the priority of the process being executed by the CPU 11, and when the priority of the interrupt factor is higher, the interrupt controller 15 sends the interrupt request signal to the CPU 11. It has the function to output to.

このように構成されたECU1において、マイコン10のCPU11は、後述するモータ制御処理およびRAM診断処理を実行する。
まず、CPU11が実行するモータ制御処理の手順を図2を用いて説明する。このモータ制御処理は、所定時間毎(本実施形態では10ms毎)に繰り返し実行される処理である。
In the ECU 1 configured as described above, the CPU 11 of the microcomputer 10 executes a motor control process and a RAM diagnosis process which will be described later.
First, a motor control process performed by the CPU 11 will be described with reference to FIG. This motor control process is a process that is repeatedly executed every predetermined time (in this embodiment, every 10 ms).

このモータ制御処理が実行されると、CPU11は、まずS10にて、後述するECCエラーカウンタの値(以下、ECCエラー回数という)が予め設定されたフェールセーフ判定値(本実施形態では3回を示す値)以上であるか否かを判断する。   When this motor control process is executed, first, in S10, the CPU 11 performs a fail-safe determination value (in the present embodiment, three times) in which a later-described ECC error counter value (hereinafter referred to as ECC error frequency) is preset. It is determined whether or not the value is equal to or greater than the value indicated.

ここで、ECCエラー回数がフェールセーフ判定値未満である場合には(S10:NO)、S20にて、モータ制御を実行し、モータ制御処理を一旦終了する。なお、S20のモータ制御では、アクセル開度信号などを用いて目標モータ回転速度を決定し、決定した目標モータ回転速度に対応したデューティ制御信号を出力する処理を行う。   Here, when the number of ECC errors is less than the fail-safe determination value (S10: NO), motor control is executed in S20, and the motor control process is temporarily terminated. Note that in the motor control in S20, a target motor rotation speed is determined using an accelerator opening signal or the like, and a duty control signal corresponding to the determined target motor rotation speed is output.

一方、ECCエラー回数がフェールセーフ判定値以上である場合には(S10:YES)、S30にて、フェールセーフ制御を実行し、モータ制御処理を一旦終了する。なお、S30のフェールセーフ制御では、リレー3を強制的にオフ状態とすることにより、走行用モータ2の駆動を停止させる。   On the other hand, if the number of ECC errors is equal to or greater than the fail-safe determination value (S10: YES), fail-safe control is executed in S30, and the motor control process is temporarily terminated. In the fail-safe control of S30, the driving of the traveling motor 2 is stopped by forcibly turning off the relay 3.

次に、CPU11が実行するRAM診断処理の手順を図3を用いて説明する。このRAM診断処理は、所定時間毎(本実施形態では10ms毎)に繰り返し実行される処理である。   Next, the procedure of the RAM diagnosis process executed by the CPU 11 will be described with reference to FIG. This RAM diagnosis process is a process that is repeatedly executed every predetermined time (in this embodiment, every 10 ms).

このRAM診断処理が実行されると、CPU11は、まずS110にて、診断異常フラグがセットされているか否かを判断する。ここで、診断異常フラグがセットされていない場合には(S110:NO)、S120にて、S140またはS180で設定される診断対象アドレスを先頭アドレスとして予め設定された診断単位バイト数(本実施形態では16バイト)分のデータをデータ記憶領域131から読み出す。これにより、RAM13のECC機能が作動する。   When the RAM diagnosis process is executed, the CPU 11 first determines whether or not a diagnosis abnormality flag is set in S110. If the diagnosis abnormality flag is not set (S110: NO), the number of diagnostic unit bytes set in advance in S120 with the diagnosis target address set in S140 or S180 as the head address (this embodiment) 16 bytes) is read from the data storage area 131. As a result, the ECC function of the RAM 13 operates.

その後S130にて、データ記憶領域131の全領域についてデータの読み出しが完了したか否かを判断する。ここで、全領域の読み出しが完了していない場合には(S130:NO)、S140にて、診断対象アドレスを診断単位バイト数分だけ次に移動させ、RAM診断処理を一旦終了する。   Thereafter, in S130, it is determined whether or not the data reading has been completed for all the areas of the data storage area 131. Here, when the reading of the entire area is not completed (S130: NO), in S140, the diagnosis target address is moved next by the number of diagnosis unit bytes, and the RAM diagnosis process is temporarily ended.

一方S110にて、診断異常フラグがセットされている場合には(S110:YES)、S150にて、CPU11への割り込みを禁止する。これにより、割込コントローラ15からの割込要求が禁止される。   On the other hand, if the diagnosis abnormality flag is set in S110 (S110: YES), interrupt to the CPU 11 is prohibited in S150. Thereby, the interrupt request from the interrupt controller 15 is prohibited.

そしてS160にて、S140またはS180で設定される診断対象アドレスを先頭アドレスとして予め設定された診断単位バイト数(本実施形態では16バイト)分のデータをデータ記憶領域131から読み出し、その後、読み出したデータを、同一のアドレスに書き込む。これにより、RAM13のECC機能が作動する。   In S160, data corresponding to a predetermined number of diagnostic unit bytes (16 bytes in this embodiment) is read from the data storage area 131 with the diagnosis target address set in S140 or S180 as the head address, and then read. Write data to the same address. As a result, the ECC function of the RAM 13 operates.

その後S170にて、CPU11への割り込みを許可する。これにより、割込コントローラ15からの割込要求が許可される。その後S130にて、全領域の読み出しが完了していない場合には(S130:NO)、S140にて、診断対象アドレスを診断単位バイト数分だけ次に移動させ、RAM診断処理を一旦終了する。   Thereafter, in S170, an interrupt to the CPU 11 is permitted. Thereby, the interrupt request from the interrupt controller 15 is permitted. Thereafter, in S130, when reading of the entire area is not completed (S130: NO), the diagnosis target address is moved to the next by the number of diagnosis unit bytes in S140, and the RAM diagnosis process is temporarily ended.

またS130にて、データ記憶領域131の全領域についてデータの読み出しが完了した場合には(S130:YES)、S180にて、診断対象アドレスをリセットする。これにより、診断対象アドレスは、データ記憶領域131の先頭アドレスに設定される。   In S130, when data reading is completed for all areas of the data storage area 131 (S130: YES), the diagnosis target address is reset in S180. As a result, the diagnosis target address is set to the head address of the data storage area 131.

そしてS190にて、異常検出情報がECCエラー記憶レジスタ133に記憶されているか否かを判断する。ここで、異常検出情報がECCエラー記憶レジスタ133に記憶されていない場合には(S190:NO)、S200にて、診断異常フラグをクリアして、RAM診断処理を一旦終了する。一方、異常検出情報がECCエラー記憶レジスタ133に記憶されている場合には(S190:YES)、S210にて、診断異常フラグをセットし、さらにS220にて、ECCエラーカウンタをインクリメント(1加算)して、RAM診断処理を一旦終了する。   In S190, it is determined whether or not the abnormality detection information is stored in the ECC error storage register 133. If the abnormality detection information is not stored in the ECC error storage register 133 (S190: NO), the diagnosis abnormality flag is cleared in S200, and the RAM diagnosis process is temporarily terminated. On the other hand, if the abnormality detection information is stored in the ECC error storage register 133 (S190: YES), the diagnosis abnormality flag is set in S210, and the ECC error counter is incremented (add 1) in S220. Then, the RAM diagnosis process is temporarily terminated.

このように構成されたECU1は、データを書き込むときには、書き込むデータに基づいてECCを生成して、対応する書き込みデータにECCを付加し、記憶されているデータを読み出すときには、読み出すデータに付加されているECCを用いて、記憶されているデータにおける1ビットの誤りを訂正することができるとともに、記憶されているデータにおける2ビット以上の誤りを検出することができ、且つ、2ビット以上の誤りを検出したときにその旨を示す異常検出情報を、内部に予め設定されたECCエラー記憶レジスタ133に記憶することができるECC機能を搭載し、記憶されるデータの書き換えが可能であるRAM13を備え、データ記憶領域131の全領域に記憶されているデータを読み出し(S120,S130,S140)、ECCエラー記憶レジスタ133に異常検出情報が記憶されているか否かを判断する(S190)。そして、ECCエラー記憶レジスタ133に異常検出情報が記憶されている場合に(S190:YES、S110:YES)、RAM13のデータ記憶領域131に記憶されているデータを読み出し、その後に、読み出したデータを、読み出したときと同じアドレスに書き込む(S160,S130,S140)。   The ECU 1 configured as described above generates an ECC based on the data to be written when writing the data, adds the ECC to the corresponding write data, and adds the ECC to the data to be read when reading the stored data. ECC can be used to correct a 1-bit error in stored data, to detect an error of 2 bits or more in stored data, and to detect an error of 2 bits or more. The RAM 13 is equipped with an ECC function capable of storing abnormality detection information indicating that when detected in an ECC error storage register 133 set in advance therein, and capable of rewriting stored data. Data stored in all areas of the data storage area 131 is read (S120, S130, 140), the abnormality detection information ECC error storage register 133 to determine whether it is stored (S190). When abnormality detection information is stored in the ECC error storage register 133 (S190: YES, S110: YES), the data stored in the data storage area 131 of the RAM 13 is read, and then the read data is stored. The data is written at the same address as when it was read (S160, S130, S140).

このように構成されたECU1では、まず、データ記憶領域131に記憶されているデータを読み出すことにより、RAM13のECC機能が作動し、2ビット以上の誤りを検出したときに、RAM13内のECCエラー記憶レジスタ133に異常検出情報が記憶される。このため、ECCエラー記憶レジスタ133に異常検出情報が記憶されていると判断し、データの読み出し、その後に、読み出したデータを、読み出したときと同じアドレスに書き込む。これにより、RAM13のECC機能が作動し、読み出したデータに基づいてECCが再度生成され、新たなECCが付加された状態で、データが書き込まれる。すなわち、次に、記憶されたデータを読み出したときには、2ビット以上の誤りがECC機能により検出されるという状況が解消されている。   In the ECU 1 configured as described above, first, by reading the data stored in the data storage area 131, the ECC function of the RAM 13 is activated, and when an error of 2 bits or more is detected, the ECC error in the RAM 13 is detected. Abnormality detection information is stored in the storage register 133. For this reason, it is determined that the abnormality detection information is stored in the ECC error storage register 133, data is read, and then the read data is written to the same address as when it was read. As a result, the ECC function of the RAM 13 operates, ECC is generated again based on the read data, and data is written in a state where a new ECC is added. That is, when the stored data is read next, the situation where an error of 2 bits or more is detected by the ECC function is solved.

したがって、書き込み頻度が少ないデータを書き込むときに2ビット以上の誤りが発生した場合であっても、以降のデータ読み出し時にECC機能によってRAM13内のECCエラー記憶レジスタ133に異常検出情報が記憶されてしまうといった状態が長時間継続するのを抑制することができる。すなわち、1回の書き誤りに起因して異常を繰り返し検出してしまうのを抑制することができる。   Therefore, even when an error of 2 bits or more occurs when writing data with low writing frequency, the abnormality detection information is stored in the ECC error storage register 133 in the RAM 13 by the ECC function at the time of subsequent data reading. Such a state can be prevented from continuing for a long time. That is, it is possible to prevent the abnormality from being repeatedly detected due to one writing error.

このため、2ビット以上の誤りを検出した回数が予め設定されたフェールセーフ判定回数以上となるとフェールセーフ制御に移行するという処理がECU1で実行される場合であっても、1回の書き誤りに起因してフェールセーフ制御に移行してしまうという事態の発生を抑制することができる。   For this reason, even if the ECU 1 executes the process of shifting to fail-safe control when the number of times that an error of 2 bits or more is detected exceeds the preset number of fail-safe determinations, the writing error is one time. Therefore, it is possible to suppress the occurrence of a situation in which the shift to fail-safe control is caused.

また、ECCエラー記憶レジスタ133に異常検出情報が記憶されている場合に、データ書き込みが行われるので、ECCエラー記憶レジスタ133に異常検出情報が記憶されていない場合には、データ書き込みが行われず、データを読み出して書き込むことによる処理負荷の増大を抑制することができ、これにより、ECU1の制御性の悪化を抑制することができる。   In addition, since data writing is performed when abnormality detection information is stored in the ECC error storage register 133, data writing is not performed when abnormality detection information is not stored in the ECC error storage register 133. An increase in processing load due to reading and writing of data can be suppressed, and thereby deterioration of controllability of the ECU 1 can be suppressed.

また、診断単位バイト数分のデータを書き込む処理(S160)を前に、CPU11への割り込みを禁止する(S150)ことにより、診断単位バイト数分のデータ書き込み以外によるRAM13へのデータ書き込みを禁止する。   Further, before the process of writing data for the number of diagnostic unit bytes (S160), interrupting the CPU 11 is prohibited (S150), thereby prohibiting data writing to the RAM 13 other than data writing for the number of diagnostic unit bytes. .

これにより、S160の処理において診断単位バイト数分のデータを読み出す処理と、S160の処理において読み出したデータを同一のアドレスに書き込む処理との間で、この同一のアドレスにデータを書き込むという割り込み処理が発生し、割り込み処理で書き込まれたデータを、S160の処理で上書きしてしまうことを防止することができる。すなわち、マルチタスクのようなシステムにおいてもRAM13でのアクセス干渉を防ぐことができ、ECU1の制御で不具合が発生するのを抑制することができる。   Thus, an interrupt process of writing data to the same address between the process of reading data for the number of diagnostic unit bytes in the process of S160 and the process of writing the data read in the process of S160 to the same address is performed. It is possible to prevent the data generated and written in the interrupt process from being overwritten in the process of S160. That is, even in a system such as a multitask, access interference in the RAM 13 can be prevented, and occurrence of problems due to control of the ECU 1 can be suppressed.

以上説明した実施形態において、RAM13は本発明における書換可能メモリ、S120,S130,S140の処理は本発明における読出手段、S190の処理は本発明における異常判断手段、S160,S130,S140の処理は本発明における書込手段、ECCエラー記憶レジスタ133は本発明における異常記憶領域、データ記憶領域131は本発明における異常検出領域、S150の処理は本発明における書込禁止手段である。   In the embodiment described above, the RAM 13 is the rewritable memory according to the present invention, the processing at S120, S130, and S140 is the reading means according to the present invention, the processing at S190 is the abnormality determining means according to the present invention, and the processes at S160, S130, and S140 are the main processing. The writing means in the present invention, the ECC error storage register 133 is an abnormal storage area in the present invention, the data storage area 131 is an abnormality detection area in the present invention, and the process of S150 is a write prohibiting means in the present invention.

(第2実施形態)
以下に本発明の第2実施形態を図面とともに説明する。なお第2実施形態では、第1実施形態と異なる部分を説明する。
(Second Embodiment)
A second embodiment of the present invention will be described below with reference to the drawings. In the second embodiment, parts different from the first embodiment will be described.

第2実施形態の電子制御装置(ECU)1は、モータ制御処理およびRAM診断処理の代わりに時間同期処理を実行する点以外は第1実施形態と同じである。
ここで、CPU11が実行する時間同期処理の手順を図4を用いて説明する。この時間同期処理は、所定時間毎(本実施形態では10ms毎)に繰り返し実行される処理である。
The electronic control unit (ECU) 1 of the second embodiment is the same as that of the first embodiment except that a time synchronization process is executed instead of the motor control process and the RAM diagnosis process.
Here, a procedure of time synchronization processing executed by the CPU 11 will be described with reference to FIG. This time synchronization process is a process that is repeatedly executed every predetermined time (in this embodiment, every 10 ms).

この時間同期処理が実行されると、CPU11は、まずS310にて、S150と同様にして、CPU11への割り込みを禁止する。そしてS320にて、ECCエラー記憶レジスタ133をクリアする。これにより、ECCエラー記憶レジスタ133の記憶内容が消去される。   When this time synchronization processing is executed, the CPU 11 first prohibits an interrupt to the CPU 11 in S310 as in S150. In S320, the ECC error storage register 133 is cleared. As a result, the stored contents of the ECC error storage register 133 are erased.

その後S330にて、診断異常フラグがセットされているか否かを判断する。ここで、診断異常フラグがセットされていない場合には(S330:NO)、S340にて、データ記憶領域131のうちモータ制御に関連するデータが記憶される領域として予め設定されたモータ制御記憶領域についてデータの読み出しを行い、S360に移行する。これにより、RAM13のECC機能が作動する。   Thereafter, in S330, it is determined whether or not a diagnosis abnormality flag is set. Here, when the diagnosis abnormality flag is not set (S330: NO), in S340, a motor control storage area preset as an area in which data related to motor control is stored in the data storage area 131. The data is read out for, and the process proceeds to S360. As a result, the ECC function of the RAM 13 operates.

一方、診断異常フラグがセットされている場合には(S330:YES)、S350にて、データ記憶領域131のモータ制御記憶領域についてデータの読み出しを行い、その後、読み出したデータを、同一のアドレスに書き込み、S360に移行する。これにより、RAM13のECC機能が作動する。   On the other hand, when the diagnosis abnormality flag is set (S330: YES), data is read from the motor control storage area of the data storage area 131 in S350, and then the read data is set to the same address. Write, go to S360. As a result, the ECC function of the RAM 13 operates.

そしてS360に移行すると、異常検出情報がECCエラー記憶レジスタ133に記憶されているか否かを判断する。ここで、異常検出情報がECCエラー記憶レジスタ133に記憶されていない場合には(S360:NO)、S370にて、診断異常フラグをクリアして、S400に移行する。一方、異常検出情報がECCエラー記憶レジスタ133に記憶されている場合には(S360:YES)、S380にて、診断異常フラグをセットし、さらにS390にて、ECCエラーカウンタをインクリメント(1加算)して、S400に移行する。   In S360, it is determined whether or not the abnormality detection information is stored in the ECC error storage register 133. If the abnormality detection information is not stored in the ECC error storage register 133 (S360: NO), the diagnosis abnormality flag is cleared in S370, and the process proceeds to S400. On the other hand, if the abnormality detection information is stored in the ECC error storage register 133 (S360: YES), the diagnosis abnormality flag is set in S380, and the ECC error counter is incremented (added by 1) in S390. Then, the process proceeds to S400.

そしてS400に移行すると、S170と同様にして、CPU11への割り込みを許可し、さらにS410にて、ECCエラーカウンタの値(ECCエラー回数)が予め設定されたフェールセーフ判定値(本実施形態では3回を示す値)以上であるか否かを判断する。   When the process proceeds to S400, the CPU 11 is allowed to interrupt the process in the same manner as S170. Further, in S410, the fail-safe determination value (3 in the present embodiment) in which the value of the ECC error counter (the number of ECC errors) is preset. It is determined whether or not it is equal to or greater than the value indicating the number of times.

ここで、ECCエラー回数がフェールセーフ判定値未満である場合には(S410:NO)、S420にて、S20と同様にして、モータ制御を実行し、時間同期処理を一旦終了する。   If the number of ECC errors is less than the fail-safe determination value (S410: NO), motor control is executed in S420 in the same manner as S20, and the time synchronization process is temporarily ended.

一方、ECCエラー回数がフェールセーフ判定値以上である場合には(S410:YES)、S430にて、S30と同様にして、フェールセーフ制御を実行し、時間同期処理を一旦終了する。   On the other hand, when the number of ECC errors is equal to or greater than the fail-safe determination value (S410: YES), fail-safe control is executed in S430 in the same manner as S30, and the time synchronization process is temporarily terminated.

このように構成されたECU1では、ECCエラー記憶レジスタ133に記憶されている異常検出情報を消去し(S320)、その後に、データ記憶領域131のうちモータ制御に関連するデータが記憶される領域として予め設定されたモータ制御記憶領域に記憶されているデータを読み出し(S340)、モータ制御記憶領域に記憶されている全てのデータを読み出した後に、ECCエラー記憶レジスタ133に異常検出情報が記憶されているか否かを判断する(S360)。   In the ECU 1 configured as described above, the abnormality detection information stored in the ECC error storage register 133 is erased (S320), and then the data storage area 131 stores data related to motor control. After reading the data stored in the preset motor control storage area (S340) and reading all the data stored in the motor control storage area, the abnormality detection information is stored in the ECC error storage register 133. It is determined whether or not (S360).

これにより、ECCエラー記憶レジスタ133に異常検出情報が記憶されていれば、データ記憶領域131のうちモータ制御記憶領域において異常が発生していると判断することができる。すなわち、モータ制御に関連するデータで異常が発生しているか否かを判断することができる。   Thus, if abnormality detection information is stored in the ECC error storage register 133, it can be determined that an abnormality has occurred in the motor control storage area of the data storage area 131. That is, it can be determined whether or not an abnormality has occurred in the data related to motor control.

したがって、RAM13のデータ記憶領域131の全体ではなく、RAM13のデータ記憶領域131のうちの特定の領域で異常が発生しているか否かを判断することができるため、この特定領域で異常が発生した場合に、この特定領域に対応したフェールセーフ制御に移行するという処理が可能となる。   Therefore, it is possible to determine whether or not an abnormality has occurred in a specific area of the data storage area 131 of the RAM 13 instead of the entire data storage area 131 of the RAM 13. Therefore, an abnormality has occurred in this specific area. In this case, a process of shifting to fail-safe control corresponding to this specific area is possible.

以上説明した実施形態において、S340の処理は本発明における読出手段、S360の処理は本発明における異常判断手段、S350の処理は本発明における書込手段、S310の処理は本発明における書込禁止手段、S320の処理は本発明における消去手段、モータ制御記憶領域は本発明における異常検出領域である。   In the embodiment described above, the process in S340 is the reading means in the present invention, the process in S360 is the abnormality determining means in the present invention, the process in S350 is the writing means in the present invention, and the process in S310 is the write prohibiting means in the present invention. , S320 is the erasing means in the present invention, and the motor control storage area is the abnormality detection area in the present invention.

(第3実施形態)
以下に本発明の第3実施形態を図面とともに説明する。なお第3実施形態では、第1実施形態と異なる部分を説明する。
(Third embodiment)
A third embodiment of the present invention will be described below with reference to the drawings. In the third embodiment, parts different from the first embodiment will be described.

第3実施形態の電子制御装置(ECU)1は、モータ制御処理およびRAM診断処理が変更された点以外は第1実施形態と同じである。
まず、第3実施形態のRAM診断処理の手順を図5を用いて説明する。
The electronic control unit (ECU) 1 of the third embodiment is the same as that of the first embodiment except that the motor control process and the RAM diagnosis process are changed.
First, the procedure of the RAM diagnosis process of the third embodiment will be described with reference to FIG.

このRAM診断処理が実行されると、CPU11は、まずS510にて、S150と同様にして、CPU11への割り込みを禁止する。そしてS520にて、ECCエラー記憶レジスタ133をクリアする。これにより、ECCエラー記憶レジスタ133の記憶内容が消去される。   When this RAM diagnosis process is executed, the CPU 11 first prohibits interruption to the CPU 11 in S510, similarly to S150. In step S520, the ECC error storage register 133 is cleared. As a result, the stored contents of the ECC error storage register 133 are erased.

その後S530にて、診断異常フラグがセットされているか否かを判断する。ここで、診断異常フラグがセットされていない場合には(S330:NO)、S540にて、S600で設定される診断対象アドレスを先頭アドレスとして予め設定された診断単位バイト数(本実施形態では16バイト)分のデータをデータ記憶領域131から読み出し、S560に移行する。これにより、RAM13のECC機能が作動する。   Thereafter, in S530, it is determined whether or not a diagnosis abnormality flag is set. Here, when the diagnosis abnormality flag is not set (S330: NO), in S540, the number of diagnosis unit bytes set in advance with the diagnosis target address set in S600 as the head address (16 in this embodiment). Bytes) of data is read from the data storage area 131, and the process proceeds to S560. As a result, the ECC function of the RAM 13 operates.

一方、診断異常フラグがセットされている場合には(S530:YES)、S550にて、S600で設定される診断対象アドレスを先頭アドレスとして予め設定された診断単位バイト数(本実施形態では16バイト)分のデータをデータ記憶領域131から読み出し、その後、読み出したデータを、同一のアドレスに書き込み、S560に移行する。これにより、RAM13のECC機能が作動する。   On the other hand, when the diagnosis abnormality flag is set (S530: YES), in S550, the number of diagnostic unit bytes set in advance with the diagnosis target address set in S600 as the head address (16 bytes in this embodiment). ) Portion of data is read from the data storage area 131, and then the read data is written to the same address, and the process proceeds to S560. As a result, the ECC function of the RAM 13 operates.

そしてS560に移行すると、異常検出情報がECCエラー記憶レジスタ133に記憶されているか否かを判断する。ここで、異常検出情報がECCエラー記憶レジスタ133に記憶されていない場合には(S560:NO)、S580に移行する。一方、異常検出情報がECCエラー記憶レジスタ133に記憶されている場合には(S560:YES)、S570にて、データ記憶領域131内において予め設定されたECCエラーアドレス記憶領域に、現在の診断対象アドレスをECCエラーアドレスとして記憶し、S580に移行する。   Then, in S560, it is determined whether or not the abnormality detection information is stored in the ECC error storage register 133. If the abnormality detection information is not stored in the ECC error storage register 133 (S560: NO), the process proceeds to S580. On the other hand, if the abnormality detection information is stored in the ECC error storage register 133 (S560: YES), the current diagnosis target is stored in the ECC error address storage area preset in the data storage area 131 in S570. The address is stored as an ECC error address, and the process proceeds to S580.

そしてS580に移行すると、S170と同様にして、CPU11への割り込みを許可し、さらにS590にて、データ記憶領域131の全領域についてデータの読み出しが完了したか否かを判断する。ここで、全領域の読み出しが完了していない場合には(S590:NO)、S600にて、診断対象アドレスを診断単位バイト数分だけ次に移動させ、RAM診断処理を一旦終了する。   When the process proceeds to S580, the CPU 11 is allowed to interrupt the process in the same manner as S170, and further, in S590, it is determined whether or not the data reading has been completed for all areas of the data storage area 131. Here, when the reading of the entire area is not completed (S590: NO), in S600, the diagnosis target address is moved next by the number of diagnosis unit bytes, and the RAM diagnosis process is temporarily ended.

一方、データ記憶領域131の全領域についてデータの読み出しが完了した場合には(S590:YES)、S610にて、診断対象アドレスをリセットする。これにより、診断対象アドレスは、データ記憶領域131の先頭アドレスに設定される。   On the other hand, when data reading is completed for all areas of the data storage area 131 (S590: YES), the diagnosis target address is reset in S610. As a result, the diagnosis target address is set to the head address of the data storage area 131.

その後S620にて、ECCエラーアドレス記憶領域にECCエラーアドレスが記憶されているか否かを判断する。ここで、ECCエラーアドレスが記憶されていない場合には(S620:NO)、S630にて、診断異常フラグをクリアして、RAM診断処理を一旦終了する。一方、ECCエラーアドレスが記憶されている場合には(S630:YES)、S640にて、診断異常フラグをセットし、さらにS650にて、ECCエラーアドレスに対応するECCエラーカウンタをインクリメント(1加算)する。なお、ECCエラーカウンタは、ECCエラーアドレス毎に予め設けられている。そしてS650の処理が終了すると、RAM診断処理を一旦終了する。   Thereafter, in S620, it is determined whether or not an ECC error address is stored in the ECC error address storage area. Here, when the ECC error address is not stored (S620: NO), the diagnosis abnormality flag is cleared in S630, and the RAM diagnosis process is temporarily ended. On the other hand, if an ECC error address is stored (S630: YES), a diagnostic abnormality flag is set in S640, and an ECC error counter corresponding to the ECC error address is incremented (added by 1) in S650. To do. An ECC error counter is provided in advance for each ECC error address. When the process of S650 is completed, the RAM diagnosis process is temporarily ended.

次に、第3実施形態のモータ制御処理の手順を図6を用いて説明する。
このモータ制御処理が実行されると、CPU11は、まずS710にて、ECCエラーアドレス毎に設けられているECCエラーカウンタのうち、ECCエラーカウンタの値(ECCエラー回数)が予め設定されたフェールセーフ判定値(本実施形態では3回を示す値)以上であるものが存在するか否かを判断する。
Next, the procedure of the motor control process of the third embodiment will be described with reference to FIG.
When this motor control process is executed, the CPU 11 first, in S710, among the ECC error counters provided for each ECC error address, the value of the ECC error counter (the number of ECC errors) is set as a fail safe. It is determined whether or not there is a determination value (a value indicating 3 times in this embodiment) or more.

ここで、ECCエラー回数がフェールセーフ判定値以上となるECCエラーカウンタが存在しない場合には(S710:NO)、S720にて、S20と同様にして、モータ制御を実行し、モータ制御処理を一旦終了する。   Here, when there is no ECC error counter in which the number of ECC errors is equal to or greater than the fail-safe determination value (S710: NO), motor control is executed in S720 similarly to S20, and the motor control process is temporarily performed. finish.

一方、ECCエラー回数がフェールセーフ判定値以上となるECCエラーカウンタが存在する場合には(S710:YES)、S730にて、ECCエラー回数がフェールセーフ判定値以上となるECCエラーカウンタに対応するECCエラーアドレスが、モータ制御に関連するデータが記憶されるアドレスであるか否かを判断する。   On the other hand, if there is an ECC error counter whose ECC error count is equal to or greater than the fail-safe determination value (S710: YES), the ECC corresponding to the ECC error counter whose ECC error count is equal to or greater than the fail-safe determination value is determined in S730. It is determined whether the error address is an address at which data related to motor control is stored.

ここで、ECCエラーアドレスが、モータ制御に関連するデータが記憶されるアドレスである場合には(S730:YES)、S740にて、S30と同様にして、フェールセーフ制御を実行し、モータ制御処理を一旦終了する。   If the ECC error address is an address in which data related to motor control is stored (S730: YES), fail safe control is executed in S740 in the same manner as S30, and motor control processing is performed. Is temporarily terminated.

一方、ECCエラーアドレスが、モータ制御に関連するデータが記憶されるアドレスでない場合には(S730:NO)、S750にて、フェールセーフ制御として、ワーニングランプ信号(図1を参照)を出力することにより警告灯(不図示)を点灯させて、モータ制御処理を一旦終了する。   On the other hand, when the ECC error address is not an address where data related to motor control is stored (S730: NO), a warning lamp signal (see FIG. 1) is output as fail-safe control in S750. As a result, a warning lamp (not shown) is turned on, and the motor control process is temporarily terminated.

このように構成されたECU1では、予め設定された診断単位バイト数毎に、データ記憶領域131の全領域に記憶されているデータを読み出し(S540)、診断単位バイト数のデータを読み出す毎に、ECCエラー記憶レジスタ133に異常検出情報が記憶されているか否かを判断し(S560)、ECCエラー記憶レジスタ133に異常検出情報が記憶されている場合に(S560:YES)、判断の対象となった診断単位バイト数のデータが記憶されているアドレスを特定するための診断対象アドレスを記憶する(S570)。   The ECU 1 configured as described above reads data stored in the entire area of the data storage area 131 for each preset diagnostic unit byte number (S540), and reads the diagnostic unit byte number data every time. It is determined whether or not the abnormality detection information is stored in the ECC error storage register 133 (S560). If the abnormality detection information is stored in the ECC error storage register 133 (S560: YES), the determination is made. The diagnosis target address for specifying the address where the data of the number of diagnostic unit bytes is stored is stored (S570).

これにより、診断単位バイト数毎に、データで異常が発生しているか否かを判断することができる。
したがって、記憶されているデータで異常が発生した場合に、異常が発生したデータのアドレスに基づいて、異常が発生したデータの内容を特定し、異常が発生したデータの内容に対応したフェールセーフ制御に移行するという処理が可能となる。
This makes it possible to determine whether or not an abnormality has occurred in the data for each number of diagnostic unit bytes.
Therefore, when an abnormality occurs in the stored data, the content of the data in which the abnormality has occurred is identified based on the address of the data in which the abnormality has occurred, and fail-safe control corresponding to the content of the data in which the abnormality has occurred The process of shifting to is possible.

以上説明した実施形態において、S540,590,600の処理は本発明における読出手段、S560の処理は本発明における異常判断手段、S550,590,600の処理は本発明における書込手段、S510の処理は本発明における書込禁止手段、S570の処理は本発明における異常アドレス記憶手段、診断単位バイト数は本発明における読出単位数である。   In the embodiment described above, the processing in S540, 590, and 600 is the reading means in the present invention, the processing in S560 is the abnormality determining means in the present invention, the processing in S550, 590, and 600 is the writing means in the present invention, and the processing in S510. Is the write inhibit means in the present invention, the processing in S570 is the abnormal address storage means in the present invention, and the number of diagnostic unit bytes is the number of read units in the present invention.

以上、本発明の一実施形態について説明したが、本発明は上記実施形態に限定されるものではなく、本発明の技術的範囲に属する限り種々の形態を採ることができる。
例えば上記実施形態では、CPU11が実行する処理で、データの読み出し及び書き込みを行うものを示したが、DMAコントローラ14を備えている場合には、データの読み出し及び書き込みがDMAにより行われるようにしてもよい。これにより、CPU11を介すことなく、ECC機能を作動させることができるため、データの異常を検出するためにCPU11の処理負荷が増大するのを抑制することができる。
As mentioned above, although one Embodiment of this invention was described, this invention is not limited to the said embodiment, As long as it belongs to the technical scope of this invention, a various form can be taken.
For example, in the above embodiment, the processing executed by the CPU 11 shows data reading and writing. However, when the DMA controller 14 is provided, the data reading and writing are performed by the DMA. Also good. Thereby, since the ECC function can be operated without going through the CPU 11, it is possible to suppress an increase in the processing load on the CPU 11 in order to detect a data abnormality.

また上記第1実施形態では、処理負荷を分散するために、診断単位バイト数毎にデータ記憶領域131のデータの読み出し及び書き込みを行うものを示したが、データ記憶領域131の全領域について一度にデータの読み出し及び書き込みを行うようにしてもよい。   Further, in the first embodiment, the data read / write of the data storage area 131 is shown for each number of diagnostic unit bytes in order to distribute the processing load. Data reading and writing may be performed.

また上記第2実施形態では、モータ制御記憶領域の全体について一度にデータの読み出し及び書き込みを行うものを示したが、診断単位バイト数毎にモータ制御記憶領域のデータの読み出し及び書き込みを行うようにしてもよい。   In the second embodiment, the entire motor control storage area is read and written at once. However, the data in the motor control storage area is read and written for each number of diagnostic unit bytes. May be.

また上記第2実施形態では、RAM13のデータ記憶領域131のうちの特定の領域で異常が発生しているか否かを判断するものを示したが、RAM13の物理的ページ毎に分割して異常が発生しているか否かを判断するようにしてもよい。   In the second embodiment, an example is shown in which it is determined whether or not an abnormality has occurred in a specific area of the data storage area 131 of the RAM 13. However, the abnormality is divided for each physical page of the RAM 13. You may make it judge whether it has generate | occur | produced.

また上記実施形態では、RAM13のデータの読み出し及び書き込みを行う前に、CPU11への割り込みを禁止するものを示したが、RAM13でアクセス干渉が発生する懸念がない場合には、割り込みを禁止しないようにしてもよい。   In the above-described embodiment, the CPU 11 is prohibited from interrupting data before reading and writing data to the RAM 13. However, when there is no concern about access interference in the RAM 13, the interrupt is not prohibited. It may be.

1…ECU、11…CPU、13…RAM、131…データ記憶領域、132…ECC記憶領域、133…ECCエラー記憶レジスタ   DESCRIPTION OF SYMBOLS 1 ... ECU, 11 ... CPU, 13 ... RAM, 131 ... Data storage area, 132 ... ECC storage area, 133 ... ECC error storage register

Claims (5)

データを書き込むときには、書き込むデータに基づいて誤り訂正符号を生成して、対応する書き込みデータに前記誤り訂正符号を付加し、記憶されているデータを読み出すときには、読み出すデータに付加されている前記誤り訂正符号を用いて、記憶されているデータにおける1ビットの誤りを訂正することができるとともに、記憶されているデータにおける2ビット以上の誤りを検出することができ、且つ、2ビット以上の誤りを検出したときにその旨を示す異常検出情報を、内部に予め設定された異常記憶領域(133)に記憶することができるECC(Error Correction Code)機能を搭載し、記憶されるデータの書き換えが可能である書換可能メモリ(13)と、
前記書換可能メモリの記憶領域のうち予め設定された異常検出領域(131)に記憶されているデータを読み出す読出手段(S120,S130,S140,S340,S540,590,600)と、
前記異常記憶領域に前記異常検出情報が記憶されているか否かを判断する異常判断手段(S190,S360,S560)と、
前記異常記憶領域に前記異常検出情報が記憶されていると前記異常判断手段が判断した場合に、前記書換可能メモリの前記異常検出領域に記憶されているデータを読み出し、その後に、読み出したデータを、読み出したときと同じアドレスに書き込む書込手段(S130,S140,S160,S350,S550,590,600)と、
前記異常記憶領域に前記異常検出情報が記憶されていると前記異常判断手段が判断した異常判断回数が予め設定されたフェールセーフ判定回数未満である場合には、車両を制御するための通常制御を実行し、前記異常判断回数が前記フェールセーフ判定回数以上である場合には、前記車両の前記制御を停止するフェールセーフ制御を行う車両制御手段とを備える
ことを特徴とする電子制御装置(1)。
When writing data, an error correction code is generated based on the data to be written, the error correction code is added to the corresponding write data, and when the stored data is read, the error correction code added to the read data A code can be used to correct a 1-bit error in stored data, as well as to detect 2-bit or more errors in stored data, and to detect 2-bit or more errors It is equipped with an ECC (Error Correction Code) function that can store abnormality detection information indicating that in the internal abnormal storage area (133), and the stored data can be rewritten. A rewritable memory (13);
Reading means (S120, S130, S140, S340, S540, 590, 600) for reading data stored in a preset abnormality detection area (131) of the storage area of the rewritable memory;
Abnormality determination means (S190, S360, S560) for determining whether or not the abnormality detection information is stored in the abnormality storage area;
When the abnormality determination unit determines that the abnormality detection information is stored in the abnormality storage area, the data stored in the abnormality detection area of the rewritable memory is read, and then the read data is Writing means (S130, S140, S160, S350, S550, 590, 600) for writing to the same address as when read ,
When the number of abnormality determinations determined by the abnormality determination means that the abnormality detection information is stored in the abnormality storage area is less than a preset number of fail-safe determinations, normal control for controlling the vehicle is performed. An electronic control device (1) , comprising: vehicle control means for performing fail-safe control to stop the control of the vehicle when the abnormality determination count is greater than or equal to the fail-safe determination count. .
前記異常記憶領域に記憶されている前記異常検出情報を消去する消去手段(S320)を備え、
前記読出手段(S340)は、前記消去手段が前記異常検出情報を消去した後に、前記異常検出領域に記憶されているデータを読み出し、
前記異常判断手段(S360)は、前記異常検出領域に記憶されている全てのデータを読み出した後に、前記異常記憶領域に前記異常検出情報が記憶されているか否かを判断する
ことを特徴とする請求項1に記載の電子制御装置。
Erasing means for erasing the abnormality detection information stored in the abnormality storage area (S320),
The reading means (S340) reads data stored in the abnormality detection area after the erasing means erases the abnormality detection information.
The abnormality determining means (S360), after reading all data stored in the abnormality detection area, determines whether or not the abnormality detection information is stored in the abnormality storage area. The electronic control device according to claim 1.
前記読出手段(S540,590,600)は、予め設定された読出単位数毎に、前記異常検出領域に記憶されているデータを読み出し、
前記異常判断手段(S560)は、前記読出手段が前記読出単位数のデータを読み出す毎に、前記異常記憶領域に前記異常検出情報が記憶されているか否かを判断し、
前記異常記憶領域に前記異常検出情報が記憶されていると前記異常判断手段が判断した場合に、前記異常判断手段による判断の対象となった前記読出単位数のデータが記憶されているアドレスを特定するためのアドレス情報を記憶する異常アドレス記憶手段(S570)を備える
ことを特徴とする請求項1に記載の電子制御装置。
The reading means (S540, 590, 600) reads data stored in the abnormality detection area for each preset number of reading units,
The abnormality determination unit (S560) determines whether or not the abnormality detection information is stored in the abnormality storage area every time the reading unit reads out the data of the number of reading units.
When the abnormality determination unit determines that the abnormality detection information is stored in the abnormality storage area, the address where the data of the number of reading units that is the target of the determination by the abnormality determination unit is specified The electronic control device according to claim 1, further comprising an abnormal address storage unit (S570) that stores address information for performing the operation.
前記読出手段によるデータの読み出しと、前記書込手段によるデータの読み出し及び書き込みは、DMA(Direct Memory Access)により行われる
ことを特徴とする請求項1〜請求項3の何れか1項に記載の電子制御装置。
The data reading by the reading means and the data reading and writing by the writing means are performed by DMA (Direct Memory Access). Electronic control device.
前記書込手段がデータを書き込む前に、前記書込手段以外による前記書換可能メモリへのデータ書き込みを禁止する書込禁止手段(S150,S310,S510)を備える
ことを特徴とする請求項1〜請求項4の何れか1項に記載の電子制御装置。
The write-in means (S150, S310, S510) for prohibiting data writing to the rewritable memory other than the writing means before the writing means writes data. The electronic control apparatus of any one of Claim 4.
JP2012189139A 2012-08-29 2012-08-29 Electronic control unit Active JP5835160B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012189139A JP5835160B2 (en) 2012-08-29 2012-08-29 Electronic control unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012189139A JP5835160B2 (en) 2012-08-29 2012-08-29 Electronic control unit

Publications (2)

Publication Number Publication Date
JP2014048744A JP2014048744A (en) 2014-03-17
JP5835160B2 true JP5835160B2 (en) 2015-12-24

Family

ID=50608403

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012189139A Active JP5835160B2 (en) 2012-08-29 2012-08-29 Electronic control unit

Country Status (1)

Country Link
JP (1) JP5835160B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016081341A (en) * 2014-10-17 2016-05-16 株式会社デンソー Electronic control device
JP6512065B2 (en) 2015-10-29 2019-05-15 株式会社デンソー Electronic control unit
JP2018010362A (en) 2016-07-11 2018-01-18 株式会社デンソー Electronic control unit
JP7024582B2 (en) * 2017-11-22 2022-02-24 株式会社デンソー In-vehicle control device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6370357A (en) * 1986-09-11 1988-03-30 Nec Corp Memory data correction system
JP3578638B2 (en) * 1998-08-25 2004-10-20 株式会社日立ユニシアオートモティブ Diagnostic device for microcomputer memory
US7797134B2 (en) * 2003-11-14 2010-09-14 Hewlett-Packard Development Company, L.P. System and method for testing a memory with an expansion card using DMA
WO2007010829A1 (en) * 2005-07-15 2007-01-25 Matsushita Electric Industrial Co., Ltd. Nonvolatile storage device, memory controller, and defective region detection method
JP5087970B2 (en) * 2007-03-30 2012-12-05 横河電機株式会社 Information processing apparatus and information processing method
JP4703673B2 (en) * 2008-03-12 2011-06-15 株式会社東芝 Memory system
US8276043B2 (en) * 2008-03-01 2012-09-25 Kabushiki Kaisha Toshiba Memory system

Also Published As

Publication number Publication date
JP2014048744A (en) 2014-03-17

Similar Documents

Publication Publication Date Title
JP5835160B2 (en) Electronic control unit
JP4227149B2 (en) Information storage method for electronic control unit
JP6860830B2 (en) Vehicle display device
JP4789420B2 (en) Data processing apparatus for vehicle control system
JP6658417B2 (en) Electronic control unit
JP2016081341A (en) Electronic control device
JP6512065B2 (en) Electronic control unit
JP2010113409A (en) Onboard electronic control device
JP2014075078A (en) Electronic control device
JP6471510B2 (en) Microcomputer
JP5590069B2 (en) Microcomputer
JP7024582B2 (en) In-vehicle control device
JP4353126B2 (en) Vehicle state determination device
JP2007015643A (en) Electronic control device for vehicle
JP2009506446A (en) Data processing system and driving method thereof
JP6363044B2 (en) Control device
JP7200883B2 (en) electronic controller
JP2009083777A (en) Vehicle control device and program
JP2009282849A (en) Microcomputer
JP6875950B2 (en) Vehicle control device
JP6702161B2 (en) In-vehicle electronic control unit
JP2018010362A (en) Electronic control unit
JP2008225835A (en) Memory access control method and circuit, and information processor
JP5803847B2 (en) Electronic control unit
JP2017199294A (en) On-vehicle control unit

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20141204

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150715

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150728

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150914

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20151019

R151 Written notification of patent or utility model registration

Ref document number: 5835160

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

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250