JP2009018773A - Electronic control device and method for writing in memory - Google Patents
Electronic control device and method for writing in memory Download PDFInfo
- Publication number
- JP2009018773A JP2009018773A JP2007184828A JP2007184828A JP2009018773A JP 2009018773 A JP2009018773 A JP 2009018773A JP 2007184828 A JP2007184828 A JP 2007184828A JP 2007184828 A JP2007184828 A JP 2007184828A JP 2009018773 A JP2009018773 A JP 2009018773A
- Authority
- JP
- Japan
- Prior art keywords
- data
- writing
- memory
- microcomputer
- write control
- 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.)
- Withdrawn
Links
Images
Abstract
Description
本発明は、電子制御装置に係り、特にマイクロコンピュータの暴走時にこれをリセットするためのウォッチドッグタイマを備えた電子制御装置に関するものである。また、本発明は、かかる電子制御装置におけるメモリへの書込み方法に関するものでもある。 The present invention relates to an electronic control device, and more particularly to an electronic control device including a watchdog timer for resetting a microcomputer when the microcomputer runs away. The present invention also relates to a method for writing to a memory in such an electronic control device.
マイクロコンピュータ(以下、適宜マイコンと略する)により制御される電子機器においては、ノイズ等の影響によりプログラムが暴走することがある。マイコンが暴走した場合には、マイコンをリセットするなどの対策がなされており(例えば特許文献1参照)、このようなマイコン暴走時のリセット制御装置としてはウォッチドッグタイマが知られている。このウォッチドッグタイマは、マイコンから所定の周期で出力されるように構成されたパルスを監視し、このパルスの周期性の異常からマイコンの暴走(異常)を検出し、暴走を検出した場合にマイコンをリセットするものである(例えば特許文献2参照)。 In an electronic device controlled by a microcomputer (hereinafter abbreviated as a microcomputer as appropriate), a program may run away due to the influence of noise or the like. When the microcomputer runs away, a countermeasure such as resetting the microcomputer is taken (for example, refer to Patent Document 1), and a watchdog timer is known as a reset control device for such a microcomputer runaway. This watchdog timer monitors pulses that are configured to be output from the microcomputer at a predetermined cycle, detects microcomputer runaway (abnormality) from the periodic abnormality of this pulse, and detects a runaway microcomputer. Is reset (see, for example, Patent Document 2).
また、多くの電子制御装置(Electronic Control Unit:ECU)においては、動作中に様々な制御データ(例えば車両用ECUにあっては車両の経年変化を通じて蓄積された燃焼噴射のタイミングデータなど)がRAM(Random Access Memory)やEEPROM(Electrically Erasable Programmable Read-Only Memory)などのメモリに書き込まれ、保存されている(例えば特許文献3参照)。これらの制御データは制御中に適宜参照され、最適な制御のために利用されている。 In many electronic control units (ECUs), various control data (for example, timing data of combustion injection accumulated through aging of a vehicle in a vehicle ECU) is stored in a RAM during operation. (Random Access Memory) and EEPROM (Electrically Erasable Programmable Read-Only Memory) and the like are written and stored (see, for example, Patent Document 3). These control data are referred to as appropriate during the control and are used for optimal control.
ここで、上述したメモリにデータを書き込む際には、保存すべきデータに加えて、このデータの信頼性を保証するための冗長データも保存データとともにメモリに書き込まれることがある。例えば、図1(a)に示されるように、「0x01」というデータをRAM500に書き込む場合、「0x01」のミラー値(逆数)である「0xFE」も「0x01」とともにRAM500に書き込まれる。車両用の電子制御装置では、イグニッションスイッチがオンになったときや所定の時間間隔で、RAM500に保存されたデータの整合性(すなわち保存されたデータとそれに対応するミラー値が正しく保存されているか)がチェックされ、データが破壊されていると判断された場合には、RAM500の初期化(リフレッシュ)が行われる。
Here, when data is written to the memory described above, in addition to the data to be stored, redundant data for ensuring the reliability of the data may be written to the memory together with the stored data. For example, as shown in FIG. 1A, when data “0x01” is written to the
しかしながら、上述したウォッチドッグタイマを有する電子制御装置の場合には以下のような問題が生じる。すなわち、メモリにデータを書き込んでいる途中でマイコンが暴走すると、ウォッチドッグタイマがそれを検出しマイコンをリセットしてしまう。この場合には、データの書込みが途中で中断され、メモリにデータが正しく書き込まれないおそれがある。例えば、図1(b)に示されるように、データ「0x01」の書込み処理中にマイコンが暴走した場合、RAM500にミラー値「0xFE」を書き込む前にウォッチドッグタイマによりマイコンがリセットされてしまう場合がある。この場合には、ミラー値「0xFE」がRAM500に書き込まれず、RAM500に保存されたデータ「0x01」に対応するミラー値が不定値になってしまう。このため、データの整合性のチェックにおいて、保存されたデータが破壊されていると判断され、RAM500のデータ内容が初期化され失われてしまう。この場合の初期化はRAM500のすべての領域に対して行われるため、1つのデータが破壊されると破壊されていないデータまでも初期化されてしまう。
However, the following problems arise in the case of the electronic control device having the above-described watchdog timer. That is, if the microcomputer runs out of control while data is being written to the memory, the watchdog timer detects it and resets the microcomputer. In this case, data writing may be interrupted and data may not be correctly written to the memory. For example, as shown in FIG. 1B, when the microcomputer runs out of control during the writing process of the data “0x01”, the microcomputer is reset by the watchdog timer before the mirror value “0xFE” is written in the
本発明は、このような従来技術の問題点に鑑みてなされたもので、メモリへの書込み処理とウォッチドッグタイマによるリセット処理とが同時に生じることによるデータの喪失を防止し、メモリに保存されるデータの信頼性を向上することができる電子制御装置を提供することを第1の目的とする。 The present invention has been made in view of such problems of the prior art, and prevents data loss due to simultaneous occurrence of write processing to the memory and reset processing by the watchdog timer, and is stored in the memory. A first object is to provide an electronic control device capable of improving the reliability of data.
また、本発明は、メモリへの書込み処理とマイクロコンピュータのリセット処理とが同時に生じることを防止して、データの喪失の防止とデータの信頼性の向上を実現することができるメモリへの書込み方法を提供することを第2の目的とする。 Further, the present invention prevents a data write process and a microcomputer reset process from occurring at the same time, thereby preventing data loss and improving data reliability. The second object is to provide the above.
かかる目的を達成するために本発明の電子制御装置は、マイクロコンピュータから出力されるウォッチドッグパルスによりクリアされるタイマと、前記タイマのカウント値が所定のリセット閾値に達したときに前記マイクロコンピュータの動作が異常であると判断して該マイクロコンピュータをリセットするリセット部とを有するウォッチドッグタイマ部と、データを記憶するメモリと、前記メモリへの書込み要求に対して、前記タイマのカウント値が前記リセット閾値に達するまでに該メモリへの書込みを完了することができる範囲内で設定された書込み制御閾値に前記タイマのカウント値が達しているか否かを判断し、前記書込み制御閾値に達していない場合には前記メモリへの書込みを実行し、前記書込み制御閾値に達している場合には前記メモリへの書込みをキャンセルする書込み制御を実行する書込み制御手段と、を備える構成としている。 In order to achieve such an object, an electronic control device of the present invention includes a timer that is cleared by a watchdog pulse output from a microcomputer, and a microcomputer that has a count value of the timer that reaches a predetermined reset threshold. In response to a watchdog timer unit having a reset unit that determines that the operation is abnormal and resets the microcomputer, a memory that stores data, and a write request to the memory, the count value of the timer is It is determined whether or not the count value of the timer has reached the write control threshold set within a range in which writing to the memory can be completed before reaching the reset threshold, and the write control threshold has not been reached. If the write to the memory is executed and the write control threshold is reached It has a configuration comprising a write control means for performing write control to cancel the writing to the memory.
本発明によれば、メモリへのデータの書込み要求があっても、メモリにデータを書き込んでいる最中にウォッチドッグタイマ部によるマイクロコンピュータのリセットが起こる可能性がある場合には、書込み制御手段によりデータの書込みがキャンセルされる。したがって、データ書込み中にマイクロコンピュータのリセットが起きることによるデータの破壊を防止することができ、メモリに保存されたデータの信頼性を高めることができる。 According to the present invention, even if there is a request to write data to the memory, if there is a possibility that the microcomputer is reset by the watchdog timer unit while writing the data to the memory, the write control means This cancels the data writing. Accordingly, it is possible to prevent the data from being destroyed due to the resetting of the microcomputer during the data writing, and to improve the reliability of the data stored in the memory.
上記電子制御装置において、前記記書込み制御閾値を前記範囲内の任意の値に設定する書込み設定手段をさらに備えていてもよい。
これにより、メモリに対するデータの書込み制御を必要に応じて調整することが容易になる。
The electronic control device may further include write setting means for setting the write control threshold value to an arbitrary value within the range.
This makes it easy to adjust the data write control to the memory as necessary.
上記電子制御装置において、前記書込み制御手段は、前記書込み要求のあったデータが冗長データを含むデータであるか否かを判定し、前記冗長データを含むデータの場合には前記書込み制御を実行し、前記冗長データを含まないデータの場合には書込み制御を行わずに前記メモリへの書込みを実行するとよい。
これにより、冗長データを含むデータに対しては、データの信頼性を高めることができ、冗長データを含まないデータに対しては、メモリへのデータの書込みに遅延を生じさせない。
In the electronic control device, the write control means determines whether or not the data requested to be written is data including redundant data, and executes the write control when the data includes redundant data. In the case of data that does not include the redundant data, it is preferable to perform writing to the memory without performing write control.
As a result, the reliability of data can be improved for data including redundant data, and no delay occurs in writing data to the memory for data not including redundant data.
本発明のメモリへの書込み方法は、マイクロコンピュータから出力されるウォッチドッグパルスによりタイマを繰り返しクリアし、前記タイマのカウント値が所定のリセット閾値に達したときに前記マイクロコンピュータの動作が異常であると判断して該マイクロコンピュータをリセットするウォッチドッグタイマ部を備えた電子制御装置におけるメモリへの書込み方法であって、前記タイマのカウント値が前記リセット閾値に達するまでに前記メモリへの書込みを完了することができる範囲内で書込み制御閾値を設定するステップと、前記メモリへの書込み要求に対して、前記タイマのカウント値が前記書込み制御閾値に達しているか否かを判定するステップと、前記書込み制御閾値に達していない場合には前記メモリへの書込みを実行し、前記書込み制御閾値に達している場合には前記メモリへの書込みをキャンセルする書込み制御を実行するステップと、を有している。 According to the method of writing to the memory of the present invention, the timer is repeatedly cleared by a watchdog pulse output from the microcomputer, and the operation of the microcomputer is abnormal when the count value of the timer reaches a predetermined reset threshold value. A method of writing to a memory in an electronic control unit having a watchdog timer unit that determines that the microcomputer is reset, and completes the writing to the memory before the count value of the timer reaches the reset threshold value Setting a write control threshold within a range that can be performed, determining whether a count value of the timer has reached the write control threshold in response to a write request to the memory, and the write If the control threshold is not reached, write to the memory. If it has reached the write control threshold has, executing a write control for canceling the writing to the memory.
上記判定するステップは、前記書込み要求のあったデータが冗長データを含むデータであるか否かを判定するステップを有し、前記冗長データを含むデータの場合には前記書込み制御のステップを実行し、前記冗長データを含まないデータの場合には前記書込み制御のステップを行わずに前記メモリへの書込みを実行するとよい。 The determining step includes a step of determining whether or not the data requested to be written is data including redundant data. If the data includes redundant data, the write control step is executed. In the case of data that does not include the redundant data, it is preferable to perform writing to the memory without performing the write control step.
上述したように、本発明によれば、メモリへのデータの書込み要求があっても、メモリにデータを書き込んでいる最中にウォッチドッグタイマ部によるマイクロコンピュータのリセットが起こる可能性がある場合には、書込み制御手段によりデータの書込みがキャンセルされる。したがって、データ書込み中にマイクロコンピュータのリセットが起きることによるデータの破壊を防止することができ、メモリに保存されたデータの信頼性を高めることができる。 As described above, according to the present invention, even when there is a request to write data to the memory, there is a possibility that the microcomputer may be reset by the watchdog timer unit while the data is being written to the memory. Is canceled by the writing control means. Accordingly, it is possible to prevent the data from being destroyed due to the resetting of the microcomputer during the data writing, and to improve the reliability of the data stored in the memory.
以下、添付図面を参照しながら本発明の好適な実施例を説明する。 Hereinafter, preferred embodiments of the present invention will be described with reference to the accompanying drawings.
以下、第1実施例の車両用電子制御装置について説明する。なお、以下では、本発明を車両用電子制御装置に適用した例について説明するが、本発明は車両用電子制御装置に限られるものではなく、データを書き込むメモリを有しているその他の用途に用いられる電子制御装置にも適用できるものである。 Hereinafter, the vehicle electronic control device of the first embodiment will be described. In the following, an example in which the present invention is applied to an electronic control device for a vehicle will be described. However, the present invention is not limited to an electronic control device for a vehicle, and may be used for other applications having a memory for writing data. The present invention can also be applied to the electronic control device used.
図2は、本発明の第1実施例における車両用電子制御システム1の構成を示すブロック図である。図2に示されるように、この車両用電子制御システム1は、複数の電子制御装置(ECU)を備えている。図2に示す例では、車両用電子制御システム1は、エンジンの燃料噴射制御を行う電子制御式燃料噴射(Electronic Fuel Injection:EFI)用ECU2と、電力の供給や充電を制御するパワーマネジメントECU3と、エアバッグの展開を制御するエアバックECU4と、タコメータをはじめとする各種メータを制御するメータECU5と、ドアロックやパワーウィンドウなどを制御するボディECU6と、燃費向上やガス排気量の低減のためにエンジンを制御するエコランECU7と、車内への侵入や車両の傾斜などを検知し警報を発するためのセキュリティECU8とを含んでいる。
FIG. 2 is a block diagram showing the configuration of the vehicle electronic control system 1 according to the first embodiment of the present invention. As shown in FIG. 2, the vehicle electronic control system 1 includes a plurality of electronic control units (ECUs). In the example shown in FIG. 2, the vehicle electronic control system 1 includes an electronic fuel injection (EFI) ECU 2 that performs fuel injection control of the engine, and a
図3は、パワーマネジメントECU3の構成を示すブロック図である。図3に示されるように、パワーマネジメントECU3は、マイクロコンピュータ(マイコン)10と、マイコン10への電源供給を制御する電源回路12と、例えばバッテリの温度、電流、エンジン回転数、車速、トランスミッションの状態などを示す各種センサ信号の信号レベルを所望のレベルに変換してマイコン10に入力する信号レベル変換器14と、例えばヒータやファンのリレーのオンオフ信号、CAN(Controller Area Network)用データをはじめとするマイコン10からの出力を外部に出力する出力回路16とを備えている。
FIG. 3 is a block diagram showing the configuration of the
電源回路12とバッテリ18との間には、イグニッションキー(図示せず)の操作により開閉されるイグニッションスイッチIGSWが設けられている。このイグニッションスイッチIGSWがオンされると、バッテリ18から供給される電圧が電源回路12で所定の電圧に調整されてマイコン10に供給され、マイコン10が起動する。
An ignition switch IGSW that is opened and closed by operating an ignition key (not shown) is provided between the
マイコン10は、ソフトウェア制御によって実現されるソフトウェア処理部21と、制御処理プログラムの暴走を検知しマイコン10をリセットするウォッチドッグタイマ部25と、各種制御データを保存するスタンバイRAM29とを含んでいる。なお、本実施例では、ウォッチドッグタイマ部25がマイコン10の内部に設けられているが、ウォッチドッグタイマ部25をマイコン10の外部に設けてもよい。
The
ソフトウェア処理部21は、図4に示すハードウェアによって実現される。ECUによる制御処理を実現するためのプログラムや後述するメモリの書込み制御のためのプログラムなどが格納されたROM32と、ROM32に格納されたプログラムを読み込んで実行する中央処理装置(CPU)31と、プログラムを実行する際に使用される一時的なデータを保存するRAM33と、データの入出力部34などから構成される。
The
イグニッションスイッチIGSWがオンにされると、マイコン10が起動し、ROM32に格納されたプログラムがRAM33にロードされCPU31により実行される。このプログラムによって、信号レベル変換器14からの信号等に基づいて所定の制御処理が行われる。また、この制御処理中に様々な制御データが学習され、これらの学習によって得られた制御データはスタンバイRAM29に保存され、その後の制御処理に利用される。
また、ROM32に格納されたプログラムのCPU31による演算によって、図3に示す通知パルス出力手段22、書込み設定手段23、書込み制御手段24が構成される。
通知パルス出力手段22は、後述するウォッチドッグタイマ部25にCPU31が正常に動していることを通知するパルスを出力する手段である。
書込み設定手段23は、後述する書込み制御閾値VWを設定する。また、書込み制御手段24は、スタンバイRAM29へのデータ書込みを制御する。これらの手段の詳細については後述する。
When the ignition switch IGSW is turned on, the
Further, the notification pulse output means 22, the write setting means 23, and the write control means 24 shown in FIG. 3 are configured by calculation by the
The notification pulse output means 22 is a means for outputting a pulse for notifying the later-described
Writing setting means 23 sets the write control threshold V W to be described later. The
ウォッチドックタイマ部25は、通知パルス出力手段22から出力される通知パルス(ウォッチドッグパルス)を入力するパルス入力部26と、制御処理プログラムが暴走した場合にCPU31にリセット信号を出力しマイコン10をリセットするリセット処理部27と、時間の経過とともにカウントアップするタイマ28とを有している。
マイコン10が正常に動作しているときには、通知パルスが一定の周期でパルス入力部26に入力され、リセット処理部27によってタイマ28が一定の周期でクリアされる。
The
When the
スタンバイRAM29には、バッテリ18から常時電圧が供給され、これにより、イグニッションスイッチIGSWの操作とは関係なく、スタンバイRAM29に保存された制御データが保持されるようになっている。また、マイコン10の外部には、スタンバイRAM29の初期化(リフレッシュ)に用いるデータを格納したEEPROM30が設けられており、スタンバイRAM29の初期化時には、EEPROM30からのデータがソフトウェアの制御によって書き込まれるようになっている。
The
図5は、ウォッチドッグタイマ部25のタイマ28のカウント値の推移を示すタイミングチャートである。図5に示されるように、マイコン10の処理負荷が低く制御処理プログラムが正常に動作しているときは、通知パルスが一定の周期でウォッチドッグタイマ部25に入力され、リセット処理部27によってタイマ28が一定の周期でクリアされる。
一方、マイコン10の処理負荷が高くなると、ソフトウェア処理部21は通知パルスを所定の周期で出力できなくなり、タイマ28のカウント値が増え続ける。ここで、ウォッチドッグタイマ部25には、マイコン10のリセットの必要性を判断する基準となるリセット閾値VR(図5参照)が設定されており、タイマ28のカウント値がリセット閾値VRに達すると、マイコン10の動作が異常であると判断し、リセット処理部27からリセット信号がCPU31に出力される。これによりマイコン10がリセットされる。なお、リセットされたマイコン10は一般的に初期化処理から再スタートされる。
FIG. 5 is a timing chart showing the transition of the count value of the
On the other hand, when the processing load of the
しかしながら、スタンバイRAM29にデータを書き込んでいる最中にウォッチドッグタイマ部25によるマイコン10のリセットが起こると、スタンバイRAM29に保存されたデータが破壊される恐れがある。
However, if the
このような問題を解決するために本実施例では、スタンバイRAM29へのデータ書込み中にウォッチドッグタイマ部25によるマイコン10のリセットが起きないように、スタンバイRAM29へのデータ書込みを書込み制御手段24により制御している。
In order to solve such a problem, in this embodiment, the write control means 24 writes data to the
具体的には、図6に示されるように、タイマ28のカウント値に対して、タイマ28のカウント値がリセット閾値VRに達するまでにスタンバイRAM29への書込みを完了することができる範囲内で書込み制御閾値VWが設定される。書込み制御閾値VWよりも小さいカウント値のときにはスタンバイRAM29へのデータ書込みが許可され、書込み制御閾値VWよりも大きいカウント値のときにはスタンバイRAM29への書込みが禁止される。すなわち、図6に示されるデータ書込み禁止期間Pがデータ書込み処理に必要とされる時間Wよりも大きくなるように書込み制御閾値VWが設定される。この書込み制御閾値VWの設定は書込み設定手段23により行われ、書込み設定手段23は書込み制御閾値VWを上記範囲内の任意の値に設定(または変更)することができるようになっている。
Specifically, as shown in FIG. 6, the count value of the
図7に示すフローチャートを参照しながら、書込み制御手段24の処理手順を説明する。
スタンバイRAM29にデータの書込み要求があると、書込み制御手段24はまずウォッチドッグタイマ部25のタイマ28のカウント値を取得し(ステップS1)、取得したカウント値と上述の書込み制御閾値VWとを比較する(ステップS2)。上記書込み制御閾値VWよりもカウント値が小さいときには(ステップS2/NO)、スタンバイRAM29へのデータ書込みが完了するまでにカウント値がリセット閾値VRに達することはない。したがってマイコン10のリセットが起こることがないので、書込み制御手段24は通常通りにデータをスタンバイRAM29に書き込む(ステップS3)。一方、書込み制御閾値VWよりもカウント値が大きい場合には(ステップS2/YES)、スタンバイRAM29にデータを書き込んでいる最中にウォッチドッグタイマ部25によるマイコン10のリセットが起こる可能性があるため、書込み制御手段24はスタンバイRAM29への書込みをキャンセルし、そのまま書込み処理を終了する。
The processing procedure of the write control means 24 will be described with reference to the flowchart shown in FIG.
When there is a data write request in the
このように、スタンバイRAM29へのデータの書込み要求があっても、スタンバイRAM29にデータを書き込んでいる最中にウォッチドッグタイマ部25によるマイコン10のリセットが起こる可能性がある場合には、書込み制御手段24によりデータの書込みがキャンセルされる。従って、データ書込み中のマイコン10のリセットによるデータの破壊を防止することができ、スタンバイRAM29に保存されたデータの信頼性を高めることができる。
As described above, even when there is a request for writing data to the
データの書込みに際して、保存すべきデータとともにこのデータの信頼性を保証する冗長データ(例えばミラー値)も書き込まれるような場合には、保存すべきデータの書込みと冗長データの書込みとの間にマイコン10のリセットが生じることを防止する必要があるため、上述した書込み制御が特に必要となるが、冗長データを有していない単一のデータであればマイコン10のリセットによりデータが破壊される可能性が低いため、上述した書込み制御を行わなくてもよい場合がある。このような場合には、以下に述べる本発明の第2実施例を適用することができる。
When writing data, redundant data (for example, a mirror value) that guarantees the reliability of the data is written together with the data to be saved, the microcomputer between the data to be saved and the redundant data is written. Since it is necessary to prevent 10 resets from occurring, the above-described write control is particularly necessary. However, if the single data does not have redundant data, the data can be destroyed by resetting the
図8は、本発明の第2の実施例に係るパワーマネジメントECU103の構成を示すブロック図である。図8に示すパワーマネジメントECU103のマイコン110においては、書込み要求のあったデータが書込み制御を行う必要のあるデータか否かを判断するデータ判断手段140aが書込み制御手段140に設けられている。その他の構成は第1実施例と同様であるので、以下では書込み制御手段140を中心として説明し、その他の構成についての説明を省略する。
FIG. 8 is a block diagram showing the configuration of the
図9は、本実施例における書込み制御手段140の処理手順を示すフローチャートである。スタンバイRAM29に対するデータの書込み要求があると、この書込み要求のあったデータが書込み制御を行う必要のあるデータであるかを書込み制御手段140のデータ判断手段140aによって判断する(ステップS11)。ここで、書込み制御を行う必要のあるデータとしては、上述したように、保存すべきデータに加えてこのデータの信頼性を保証するミラー値などの冗長データを有するデータなどが挙げられる。
FIG. 9 is a flowchart showing the processing procedure of the write control means 140 in this embodiment. When there is a data write request to the
書込み要求のあったデータが書込み制御を行う必要のあるデータであれば、上述した第1実施例のステップS1以降の処理が行われる。すなわち、書込み制御手段140によりウォッチドッグタイマ部25のタイマ28のカウント値が取得され(ステップS12)、取得したカウント値と書込み制御閾値VWとが比較される(ステップS13)。上記書込み制御閾値VWよりもカウント値が小さいときには(ステップS13/NO)、書込み制御手段140によって通常通りにデータがスタンバイRAM29に書き込まれる(ステップ14)。また、書込み制御閾値VWよりもカウント値が大きい場合には(ステップS13/YES)、書込み制御手段140によるスタンバイRAM29への書込みがキャンセルされる。
If the data requested to be written is data that needs to be subjected to write control, the processing after step S1 in the first embodiment described above is performed. That is, the write control unit 140 the count value of the
一方、書込み要求のあったデータが書込み制御を行う必要のないデータである場合には、上述したステップ12〜13の処理は行われず、そのままスタンバイRAM29にデータが書き込まれる(ステップS14)。
On the other hand, if the data requested to be written is data that does not need to be written, the processing in
このように、本実施例では、書込み時のリセットによりデータの破壊が起きやすいデータ(例えばミラー値などの冗長データを有するデータ)についてのみ書込み制御を行い、その他のデータについては書込み制御を行うことなく通常の書込み動作を行うことができる。したがって、すべてのデータについて書込み制御をする場合に比べてマイコンの処理負荷が軽減される。 As described above, in this embodiment, write control is performed only for data (for example, data having redundant data such as a mirror value) that is likely to be destroyed by reset at the time of write, and write control is performed for other data. Normal write operation can be performed. Therefore, the processing load on the microcomputer is reduced as compared with the case where write control is performed for all data.
本実施例は、上述した第1実施例をハードウェアによって実現した実施例である。
図10を参照しながら本実施例の構成を説明する。図10に示すように、本実施例は、クロック発生部120で発生するクロックを分周器121で分周して所定周波数のクロックとし、ウォッチドックタイマカウンタ(以下、WDTカウンタと表記する)122でこのクロックをカウントしている。このWDTカウンタ122には、第1レジスタ123及び第2レジスタ128の保持する設定値が入力される。
第1レジスタ123からWDTカウンタ122には、リセット閾値保持部124の保持する上述したリセット閾値(VR)が出力される。第2レジスタ128からWDTカウンタ122には、書込み制御閾値保持部129の保持する上述した書込み制御閾値(VW)が出力される。
WDTカウンタ122は、書込み制御閾値(VW)のクロックをカウントすると、第2レジスタ128に所定の信号を出力する。所定の信号を入力した第2レジスタ128は、ON保留フラグ130をONに設定する。このON保留フラグ130をONにすることで、第2レジスタ128からSRAM29にデータの書込み禁止信号が出力される。ソフトウェア処理部127の制御によってSRAM29へのデータ書込みが指示されても、書込み禁止信号がSRAM29に出力されているので、SRAM29へのデータ書込みは実行されない。
This embodiment is an embodiment in which the first embodiment described above is realized by hardware.
The configuration of this embodiment will be described with reference to FIG. As shown in FIG. 10, in this embodiment, a clock generated by the
The reset threshold (V R ) held by the reset
The WDT counter 122 outputs a predetermined signal to the
また、WDTカウンタ122は、リセット閾値(VR)のクロックをカウントすると、図10に示すスイッチ126の設定に従って、マイコン10のリセット端子にリセット信号を出力するか、又はソフトウェア処理部127へ割込み信号を出力する。第1レジスタ123には、マイコン10をリセットするか、ソフトウェアへの割込み信号を出力するかを設定するリセット又は割込み設定保持部125が用意されており、第1レジスタ123は、リセット又は割込み設定保持部125の設定に従って、スイッチ126を設定する。
なお、リセット閾値保持部124、リセット又は割込み設定保持部125、書込み制御閾値保持部129の保持する設定情報は、ソフトウェア処理部127によって設定される。
Further, when the WDT counter 122 counts the clock of the reset threshold (V R ), it outputs a reset signal to the reset terminal of the
The setting information held by the reset
上述した実施例においては、パワーマネジメントECU3に本発明を適用した場合について説明したが、本発明はパワーマネジメントECUに限られるものではなく、他のECUにも適用できるものであることは言うまでもない。
In the above-described embodiments, the case where the present invention is applied to the
また、ECUが単一のマイコンを有する構成について説明したが、これに限られるものではない。例えば、ECUにメインマイコンとサブマイコンとを設け、これらのマイコンにより制御処理を分散して行うようにしてもよい。この場合において、上述したウォッチドッグタイマ部25は、メインマイコンの内部または外部、サブマイコンの内部または外部のいずれの場所に設けてもよい。
Moreover, although the configuration in which the ECU has a single microcomputer has been described, the present invention is not limited to this. For example, the ECU may be provided with a main microcomputer and a sub-microcomputer, and control processing may be performed by these microcomputers in a distributed manner. In this case, the above-described
また、上述した実施例では、タイマ28としてカウント値をカウントアップするカウントアップタイマを用い、このカウント値がリセット閾値VR以上になるとマイコンをリセットするオーバーフロー型ウォッチドッグタイマ部を用いた例について説明したが、本発明に係るウォッチドッグタイマ部はオーバーフロー型に限られるものではない。例えば、図11に示されるように、タイマ28としてカウント値をカウントダウンするカウントダウンタイマを用い、このカウント値がリセット閾値VR以下になるとマイコンをリセットするアンダーフロー型ウォッチドッグタイマ部にも用いることができる。なお、オーバーフロー型ウォッチドッグタイマ部を用いた場合には、「カウント値がリセット閾値に達する」というのはカウント値がリセット閾値以上になることを意味するが、アンダーフロー型ウォッチドッグタイマ部を用いた場合には、「カウント値がリセット閾値に達する」というのはカウント値がリセット閾値以下になることを意味する。
また、図12に示すようにリセット閾値VRとして上限値(図12に示すVR(上限))と下限値(図12に示すVR(下限))とを設けて範囲設定し、この設定範囲内でソフトウェア処理部21から通知パルスを入力した場合に、タイマ28をリセットし、設定範囲内でソフトウェア処理部21から通知パルスを入力できなかった場合にマイコンをリセットするウィンドーコンパレートタイプにも用いることもできる。
さらに、上述した実施例の書込み制御閾値(VW)は、メモリに書き込むデータの大きさに応じて変更できる。
Further, in the embodiment described above, using a count-up timer which counts up the count value as the
In addition, the range set by providing the upper limit value as the reset threshold V R as shown in FIG. 12 lower limit value (V R (the upper limit) shown in FIG. 12) (V R shown in FIG. 12 (lower limit)), the setting When the notification pulse is input from the
Furthermore, the write control threshold value (V W ) of the above-described embodiment can be changed according to the size of data written to the memory.
これまで本発明の好ましい実施例について説明したが、本発明は上述の実施例に限定されず、その技術的思想の範囲内において種々異なる形態にて実施されてよいことは言うまでもない。
例えば、上述した実施例では、スタンバイRAMへのデータの保存時について説明してきたが、これ以外に、マイクロコンピュータに内蔵されたRAM、マイクロコンピュータの外部に設けられたRAM、マイクロコンピュータに内蔵されたEEPROM、マイクロコンピュータの外部に設けられたEEPROM、マイクロコンピュータに内蔵されたフラッシュROM、およびマイクロコンピュータの外部に設けられたフラッシュROMなど、種々のメモリに対して本発明を適用することができる。
Although the preferred embodiments of the present invention have been described so far, it is needless to say that the present invention is not limited to the above-described embodiments and may be implemented in various forms within the scope of the technical idea thereof.
For example, in the above-described embodiment, the description has been given of the case of storing data in the standby RAM. However, in addition to this, a RAM built in the microcomputer, a RAM provided outside the microcomputer, and a microcomputer built in the microcomputer. The present invention can be applied to various memories such as an EEPROM, an EEPROM provided outside the microcomputer, a flash ROM incorporated in the microcomputer, and a flash ROM provided outside the microcomputer.
3、103 パワーマネジメントECU
10、110 マイクロコンピュータ
12 電源回路
14 信号レベル変換器
16 出力回路
18 バッテリ
21 ソフトウェア処理部
22 通知パルス出力手段
23 書込み設定手段
24、140 書込み制御手段
25 ウォッチドッグタイマ部
26 パルス入力部
27 リセット処理部
28 タイマ
29 SRAM
30 EEPROM
140a データ判断手段
IGSW イグニッションスイッチ
VR リセット閾値
VW 書込み制御閾値
3, 103 Power management ECU
DESCRIPTION OF SYMBOLS 10,110
30 EEPROM
140a data determination means IGSW ignition switch V R reset threshold V W write control threshold
Claims (5)
データを記憶するメモリと、
前記メモリへの書込み要求に対して、前記タイマのカウント値が前記リセット閾値に達するまでに該メモリへの書込みを完了することができる範囲内で設定された書込み制御閾値に前記タイマのカウント値が達しているか否かを判断し、前記書込み制御閾値に達していない場合には前記メモリへの書込みを実行し、前記書込み制御閾値に達している場合には前記メモリへの書込みをキャンセルする書込み制御を実行する書込み制御手段と、
を備えたことを特徴とする電子制御装置。 A timer that is cleared by a watchdog pulse output from the microcomputer, and when the count value of the timer reaches a predetermined reset threshold value, the microcomputer determines that the operation of the microcomputer is abnormal and resets the microcomputer. A watchdog timer unit having a reset unit;
A memory for storing data;
In response to a write request to the memory, the count value of the timer is set to a write control threshold set within a range in which writing to the memory can be completed before the count value of the timer reaches the reset threshold. A write control that determines whether or not the write control threshold has been reached and executes writing to the memory if the write control threshold has not been reached, and cancels the write to the memory if the write control threshold has been reached Write control means for executing
An electronic control device comprising:
前記タイマのカウント値が前記リセット閾値に達するまでに前記メモリへの書込みを完了することができる範囲内で書込み制御閾値を設定するステップと、
前記メモリへの書込み要求に対して、前記タイマのカウント値が前記書込み制御閾値に達しているか否かを判定するステップと、
前記書込み制御閾値に達していない場合には前記メモリへの書込みを実行し、前記書込み制御閾値に達している場合には前記メモリへの書込みをキャンセルする書込み制御を実行するステップと、を有することを特徴とするメモリへの書込み方法。 The timer is repeatedly cleared by a watchdog pulse output from the microcomputer, and when the count value of the timer reaches a predetermined reset threshold, it is determined that the operation of the microcomputer is abnormal and the microcomputer is reset. A method of writing to a memory in an electronic control device having a watchdog timer unit,
Setting a write control threshold within a range in which writing to the memory can be completed before the count value of the timer reaches the reset threshold;
In response to a write request to the memory, determining whether the count value of the timer has reached the write control threshold;
Executing writing to the memory if the write control threshold has not been reached, and executing write control to cancel writing to the memory if the write control threshold has been reached. A method of writing to a memory characterized by
前記冗長データを含むデータの場合には前記書込み制御のステップを実行し、前記冗長データを含まないデータの場合には前記書込み制御のステップを行わずに前記メモリへの書込みを実行することを特徴とする請求項4記載のメモリへの書込み方法。 The step of determining includes the step of determining whether the data requested to be written is data including redundant data;
In the case of data including the redundant data, the write control step is executed, and in the case of data not including the redundant data, the writing to the memory is executed without performing the write control step. 5. A method for writing to a memory according to claim 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007184828A JP2009018773A (en) | 2007-07-13 | 2007-07-13 | Electronic control device and method for writing in memory |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007184828A JP2009018773A (en) | 2007-07-13 | 2007-07-13 | Electronic control device and method for writing in memory |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2009018773A true JP2009018773A (en) | 2009-01-29 |
Family
ID=40358777
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007184828A Withdrawn JP2009018773A (en) | 2007-07-13 | 2007-07-13 | Electronic control device and method for writing in memory |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2009018773A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101801116B1 (en) | 2011-11-28 | 2017-12-21 | 콘티넨탈 오토모티브 시스템 주식회사 | Method and apparatus for driving pcu |
-
2007
- 2007-07-13 JP JP2007184828A patent/JP2009018773A/en not_active Withdrawn
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101801116B1 (en) | 2011-11-28 | 2017-12-21 | 콘티넨탈 오토모티브 시스템 주식회사 | Method and apparatus for driving pcu |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10346231B2 (en) | Watchdog circuit, power IC and watchdog monitor system | |
JP4692318B2 (en) | Electronic control unit | |
US6144887A (en) | Electronic control unit with reset blocking during loading | |
JP3838055B2 (en) | In-vehicle control device | |
JP6598592B2 (en) | Semiconductor integrated circuit and electronic control unit | |
EP1975788B1 (en) | Electronic control apparatus | |
JP4665846B2 (en) | Microcomputer and electronic control device | |
JP3870751B2 (en) | Electronic control unit | |
JP5962697B2 (en) | Electronic control unit | |
TW202022878A (en) | Data processing system and data processing method | |
JP2009018773A (en) | Electronic control device and method for writing in memory | |
US6168321B1 (en) | Electronic control unit having user breakable function | |
JP3923810B2 (en) | Electronic control device for vehicle | |
JP4812699B2 (en) | Power control device | |
JP3870974B2 (en) | Electronic control unit | |
JP2018134964A (en) | Electronic control unit for automobile | |
CN108073489B (en) | Method for ensuring operation of calculator | |
JP6172040B2 (en) | Electronic control unit | |
JP2001160004A (en) | Electronic controller | |
JP5392058B2 (en) | Processing apparatus and control method | |
JP2008309069A (en) | Electronic control device for vehicle, electronic control system for vehicle and starting method of electronic control device for vehicle | |
JP2011100416A (en) | In-vehicle electronic controller and memory control method | |
JPH0325813B2 (en) | ||
JP6589767B2 (en) | Electronic control unit | |
JPH04256038A (en) | Watchdog timer inspecting device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20100618 |
|
A072 | Dismissal of procedure |
Free format text: JAPANESE INTERMEDIATE CODE: A073 Effective date: 20111025 |
|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20111101 |