JP2013143094A - Information processor and watchdog ic - Google Patents
Information processor and watchdog ic Download PDFInfo
- Publication number
- JP2013143094A JP2013143094A JP2012004228A JP2012004228A JP2013143094A JP 2013143094 A JP2013143094 A JP 2013143094A JP 2012004228 A JP2012004228 A JP 2012004228A JP 2012004228 A JP2012004228 A JP 2012004228A JP 2013143094 A JP2013143094 A JP 2013143094A
- Authority
- JP
- Japan
- Prior art keywords
- time
- measurement time
- microcomputer
- period
- maximum value
- 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
本発明は、周期的にタイマをクリアする情報処理装置等に関する。 The present invention relates to an information processing apparatus that periodically clears a timer.
マイコン及びアプリが正常に動作していることを監視する仕組みとしてWDT(Watch Dog Timer)が知られている。
図1はWDTの動作を説明する図の一例である。WDTは、カウント値がリセット時間に達するか、カウント値がゼロになると(以下、単にオーバーフローという)マイコンをリセットするなどのフェールセーフを行う。マイコンは車両制御などを行うアプリを実行している。アプリは、WDTのカウント値をクリアする機能(図のWD制御部)を呼び出したり定期的に実行したりすることで、WDTがオーバーフローする前にカウント値をクリアできる(例えば、特許文献1参照。)。
A WDT (Watch Dog Timer) is known as a mechanism for monitoring that a microcomputer and an application are operating normally.
FIG. 1 is an example for explaining the operation of WDT. The WDT performs fail-safe such as resetting the microcomputer when the count value reaches the reset time or when the count value reaches zero (hereinafter simply referred to as overflow). The microcomputer executes an application that performs vehicle control and the like. The application can clear the count value before the WDT overflows by calling a function for clearing the count value of the WDT (WD control unit in the figure) or periodically executing the function (see, for example, Patent Document 1). ).
しかしながら、WD制御部が暴走する、無限ループに陥る、又は、マイコンの異常によりアプリは作動していないがWD制御部だけが正常に作動する、などの異常が生じる場合がある(以下、正常クリア異常という)。この場合、アプリの正常動作も保証できないので、マイコンをリセットするなどのフェールセーフが行われることが好ましい。しかし、WDTのカウント値はオーバーフロー前にクリアされるので、WDTはWD制御部が暴走してもオーバーフローしない。このため、マイコンに対しフェールセーフ処理を提供することができない。 However, the WD control unit may run out of control, fall into an infinite loop, or the application may not operate due to a malfunction of the microcomputer but only the WD control unit may operate normally (hereinafter referred to as normal clear). Called abnormal). In this case, since the normal operation of the application cannot be guaranteed, fail safe such as resetting the microcomputer is preferably performed. However, since the count value of WDT is cleared before overflow, WDT does not overflow even if the WD control unit runs away. For this reason, fail-safe processing cannot be provided to the microcomputer.
このような正常クリア異常を検出する技術として所定時間内のクリア信号の数を監視する技術が考えられている(例えば、特許文献2参照。)。特許文献2には、所定時間内のクリア信号が閾値を超えると(予め設定した周期よりも短周期でクリア信号が出力されると)、プログラムがクリア信号を出力する処理にデッドロックしていることを検出するウォッチドッグタイマが開示されている。
As a technique for detecting such a normal clear abnormality, a technique for monitoring the number of clear signals within a predetermined time is considered (for example, see Patent Document 2). In
しかしながら、特許文献2に記載されたWDTは、WD制御部に予め設定されている周期よりも短周期でクリア信号が出力されないと、異常を検出できないという問題がある。すなわち、正常クリア異常では、必ずしも短周期になるとは限らないので短周期にならない正常クリア異常を検出できない。
However, the WDT described in
また、特許文献2ではマイコンが正常に動作しているか否かについては十分な監視が行われていない。クリア信号に異常がある場合、マイコンにも異常がある可能性があるので、クリア信号が出力されていること以外の観点からマイコンが正常か否かを監視することが好ましい。
In
本発明は、上記課題に鑑み、クリア信号が出力され続ける異常が生じても、マイコンの異常を検出できる情報処理装置を提供することを目的とする。 In view of the above problems, an object of the present invention is to provide an information processing apparatus that can detect an abnormality of a microcomputer even when an abnormality in which a clear signal is continuously output occurs.
本発明は、時間を計測する時間計測回路と、前記時間計測回路が計測する計測時間を周期的にクリアする演算装置とを有する情報処理装置であって、前記時間計測回路は、計測時間の可変最大値を変更する計測時間変更手段と、前記計測時間が可変最大値に到達した場合、前記演算装置の異常を検出する異常検出手段と、を有することを特徴とする。 The present invention is an information processing apparatus including a time measurement circuit that measures time and an arithmetic device that periodically clears the measurement time measured by the time measurement circuit, wherein the time measurement circuit has a variable measurement time. Measurement time changing means for changing the maximum value and abnormality detection means for detecting an abnormality of the arithmetic unit when the measurement time reaches a variable maximum value.
クリア信号が出力され続ける異常が生じても、マイコンの異常を検出できる情報処理装置を提供することができる。 It is possible to provide an information processing apparatus capable of detecting an abnormality of a microcomputer even when an abnormality in which a clear signal is continuously output occurs.
以下、本発明を実施するための形態について図面を参照しながら説明する。 Hereinafter, embodiments for carrying out the present invention will be described with reference to the drawings.
図2は、本実施例のマイコン50によるWDIC100のクリアの概略を説明する図の一例である。本実施例では、WDIC(Watch Dog IC)100がリセット時間を可変に制御している。リセット時間とは、WDIC100がオーバーフローするまでの時間である。そして、WDIC100は、パルス信号(以下、WDR信号という)によりリセット時間をマイコン50に通知する。
FIG. 2 is an example of a diagram for explaining an outline of clearing the WDIC 100 by the
図2(a)(b)はWDR信号の一例を示している。WDIC100は、WDR信号の周期(又は周波数と説明しても同じである)によりリセット時間を通知する。図2(a)に示すようにリセット時間が短いと、例えば周期の短いWDR信号を送信し、図2(b)に示すようにリセット時間が長いと、例えば周期の長いWDR信号を送信する。 2A and 2B show an example of the WDR signal. The WDIC 100 notifies the reset time according to the period (or the same as the frequency) of the WDR signal. When the reset time is short as shown in FIG. 2A, for example, a short period WDR signal is transmitted, and when the reset time is long as shown in FIG. 2B, for example, a long period WDR signal is transmitted.
図2(c)に示すように、マイコン50のWD制御部は、WDR信号の周期を用いて演算を行い現在のWDIC100のリセット時間を特定し(リセット時間そのものを特定する必要はない)、リセット時間からクリア周期を更新する(例えば、リセット時間の半分程度にする)。WD制御部は、クリア周期毎にWDIC100にクリア信号を送信する。したがって、WDIC100がリセット時間を可変にしても、WD制御部はWDIC100がオーバーフローする前にWDIC100をクリアすることができる。
As shown in FIG. 2 (c), the WD control unit of the
以上のような監視方法によれば、マイコン50がWDIC100をクリアするには、WDR信号の入力処理、クリア信号の周期の演算、及び、クリア信号の出力、の3段階の処理が正常に行われている必要がある。WD制御部が暴走するような正常クリア異常が発生した場合、3段階の処理の少なくとも1つは困難であることが多い。したがって、WDIC100は、WD制御部だけは周期的にクリア信号を出力するような正常クリア異常が生じても、マイコン50に対するフェールセーフ処理を提供することができる。
According to the monitoring method as described above, in order for the
また、リセット時間をWDR信号でマイコン50に出力することで、以下のメリットも生じる。WDIC100のカウント時間は温度特性があるため、単位時間のカウント値は温度によって増減する。これは、WDIC100のリセット時間はCR回路により規定されるが、コンデンサと抵抗の特性には温度依存性があり、同じWDIC100が計測するカウント時間に最大30%程度の違いが生じるためである。このため、従来では、マイコン50がWDIC100をクリアする周期に、リセット時間に対するマージンを設ける必要があった(例えば、リセット時間が10ミリ秒なら、マージンを見てクリア周期を5ミリ秒とする。)。
Further, by outputting the reset time to the
しかし、本実施例のWDIC100では、リセット時間を計測するCR回路に用いられるコンデンサと抵抗を用いてWDR信号も生成するので、リセット時間とWDR信号の温度特性が同じである。したがって、マイコン50は、WDR信号の周期から算出したパルス信号の周期に対しマージンを設定する必要がない。なお、これは、マイコン内にWDICがある場合(カウンタ時間(タイマカウンタ)、パルス信号の周期、及び、WD制御部のクロック源が共通の場合)にも言える。
However, in the WDIC 100 of the present embodiment, the WDR signal is also generated using the capacitor and the resistor used in the CR circuit for measuring the reset time, so that the temperature characteristics of the reset time and the WDR signal are the same. Therefore, the
〔構成例〕
図3は、本実施例のマイコンシステム200又はマイコン50の概略構成図の一例を示す。本実施例のマイコン50は、外部のWDIC100と接続されていてもよいし、内部に有していてもよい。
[Configuration example]
FIG. 3 shows an example of a schematic configuration diagram of the
本実施例のマイコン50又はマイコンシステム200は、主に車両のECU(Electronic Control Unit)に搭載されることを想定している。車載されるECUには、その主要な機能により、エンジンECU、ブレーキECU、ボディECU、ナビゲーションECU(AV・情報処理ECU)、ゲートウェイECU等がある。本実施例のマイコン50又はマイコンシステム200はECUの機能の違いに影響されず搭載されることが可能である。
It is assumed that the
まず、図3(a)において、マイコン50は、システムバス9に接続されたCPU11、RAM12、及び、フラッシュメモリ13を有し、周辺バス10に接続されたCANコントローラ16、ADC(A/Dコントローラ)17及びI/Oチャネル18を有し、システムバス9と周辺バス10がブリッジ15により接続されている。
3A, the
CPU11は、フラッシュメモリ13に記憶されているプログラムを、RAM12を作業メモリにして実行する。CPU11は、マルチコアでもシングルコアでもよい。フラッシュメモリ13に記憶されたプログラムは、マイコン50が車載装置を制御するアプリの他、WDIC100をクリアするプログラム(WD制御部)、OS(Operating System)、ミドルウェア、デバイスドライバ等が含まれている。
The
ブリッジ15は、システムバス9と周辺バス10の間の周波数や電圧の違いを吸収し、システムバス9に接続された回路と周辺バス10に接続された回路とを通信可能に接続する。CANコントローラ16は、マイコン50がECUに搭載された場合に、他のECUと通信するための通信回路である。ADC17は、マイコン50に接続されたセンサのアナログ信号をデジタル信号に変換する。ADC17に加え、DAC(D/Aコントローラ)を有する場合もある。
The
I/Oチャネル18には、WDIC100の他、他のマイコン、アクチュエータ、センサ、スイッチ等が接続される。I/Oチャネル18からはHigh信号又はLow信号がWDIC100の各端子に出力される。
In addition to the
WDIC100は、カウンタ制御部21、及び、リセット部25を有している。カウンタ制御部21は、カウント時間22、リセット時間23、及び、パルス出力部24を有する。詳細は後述するが、カウンタ制御部21は、リセット時間23を可変に設定すると共に、カウント時間22をカウントしている。また、マイコン50からクリア信号を受け付けることで、リセット時間23がクリアされる。カウント時間22がリセット時間23に到達するまでに、クリア信号を受け付けないとリセット部25に通知する。リセット部25は、リセット信号をマイコン50のリセット端子に出力することでマイコン50をリセットする。
The
なお、マイコン監視に特化したWDIC100の代わりに監視用のマイコンを配置し、監視用のマイコン50がWDIC100と同様にマイコン50を監視することもできる。
Note that a monitoring microcomputer may be arranged in place of the
図4は、図3(a)のWDIC100の機能を模式的に説明する図の一例である。図4(a)はWDIC100の端子とリセット時間23を説明するための図であり、図4(b)はパルス出力部24を説明するための図である。
FIG. 4 is an example of a diagram for schematically explaining the function of the
WDIC100は、TC端子、WD端子、及び、RESET端子を有している。この他、電源端子、グラウンド端子等を有するが省略した。WD端子は、マイコン50がリセット時間23をクリアするクリア信号を入力するための端子である。RESET端子は、WDIC100がマイコン50をリセットするリセット信号を出力するための端子である。TC端子は、リセット時間23を規定するコンデンサC1〜C3と抵抗R1〜R3と接続される端子である。従来から、WDIC100のTC端子には、リセット時間23を規定するためのコンデンサ、又は、1組のコンデンサと抵抗が接続される。本実施例のWDIC100では、スイッチ1をコンデンサC1〜C3の1つと、スイッチ2を抵抗R1〜R3の1つとそれぞれ選択的に接続することで、リセット時間23を可変に設定する。図ではコンデンサC1〜C3と抵抗R1〜R3がそれぞれ3つなので、9通りのリセット時間23を規定できる。コンデンサと抵抗は4つ以上でもよい。WDIC100は、例えば周期的又は不作為にスイッチ1,2を切り替えることで、リセット時間23を変更する。また、スイッチ1,2の制御はCPU11が行うこともできる。
The
WDIC100は、コンデンサC1〜C3(又は、コンデンサC1〜C3と不図示のコンデンサ)が満充電されるまでの時間をリセット時間23とする。満充電されるまでにクリア信号が入力されると、クリア信号によりコンデンサC1が放電される。満充電されてしまうとRESET端子がリセット信号(Low信号又はHigh信号)を出力する。このように、図3(a)のリセット時間23は図4(a)のコンデンサC1〜C3と抵抗R1〜R3の組み合わせに、図3(a)のカウント時間22は図4(a)のコンデンサC1〜C3の充電状態に、図2(a)のリセット部25は図3(a)のRESET端子にそれぞれ対応する。
The
そして、図4(b)の発振回路がリセット時間23をマイコン50に通知する。オペアンプの反転出力は、コンデンサC1〜C3、及び、抵抗R1〜R3、Rcpを介してオペアンプに正帰還する。コンデンサC1〜C3の充電電圧が正帰還されるので、充電過程ではコンデンサの電圧が急激に立ち上がり、放電過程では電圧が急激に減少する。これを繰り返すことで発振回路が周期的な矩形波(パルス)を出力する。この周期は、コンデンサC1〜C3の静電容量と抵抗R1〜R3の抵抗値の積に反比例する(周期f=k×1/CR kは定数)。したがって、図4(a)で選択されたコンデンサC1〜C3、抵抗R1〜R3を用いて図4(b)の発振回路を構成することで、リセット時間23と1対1に対応した周期のパルス(WDR信号)を出力することができる。このように、図3(a)のパルス出力部24は図4(a)のコンデンサC1〜C3、抵抗R1〜R3を用いた発振回路に相当する。
4B notifies the
続いて図2(b)のマイコン50について説明する。図2(b)のように、マイコン内にWDIC100が配置される場合、WDIC100は、クロック選択部31、コントロールレジスタ32、タイマカウンタ33、パルス出力部34、及び、内部リセット部35を有する。WDIC100の機能は、図2(a)と同様だが、実現方法がやや異なる。
Next, the
図5は、図2(b)のWDIC100の機能を説明する図の一例である。コントロールレジスタ32は、例えば8bitのレジスタで1ビット毎にWDIC100の動作を制御することができる。例えば、クロック選択部31が選択するクロック(クロック選択ビット)、タイマカウンタ33のカウント開始/停止、オーバーフロー時の動作、実際のオーバーフローの有無などが登録される。
FIG. 5 is an example of a diagram illustrating the function of the
クロック選択部31には分周回路14から周期が異なる例えば8個のクロック信号が供給されている。分周回路14はメインクロックを1/2〜1/数千に分周する回路で、マイコン内部又は外部のどちらに配置されてもよい。クロック選択部31は、コントロールレジスタ32の設定に基づきタイマカウンタ33に供給するクロックを1つ選択する。
The
タイマカウンタ33は、クロックが1つ入力される毎に1つ値が大きくなるカウンタである。タイマカウンタ33がオーバーフローすると(例えば0xFFFFFFFになると)、内部リセット部35がそれを検出する。内部リセット部35は、マイコン50を例えばリセットする。具体的には、外部の不図示の監視回路にマイコン50をリセットさせたり、外部に異常を通知する、CPU11に割込み、異常処理を行わせる、等を行う。
The
したがって、図2(b)の構成では、クロック選択部31が選択するクロック周期とタイマカウンタ33の最大カウント値(例えば8bit)がリセット時間23となる。より柔軟にリセット時間23を調整できるように、最大カウント値でなくカウント可能なビット数をコントロールレジスタ32などで制御してもよい。
Therefore, in the configuration of FIG. 2B, the clock period selected by the
そして、パルス出力部34は、タイマカウンタ33の増大速度に比例した周期のWDR信号をCPU11に出力する。例えば、以下のようにパルスを出力する。
・タイマカウンタ33が1つ増える毎に、1パルスを出力する。
・タイマカウンタ33が1つ増える毎に、2パルスを出力する。
・タイマカウンタ33が2つ増える毎に、1パルスを出力する。
このように、パルス出力部34はタイマカウンタ33がN増える毎に、Mパルスを出力する。タイマカウンタ33の増大速度は、リセット時間23と1対1に対応するので、パルス出力部34が出力するWDR信号の周期もリセット時間23と1対1に対応する。
Then, the
Each time the
・ Each time the
Each time the
Thus, the
なお、パルス出力部34とCPU11は直接、接続されていることが好ましいが、WDR信号の出力タイミングでシステムバス9を介してパルスタイミング(又はカウント値でもよい)を通知してもよい。いずれの場合も、図2(a)と同様に、CPU11はWDR信号のパルスを取得して、クリア信号の周期を算出できる。
The
また、図3(b)のような態様では、コントロールレジスタ32のクロック選択ビットがリセット時間23を制御する。コントロールレジスタ32の値は、一般にはCPU11が設定する。しかし、本実施例では、WDIC(例えば、クロック選択部31)100が独立にコントロールレジスタ32を制御することが好ましい。こうすることで、リセット時間23をWDIC100がCPU11から独立して制御できる。または、CPU11がコントロールレジスタ32の値を設定してもよいが、少なくとも、CPU11はコントロールレジスタ32の設定値をクリア信号の周期の算出に使用しない。
In the mode as shown in FIG. 3B, the clock selection bit of the
なお、以下では、マイコン50の異常監視がマイコンシステム200又はマイコン50のいずれにより実行されるかは特に制限しない。しかし、図2(a)の態様では、アプリやマイコン全体に異常が生じた場合でも、WDIC100は影響されないので、マイコン50の信頼性を向上できる。図2(b)の態様では、1チップ内にWDIC100が含まれているので、コスト的、実装スペース的に有利である。
In the following description, it is not particularly limited whether the
〔マイコンの機能〕
図6は、マイコン50の機能ブロック図の一例を示す。マイコン50は、車両制御用のアプリを実行しており、例えば、制御対象の車載装置に適切な周期でアプリを繰り返し実行する。WDIC100をクリアするWD制御部40は、例えばアプリが1回実行される毎に実行される。アプリの実行時間が長い場合は、アプリの途中でWD制御部40が適宜呼び出され、WDIC100をクリアする。このように、アプリとWD制御部40が一体であるため、WD制御部40がWDIC100をクリアするか否かにより、WDIC100がアプリの異常を検出できる。アプリに異常がある場合はマイコン50に異常がある場合があるので、アプリの異常からマイコン50の異常を検出できる。
[Function of microcomputer]
FIG. 6 shows an example of a functional block diagram of the
WD制御部40は、WDR処理部41、周期算出部42、及び、クリア部43を有している。これらの機能は、CPU11がフラッシュメモリ13に記憶されたプログラムをハードウェアと協働して実行することで実現される。
The
タイマ割込みなどによりアプリは周期的に処理を開始し、それが終了するとWD制御部40を呼び出す。WDR処理部41は、WDIC100からWDR信号を取得する。WDIC100は図のI〜IIIに示すようにリセット時間23を時間と共に変更している。図の点線で示す上限値はWDIC100が取り得る最大のリセット時間23であり、下限値はWDIC100が取り得る最小のリセット時間23である。
The application periodically starts processing by a timer interrupt or the like, and calls the
パルス出力部24,34はリセット時間23と1対1に対応した周期でWDR信号を出力している。WDR処理部41は、I/Oチャネル18のうちWDR信号が入力されるI/Oを監視して、パルスの入力の有無を確認する。そして、確認結果を周期算出部42に通知する。
The
周期算出部42は、単位時間当たりのWDR信号の数をカウントする。そして、この数からクリア信号の周期を、例えば以下のように算出する。
クリア信号の周期=単位時間当たりのWDR信号の数/2
この場合、単位時間当たりのWDR信号の数が多いほど(周波数は速いほど)、クリア信号の周期が長くなる(周波数が遅くなる)。また、以下のように算出してもよい。
クリア信号の周期=a×1/単位時間当たりのWDR信号の数
この場合、単位時間当たりのWDR信号の数が多いほど(周波数は速いほど)、クリア信号の周期が短くなる(周波数が速くなる)。なお、aは係数である。
The
Clear signal cycle = number of WDR signals per unit time / 2
In this case, the greater the number of WDR signals per unit time (the faster the frequency), the longer the cycle of the clear signal (the slower the frequency). Moreover, you may calculate as follows.
Clear signal cycle = a × 1 / number of WDR signals per unit time In this case, as the number of WDR signals per unit time increases (the frequency becomes faster), the cycle of the clear signal becomes shorter (the frequency becomes faster). ). Note that a is a coefficient.
単位時間当たりのWDR信号の数からクリア信号の周期をどのように算出するかは、WDR信号にリセット時間23がどのように反映されているか(リセット時間23が短いほどWDR信号の周期波がないのか、又は、短いのか)によって決定できる。仮に、「リセット時間=WDR信号の周期」の場合、算出式としては、クリア信号の周期が、WDR信号の周期の半分未満になることが好ましい。半分未満とすることで、マイコン50としては2回連続してクリアミスしなければ、リセットされることがない。
How to calculate the period of the clear signal from the number of WDR signals per unit time is how the
また、「リセット時間=WDR信号の周期」の場合、クリア信号の周期の最大値は、WDR信号の周期よりも小さい同程度の値である。また、クリア信号の周期の最小値には、特に制約がないが、例えば、アプリの動作を阻害しない程度となる。数値的には、クリア信号の周期の最小値は、WDR信号の周期の1/5〜1/10程度である。クリア信号の周期を短くするほど、マイコン50の監視を強化できる。
In the case of “reset time = period of WDR signal”, the maximum value of the period of the clear signal is the same value smaller than the period of the WDR signal. Further, the minimum value of the clear signal cycle is not particularly limited, but is, for example, a level that does not hinder the operation of the application. Numerically, the minimum value of the cycle of the clear signal is about 1/5 to 1/10 of the cycle of the WDR signal. The shorter the clear signal cycle, the stronger the monitoring of the
周期算出部42は、算出した周期をクリア部43に設定する。WDIC100がリセット時間23を変更していなければ、クリア信号の周期にも変更がないので、すでに設定されている周期に変更がなければ新たに設定しなくてもよい。なお、WDIC100がリセット時間23を変更する頻度の方が、周期算出部42がクリア信号を算出する頻度よりも多いと、マイコン50がリセットされてしまう。よって、必ず、WDIC100がリセット時間23を変更する頻度<周期算出部42がクリア信号を算出する頻度、が成り立つ。このため、WDR処理部41がWDR信号のパルスを検出しても、クリア信号のパルスに変更がない場合がある。
The
また、リセット時間23は周期的に変更するよりも、WDIC100としては減少する変更が多くなるようにリセット時間23を変更する方がマイコン50の監視に好適になる。図のIIのリセット時間23では、時刻t1でT1、時刻t2でT4、時刻t3でT3、時刻t4でT2、時刻t5でT1、となっている。ここで、リセット時間23が長くなる変更(時刻t1でT1から、時刻t2でT4)は、マイコン50の監視が緩和されることを意味する。そこで、リセット時間23が長くなる変更を短時間にして、リセット時間23が短くなる変更を長時間、確保することが有効になる。図の例では、t5〜t2>>t2〜t1 となっている。
In addition, the
また、リセット時間23は、図のIIIに示すように不作為に変更することも有効である。例えば、WD制御部40に不具合があるが、クリア信号の周期が徐々に変わるような不具合がある場合、不作為に変更することで、WD制御部40の不具合を早期に検出できる可能性がある。また、リセット時間23が不規則に変わることで、周期算出部42が算出する周期にも一定の傾向が出にくいので、周期算出部42が正常であることの確度が増大する。
It is also effective to change the
このように、本実施例のマイコン50は、WDR処理部41によるWDR信号の取得、WDR信号の検出結果に基づく周期算出部42によるクリア信号の周期の算出、及び、クリア部43による周期的なクリア信号の出力、が全て正常に行われないと、マイコンがリセットされてしまう。したがって、WDIC100は、アプリに異常が生じているが、WD制御部40だけが決まった周期でクリア信号を出力するような異常を検出しマイコン50にフェールセーフ処理を提供することができる。
As described above, the
〔動作手順〕
図7は、マイコン50がWDR信号の取得、クリア信号の周期の算出、及び、クリア信号を出力する手順を示すフローチャート図の一例である。まず、図7(a)のメイン処理が実行される。
[Operation procedure]
FIG. 7 is an example of a flowchart illustrating a procedure in which the
図7(a)では、まず、タイマなどの割込みによりアプリの処理タイミングが到来する(S10)。 In FIG. 7A, first, the processing timing of the application arrives due to an interrupt such as a timer (S10).
アプリは演算に必要な入力処理を行う(S20)。例えば、燃料噴射量の決定に必要なアクセル開度、車速などの信号をセンサの検出値やCAN通信により取得する。また、例えば自動制動などの運転支援を行うため、障害物の検知結果などを取得する。 The application performs input processing necessary for calculation (S20). For example, signals such as the accelerator opening and the vehicle speed necessary for determining the fuel injection amount are acquired by a sensor detection value or CAN communication. In addition, for example, in order to perform driving support such as automatic braking, an obstacle detection result is acquired.
次に、WDR処理部41はWDR入力処理を行う(S30)。WDR入力処理は、例えば、I/Oチャネル18にWDR信号の取得を要求し、その取得結果からパルスの有無を判定する。
Next, the
次に、周期算出部42は、WDR信号のパルスの検出結果に基づき、クリア信号の周期を算出する(S40)。ステップS40の処理については図7(b)にて説明する。
Next, the
そしてアプリは入力処理で取得したセンサの検出値やCAN通信により取得したデータを用いてアプリ処理を実行する(S50)。アプリ処理は、例えば、燃料噴射や自動制動などに必要なアクチュエータを制御したり、演算結果をCAN通信で他のECUに送信するなどの処理である。 Then, the application executes the application process using the detection value of the sensor acquired by the input process and the data acquired by CAN communication (S50). The application process is, for example, a process of controlling an actuator necessary for fuel injection or automatic braking, or transmitting a calculation result to another ECU through CAN communication.
そして、クリア部43はクリア信号の出力処理を行う(S60)。ステップS60の処理については図7(c)にて説明する。
Then, the
図7(b)は、周期算出部42がクリア信号の周期を算出する手順を示すフローチャート図の一例である。図7(b)では、周期算出部42は、単位時間のWDR信号の数の半分をクリア信号の周期としている(S401)。すなわち、単位時間のWDR信号の数の半分の値を求めることができれば、クリア信号の周期が得られる。単に1/2の演算を行う以外に以下のような算出が考えられる。
(i)単位時間のWDR信号の数を1/10にして、5回足し合わせる。
(ii)単位時間のWDR信号の数を1/10にして、その値を単位時間のWDR信号の数から5回引く。
(iii)単位時間のWDR信号の数を1/10にして、その値に5を掛ける。
FIG. 7B is an example of a flowchart illustrating a procedure in which the
(I) The number of WDR signals per unit time is reduced to 1/10 and added five times.
(Ii) The number of WDR signals per unit time is reduced to 1/10, and the value is subtracted five times from the number of WDR signals per unit time.
(Iii) Reduce the number of WDR signals per unit time to 1/10 and multiply the value by 5.
これらの算出方法のいずれの方法を用いても単位時間のWDR信号の数の半分の値が求められる。したがって、常に同じ演算方法で周期算出部42がクリア信号の周期を算出するのでなく、算出の度に、1/2の演算を行う算出方法、及び、(i)〜(iii)の算出方法を順番に切り替えてもよい。この場合、算出方法に応じてCPUがALU内の異なる演算器(シフタ、加算器、減算器、乗算器、除算器)を使用することが期待できるので、マイコン50の監視を強化できる。
Whichever of these calculation methods is used, a value half the number of WDR signals per unit time is obtained. Therefore, instead of the
図7(c)は、クリア部43がクリア信号を出力するする手順を示すフローチャート図の一例である。この処理は、クリア信号の立ち上がりエッジと立ち下がりエッジを出力タイミングの度に切り替える処理である。
FIG. 7C is an example of a flowchart illustrating a procedure in which the
まず、クリア部43は、クリア信号の出力タイミングが到来したか否かを判定する(S601)。この出力タイミングは、例えばクリア信号の周期の半分になる。出力タイミングでなければクリア信号のパルスを出力する必要がないので処理は終了する。この場合、図7(a)の処理も終了する。
First, the
出力タイミングが到来した場合(S601のYes)、すでにON出力中か否かを判定する(S602)。すなわち、クリア信号のパルスがHigh状態か否かを判定する。High状態かLow状態かは、過去の制御結果をフラグなどで保持しておくことで判定できる。 When the output timing has arrived (Yes in S601), it is determined whether or not the output is already being output (S602). That is, it is determined whether or not the pulse of the clear signal is in a high state. Whether the state is the high state or the low state can be determined by holding a past control result with a flag or the like.
ON出力中の場合(S602のYes)、クリア部43は出力をOFFにする(S603)。すなわち、クリア信号のパルスがHigh状態であったので、Low状態に変更する。
When the output is ON (Yes in S602), the
ON出力中でない場合(S602のNo)、クリア部43は出力をONにする(S604)。すなわち、クリア信号のパルスがLow状態であったので、High状態に変更する。S603、S604の処理により、デューティが50%のクリア信号が得られる。
If the output is not ON (No in S602), the
具体的には、図3(a)の態様では、WDIC100のWD端子に接続されたI/Oチャネルの状態をHからLに切り替えればよく(S603)、WDIC100のWD端子に接続されたI/Oチャネルの状態をLからHに切り替えればよい(S604)。また、図3(b)の態様では、WDIC100のタイマカウンタ33をクリアする命令を実行せず(S603)、WDIC100のタイマカウンタ33をクリアする命令を実行すればよい(S604)。
Specifically, in the embodiment of FIG. 3A, the state of the I / O channel connected to the WD terminal of the
クリア部43は、ステップS40で算出されたクリア信号の周期を更新する(S605)。これにより、次回、図7(c)が実行されるタイミングではクリア信号の新しい周期に基づきクリア信号のパルスを制御できる。なお、この周期は毎回、違う値に更新されるとは限らない。
The
図7(c)の処理手順は一例であり、出力タイミングの度に、クリア信号のパルスをHighに設定し所定クロックの経過後、Lowに設定してもよい。こうすることでクリア信号の周期を変更せずにデューティを小さくできる。 The processing procedure in FIG. 7C is an example, and the pulse of the clear signal may be set to High at every output timing, and may be set to Low after a predetermined clock has elapsed. By doing so, the duty can be reduced without changing the cycle of the clear signal.
以上説明したように、マイコン50は、WDR信号の入力処理、クリア周期の演算、及び、クリア信号の出力、の3段階の処理を行わなければ、WDIC100をクリアできないので、クリア部43が暴走するような正常クリア異常が発生してもマイコン50の異常を検出できる。
As described above, the
〔変形例〕
図8(a)は、マイコン50が複数のアプリを実行する場合におけるWDIC100のクリアを説明する図の一例である。マイコン50のCPU11が複数のコアを有していたり、1つのコア11が複数のアプリを時分割して実行することがある。複数のアプリが実行されていても、WDIC100の数には制約があるので、1つのWDIC100が複数のアプリを監視できることが好ましい。
[Modification]
FIG. 8A is an example of a diagram illustrating clearing of the
アプリ1とアプリ2がそれぞれWD制御部40を呼び出すと、アプリ1又は2のどちらかに異常が生じても、どちらかが正常な場合にWDIC100がクリアされてしまう。このような場合は、WDIC100のリセット時間23を短くすることが好適となる。
When the
図8(b)はリセット時間23と、アプリ1,アプリ2の処理周期を説明する図の一例である。マイコン50は、タイマなどの割込みやカウント値を利用して、予め定められた頻度でアプリ1,2を実行する。WDIC100がアプリ1,2を個別に監視するには、リセット時間23を以下のように定める。
上限:リセット時間23は、アプリ1とアプリ2の両方が実行される時間よりも短い。
下限:リセット時間23は、アプリ1又は2のうち実行時間が長い方のアプリの実行時間よりも長い。
FIG. 8B is an example of a diagram illustrating the
Upper limit: The
Lower limit: The
したがって、WDIC100はこの制約の中でリセット時間23を変動させる。こうすることで、アプリ1又は2に異常が生じた場合、正常な方のアプリ1又は2内のWD制御部40が実行される前に、WDIC100がオーバーフローすることでマイコン50の異常を検知できる。
Therefore, the
しかし、マイコン50が複数のコアを有するような場合、複数のコアがアプリ1,2を並行に実行するので、アプリ1又は2のいずれかに異常を生じても、正常なアプリから呼び出されるWD制御部40がWDIC100をクリアしてしまう。このような場合は、WDIC100がコア又はアプリを識別することが有効である。
However, when the
図8(c)はリセット時間23と、アプリ1,アプリ2の処理周期を説明する図の一例である。WDIC100のWD端子にAND回路45が接続されている。AND回路45の2つの入力端子には、アプリ1が呼び出すWD制御部40のクリア信号と、アプリ2が呼び出すWD制御部40のクリア信号とがそれぞれ入力される。AND回路45は、アプリ1,2が実行される頻度に応じた時間だけクリア信号をラッチしておき、2つの入力端子にクリア信号が共に入力された場合に、カウント時間22をクリアする。こうすることで、1つのWDIC100で複数のアプリ又はコアを監視することができる。
FIG. 8C is an example for explaining the
なお、図3(b)のようにWDIC100がマイコン内に配置されている場合、タイマカウンタ33の入力にAND回路45を設けてもよいし、アプリ又はコアの数に応じたフラグを用意し、全てのフラグがセットされることでタイマカウンタ33をクリアしてもよい。こうすることで、図8(c)と同様に図3(b)のWDIC100を、複数のアプリが利用できる。
When the
また、図3(a)のようにWDIC100とマイコン50が独立した態様では、WDIC100とマイコン50が同一の基板に配置されていること、すなわち同じECU内に配置されていることが好適である。しかし、マイコン50とWDIC100が別々のECUに配置されていても、2つのECUを専用線で接続することで、同様の処理を実現できる。すなわち、WDIC100が搭載されたECUからマイコン50が搭載されたECUにWDR信号を送信し、マイコン50が搭載されたECUからWDIC100が搭載されたECUにクリア信号を送信すればよい。
Further, in the aspect in which the
実施例1では、WDIC100がマイコン50にWDR信号を出力することが必要であった。本実施例では、WDIC100がマイコン50にWDR信号を出力しなくても、WDIC100がリセット時間を変更し、変更されたリセット時間内にクリア信号を周期的に出力するマイコン50又はマイコンシステム200について説明する。
In the first embodiment, it is necessary for the
図9(a)は、マイコン50の機能ブロック図の一例を示す。図9(a)において図6と同一部の説明は省略する。本実施例のマイコン50は、WDR信号を取得しないのでWDR処理部が不要になる。また、WDR信号の周期から、クリア信号の周期を算出する必要がないので、周期算出部も不要となる。これらに代えて、リセット時間テーブル46と同期管理部47を有している。
FIG. 9A shows an example of a functional block diagram of the
図9(b)はリセット時間テーブル46を模式的に説明する図の一例である。リセット時間テーブル46には、リセット時間とクリア信号の周期が、時間と対応づけて登録されている。時間は例えば「初期値」「t1秒」「t2秒」「t3秒」「t4秒」である。この初期値は、WDIC100がカウント時間のカウントを開始した時のリセット時間を意味する。電源のオンなどによりマイコン50が起動すると、CPU11がWDIC100にカウント時間のカウントを開始させる。その後、WDIC100はカウント時間のカウントを開始すると共に、予め定められた時間が経過する毎に、予め定められたリセット時間に変更する。
FIG. 9B is an example of a diagram for schematically explaining the reset time table 46. In the reset time table 46, the reset time and the cycle of the clear signal are registered in association with the time. The time is, for example, “initial value”, “t1 second”, “t2 second”, “t3 second”, or “t4 second”. This initial value means a reset time when the
リセット時間テーブル46には、WDIC100がリセット時間を変更するタイミングと変更後のリセット時間及びクリア信号の周期が登録されている(周波数を登録してもよい)。なお、リセット時間テーブル46にはリセット時間は特に必要ないが説明のため記載した。マイコン50はリセット時間テーブル46を参照することで、WDIC100がカウントを開始した直後のクリア信号の周期の初期値はT1/2秒で、t1秒が経過するとT2/2に、t2秒が経過するとT3/2に、t3秒が経過するとT4/2に、なることが分かる。
In the reset time table 46, the timing at which the
したがって、WDIC100とマイコン50のWD制御部40の同期さえ取れれば、WDIC100がWDR信号を出力することなく、WDIC100がリセット時間を変更しても、WD制御部は変更されたリセット時間内にクリア信号を周期的に出力することができる。WD制御部の同期管理部47は、WDIC100がカウント時間の計測を開始した時を基準に動作クロックをカウントし、時間t1秒等が経過する毎に、リセット時間テーブル46に登録されているクリア信号の周期を読み出す。クリア部40は、この周期でクリア信号を出力するので、リセット時間が変更されてもオーバーフローする前にカウント時間をクリアできる。
Therefore, as long as the
なお、同期管理部47が、WDIC100がカウントを開始した時を基準にしたまま、リセット時間テーブル46に基づきクリア信号の周期を変更すると、WDIC100のリセット時間の変更タイミングとのずれが大きくなるおそれがある。そこで、同期管理部47がWDIC100に対し、定期的にリセット時間を初期値に戻させることが有効である。このようにすれば、WDIC100の変更タイミングと、同期管理部47の変更タイミングのずれを一定値内に維持できる。
Note that if the
〔動作手順〕
図10は、マイコン50が、クリア信号の周期を変更して、クリア信号を出力する手順を示すフローチャート図の一例である。
[Operation procedure]
FIG. 10 is an example of a flowchart illustrating a procedure in which the
まず、タイマなどの割込みによりアプリの処理タイミングが到来する(S10)。 First, the processing timing of the application arrives due to an interrupt such as a timer (S10).
アプリは演算に必要な入力処理を行う(S20)。例えば、燃料噴射量の決定に必要なアクセル開度、車速などの信号をセンサの検出値やCAN通信により取得する。また、例えば自動制動などの運転支援を行うため、障害物の検知結果などを取得する。 The application performs input processing necessary for calculation (S20). For example, signals such as the accelerator opening and the vehicle speed necessary for determining the fuel injection amount are acquired by a sensor detection value or CAN communication. In addition, for example, in order to perform driving support such as automatic braking, an obstacle detection result is acquired.
次に、同期管理部47は同期処理を行う(S31)。同期処理は、動作クロックに基づきクリア信号の周期を決定する処理である。同期管理部47は、動作クロックに基づきカウントした時間に対応づけられたクリア信号の周期をリセット時間テーブル46から読み出す。本実施例ではクリア信号の周期計算は不要になる。
Next, the
そしてアプリは入力処理で取得したセンサの検出値やCAN通信により取得したデータを用いてアプリ処理を実行する(S50)。アプリ処理は、例えば、燃料噴射や自動制動などに必要なアクチュエータを制御したり、演算結果をCAN通信で他のECUに送信するなどの処理である。 Then, the application executes the application process using the detection value of the sensor acquired by the input process and the data acquired by CAN communication (S50). The application process is, for example, a process of controlling an actuator necessary for fuel injection or automatic braking, or transmitting a calculation result to another ECU through CAN communication.
そして、クリア部43はクリア信号の出力処理を行う(S60)。ステップS60の処理は図10(b)に示すとおりであるが、図7(c)と同様なので説明は省略する。
Then, the
以上説明したように、本実施例のマイコン50は、WDIC100がマイコン50にWDR信号を出力しなくても、変更されたリセット時間内にクリア信号を周期的に出力することができる。
As described above, the
21 カウンタ制御部
22 カウント時間
23 リセット時間
24、34 パルス出力部
25 リセット部
31 クロック選択部
32 コントロールレジスタ
33 タイマカウンタ
35 内部リセット部
40 WD制御部
41 WDR処理部
42 周期算出部
43 クリア部
46 リセット時間テーブル
47 同期管理部
50 マイコン
100 WDIC
21
Claims (10)
前記時間計測回路は、計測時間の可変最大値を変更する計測時間変更手段と、
前記計測時間が可変最大値に到達した場合、前記演算装置の異常を検出する異常検出手段と、を有することを特徴とする情報処理装置。 An information processing apparatus having a time measurement circuit that measures time and an arithmetic device that periodically clears the measurement time measured by the time measurement circuit,
The time measuring circuit includes a measuring time changing means for changing a variable maximum value of the measuring time;
An information processing apparatus comprising: an abnormality detection unit configured to detect an abnormality of the arithmetic device when the measurement time reaches a variable maximum value.
前記演算装置は、前記可変最大値又は前記相関指標から、計測時間の可変最大値内に、計測時間をクリア可能な周期を決定する周期決定手段と、
前記周期決定手段が決定した周期毎に計測時間をクリアする時間クリア手段と、を有することを特徴とする請求項1記載の情報処理装置。 The measurement time changing means notifies the arithmetic unit of the variable index or the correlation index correlated with the variable maximum value,
The arithmetic device, from the variable maximum value or the correlation index, within a variable maximum value of the measurement time, a cycle determination means for determining a cycle that can clear the measurement time,
The information processing apparatus according to claim 1, further comprising: a time clear unit that clears the measurement time for each cycle determined by the cycle determination unit.
前記周期決定手段は、前記パルス信号の周期又は周波数を算出し、算出された周期又は周波数から計測時間をクリアする周期を決定する、
ことを特徴とする請求項2記載の情報処理装置。 The measurement time changing means notifies the variable maximum value of the measurement time by the period or frequency of the pulse signal,
The period determining means calculates a period or frequency of the pulse signal, and determines a period for clearing measurement time from the calculated period or frequency.
The information processing apparatus according to claim 2.
前記時間計測回路はウォッチドックIC、前記演算装置はマイコンである、
ことを特徴とする請求項3記載の情報処理装置。 The time measuring circuit and the arithmetic unit are arranged on separate chips,
The time measurement circuit is a watchdog IC, and the arithmetic unit is a microcomputer.
The information processing apparatus according to claim 3.
ことを特徴とする請求項4記載の情報処理装置。 The measurement time changing means defines the variable maximum value of the measurement time by combining the capacitance of the capacitor and the resistance value of the resistor, and oscillates using the combination of the capacitor and the resistor used to define the variable maximum value. Outputting the pulse signal whose period is determined by a circuit;
The information processing apparatus according to claim 4.
前記計測時間変更手段は、動作クロックの分周比を変えることで前記可変最大値を変更すると共に、動作クロックのカウント値の増加速度に比例した周期又は周波数の前記パルス信号を生成する、
ことを特徴とする請求項6記載の情報処理装置。 The abnormality detection means measures the measurement time by counting the divided operation clock,
The measurement time changing means changes the variable maximum value by changing a frequency dividing ratio of the operation clock, and generates the pulse signal having a period or frequency proportional to the increase rate of the count value of the operation clock.
The information processing apparatus according to claim 6.
ことを特徴とする請求項1〜7いずれか1項記載の情報処理装置。 The measurement time changing means changes the measurement time so that the period during which the variable maximum value of the measurement time largely changes is shorter than the period during which the variable maximum changes periodically, omission, or less.
The information processing apparatus according to claim 1, wherein the information processing apparatus is an information processing apparatus.
前記周期決定手段は、前記可変最大値又は前記相関指標から、計測時間をクリア可能な周期を決定することなく、前記テーブルから計測時間をクリアする周期又は周波数を読み出し、
前記時間クリア手段は、前記周期決定手段が読み出した周期毎又は周波数にて計測時間をクリアする、ことを特徴とする請求項1記載の情報処理装置。 The arithmetic device has a table in which the measurement time changing means changes the variable maximum value of the measurement time and a table in which the period or frequency of the pulse signal that clears the measurement time after the change is registered,
The period determining means reads the period or frequency for clearing the measurement time from the table without determining the period that can clear the measurement time from the variable maximum value or the correlation index,
The information processing apparatus according to claim 1, wherein the time clear unit clears the measurement time at each cycle or frequency read by the cycle determination unit.
計測時間を計測する時間計測手段と、
計測時間の可変最大値を変更する計測時間変更手段と、
計測時間が前記可変最大値に到達した場合、前記マイコンの異常を検出する異常検出手段と、を有することを特徴とするウォッチドッグIC。 A watchdog IC that monitors a microcomputer that periodically clears the measurement time,
A time measuring means for measuring the measurement time;
A measuring time changing means for changing the variable maximum value of the measuring time;
A watchdog IC comprising: an abnormality detection means for detecting an abnormality of the microcomputer when the measurement time reaches the variable maximum value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012004228A JP2013143094A (en) | 2012-01-12 | 2012-01-12 | Information processor and watchdog ic |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012004228A JP2013143094A (en) | 2012-01-12 | 2012-01-12 | Information processor and watchdog ic |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2013143094A true JP2013143094A (en) | 2013-07-22 |
Family
ID=49039616
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012004228A Pending JP2013143094A (en) | 2012-01-12 | 2012-01-12 | Information processor and watchdog ic |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2013143094A (en) |
-
2012
- 2012-01-12 JP JP2012004228A patent/JP2013143094A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2013517486A (en) | Method and apparatus for monitoring frequency signals | |
JP5861718B2 (en) | Electronic control device for vehicle and data receiving method | |
KR20180044845A (en) | Resetting method for single chip computer system and single chip computer system | |
WO2021041768A1 (en) | Daisy chain mode entry sequence | |
US8762792B2 (en) | Event monitor having switch matrix, separate counter, and compare circuitry | |
JP4701898B2 (en) | External signal detection circuit and real-time clock | |
JP2593915B2 (en) | Double microcomputer system runaway prevention circuit | |
JP6733349B2 (en) | Abnormality diagnosis device and abnormality diagnosis method | |
JP2013143094A (en) | Information processor and watchdog ic | |
US10935949B2 (en) | Controller system | |
CN109753404B (en) | Control system state monitoring circuit and method and control system central processing unit | |
JP2013091365A (en) | Electronic control device | |
CN109478052B (en) | Method and device for determining execution time of application program | |
CN110192183B (en) | Computer device, task starting method, and computer-readable storage medium | |
JP5987723B2 (en) | Slave for communication | |
JP2002091802A (en) | Runaway monitoring device for electronic control system | |
JP6522550B2 (en) | Electronic control unit | |
US7437448B1 (en) | Method and device for function selection of a control unit | |
EP2284693A1 (en) | Wait instruction | |
CN108073806B (en) | Method and device for detecting clock frequency | |
RU2429492C1 (en) | System to measure linear acceleration parameters | |
JP2005264824A (en) | Electronic control unit | |
US20120079239A1 (en) | Timing module | |
CN115902575A (en) | Aging sensor, aging compensation method, chip module and electronic equipment | |
JP2014146222A (en) | Microcomputer device for vehicle |