JP5954261B2 - Electronic control unit - Google Patents

Electronic control unit Download PDF

Info

Publication number
JP5954261B2
JP5954261B2 JP2013118053A JP2013118053A JP5954261B2 JP 5954261 B2 JP5954261 B2 JP 5954261B2 JP 2013118053 A JP2013118053 A JP 2013118053A JP 2013118053 A JP2013118053 A JP 2013118053A JP 5954261 B2 JP5954261 B2 JP 5954261B2
Authority
JP
Japan
Prior art keywords
control program
rewriting
engine
program
vehicle
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
JP2013118053A
Other languages
Japanese (ja)
Other versions
JP2014235652A (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 JP2013118053A priority Critical patent/JP5954261B2/en
Publication of JP2014235652A publication Critical patent/JP2014235652A/en
Application granted granted Critical
Publication of JP5954261B2 publication Critical patent/JP5954261B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、記憶したプログラムを書き換え可能な電子制御装置に関する。   The present invention relates to an electronic control device that can rewrite a stored program.

車両の制御装置において、自動車の機能安全に関する規格であるISO26262に準拠するための技術としてロックステップ処理が知られている(例えば、特許文献1を参照)。ロックステップ処理は、複数のコアから構成されるマルチコアマイコンにおいて、複数のコアで同一の演算を並行して実行してその演算結果を比較し、演算結果が一致していれば、各コアが正常動作していると判定し、演算結果が不一致であれば、何れかのコアで異常が発生していると判定するものである。   In a vehicle control device, lockstep processing is known as a technique for complying with ISO 26262, which is a standard related to the functional safety of automobiles (see, for example, Patent Document 1). Lockstep processing is a multi-core microcomputer composed of multiple cores. The same operation is executed in parallel on multiple cores and the results of the operations are compared. If it is determined that it is operating and the calculation results do not match, it is determined that an abnormality has occurred in any of the cores.

このようなロックステップ処理を行うように構成されたエンジン制御装置に対して、ユーザ側に車両を販売した後で、制御プログラムの書き換えを実施するならば、通常、車両が停止し且つエンジンが停止している状態で、書き換えを実行するものと想定される。その理由は、エンジン制御プログラムの実行中に書き換えを行うと、プログラム実行中にデータの不整合が発生し、プログラムが正常に動作しなくなる可能性があるからである。   If the control program is rewritten after the vehicle is sold to the user side with respect to the engine control device configured to perform such lockstep processing, the vehicle is usually stopped and the engine is stopped. In this state, it is assumed that rewriting is executed. The reason is that if rewriting is performed during the execution of the engine control program, data inconsistency may occur during the execution of the program and the program may not operate normally.

特表2007−507015号公報Special table 2007-507015 gazette

しかし、制御プログラムを提供するリモートセンタと車両との間で無線通信することにより、車両のエンジン制御装置に記憶されているエンジン制御プログラムを書き換える場合を想定したならば、リモートセンタから無線通信で制御プログラムが提供される毎に、車両を停止させ更にエンジンを停止させるようにすると、車両利用者の利便性が損なわれるという問題があった。   However, if it is assumed that the engine control program stored in the engine control device of the vehicle is rewritten by wireless communication between the remote center that provides the control program and the vehicle, control is performed by wireless communication from the remote center. Each time the program is provided, if the vehicle is stopped and the engine is further stopped, there is a problem that convenience for the vehicle user is impaired.

本発明は、こうした問題に鑑みてなされたものであり、制御プログラムの書き換えに起因してエンジンの動作に異常が発生するという事態の発生を回避するとともに、車両利用者の利便性を向上させることができる技術を提供することを目的とする。   The present invention has been made in view of these problems, and avoids the occurrence of a situation in which an abnormality occurs in the operation of the engine due to rewriting of the control program, and improves the convenience for the vehicle user. It aims at providing the technology that can do.

上記目的を達成するためになされた本発明の電子制御装置は、第1記憶部と、第2記憶部と、第1処理実行手段と、第2処理実行手段と、第1書換手段と、第2書換手段と、第3書換手段とを備える。   The electronic control device of the present invention made to achieve the above object includes a first storage unit, a second storage unit, a first process execution unit, a second process execution unit, a first rewrite unit, 2 rewriting means and 3rd rewriting means.

そして本発明の電子制御装置では、第1記憶部に、エンジンを制御するために設けられた第1制御プログラムと、エンジンを制御するために設けられ第1制御プログラムとは異なる第2制御プログラムとが記憶される。また第2記憶部に、第1制御プログラムと、エンジンを制御するために設けられ第1制御プログラムおよび第2制御プログラムとは異なる第3制御プログラムとが記憶される。   In the electronic control device of the present invention, a first control program provided for controlling the engine in the first storage unit, and a second control program provided for controlling the engine and different from the first control program, Is memorized. The second storage unit stores a first control program and a third control program that is provided to control the engine and is different from the first control program and the second control program.

さらに本発明の電子制御装置では、まず第1処理実行手段が、第1記憶部に記憶された第1制御プログラムおよび第2制御プログラムに従って処理を行う。また第2処理実行手段が、第2記憶部に記憶された第1制御プログラムおよび第3制御プログラムに従って処理を行う。そして第1書換手段が、第1制御プログラムの書き換えを要求する第1書換要求を取得した場合において、さらに、エンジンが停止しており且つ車両が停止しているときに、第1記憶部に記憶されている第1制御プログラムと、第2記憶部に記憶されている第1制御プログラムを書き換える。また第2書換手段が、第2制御プログラムの書き換えを要求する第2書換要求を取得した場合において、さらに、エンジンが停止しており且つ車両が停止しているとき、またはエンジンが稼動しており且つ車両が停止しているときに、第1記憶部に記憶されている第2制御プログラムを書き換える。また第3書換手段が、第3制御プログラムの書き換えを要求する第3書換要求を取得した場合において、さらに、エンジンが停止しており且つ車両が停止しているとき、またはエンジンが稼動しており且つ車両が停止しているときに、第2記憶部に記憶されている第3制御プログラムを書き換える。   Furthermore, in the electronic control device of the present invention, first, the first process execution means performs processing according to the first control program and the second control program stored in the first storage unit. Further, the second process execution means performs the process according to the first control program and the third control program stored in the second storage unit. And when the 1st rewriting means acquires the 1st rewriting request which requires rewriting of the 1st control program, when an engine has stopped and a vehicle has stopped, it memorizes to the 1st storage part. The first control program being stored and the first control program stored in the second storage unit are rewritten. Further, when the second rewriting means acquires the second rewriting request for requesting rewriting of the second control program, the engine is further stopped and the vehicle is stopped, or the engine is operating. When the vehicle is stopped, the second control program stored in the first storage unit is rewritten. Further, when the third rewriting means acquires the third rewriting request for requesting rewriting of the third control program, the engine is further stopped and the vehicle is stopped, or the engine is operating. When the vehicle is stopped, the third control program stored in the second storage unit is rewritten.

このように構成された電子制御装置では、第1記憶部と第2記憶部に記憶された第1制御プログラムの書き換えは、エンジンが停止しており且つ車両が停止しているときに実行される。このため、第1制御プログラムの書き換えが実行されている最中に電源遮断等により第1制御プログラムの書き換えが中断し、これにより、第1記憶部に記憶されている第1制御プログラムの内容と、第2記憶部に記憶されている第1制御プログラムの内容とが相違してしまうという事態が発生したとしても、このときにはエンジンが停止しているため、第1処理実行手段および第2処理実行手段は第1制御プログラムに従った処理を行っていない。したがって、第1制御プログラムの書き換えの中断により、第1処理実行手段が第1制御プログラムに従って行う処理の内容と、第2処理実行手段が第1制御プログラムに従って行う処理の内容とが相違してしまうことに起因してエンジンの動作に異常が発生するという事態の発生を回避することができる。   In the electronic control device configured as described above, rewriting of the first control program stored in the first storage unit and the second storage unit is executed when the engine is stopped and the vehicle is stopped. . For this reason, while the rewriting of the first control program is being executed, the rewriting of the first control program is interrupted due to power interruption or the like, and thereby the contents of the first control program stored in the first storage unit Even if a situation occurs in which the content of the first control program stored in the second storage unit is different, the engine is stopped at this time, so the first process execution means and the second process execution are performed. The means does not perform processing according to the first control program. Therefore, due to the interruption of rewriting of the first control program, the content of the process performed by the first process execution unit according to the first control program and the content of the process performed by the second process execution unit according to the first control program are different. Therefore, it is possible to avoid a situation in which an abnormality occurs in the operation of the engine.

また本発明の電子制御装置では、第1記憶部に記憶された第2制御プログラムの書き換えと、第2記憶部に記憶された第3制御プログラムの書き換えは、エンジンが停止しており且つ車両が停止しているときだけではなく、エンジンが稼動しており且つ車両が停止しているときも実行される。このため、第2制御プログラムと第3制御プログラムを書き換えるために、車両を停止させ更にエンジンを停止させておく時間を短縮することができ、車両利用者の利便性を向上させることができる。   In the electronic control device of the present invention, the rewriting of the second control program stored in the first storage unit and the rewriting of the third control program stored in the second storage unit are performed when the engine is stopped and the vehicle is It is executed not only when the vehicle is stopped, but also when the engine is running and the vehicle is stopped. For this reason, in order to rewrite a 2nd control program and a 3rd control program, the time which stops a vehicle and also stops an engine can be shortened, and the convenience of a vehicle user can be improved.

以上、本発明の電子制御装置によれば、第1処理実行手段および第2処理実行手段の両方で実行される処理、すなわち重要度が高い処理に関しては、制御プログラムの書き換えによりエンジンの動作に異常が発生するという事態の発生を回避することができるとともに、第1処理実行手段および第2処理実行手段の何れか一方で実行される処理、すなわち比較的重要度が低い処理に関しては、エンジンが稼動しており且つ車両が停止しているときにも制御プログラムの書き換えを可能とすることで、車両利用者の利便性を向上させることができる。   As described above, according to the electronic control device of the present invention, regarding the processing executed by both the first processing execution means and the second processing execution means, that is, processing with high importance, the engine operation is abnormal due to rewriting of the control program. Can be avoided, and the engine is operated for a process executed by one of the first process execution means and the second process execution means, that is, a process of relatively low importance. The convenience of the vehicle user can be improved by allowing the control program to be rewritten even when the vehicle is stopped.

エンジンECU1とその周辺装置の構成を示すブロック図である。It is a block diagram which shows the structure of engine ECU1 and its peripheral device. ROMモードメイン処理の前半部分を示すフローチャートである。It is a flowchart which shows the first half part of ROM mode main processing. ROMモードメイン処理の後半部分を示すフローチャートである。It is a flowchart which shows the latter half part of ROM mode main processing. RAMモードメイン処理の前半部分を示すフローチャートである。It is a flowchart which shows the first half part of RAM mode main processing. RAMモードメイン処理の後半部分を示すフローチャートである。It is a flowchart which shows the latter half part of RAM mode main processing. メイン側ロックステップ対応プログラム書換処理を示すフローチャートである。It is a flowchart which shows the main side lock step corresponding | compatible program rewriting process. サブ側ロックステップ対応プログラム書換処理を示すフローチャートである。It is a flowchart which shows a sub-side lock step corresponding | compatible program rewriting process. 非ロックステップ対応プログラム書換処理を示すフローチャートである。It is a flowchart which shows a non-lock step corresponding program rewriting process. エンジン状態および車両状態と書き換えの許可および禁止との関係を示す図である。It is a figure which shows the relationship between an engine state and a vehicle state, and permission and prohibition of rewriting. エンジンECU1の動作を示す第1のタイミングチャートである。3 is a first timing chart showing the operation of engine ECU1. エンジンECU1の動作を示す第2のタイミングチャートである。3 is a second timing chart showing the operation of engine ECU1. エンジンECU1の動作を示す第3のタイミングチャートである。7 is a third timing chart showing the operation of engine ECU1.

以下に本発明の実施形態について図面とともに説明する。
本実施形態の電子制御装置(Electronic Control Unit)1(以下、エンジンECU1という)は、車両に搭載され、車両のエンジン(不図示)の制御を行う。
Embodiments of the present invention will be described below with reference to the drawings.
An electronic control unit (Electronic Control Unit) 1 (hereinafter referred to as an engine ECU 1) of the present embodiment is mounted on a vehicle and controls a vehicle engine (not shown).

エンジンECU1は、図1に示すように、エンジンを制御するための様々な処理を行うマイクロコンピュータ(以下、マイコンという)2と、エンジンECU1の外部とマイコン2との間で信号の入出力を行わせるための入力回路3および出力回路4とを備える。   As shown in FIG. 1, the engine ECU 1 inputs and outputs signals between a microcomputer (hereinafter referred to as a microcomputer) 2 that performs various processes for controlling the engine and between the outside of the engine ECU 1 and the microcomputer 2. Input circuit 3 and output circuit 4 are provided.

入力回路3には、アクセル開度センサ61、車速センサ62、クランクセンサ63、カムセンサ64およびシフト位置センサ65等が接続されている。アクセル開度センサ61は、運転者のアクセルペダルの踏込量に応じたアクセル開度を検出する。車速センサ62は、エンジンECU1が搭載されている車両の走行速度を検出する。クランクセンサ63は、エンジンのクランク軸の回転に応じてクランク角信号を出力する。カムセンサ64は、エンジンのカム軸の回転に応じてカム角信号を出力する。シフト位置センサ65は、車両に搭載された変速機(不図示)のシフト位置を検出する。   An accelerator opening sensor 61, a vehicle speed sensor 62, a crank sensor 63, a cam sensor 64, a shift position sensor 65, and the like are connected to the input circuit 3. The accelerator opening sensor 61 detects the accelerator opening according to the amount of depression of the driver's accelerator pedal. The vehicle speed sensor 62 detects the traveling speed of the vehicle on which the engine ECU 1 is mounted. The crank sensor 63 outputs a crank angle signal according to the rotation of the crankshaft of the engine. The cam sensor 64 outputs a cam angle signal according to the rotation of the cam shaft of the engine. The shift position sensor 65 detects a shift position of a transmission (not shown) mounted on the vehicle.

出力回路4には、電子スロットル71、インジェクタ72、点火プラグ73、EGRバルブ74、電動ファン75およびメインリレー76等が接続されている。
そしてマイコン2は、コア11、コア12、比較回路13および通信回路14を備える。
To the output circuit 4, an electronic throttle 71, an injector 72, a spark plug 73, an EGR valve 74, an electric fan 75, a main relay 76, and the like are connected.
The microcomputer 2 includes a core 11, a core 12, a comparison circuit 13, and a communication circuit 14.

コア11は、CPU21、ROM22およびRAM23を備える。またコア12は、CPU31、ROM32およびRAM33を備える。以下、コア11をメインコア11、コア12をサブコア12ともいう。   The core 11 includes a CPU 21, a ROM 22 and a RAM 23. The core 12 includes a CPU 31, a ROM 32 and a RAM 33. Hereinafter, the core 11 is also referred to as a main core 11, and the core 12 is also referred to as a sub-core 12.

ROM22,32は、データ書き換え可能な不揮発性メモリであり、CPU21,31が実行するプログラムと、プログラムの実行時に参照されるデータを記憶する。
ROM22には、電子スロットル制御プログラム、インジェクタ制御プログラム、点火プラグ制御プログラムおよびEGRバルブ制御プログラムが記憶されている。電子スロットル制御プログラムは、電子スロットル71を制御するためのプログラムである。インジェクタ制御プログラムは、インジェクタ72を制御するためのプログラムである。点火プラグ制御プログラムは、点火プラグ73を制御するためのプログラムである。EGRバルブ制御プログラムは、EGRバルブ74を制御するためのプログラムである。
The ROMs 22 and 32 are data rewritable nonvolatile memories, and store programs executed by the CPUs 21 and 31 and data referred to when the programs are executed.
The ROM 22 stores an electronic throttle control program, an injector control program, a spark plug control program, and an EGR valve control program. The electronic throttle control program is a program for controlling the electronic throttle 71. The injector control program is a program for controlling the injector 72. The spark plug control program is a program for controlling the spark plug 73. The EGR valve control program is a program for controlling the EGR valve 74.

ROM32には、電子スロットル制御プログラム、電動ファン制御プログラムおよびメインリレー制御プログラムが記憶されている。電動ファン制御プログラムは、電動ファン75を制御するためのプログラムである。メインリレー制御プログラムは、メインリレー76を制御するためのプログラムである。   The ROM 32 stores an electronic throttle control program, an electric fan control program, and a main relay control program. The electric fan control program is a program for controlling the electric fan 75. The main relay control program is a program for controlling the main relay 76.

ROM22,32の記憶領域は、複数のブロックに分割して管理されている。ROM22,32にデータを書き込む前に実行されるデータ消去は、このブロック単位で実行される。そして複数のブロックにはそれぞれ、ブロックを識別するためのブロック識別情報が付与されている。本実施形態のブロック識別情報は、ROM22,32におけるブロックの記憶アドレスが1ブロック分大きくなると値が1大きくなるように設定された自然数である。すなわち、本実施形態のブロック識別情報は、対応するブロックの記憶アドレスが小さい順に、1,2,3,4,・・・・の値が割り当てられている。   The storage areas of the ROMs 22 and 32 are managed by being divided into a plurality of blocks. Data erasure executed before data is written to the ROMs 22 and 32 is executed in units of blocks. Each block is provided with block identification information for identifying the block. The block identification information of the present embodiment is a natural number set so that the value increases by 1 when the storage address of the block in the ROMs 22 and 32 increases by one block. That is, the block identification information of this embodiment is assigned values 1, 2, 3, 4,... In ascending order of storage addresses of the corresponding blocks.

RAM23,33は、揮発性メモリであり、CPU21,31の演算結果等を一時的に記憶する。またRAM23,33にはそれぞれ、ROM22,32においてデータ消去が完了しているブロックを示す情報を記憶する領域(以下、消去完了ブロック記憶領域という)が設けられている。さらにRAM23,33にはそれぞれ、ROM22,32において制御プログラムの書き込みが完了しているアドレスを示す情報を記憶する領域(以下、書込完了アドレス記憶領域という)が設けられている。   The RAMs 23 and 33 are volatile memories, and temporarily store calculation results of the CPUs 21 and 31. In addition, the RAMs 23 and 33 are provided with areas for storing information indicating blocks for which data erasure has been completed in the ROMs 22 and 32 (hereinafter referred to as erasure completion block storage areas). Further, the RAMs 23 and 33 are provided with areas (hereinafter referred to as write completion address storage areas) for storing information indicating addresses at which the writing of the control program is completed in the ROMs 22 and 32, respectively.

CPU21,31は、アクセル開度センサ61、車速センサ62、クランクセンサ63、カムセンサ64およびシフト位置センサ65等から出力される信号を入力回路3を介して入力する。またCPU21,31は、ROM22,32に記憶されたプログラムに基づいて各種処理を実行する。なおCPU21,31は、互いにデータ通信可能に接続されている。   The CPUs 21 and 31 input signals output from the accelerator opening sensor 61, the vehicle speed sensor 62, the crank sensor 63, the cam sensor 64, the shift position sensor 65, and the like via the input circuit 3. The CPUs 21 and 31 execute various processes based on programs stored in the ROMs 22 and 32. The CPUs 21 and 31 are connected to each other so that data communication is possible.

そしてCPU21は、入力回路3を介して入力される各種信号に基づいて制御演算を行い、その演算結果に基づき、電子スロットル71、インジェクタ72、点火プラグ73およびEGRバルブ74を駆動するための駆動信号を出力する。なお、インジェクタ72、点火プラグ73およびEGRバルブ74を駆動するための駆動信号は出力回路4に入力する。電子スロットル71を駆動するための駆動信号(以下、スロットル駆動信号という)は比較回路13に入力する。   Then, the CPU 21 performs a control calculation based on various signals input via the input circuit 3, and a drive signal for driving the electronic throttle 71, the injector 72, the spark plug 73, and the EGR valve 74 based on the calculation result. Is output. A drive signal for driving the injector 72, the spark plug 73 and the EGR valve 74 is input to the output circuit 4. A drive signal (hereinafter referred to as a throttle drive signal) for driving the electronic throttle 71 is input to the comparison circuit 13.

またCPU31は、入力回路3を介して入力される各種信号に基づいて制御演算を行い、その演算結果に基づき、電子スロットル71、電動ファン75およびメインリレー76を駆動するための駆動信号を出力する。なお、電動ファン75およびメインリレー76を駆動するための駆動信号は出力回路4に入力する。電子スロットル71を駆動するためのスロットル駆動信号は比較回路13に入力する。   Further, the CPU 31 performs a control calculation based on various signals input via the input circuit 3, and outputs a drive signal for driving the electronic throttle 71, the electric fan 75, and the main relay 76 based on the calculation result. . A drive signal for driving the electric fan 75 and the main relay 76 is input to the output circuit 4. A throttle drive signal for driving the electronic throttle 71 is input to the comparison circuit 13.

比較回路13は、CPU21からのスロットル駆動信号とCPU31からのスロットル駆動信号とを比較し、両者が一致している場合に、入力した2つのスロットル駆動信号の何れかを出力する。なお、比較回路13から出力されたスロットル駆動信号は出力回路4に入力する。   The comparison circuit 13 compares the throttle drive signal from the CPU 21 with the throttle drive signal from the CPU 31 and outputs either of the two input throttle drive signals if they match. The throttle drive signal output from the comparison circuit 13 is input to the output circuit 4.

通信回路14は、車内LAN41を介して、車両に搭載された各種機器との間でデータ通信を行う。そして車内LAN41には、車両の外部に設置されたリモートセンタRCとの間で無線通信を行うプログラム変更ECU42が接続されている。これによりコア11およびコア12が、車内LAN41を介して、プログラム変更ECU42とデータ通信可能に接続される。   The communication circuit 14 performs data communication with various devices mounted on the vehicle via the in-vehicle LAN 41. The in-vehicle LAN 41 is connected to a program change ECU 42 that performs wireless communication with a remote center RC installed outside the vehicle. As a result, the core 11 and the core 12 are connected to the program change ECU 42 via the in-vehicle LAN 41 so that data communication is possible.

リモートセンタRCは、車両の所有者がカーディーラに車両を持ち込むことなく、ROM22,32に記憶されているプログラムを更新可能にするために設置されている。そしてリモートセンタRCは、車両を制御するための車両制御プログラム(すなわち、上記の電子スロットル制御プログラムおよびインジェクタ制御プログラム等)の更新が必要になったときに、車両に搭載されたプログラム変更ECU42との間で無線通信を行うことにより、新しい車両制御プログラムと、車両制御プログラムを書き換えるための書換制御プログラムとをプログラム変更ECU42へ送信する。   The remote center RC is installed so that the program stored in the ROMs 22 and 32 can be updated without the vehicle owner bringing the vehicle to the card dealer. The remote center RC communicates with the program change ECU 42 mounted on the vehicle when it is necessary to update the vehicle control program for controlling the vehicle (that is, the electronic throttle control program and the injector control program described above). By performing wireless communication between them, a new vehicle control program and a rewrite control program for rewriting the vehicle control program are transmitted to the program change ECU 42.

またプログラム変更ECU42には、操作キーおよび表示パネルからなるユーザインターフェース(以降、ユーザI/Fという)43が接続されている。
プログラム変更ECU42は、リモートセンタRCから、新しい車両制御プログラムと書換制御プログラムを受信すると、プログラム書換処理の実行の許可を求める書換許可確認画像を表示パネルに表示するように指示する許可画像表示指令をユーザI/F43へ出力する。ユーザI/F43は、許可画像表示指令を受信すると、書換許可確認画像を表示パネルに表示する。
The program change ECU 42 is connected to a user interface (hereinafter referred to as user I / F) 43 including operation keys and a display panel.
When the program change ECU 42 receives a new vehicle control program and a rewrite control program from the remote center RC, the program change ECU 42 issues a permission image display command for instructing the display panel to display a rewrite permission confirmation image for requesting permission to execute the program rewriting process. Output to the user I / F 43. Upon receiving the permission image display command, the user I / F 43 displays a rewrite permission confirmation image on the display panel.

そして、書換許可確認画像が表示パネルに表示されているときに操作者がユーザI/F43の操作キーを操作すると、ユーザI/F43は、書換許可信号をプログラム変更ECU42へ出力する。プログラム変更ECU42は、書換許可信号が入力されると、車両制御プログラムの書き換えを要求するプログラム書換要求を車内LAN41を介してエンジンECU1へ送信する。   When the operator operates the operation key of the user I / F 43 while the rewrite permission confirmation image is displayed on the display panel, the user I / F 43 outputs a rewrite permission signal to the program change ECU 42. When the rewrite permission signal is input, the program change ECU 42 transmits a program rewrite request for rewriting the vehicle control program to the engine ECU 1 via the in-vehicle LAN 41.

またプログラム変更ECU42は、車両制御プログラムの書き換えが完了すると、その旨を示す書換完了画像を表示パネルに表示するように指示する完了画像表示指令をユーザI/F43へ出力する。ユーザI/F43は、完了画像表示指令を受信すると、書換完了画像を表示パネルに表示する。   When the rewriting of the vehicle control program is completed, the program change ECU 42 outputs a completion image display command to the user I / F 43 instructing to display a rewriting completion image indicating that on the display panel. When the user I / F 43 receives the completion image display command, the user I / F 43 displays the rewriting completion image on the display panel.

このように構成されたエンジンECU1において、CPU21,31はそれぞれ、後述するROMモードメイン処理を実行する。
ここで、CPU21,31が実行するROMモードメイン処理の手順を説明する。ROMモードメイン処理は、エンジンECU1の動作中において所定時間毎(本実施形態では4ms毎)に繰り返し実行される処理である。
In the engine ECU 1 configured as described above, the CPUs 21 and 31 each execute a ROM mode main process which will be described later.
Here, the procedure of the ROM mode main process executed by the CPUs 21 and 31 will be described. The ROM mode main process is a process that is repeatedly executed every predetermined time (in this embodiment, every 4 ms) during the operation of the engine ECU 1.

このROMモードメイン処理が実行されると、CPU21(CPU31)は、図2および図3に示すように、まずS10にて、CPU21(CPU31)をROMモードに設定する。ROMモードでは、ROM22(ROM32)に記憶されているプログラムをROM22(ROM32)から読み出すことにより、CPU21(CPU31)が処理を実行する。   When the ROM mode main process is executed, the CPU 21 (CPU 31) first sets the CPU 21 (CPU 31) to the ROM mode in S10 as shown in FIGS. In the ROM mode, the CPU 21 (CPU 31) executes processing by reading a program stored in the ROM 22 (ROM 32) from the ROM 22 (ROM 32).

そしてS20にて、ROM22(ROM32)に記憶されているエンジン制御プログラムをROM22(ROM32)から読み出すことで、エンジンを制御する処理を実行する。なおS20では、エンジン制御処理のうち、例えば、電子スロットル71の開度、インジェクタ72の燃料噴射量、点火プラグ73の点火タイミング、および吸入空気量を算出処理は4ms毎に実行され、電動ファン75を制御する処理は8ms毎に実行される。   In S20, an engine control program stored in the ROM 22 (ROM 32) is read from the ROM 22 (ROM 32), thereby executing processing for controlling the engine. In S20, among the engine control processes, for example, the calculation process of the opening degree of the electronic throttle 71, the fuel injection amount of the injector 72, the ignition timing of the spark plug 73, and the intake air amount is executed every 4 ms. The process for controlling is executed every 8 ms.

次にS30にて、電子スロットル制御プログラムについてのプログラム書換要求をプログラム変更ECU42から受信したか否かを判断する。ここで、電子スロットル制御プログラムのプログラム書換要求を受信した場合には(S30:YES)、S40にて、メインコア11において電子スロットル制御プログラムについてのプログラム書換要求があったか否かを示す第1メイン要求フラグF11をセットするとともに、サブコア12において電子スロットル制御プログラムについてのプログラム書換要求があったか否かを示す第1サブ要求フラグF12をセットして、S60に移行する。一方、電子スロットル制御プログラムのプログラム書換要求を受信していない場合には(S30:NO)、S50にて、第1メイン要求フラグF11と第1サブ要求フラグF12をクリアして、S60に移行する。   Next, in S30, it is determined whether a program rewrite request for the electronic throttle control program has been received from the program change ECU. If a program rewrite request for the electronic throttle control program is received (S30: YES), the first main request indicating whether or not a program rewrite request for the electronic throttle control program has been made in the main core 11 in S40. In addition to setting the flag F11, the first sub request flag F12 indicating whether or not a program rewrite request for the electronic throttle control program has been made in the sub core 12 is set, and the process proceeds to S60. On the other hand, if the program rewrite request for the electronic throttle control program has not been received (S30: NO), the first main request flag F11 and the first sub request flag F12 are cleared in S50, and the process proceeds to S60. .

そしてS60に移行すると、メインコア11における電子スロットル制御プログラム以外の制御プログラムについてのプログラム書換要求をプログラム変更ECU42から受信したか否かを判断する。ここで、プログラム書換要求を受信した場合には(S60:YES)、S70にて、メインコア11において電子スロットル制御プログラム以外の制御プログラムについてのプログラム書換要求があったか否かを示す第2メイン要求フラグF13をセットして、S90に移行する。一方、プログラム書換要求を受信していない場合には(S60:NO)、S80にて、第2メイン要求フラグF13をクリアして、S90に移行する。   In S60, it is determined whether a program rewrite request for a control program other than the electronic throttle control program in the main core 11 has been received from the program change ECU 42. If a program rewrite request is received (S60: YES), a second main request flag indicating whether or not a program rewrite request for a control program other than the electronic throttle control program has been made in the main core 11 in S70. F13 is set and the process proceeds to S90. On the other hand, if the program rewrite request has not been received (S60: NO), the second main request flag F13 is cleared in S80, and the process proceeds to S90.

そしてS90に移行すると、サブコア12における電子スロットル制御プログラム以外の制御プログラムについてのプログラム書換要求をプログラム変更ECU42から受信したか否かを判断する。ここで、プログラム書換要求を受信した場合には(S90:YES)、S100にて、サブコア12において電子スロットル制御プログラム以外の制御プログラムについてのプログラム書換要求があったか否かを示す第2サブ要求フラグF14をセットして、S120に移行する。一方、プログラム書換要求を受信していない場合には(S90:NO)、S110にて、第2サブ要求フラグF14をクリアして、S120に移行する。   In S90, it is determined whether a program rewrite request for a control program other than the electronic throttle control program in the sub-core 12 has been received from the program change ECU 42. If a program rewrite request is received (S90: YES), a second sub request flag F14 indicating whether or not a program rewrite request for a control program other than the electronic throttle control program has been made in the sub-core 12 in S100. Is set, and the process proceeds to S120. On the other hand, if the program rewrite request has not been received (S90: NO), the second sub request flag F14 is cleared in S110, and the process proceeds to S120.

そしてS120に移行すると、RAM23(RAM33)の故障診断を実行する。そしてS130にて、S120での故障診断結果に基づいて、RAM23(RAM33)が故障しているか否かを判断する。ここで、RAM23(RAM33)が故障している場合には(S130:YES)、S190に移行する。一方、RAM23(RAM33)が故障していない場合には(S130:NO)、S140にて、キースイッチの位置が、オフ(OFF)位置またはアクセサリ(ACC)位置であるか否かを判断する。   In S120, failure diagnosis of the RAM 23 (RAM 33) is executed. In S130, based on the failure diagnosis result in S120, it is determined whether or not the RAM 23 (RAM 33) has failed. If the RAM 23 (RAM 33) has failed (S130: YES), the process proceeds to S190. On the other hand, if the RAM 23 (RAM 33) has not failed (S130: NO), it is determined in S140 whether the key switch position is the OFF (OFF) position or the accessory (ACC) position.

ここで、キースイッチの位置がオフ位置またはアクセサリ位置である場合には(S140:YES)、S150にて、エンジンが停止している状態(以下、エンジン停止状態という)であり且つ車両が停止している状態(以下、車両停止状態という)であるか否かを判断する。なお本実施形態では、エンジン回転数が300rpm以下であるときに、「エンジン停止状態である」と判断する。また、車速が0km/hであるときに、「車両停止状態である」と判断する。   Here, when the key switch is in the off position or the accessory position (S140: YES), in S150, the engine is stopped (hereinafter referred to as the engine stop state) and the vehicle is stopped. It is judged whether it is in the state (henceforth a vehicle stop state). In the present embodiment, when the engine speed is 300 rpm or less, it is determined that “the engine is stopped”. Further, when the vehicle speed is 0 km / h, it is determined that the vehicle is in a stopped state.

ここで、エンジン停止状態であり且つ車両停止状態である場合には(S150:YES)、S160にて、電子スロットル制御プログラムの書き換えが可能であるか否かを示す第1可能フラグF21をセットするとともに、電子スロットル制御プログラム以外の制御プログラムの書き換えが可能であるか否かを示す第2可能フラグF22をセットして、S190に移行する。一方、エンジン停止状態ではない、または車両停止状態ではない場合には(S150:NO)、S190に移行する。   If the engine is stopped and the vehicle is stopped (S150: YES), a first possible flag F21 indicating whether or not the electronic throttle control program can be rewritten is set in S160. At the same time, a second possible flag F22 indicating whether or not a control program other than the electronic throttle control program can be rewritten is set, and the process proceeds to S190. On the other hand, when the engine is not stopped or the vehicle is not stopped (S150: NO), the process proceeds to S190.

またS140にて、キースイッチの位置がオフ位置およびアクセサリ位置以外である場合には(S140:NO)、S170にて、車両停止状態であり且つアイドル運転状態であるか否かを判断する。ここで、車両停止状態であり且つアイドル運転状態である場合には(S170:YES)、第1可能フラグF21をクリアするとともに、第2可能フラグF22をセットして、S190に移行する。一方、車両停止状態ではない、またはアイドル運転状態ではない場合には(S170:NO)、S190に移行する。   In S140, if the position of the key switch is other than the OFF position and the accessory position (S140: NO), it is determined in S170 whether the vehicle is in a stopped state and in an idle operation state. If the vehicle is in a stopped state and is in an idle operation state (S170: YES), the first possible flag F21 is cleared and the second possible flag F22 is set, and the process proceeds to S190. On the other hand, when the vehicle is not stopped or is not in the idle operation state (S170: NO), the process proceeds to S190.

そしてS190に移行すると、第1可能フラグF21がセットされているか否かを判断する。ここで、第1可能フラグF21がセットされている場合には(S190:YES)、S200にて、メインコア11において電子スロットル制御プログラムの書き換えが許可されたか否かを示す第1メイン許可フラグF31と、サブコア12において電子スロットル制御プログラムの書き換えが許可されたか否かを示す第1サブ許可フラグF32を設定して、S220に移行する。具体的には、第1メイン要求フラグF11がセットされている場合には第1メイン許可フラグF31をセットする一方、第1メイン要求フラグF11がクリアされている場合には第1メイン許可フラグF31をクリアする。同様に、第1サブ要求フラグF12がセットされている場合には第1サブ許可フラグF32をセットする一方、第1サブ要求フラグF12がクリアされている場合には第1サブ許可フラグF32をクリアする。一方、第1可能フラグF21がクリアされている場合には(S190:NO)、S210にて、第1メイン許可フラグF31と第1サブ許可フラグF32をクリアして、S220に移行する。   In S190, it is determined whether or not the first possible flag F21 is set. If the first possible flag F21 is set (S190: YES), the first main permission flag F31 indicating whether or not rewriting of the electronic throttle control program is permitted in the main core 11 in S200. Then, the first sub permission flag F32 indicating whether or not rewriting of the electronic throttle control program is permitted in the sub core 12 is set, and the process proceeds to S220. Specifically, when the first main request flag F11 is set, the first main permission flag F31 is set, while when the first main request flag F11 is cleared, the first main permission flag F31 is set. To clear. Similarly, when the first sub request flag F12 is set, the first sub permission flag F32 is set, while when the first sub request flag F12 is cleared, the first sub permission flag F32 is cleared. To do. On the other hand, if the first possible flag F21 is cleared (S190: NO), the first main permission flag F31 and the first sub permission flag F32 are cleared in S210, and the process proceeds to S220.

そしてS220に移行すると、第2可能フラグF22がセットされているか否かを判断する。ここで、第2可能フラグF22がセットされている場合には(S220:YES)、S230にて、メインコア11において電子スロットル制御プログラム以外の制御プログラムの書き換えが許可されたか否かを示す第2メイン許可フラグF33と、サブコア12において電子スロットル制御プログラム以外の制御プログラムの書き換えが許可されたか否かを示す第2サブ許可フラグF34を設定して、S250に移行する。具体的には、第2メイン要求フラグF13がセットされている場合には第2メイン許可フラグF33をセットする一方、第2メイン要求フラグF13がクリアされている場合には第2メイン許可フラグF33をクリアする。同様に、第2サブ要求フラグF14がセットされている場合には第2サブ許可フラグF34をセットする一方、第2サブ要求フラグF14がクリアされている場合には第2サブ許可フラグF34をクリアする。一方、第2可能フラグF22がクリアされている場合には(S220:NO)、S240にて、第2メイン許可フラグF33と第2サブ許可フラグF34をクリアして、S250に移行する。   In S220, it is determined whether the second possible flag F22 is set. Here, when the second possible flag F22 is set (S220: YES), the second indicating whether or not rewriting of a control program other than the electronic throttle control program is permitted in the main core 11 in S230. The main permission flag F33 and a second sub permission flag F34 indicating whether or not rewriting of a control program other than the electronic throttle control program is permitted in the sub core 12 are set, and the process proceeds to S250. Specifically, when the second main request flag F13 is set, the second main permission flag F33 is set, while when the second main request flag F13 is cleared, the second main permission flag F33 is set. To clear. Similarly, when the second sub request flag F14 is set, the second sub permission flag F34 is set, while when the second sub request flag F14 is cleared, the second sub permission flag F34 is cleared. To do. On the other hand, when the 2nd possible flag F22 is cleared (S220: NO), the 2nd main permission flag F33 and the 2nd sub permission flag F34 are cleared in S240, and it transfers to S250.

そしてS250に移行すると、第1メイン許可フラグF31と第1サブ許可フラグF32の両方がセットされているか否かを判断する。ここで、第1メイン許可フラグF31と第1サブ許可フラグF32の両方がセットされている場合には(S250:YES)、S280に移行する。一方、第1メイン許可フラグF31および第1サブ許可フラグF32の何れか一方がクリアされている場合には(S250:NO)、S260にて、第2メイン許可フラグF33がセットされているか否かを判断する。   In S250, it is determined whether both the first main permission flag F31 and the first sub permission flag F32 are set. If both the first main permission flag F31 and the first sub permission flag F32 are set (S250: YES), the process proceeds to S280. On the other hand, if one of the first main permission flag F31 and the first sub permission flag F32 is cleared (S250: NO), whether or not the second main permission flag F33 is set in S260. Judging.

ここで、第2メイン許可フラグF33がセットされている場合には(S260:YES)、S280に移行する。一方、第2メイン許可フラグF33がクリアされている場合には(S260:NO)、S270にて、第2サブ許可フラグF34がセットされているか否かを判断する。ここで、第2サブ許可フラグF34がセットされている場合には(S270:YES)、S280に移行する。一方、第2サブ許可フラグF34がクリアされている場合には(S270:NO)、ROMモードメイン処理を一旦終了する。   If the second main permission flag F33 is set (S260: YES), the process proceeds to S280. On the other hand, if the second main permission flag F33 is cleared (S260: NO), it is determined in S270 whether or not the second sub permission flag F34 is set. If the second sub permission flag F34 is set (S270: YES), the process proceeds to S280. On the other hand, when the second sub permission flag F34 is cleared (S270: NO), the ROM mode main process is temporarily ended.

そしてS280に移行すると、プログラム変更ECU42から書換制御プログラムを受信して、RAM23(RAM33)に格納する。さらにS290にて、ROM22(ROM32)に記憶されているエンジン制御プログラムをROM22(ROM32)から読み出して、RAM23(RAM33)に格納する。   In S280, the rewrite control program is received from the program change ECU 42 and stored in the RAM 23 (RAM 33). In S290, the engine control program stored in the ROM 22 (ROM 32) is read from the ROM 22 (ROM 32) and stored in the RAM 23 (RAM 33).

そしてS300にて、書換制御プログラムとエンジン制御プログラムの全てをRAM23(RAM33)に格納したか否かを判断する。ここで、書換制御プログラムとエンジン制御プログラムの全ての格納が完了していない場合には(S300:NO)、ROMモードメイン処理を一旦終了する。一方、書換制御プログラムとエンジン制御プログラムの全ての格納が完了した場合には(S300:YES)、S320にて、書換制御プログラムとエンジン制御プログラムの格納が完了した旨を示す格納完了通知をCPU31(CPU21)へ送信する。   In S300, it is determined whether all of the rewrite control program and the engine control program are stored in the RAM 23 (RAM 33). Here, when the storage of all of the rewrite control program and the engine control program is not completed (S300: NO), the ROM mode main process is temporarily terminated. On the other hand, when all storage of the rewrite control program and the engine control program is completed (S300: YES), in S320, a storage completion notification indicating that storage of the rewrite control program and the engine control program is completed is sent to the CPU 31 ( CPU21).

その後S320にて、CPU31(CPU21)から格納完了通知を受信したか否かを判断する。ここで、格納完了通知を受信していない場合には(S320:NO)、ROMモードメイン処理を一旦終了する。一方、格納完了通知を受信した場合には(S320:YES)、S330にて、CPU21(CPU31)をRAMモードに設定し、RAM23(RAM33)に格納された書換制御プログラムにジャンプする。これにより、RAMモードメイン処理に移行する。RAMモードでは、RAM23(RAM33)に記憶されているプログラムを読み出すことにより、CPU21(CPU31)が処理を実行する。   Thereafter, in S320, it is determined whether or not a storage completion notification is received from CPU 31 (CPU 21). Here, when the storage completion notification has not been received (S320: NO), the ROM mode main process is temporarily terminated. On the other hand, if a storage completion notification is received (S320: YES), the CPU 21 (CPU 31) is set to the RAM mode in S330, and the program jumps to the rewrite control program stored in the RAM 23 (RAM 33). Thereby, the RAM mode main process is started. In the RAM mode, the CPU 21 (CPU 31) executes processing by reading a program stored in the RAM 23 (RAM 33).

次に、CPU21,31が実行するRAMモードメイン処理の手順を説明する。RAMモードメイン処理は、エンジンECU1の動作中において繰り返し実行される処理である。   Next, the procedure of the RAM mode main process executed by the CPUs 21 and 31 will be described. The RAM mode main process is a process that is repeatedly executed during the operation of the engine ECU 1.

このRAMモードメイン処理が実行されると、CPU21(CPU31)は、図4および図5に示すように、まずS410にて、第1メイン許可フラグF31と第1サブ許可フラグF32の両方がセットされているか否かを判断する。ここで、第1メイン許可フラグF31と第1サブ許可フラグF32の両方がセットされている場合には(S410:YES)、S420にて、ロックステップ対応プログラム書換処理(後述)を実行する。なお、ロックステップ対応プログラムとは、メインコア11とサブコア12で実行される制御プログラムであり、本実施形態では、電子スロットル制御プログラムである。そしてロックステップ対応プログラム書換処理が終了すると、S430にて、第1メイン許可フラグF31と第1サブ許可フラグF32をクリアして、S510に移行する。   When the RAM mode main process is executed, the CPU 21 (CPU 31) first sets both the first main permission flag F31 and the first sub permission flag F32 in S410, as shown in FIGS. Judge whether or not. If both the first main permission flag F31 and the first sub permission flag F32 are set (S410: YES), a lock step corresponding program rewriting process (described later) is executed in S420. The lock step compatible program is a control program executed by the main core 11 and the sub core 12, and is an electronic throttle control program in this embodiment. When the lock step corresponding program rewriting process is completed, the first main permission flag F31 and the first sub permission flag F32 are cleared in S430, and the process proceeds to S510.

一方、第1メイン許可フラグF31および第1サブ許可フラグF32の何れか一方がクリアされている場合には(S410:NO)、S440にて、第2メイン許可フラグF33がセットされており、且つ、このRAMモードメイン処理を実行しているのがメインコア11のCPU21であるか否かを判断する。ここで、第2メイン許可フラグF33がセットされており且つCPU21がRAMモードメイン処理を実行している場合には(S440:YES)、非ロックステップ対応プログラム書換処理(後述)を実行する。なお、非ロックステップ対応プログラムとは、メインコア11およびサブコア12の何れかで実行される制御プログラムであり、本実施形態では、電子スロットル制御プログラム以外の制御プログラムである。そして非ロックステップ対応プログラム書換処理が終了すると、S460にて、第2メイン許可フラグF33をクリアして、S510に移行する。   On the other hand, when one of the first main permission flag F31 and the first sub permission flag F32 is cleared (S410: NO), the second main permission flag F33 is set in S440, and Then, it is determined whether the CPU 21 of the main core 11 is executing the RAM mode main process. Here, when the second main permission flag F33 is set and the CPU 21 is executing the RAM mode main process (S440: YES), a non-lock step corresponding program rewriting process (described later) is executed. The non-lock step corresponding program is a control program executed by either the main core 11 or the sub-core 12, and is a control program other than the electronic throttle control program in this embodiment. When the non-lock step corresponding program rewriting process is completed, the second main permission flag F33 is cleared in S460, and the process proceeds to S510.

一方、第2メイン許可フラグF33がクリアされているか、このRAMモードメイン処理を実行しているのがメインコア11のCPU21ではない場合には(S440:NO)、S470にて、第2サブ許可フラグF34がセットされており、且つ、このRAMモードメイン処理を実行しているのがサブコア12のCPU31であるか否かを判断する。ここで、第2サブ許可フラグF34がセットされており且つCPU31がRAMモードメイン処理を実行している場合には(S470:YES)、S480にて、非ロックステップ対応プログラム書換処理を実行する。そして非ロックステップ対応プログラム書換処理が終了すると、S490にて、第2サブ許可フラグF34をクリアして、S510に移行する。   On the other hand, if the second main permission flag F33 is cleared or if the RAM mode main process is not performed by the CPU 21 of the main core 11 (S440: NO), the second sub permission is performed in S470. It is determined whether or not the flag F34 is set and the CPU 31 of the sub-core 12 is executing this RAM mode main process. Here, when the second sub permission flag F34 is set and the CPU 31 is executing the RAM mode main process (S470: YES), the non-lock step corresponding program rewriting process is executed in S480. When the non-lock step corresponding program rewriting process is completed, the second sub permission flag F34 is cleared in S490, and the process proceeds to S510.

一方、第2サブ許可フラグF34がクリアされているか、このRAMモードメイン処理を実行しているのがサブコア12のCPU31ではない場合には(S470:NO)、S500にて、RAM23(RAM33)に記憶されているエンジン制御プログラムを読み出すことで、エンジンを制御する処理を実行して、S510に移行する。   On the other hand, if the second sub permission flag F34 is cleared or if the RAM mode main process is not executed by the CPU 31 of the sub core 12 (S470: NO), the RAM 23 (RAM 33) is stored in S500. By reading the stored engine control program, a process for controlling the engine is executed, and the process proceeds to S510.

そしてS510に移行すると、第1メイン許可フラグF31と第1サブ許可フラグF32の両方がクリアされているか否かを判断する。ここで、第1メイン許可フラグF31および第1サブ許可フラグF32の少なくとも何れか一方がセットされている場合には(S510:NO)、RAMモードメイン処理を一旦終了する。   In S510, it is determined whether both the first main permission flag F31 and the first sub permission flag F32 are cleared. Here, when at least one of the first main permission flag F31 and the first sub permission flag F32 is set (S510: NO), the RAM mode main process is temporarily ended.

一方、第1メイン許可フラグF31と第1サブ許可フラグF32の両方がクリアされている場合には(S510:YES)、S520にて、第2メイン許可フラグF33がクリアされているか否かを判断する。ここで、第2メイン許可フラグF33がセットされている場合には(S520:NO)、RAMモードメイン処理を一旦終了する。一方、第2メイン許可フラグF33がクリアされている場合には(S520:YES)、S530にて、第2サブ許可フラグF34がクリアされているか否かを判断する。ここで、第2サブ許可フラグF34がセットされている場合には(S530:NO)、RAMモードメイン処理を一旦終了する。   On the other hand, if both the first main permission flag F31 and the first sub permission flag F32 are cleared (S510: YES), it is determined in S520 whether the second main permission flag F33 is cleared. To do. If the second main permission flag F33 is set (S520: NO), the RAM mode main process is temporarily terminated. On the other hand, if the second main permission flag F33 is cleared (S520: YES), it is determined in S530 whether the second sub permission flag F34 is cleared. If the second sub permission flag F34 is set (S530: NO), the RAM mode main process is temporarily terminated.

一方、第2サブ許可フラグF34がクリアされている場合には(S530:YES)、S540にて、CPU21(CPU31)をROMモードに設定し、ROM22(ROM32)に格納された制御プログラムにジャンプする。これにより、ROMモードメイン処理に移行する。   On the other hand, if the second sub permission flag F34 is cleared (S530: YES), the CPU 21 (CPU 31) is set to the ROM mode in S540, and the control program stored in the ROM 22 (ROM 32) is jumped to. . This shifts to the ROM mode main process.

次に、CPU21がS420で実行するロックステップ対応プログラム書換処理(以下、メイン側ロックステップ対応プログラム書換処理という)の手順を説明する。
このメイン側ロックステップ対応プログラム書換処理が実行されると、CPU21は、図6に示すように、まずS610にて、RAM23の消去完了ブロック記憶領域を参照することにより、ROM22において電子スロットル制御プログラムを書き込む記憶領域(以下、書換対象領域という)のデータ消去が完了しているか否かを判断する。
Next, the procedure of the lock step corresponding program rewriting process (hereinafter referred to as main side lock step corresponding program rewriting process) executed by the CPU 21 in S420 will be described.
When the main-side lockstep corresponding program rewriting process is executed, as shown in FIG. 6, the CPU 21 first loads the electronic throttle control program in the ROM 22 by referring to the erase completion block storage area of the RAM 23 in S610. It is determined whether or not data erasure of a storage area to be written (hereinafter referred to as a rewrite target area) has been completed.

ここで、書換対象領域のデータ消去が完了していない場合には(S610:NO)、S620にて、ROM22における書換対象領域のデータ消去を実行する。その後S630にて、S620の処理でデータ消去が実行された書換対象領域においてデータ消去が完了したことを示すように、消去完了ブロック記憶領域に記憶されている情報を更新する。そしてS610に移行する。   If the data erasure in the rewrite target area is not completed (S610: NO), the data erasure in the ROM 22 is executed in S620. Thereafter, in S630, the information stored in the erase completion block storage area is updated so as to indicate that the data erase has been completed in the rewrite target area where the data erase has been executed in the process of S620. Then, the process proceeds to S610.

一方、書換対象領域のデータ消去が完了している場合には(S610:YES)、S640にて、プログラム変更ECU42に対して、1回のデータ書込で書き込まれるデータ量として予め設定された書込単位データ量の書込データの送信を要求するコマンド(以下、書込データ送信要求コマンドという)を送信する。その後S650にて、プログラム変更ECU42から書込単位データ量分の書込データを受信したか否かを判断する。ここで、書込単位データ量分の書込データを受信していない場合には(S650:NO)、S650の処理を繰り返すことにより、プログラム変更ECU42から書込単位データ量分の書込データを受信するまで待機する。   On the other hand, if the data erasure in the rewrite target area has been completed (S610: YES), the data set in advance as the amount of data written in one data write to the program change ECU 42 in S640. A command (hereinafter referred to as a write data transmission request command) requesting transmission of write data having a data amount of data is transmitted. Thereafter, in S650, it is determined whether or not write data corresponding to the write unit data amount has been received from program change ECU. Here, when the write data for the write unit data amount has not been received (S650: NO), the process of S650 is repeated, so that the write data for the write unit data amount is obtained from the program change ECU 42. Wait for reception.

そして、プログラム変更ECU42から書込単位データ量分の書込データを受信した場合には(S650:YES)、S660にて、受信した書込データをサブコア12へ送信する。さらにS670にて、受信した書込データをROM22に書き込む。その後S680にて、S670の処理で書込データが書き込まれた記憶領域においてデータ書込が完了したことを示すように、書込完了アドレス記憶領域に記憶されている情報を更新する。   When the write data corresponding to the write unit data amount is received from the program change ECU 42 (S650: YES), the received write data is transmitted to the sub-core 12 in S660. Further, in S670, the received write data is written into the ROM 22. Thereafter, in S680, the information stored in the write completion address storage area is updated so as to indicate that data writing has been completed in the storage area in which the write data is written in S670.

そしてS690にて、サブコア12から、S660で送信した書込データの書き込みが完了したことを示す書込完了通知を受信したか否かを判断する。ここで、サブコア12から書込完了通知を受信していない場合には(S690:NO)、S690の処理を繰り返すことにより、サブコア12から書込完了通知を受信するまで待機する。そして、サブコア12から書込完了通知を受信した場合には(S690:YES)、S700にて、書込完了アドレス記憶領域を参照することにより、ROM22における書換対象領域の全てで書込データの書き込みが完了したか否かを判断する。   In S690, it is determined whether or not a write completion notification indicating that the writing of the write data transmitted in S660 has been completed is received from sub-core 12. Here, when the writing completion notification is not received from the sub-core 12 (S690: NO), the processing of S690 is repeated to wait until the writing completion notification is received from the sub-core 12. When the write completion notification is received from the sub-core 12 (S690: YES), the write data is written in all the rewrite target areas in the ROM 22 by referring to the write completion address storage area in S700. It is determined whether or not is completed.

ここで、書き込みが完了していない書換対象領域がある場合には(S700:NO)、S640に移行して上述の処理を繰り返す。一方、書換対象領域の全てで書き込みが完了した場合には(S700:YES)、S710にて、サブコア12から、ROM32における書換対象領域の全てで書込データの書き込みが完了したことを示す全書込完了通知を受信したか否かを判断する。ここで、サブコア12から全書込完了通知を受信していない場合には(S710:NO)、S710の処理を繰り返すことにより、サブコア12から全書込完了通知を受信するまで待機する。そして、サブコア12から全書込完了通知を受信した場合には(S710:YES)、メイン側ロックステップ対応プログラム書換処理を終了する。   Here, if there is a rewrite target area for which writing has not been completed (S700: NO), the process proceeds to S640 and the above-described processing is repeated. On the other hand, when the writing is completed in all the rewriting target areas (S700: YES), in S710, all writing indicating that the writing of writing data is completed in all the rewriting target areas in the ROM 32 from the sub-core 12. It is determined whether or not a completion notification has been received. If the all-write completion notification has not been received from the sub-core 12 (S710: NO), the process of S710 is repeated until the all-write completion notification is received from the sub-core 12. If the all-write completion notification is received from the sub-core 12 (S710: YES), the main-side lockstep corresponding program rewriting process is terminated.

次に、CPU31がS420で実行するロックステップ対応プログラム書換処理(以下、サブ側ロックステップ対応プログラム書換処理という)の手順を説明する。
このサブ側ロックステップ対応プログラム書換処理が実行されると、CPU31は、図7に示すように、まずS810にて、RAM33の消去完了ブロック記憶領域を参照することにより、ROM32において電子スロットル制御プログラムを書き込む記憶領域(以下、書換対象領域という)のデータ消去が完了しているか否かを判断する。
Next, the procedure of the lock step corresponding program rewriting process (hereinafter referred to as sub-side lock step corresponding program rewriting process) executed by the CPU 31 in S420 will be described.
When the sub-side lock step corresponding program rewriting process is executed, the CPU 31 first loads the electronic throttle control program in the ROM 32 by referring to the erase completion block storage area of the RAM 33 in S810 as shown in FIG. It is determined whether or not data erasure of a storage area to be written (hereinafter referred to as a rewrite target area) has been completed.

ここで、書換対象領域のデータ消去が完了していない場合には(S810:NO)、S820にて、ROM32における書換対象領域のデータ消去を実行する。その後S830にて、S820の処理でデータ消去が実行された書換対象領域においてデータ消去が完了したことを示すように、消去完了ブロック記憶領域に記憶されている情報を更新する。そしてS810に移行する。   If the data erasure in the rewrite target area has not been completed (S810: NO), the data erasure in the ROM 32 is executed in S820. Thereafter, in S830, the information stored in the erase completion block storage area is updated so as to indicate that the data erase has been completed in the rewrite target area where the data erase has been executed in the process of S820. Then, the process proceeds to S810.

一方、書換対象領域のデータ消去が完了している場合には(S810:YES)、S840にて、メインコア11から、1回のデータ書込で書き込まれるデータ量として予め設定された書込単位データ量の書込データ分の書込データを受信したか否かを判断する。ここで、書込単位データ量分の書込データを受信していない場合には(S840:NO)、S840の処理を繰り返すことにより、メインコア11から書込単位データ量分の書込データを受信するまで待機する。   On the other hand, when the data erasure of the rewrite target area has been completed (S810: YES), in S840, the write unit preset as the amount of data to be written in one data write from the main core 11 It is determined whether write data corresponding to the amount of write data has been received. Here, when the write data for the write unit data amount is not received (S840: NO), the write data for the write unit data amount is received from the main core 11 by repeating the process of S840. Wait for reception.

そして、メインコア11から書込単位データ量分の書込データを受信した場合には(S840:YES)、S850にて、受信した書込データをROM32に書き込む。その後S860にて、S850の処理で書込データが書き込まれた記憶領域においてデータ書込が完了したことを示すように、書込完了アドレス記憶領域に記憶されている情報を更新する。さらにS870にて、書込データの書き込みが完了したことを示す書込完了通知をメインコア11へ送信する。   When the write data corresponding to the write unit data amount is received from the main core 11 (S840: YES), the received write data is written in the ROM 32 in S850. Thereafter, in S860, the information stored in the write completion address storage area is updated so as to indicate that the data writing is completed in the storage area in which the write data is written in the process of S850. Further, in S870, a write completion notification indicating completion of writing of the write data is transmitted to the main core 11.

そしてS880にて、書込完了アドレス記憶領域を参照することにより、ROM32における書換対象領域の全てで書込データの書き込みが完了したか否かを判断する。ここで、書き込みが完了していない書換対象領域がある場合には(S880:NO)、S840に移行して上述の処理を繰り返す。一方、書換対象領域の全てで書き込みが完了した場合には(S880:YES)、S890にて、ROM32における書換対象領域の全てで書込データの書き込みが完了したことを示す全書込完了通知をメインコア11へ送信して、サブ側ロックステップ対応プログラム書換処理を終了する。   In S880, it is determined whether or not writing of the write data is completed in all the rewrite target areas in the ROM 32 by referring to the write completion address storage area. If there is a rewrite target area that has not been completely written (S880: NO), the process proceeds to S840 and the above-described processing is repeated. On the other hand, when the writing is completed in all the rewriting target areas (S880: YES), in S890, the all writing completion notification indicating that the writing of the writing data is completed in all the rewriting target areas in the ROM 32 is performed. The data is transmitted to the core 11, and the sub-side lock step corresponding program rewriting process is terminated.

次に、CPU21がS450で実行するとともにCPU31がS470で実行する非ロックステップ対応プログラム書換処理の手順を説明する。
この非ロックステップ対応プログラム書換処理が実行されると、CPU21(CPU31)は、図8に示すように、まずS1010にて、RAM23(RAM33)に記憶されているエンジン制御プログラムを読み出すことで、エンジンを制御する処理を実行する。その後S1020にて、車両が停止している状態(以下、車両停止状態という)であるか否かを判断する。ここで、車両停止状態ではない場合には(S1020:NO)、S1010に移行して上述の処理を繰り返す。
Next, the procedure of the non-lock step corresponding program rewriting process executed by the CPU 21 in S450 and the CPU 31 in S470 will be described.
When this non-lock step corresponding program rewriting process is executed, the CPU 21 (CPU 31) first reads the engine control program stored in the RAM 23 (RAM 33) in S1010 as shown in FIG. Execute the process to control. Thereafter, in S1020, it is determined whether or not the vehicle is in a stopped state (hereinafter referred to as a vehicle stopped state). If the vehicle is not stopped (S1020: NO), the process proceeds to S1010 and the above-described process is repeated.

一方、車両停止状態である場合には(S1020:YES)、S1030にて、RAM23(RAM33)の消去完了ブロック記憶領域を参照することにより、ROM22(ROM32)において、プログラム書換の対象となっている制御プログラムを書き込む記憶領域(以下、書換対象領域という)のデータ消去が完了しているか否かを判断する。   On the other hand, when the vehicle is in a stopped state (S1020: YES), the program is rewritten in the ROM 22 (ROM 32) by referring to the erase completion block storage area of the RAM 23 (RAM 33) in S1030. It is determined whether or not data erasure in a storage area (hereinafter referred to as a rewrite target area) in which a control program is written has been completed.

ここで、書換対象領域のデータ消去が完了していない場合には(S1030:NO)、S1040にて、ROM22(ROM32)における書換対象領域のデータ消去を実行する。その後S1050にて、S1040の処理でデータ消去が実行された書換対象領域においてデータ消去が完了したことを示すように、消去完了ブロック記憶領域に記憶されている情報を更新する。そしてS1010に移行する。   If the data erasure in the rewrite target area is not completed (S1030: NO), the data erasure in the rewrite target area in the ROM 22 (ROM 32) is executed in S1040. Thereafter, in S1050, the information stored in the erase completion block storage area is updated so as to indicate that the data erase has been completed in the rewrite target area where the data erase has been executed in the process of S1040. Then, the process proceeds to S1010.

一方、書換対象領域のデータ消去が完了している場合には(S1030:YES)、S1060にて、書込データ送信要求コマンドをプログラム変更ECU42へ送信したか否かを示すコマンド送信フラグがセットされているか否かを判断する。ここで、コマンド送信フラグがセットされていない場合には(S1060:NO)、S1070にて、書込データ送信要求コマンドをプログラム変更ECU42へ送信する。その後S1080にて、コマンド送信フラグをセットして、S1090に移行する。一方、コマンド送信フラグがセットされている場合には(S1060:YES)、S1090に移行する。   On the other hand, when the data erasure in the rewrite target area has been completed (S1030: YES), a command transmission flag indicating whether or not a write data transmission request command has been transmitted to the program change ECU 42 is set in S1060. Judge whether or not. If the command transmission flag is not set (S1060: NO), a write data transmission request command is transmitted to the program change ECU 42 in S1070. Thereafter, in S1080, the command transmission flag is set, and the process proceeds to S1090. On the other hand, when the command transmission flag is set (S1060: YES), the process proceeds to S1090.

そしてS1090に移行すると、プログラム変更ECU42から書込単位データ量分の書込データを受信したか否かを判断する。ここで、書込単位データ量分の書込データを受信していない場合には(S1090:NO)、S1010に移行する。一方、プログラム変更ECU42から書込単位データ量分の書込データを受信した場合には(S1090:YES)、S1100にて、コマンド送信フラグをクリアする。そしてS1110にて、受信した書込データをROM22(ROM32)に書き込む。その後S1120にて、S1110の処理で書込データが書き込まれた記憶領域においてデータ書込が完了したことを示すように、書込完了アドレス記憶領域に記憶されている情報を更新する。   Then, in S1090, it is determined whether or not write data corresponding to the write unit data amount has been received from the program change ECU 42. If write data for the write unit data amount has not been received (S1090: NO), the process proceeds to S1010. On the other hand, when write data corresponding to the write unit data amount is received from the program change ECU 42 (S1090: YES), the command transmission flag is cleared in S1100. In step S1110, the received write data is written in the ROM 22 (ROM 32). Thereafter, in S1120, the information stored in the write completion address storage area is updated so as to indicate that the data writing is completed in the storage area in which the write data is written in the process of S1110.

その後S1130にて、書込完了アドレス記憶領域を参照することにより、ROM22(ROM32)における書換対象領域の全てで書込データの書き込みが完了したか否かを判断する。ここで、書き込みが完了していない書換対象領域がある場合には(S1130:NO)、S1010に移行して上述の処理を繰り返す。一方、書換対象領域の全てで書き込みが完了した場合には(S1130:YES)、非ロックステップ対応プログラム書換処理を終了する。   Thereafter, in S1130, by referring to the write completion address storage area, it is determined whether or not writing of the write data is completed in all of the rewrite target areas in the ROM 22 (ROM 32). If there is a rewrite target area where writing has not been completed (S1130: NO), the process proceeds to S1010 and the above-described processing is repeated. On the other hand, when the writing is completed in all the rewriting target areas (S1130: YES), the non-lock step corresponding program rewriting process is ended.

次に、このように構成されたエンジンECU1の動作を説明する。
まず、エンジンECU1が搭載された車両は、図9(a)に示すように、エンジン停止・車両停止状態C1、エンジン稼動・車両停止状態C2およびエンジン稼動・車両走行状態C3の何れかの状態となる。
Next, the operation of the engine ECU 1 configured as described above will be described.
First, as shown in FIG. 9 (a), the vehicle on which the engine ECU 1 is mounted is in any one of an engine stop / vehicle stop state C1, an engine operation / vehicle stop state C2, and an engine operation / vehicle travel state C3. Become.

エンジン停止・車両停止状態C1は、エンジン停止状態となっており且つ車両停止状態となっている状態である。エンジン稼動・車両停止状態C2は、エンジンが稼動している状態(以下、エンジン稼動状態という)となっており且つ車両停止状態となっている状態である。エンジン稼動・車両走行状態C3は、エンジン稼動状態となっており且つ車両が走行している状態(以下、車両走行状態という)となっている状態である。   The engine stop / vehicle stop state C1 is an engine stop state and a vehicle stop state. The engine operation / vehicle stop state C2 is a state in which the engine is operating (hereinafter referred to as an engine operation state) and a vehicle stop state. The engine running / vehicle running state C3 is a state in which the engine is running and the vehicle is running (hereinafter referred to as a vehicle running state).

そして図9(b)に示すように、エンジン停止・車両停止状態C1では、電子スロットル制御プログラムと、電子スロットル制御プログラム以外の制御プログラムの書き換えが許可される。またエンジン稼動・車両停止状態C2では、電子スロットル制御プログラムの書き換えが禁止され、電子スロットル制御プログラム以外の制御プログラムの書き換えが許可される。またエンジン稼動・車両走行状態C3では、電子スロットル制御プログラムと、電子スロットル制御プログラム以外の制御プログラムの書き換えが禁止される。   As shown in FIG. 9B, in the engine stop / vehicle stop state C1, rewriting of the electronic throttle control program and control programs other than the electronic throttle control program is permitted. In the engine operation / vehicle stop state C2, rewriting of the electronic throttle control program is prohibited, and rewriting of control programs other than the electronic throttle control program is permitted. In the engine operating / vehicle running state C3, rewriting of the electronic throttle control program and control programs other than the electronic throttle control program is prohibited.

また、メインコア11において電子スロットル制御プログラム以外の制御プログラムについてのプログラム書換要求があり且つその他のプログラム書換要求がない場合には、エンジン停止・車両停止状態C1またはエンジン稼動・車両停止状態C2になったときに、メインコア11で、書換要求があった制御プログラムの書き換えが実行される。   When there is a program rewrite request for a control program other than the electronic throttle control program in the main core 11 and there is no other program rewrite request, the engine is stopped / vehicle stopped state C1 or the engine is operated / vehicle stopped state C2. The main core 11 rewrites the control program requested to be rewritten.

また、サブコア12において電子スロットル制御プログラム以外の制御プログラムについてのプログラム書換要求があり且つその他のプログラム書換要求がない場合には、エンジン停止・車両停止状態C1またはエンジン稼動・車両停止状態C2になったときに、サブコア12で、書換要求があった制御プログラムの書き換えが実行される。   Further, when there is a program rewrite request for a control program other than the electronic throttle control program in the sub-core 12 and there is no other program rewrite request, the engine is stopped / vehicle stopped C1 or the engine is operated / vehicle stopped C2. In some cases, the sub-core 12 rewrites the control program requested to be rewritten.

また、メインコア11において電子スロットル制御プログラム以外の制御プログラムについてのプログラム書換要求があり且つサブコア12において電子スロットル制御プログラム以外の制御プログラムについてのプログラム書換要求がある場合には、メインコア11およびサブコア12のそれぞれで個別に、書換要求があった制御プログラムの書き換えが実行される。   When there is a program rewrite request for a control program other than the electronic throttle control program in the main core 11 and there is a program rewrite request for a control program other than the electronic throttle control program in the sub core 12, the main core 11 and the sub core 12 In each of the above, rewriting of the control program requested to be rewritten is executed.

また、メインコア11とサブコア12において電子スロットル制御プログラムについてのプログラム書換要求がある場合には、エンジン停止・車両停止状態C1になったときに、メインコア11およびサブコア12のそれぞれで、互いに同期して電子スロットル制御プログラムの書き換えが実行される。   In addition, when there is a program rewrite request for the electronic throttle control program in the main core 11 and the sub core 12, the main core 11 and the sub core 12 are synchronized with each other when the engine stop / vehicle stop state C1 is reached. Thus, the electronic throttle control program is rewritten.

また、メインコア11とサブコア12において電子スロットル制御プログラムについてのプログラム書換要求があり且つメインコア11において電子スロットル制御プログラム以外の制御プログラムについてのプログラム書換要求がある場合には、電子スロットル制御プログラムの書き換えと、電子スロットル制御プログラム以外の制御プログラムの書き換えの順序は、以下通りである。   When there is a program rewrite request for the electronic throttle control program in the main core 11 and the sub-core 12 and there is a program rewrite request for a control program other than the electronic throttle control program in the main core 11, the electronic throttle control program is rewritten. The order of rewriting control programs other than the electronic throttle control program is as follows.

まず、エンジン停止・車両停止状態C1よりも早くエンジン稼動・車両停止状態C2になった場合には、メインコア11で、電子スロットル制御プログラム以外の制御プログラムの書き換えが実行される。その後、エンジン停止・車両停止状態C1になると、メインコア11およびサブコア12のそれぞれで、互いに同期して電子スロットル制御プログラムの書き換えが実行される。   First, when the engine operation / vehicle stop state C2 is entered earlier than the engine stop / vehicle stop state C1, the main core 11 rewrites a control program other than the electronic throttle control program. Thereafter, when the engine stop / vehicle stop state C1 is entered, the main core 11 and the sub-core 12 rewrite the electronic throttle control program in synchronization with each other.

また、エンジン稼動・車両停止状態C2よりも早くエンジン停止・車両停止状態C1になった場合には、メインコア11およびサブコア12のそれぞれで、互いに同期して電子スロットル制御プログラムの書き換えが実行される。そして、電子スロットル制御プログラムの書き換えが完了すると、メインコア11で、電子スロットル制御プログラム以外の制御プログラムの書き換えが実行される。   Further, when the engine stop / vehicle stop state C1 is entered earlier than the engine operation / vehicle stop state C2, the electronic core control program is rewritten in synchronization with each other in the main core 11 and the sub core 12. . When rewriting of the electronic throttle control program is completed, rewriting of control programs other than the electronic throttle control program is executed in the main core 11.

次に、メインコア11とサブコア12において電子スロットル制御プログラムについてのプログラム書換要求があり且つサブコア12において電子スロットル制御プログラム以外の制御プログラムについてのプログラム書換要求がある場合には、電子スロットル制御プログラムの書き換えと、電子スロットル制御プログラム以外の制御プログラムの書き換えの順序は、以下通りである。   Next, when there is a program rewriting request for the electronic throttle control program in the main core 11 and the sub core 12 and there is a program rewriting request for a control program other than the electronic throttle control program in the sub core 12, the rewriting of the electronic throttle control program is performed. The order of rewriting control programs other than the electronic throttle control program is as follows.

まず、エンジン停止・車両停止状態C1よりも早くエンジン稼動・車両停止状態C2になった場合には、サブコア12で、電子スロットル制御プログラム以外の制御プログラムの書き換えが実行される。その後、エンジン停止・車両停止状態C1になると、メインコア11およびサブコア12のそれぞれで、互いに同期して電子スロットル制御プログラムの書き換えが実行される。   First, when the engine operation / vehicle stop state C2 is entered earlier than the engine stop / vehicle stop state C1, the sub-core 12 rewrites control programs other than the electronic throttle control program. Thereafter, when the engine stop / vehicle stop state C1 is entered, the main core 11 and the sub-core 12 rewrite the electronic throttle control program in synchronization with each other.

また、エンジン稼動・車両停止状態C2よりも早くエンジン停止・車両停止状態C1になった場合には、メインコア11およびサブコア12のそれぞれで、互いに同期して電子スロットル制御プログラムの書き換えが実行される。そして、電子スロットル制御プログラムの書き換えが完了すると、サブコア12で、電子スロットル制御プログラム以外の制御プログラムの書き換えが実行される。   Further, when the engine stop / vehicle stop state C1 is entered earlier than the engine operation / vehicle stop state C2, the electronic core control program is rewritten in synchronization with each other in the main core 11 and the sub core 12. . When the rewriting of the electronic throttle control program is completed, rewriting of control programs other than the electronic throttle control program is executed in the sub-core 12.

次に、メインコア11とサブコア12において電子スロットル制御プログラムについてのプログラム書換要求があり且つメインコア11とサブコア12において電子スロットル制御プログラム以外の制御プログラムについてのプログラム書換要求がある場合には、電子スロットル制御プログラムの書き換えと、電子スロットル制御プログラム以外の制御プログラムの書き換えの順序は、以下通りである。   Next, when there is a program rewriting request for the electronic throttle control program in the main core 11 and the sub core 12, and there is a program rewriting request for a control program other than the electronic throttle control program in the main core 11 and the sub core 12, the electronic throttle The order of rewriting the control program and rewriting the control program other than the electronic throttle control program is as follows.

まず、エンジン停止・車両停止状態C1よりも早くエンジン稼動・車両停止状態C2になった場合には、メインコア11およびサブコア12のそれぞれで個別に、電子スロットル制御プログラム以外の制御プログラムの書き換えが実行される。その後、エンジン停止・車両停止状態C1になると、メインコア11およびサブコア12のそれぞれで、互いに同期して電子スロットル制御プログラムの書き換えが実行される。   First, when the engine operation / vehicle stop state C2 is entered earlier than the engine stop / vehicle stop state C1, the main core 11 and the sub core 12 individually rewrite control programs other than the electronic throttle control program. Is done. Thereafter, when the engine stop / vehicle stop state C1 is entered, the main core 11 and the sub-core 12 rewrite the electronic throttle control program in synchronization with each other.

また、エンジン稼動・車両停止状態C2よりも早くエンジン停止・車両停止状態C1になった場合には、メインコア11およびサブコア12のそれぞれで、互いに同期して電子スロットル制御プログラムの書き換えが実行される。そして、電子スロットル制御プログラムの書き換えが完了すると、メインコア11およびサブコア12のそれぞれで個別に、電子スロットル制御プログラム以外の制御プログラムの書き換えが実行される。   Further, when the engine stop / vehicle stop state C1 is entered earlier than the engine operation / vehicle stop state C2, the electronic core control program is rewritten in synchronization with each other in the main core 11 and the sub core 12. . When the rewriting of the electronic throttle control program is completed, rewriting of control programs other than the electronic throttle control program is executed individually for each of the main core 11 and the sub-core 12.

図10は、プログラム書換を実行しない場合の動作を示すタイミングチャートである。
図10に示すように、キースイッチがオフ状態からオン状態に切り替わると、エンジンECU1に電源が供給され(時刻t01を参照)、メインコア11のCPU21とサブコア12のCPU31において、電子スロットル制御プログラムと、電子スロットル制御プログラム以外の制御プログラムが実行される。電子スロットル制御プログラムはロックステップ対象であるため、CPU21の電子スロットル制御プログラムとCPU31の電子スロットル制御プログラムは同じタイミングで実行される。
FIG. 10 is a timing chart showing the operation when program rewriting is not executed.
As shown in FIG. 10, when the key switch is switched from the off state to the on state, power is supplied to the engine ECU 1 (see time t01), and the electronic throttle control program is executed in the CPU 21 of the main core 11 and the CPU 31 of the sub core 12. A control program other than the electronic throttle control program is executed. Since the electronic throttle control program is a lock step target, the electronic throttle control program of the CPU 21 and the electronic throttle control program of the CPU 31 are executed at the same timing.

その後、キースイッチがオン状態からオフ状態に切り替わると(時刻t02を参照)、電子スロットル制御プログラムの実行と、電子スロットル制御プログラム以外の制御プログラムの実行が停止した後に、エンジンECU1をシャットダウンするための事前処理が実行される。そして、エンジンECU1がメインリレー76への駆動信号出力をオンからオフに変化させることで、エンジンECU1への電源供給が遮断され(時刻t03を参照)、エンジンECU1の機能が停止する。   Thereafter, when the key switch is switched from the on state to the off state (see time t02), the execution of the electronic throttle control program and the execution of the control program other than the electronic throttle control program are stopped, and then the engine ECU 1 is shut down. Pre-processing is executed. Then, the engine ECU 1 changes the drive signal output to the main relay 76 from on to off, whereby the power supply to the engine ECU 1 is interrupted (see time t03), and the function of the engine ECU 1 is stopped.

図11は、電子スロットル制御プログラム以外の制御プログラムのプログラム書換を実行する場合の動作を示すタイミングチャートである。
図11に示すように、キースイッチがオフ状態からオン状態に切り替わると、エンジンECU1に電源が供給され(時刻t11を参照)、メインコア11のCPU21とサブコア12のCPU31において、電子スロットル制御プログラムと、電子スロットル制御プログラム以外の制御プログラムが実行される。その後、エンジンECU1がプログラム変更ECU42からプログラム書換要求RRを受信する(時刻t12を参照)。このときに、車両は、エンジンが稼動している状態(以下、エンジン稼動状態という)であり且つ走行している状態(以下、車両走行状態という)であるため、プログラム書換は実行されない。
FIG. 11 is a timing chart showing an operation when program rewriting of a control program other than the electronic throttle control program is executed.
As shown in FIG. 11, when the key switch is switched from the off state to the on state, power is supplied to the engine ECU 1 (see time t11), and the electronic throttle control program and A control program other than the electronic throttle control program is executed. Thereafter, engine ECU 1 receives program rewrite request RR from program change ECU 42 (see time t12). At this time, since the vehicle is in a state where the engine is operating (hereinafter referred to as an engine operating state) and is in a traveling state (hereinafter referred to as a vehicle traveling state), the program rewriting is not executed.

その後、車両が、エンジン稼動状態であり且つ車両停止状態である状態になると(時刻t13を参照)、メインコア11のCPU21とサブコア12のCPU31において、電子スロットル制御プログラム以外の制御プログラムについてのプログラム書換処理が実行される(図11の書換処理RP01,RP02,RP03,RP04,RP05,RP06を参照)。なお、CPU21のプログラム書換処理とCPU31のプログラム書換処理は互いに同じタイミングで実行される必要はなく個別に実行される。また、電子スロットル制御プログラム以外の制御プログラムについてのプログラム書換処理の実行中であっても、CPU21,31のそれぞれにおいてエンジン制御が継続して実行される。   Thereafter, when the vehicle is in an engine operating state and a vehicle stopped state (see time t13), the CPU 21 of the main core 11 and the CPU 31 of the sub core 12 rewrite programs for control programs other than the electronic throttle control program. Processing is executed (see rewriting processing RP01, RP02, RP03, RP04, RP05, RP06 in FIG. 11). The program rewriting process of the CPU 21 and the program rewriting process of the CPU 31 do not need to be executed at the same timing, but are executed individually. Further, even during execution of the program rewriting process for a control program other than the electronic throttle control program, the engine control is continuously executed in each of the CPUs 21 and 31.

その後、CPU21におけるプログラム書換処理が完了すると(時刻t14を参照)、CPU21はRAMモードからROMモードに切り替わる。また、CPU31におけるプログラム書換処理が完了すると(時刻t15を参照)、CPU31はRAMモードからROMモードに切り替わる。   Thereafter, when the program rewriting process in the CPU 21 is completed (see time t14), the CPU 21 switches from the RAM mode to the ROM mode. When the program rewriting process in the CPU 31 is completed (see time t15), the CPU 31 switches from the RAM mode to the ROM mode.

その後、キースイッチがオン状態からオフ状態に切り替わると(時刻t16を参照)、電子スロットル制御プログラムの実行と、電子スロットル制御プログラム以外の制御プログラムの実行が停止した後に、エンジンECU1をシャットダウンするための事前処理が実行される。そして、エンジンECU1がメインリレー76への駆動信号出力をオンからオフに変化させることで、エンジンECU1への電源供給が遮断され(時刻t17を参照)、エンジンECU1の機能が停止する。   Thereafter, when the key switch is switched from the on state to the off state (see time t16), the execution of the electronic throttle control program and the execution of the control program other than the electronic throttle control program are stopped, and then the engine ECU 1 is shut down. Pre-processing is executed. Then, when the engine ECU 1 changes the drive signal output to the main relay 76 from on to off, the power supply to the engine ECU 1 is interrupted (see time t17), and the function of the engine ECU 1 is stopped.

図12は、電子スロットル制御プログラムのプログラム書換と、電子スロットル制御プログラム以外の制御プログラムのプログラム書換を実行する場合の動作を示すタイミングチャートである。   FIG. 12 is a timing chart showing an operation in the case where the program rewriting of the electronic throttle control program and the program rewriting of a control program other than the electronic throttle control program are executed.

図12に示すように、キースイッチがオフ状態からオン状態に切り替わると、エンジンECU1に電源が供給され(時刻t21を参照)、メインコア11のCPU21とサブコア12のCPU31において、電子スロットル制御プログラムと、電子スロットル制御プログラム以外の制御プログラムが実行される。その後、エンジンECU1がプログラム変更ECU42からプログラム書換要求RRを受信する(時刻t22を参照)。このときに、車両は、エンジン稼動状態であり且つ車両走行状態であるため、プログラム書換は実行されない。   As shown in FIG. 12, when the key switch is switched from the off state to the on state, power is supplied to the engine ECU 1 (see time t21), and the electronic throttle control program is executed in the CPU 21 of the main core 11 and the CPU 31 of the sub core 12. A control program other than the electronic throttle control program is executed. Thereafter, engine ECU 1 receives program rewrite request RR from program change ECU 42 (see time t22). At this time, since the vehicle is in the engine running state and the vehicle running state, the program rewriting is not executed.

その後、車両がエンジン稼動状態であり且つ車両停止状態である状態になると(時刻t23を参照)、メインコア11のCPU21とサブコア12のCPU31において、電子スロットル制御プログラム以外の制御プログラムについてのプログラム書換処理が実行される(図12の書換処理RP11,RP12,RP13,RP14を参照)。なお、CPU21のプログラム書換処理とCPU31のプログラム書換処理は互いに同じタイミングで実行される必要はなく個別に実行される。また、電子スロットル制御プログラム以外の制御プログラムについてのプログラム書換処理の実行中であっても、CPU21,31のそれぞれにおいてエンジン制御が継続して実行される。   Thereafter, when the vehicle is in an engine operating state and a vehicle stopped state (see time t23), the program rewriting process for the control program other than the electronic throttle control program is performed in the CPU 21 of the main core 11 and the CPU 31 of the sub core 12. Is executed (see rewriting processes RP11, RP12, RP13, and RP14 in FIG. 12). The program rewriting process of the CPU 21 and the program rewriting process of the CPU 31 do not need to be executed at the same timing, but are executed individually. Further, even during execution of the program rewriting process for a control program other than the electronic throttle control program, the engine control is continuously executed in each of the CPUs 21 and 31.

その後、車両が車両走行状態になると(時刻t24を参照)、CPU21で実行中のプログラム書換処理とCPU31で実行中のプログラム書換処理が中断され、CPU21,31のそれぞれにおいてエンジン制御が継続して実行される。   Thereafter, when the vehicle enters the vehicle running state (see time t24), the program rewriting process being executed by the CPU 21 and the program rewriting process being executed by the CPU 31 are interrupted, and the engine control is continuously executed in each of the CPUs 21 and 31. Is done.

その後、再度、車両がエンジン稼動状態であり且つ車両停止状態である状態になると(時刻t25を参照)、CPU21,31において、電子スロットル制御プログラム以外の制御プログラムについてのプログラム書換処理の実行が再開される(図12の書換処理RP15,RP16,RP17,RP18を参照)。なお、プログラム書換処理を再開するときには、消去完了ブロック記憶領域と書込完了アドレス記憶領域に記憶されている情報に基づいて、プログラム書換処理が中断された記憶領域からデータ書込を実行する。   Thereafter, when the vehicle is in the engine operating state and the vehicle is in the stopped state again (see time t25), the CPU 21 and 31 resume execution of the program rewriting process for the control program other than the electronic throttle control program. (Refer to the rewrite processes RP15, RP16, RP17, and RP18 in FIG. 12). When the program rewriting process is resumed, data writing is executed from the storage area where the program rewriting process is interrupted based on the information stored in the erase completion block storage area and the write completion address storage area.

その後、CPU21におけるプログラム書換処理が完了する(時刻t26を参照)。さらに、CPU31におけるプログラム書換処理が完了する(時刻t27を参照)。なお、電子スロットル制御プログラムの書き換えが完了していないため、CPU21,31はRAMモードを継続する。   Thereafter, the program rewriting process in the CPU 21 is completed (see time t26). Further, the program rewriting process in the CPU 31 is completed (see time t27). Since rewriting of the electronic throttle control program has not been completed, the CPUs 21 and 31 continue the RAM mode.

その後、キースイッチがオン状態からオフ状態に切り替わると(時刻t28を参照)、電子スロットル制御プログラムの実行と、電子スロットル制御プログラム以外の制御プログラムの実行が停止する。そして、車両がエンジン停止状態であり且つ車両停止状態である状態になるため(時刻t28を参照)、メインコア11のCPU21とサブコア12のCPU31において、電子スロットル制御プログラムについてのプログラム書換処理が実行される(図12の書換処理RP19,RP20を参照)。電子スロットル制御プログラムの書き換え前後で、ROM22に記憶されている電子スロットル制御プログラムと、ROM32に記憶されている電子スロットル制御プログラムとが同じである必要があるため、メインコア11とサブコア12で一括して電子スロットル制御プログラムの書き換えが実行される。このため、電子スロットル制御プログラムについてのプログラム書換処理は、CPU21とCPU31との間で時間的な同期をとって実行される。   Thereafter, when the key switch is switched from the on state to the off state (see time t28), the execution of the electronic throttle control program and the execution of control programs other than the electronic throttle control program are stopped. Since the vehicle is in the engine stop state and the vehicle stop state (see time t28), the program rewriting process for the electronic throttle control program is executed in the CPU 21 of the main core 11 and the CPU 31 of the sub core 12. (Refer to the rewriting processes RP19 and RP20 in FIG. 12). Before and after rewriting the electronic throttle control program, the electronic throttle control program stored in the ROM 22 and the electronic throttle control program stored in the ROM 32 need to be the same. Thus, the electronic throttle control program is rewritten. For this reason, the program rewriting process for the electronic throttle control program is executed in time synchronization between the CPU 21 and the CPU 31.

そして、電子スロットル制御プログラムについてのプログラム書換処理が完了すると(時刻t29を参照)、CPU21,31はRAMモードからROMモードに切り替わる。また、この時点で既にキースイッチがオフ状態であるため、エンジンECU1をシャットダウンするための事前処理が実行される。そして、エンジンECU1がメインリレー76への駆動信号出力をオンからオフに変化させることで、エンジンECU1への電源供給が遮断され(時刻t30を参照)、エンジンECU1の機能が停止する。   When the program rewriting process for the electronic throttle control program is completed (see time t29), the CPUs 21 and 31 are switched from the RAM mode to the ROM mode. Further, since the key switch is already in the OFF state at this time, a pre-process for shutting down engine ECU 1 is executed. Then, when the engine ECU 1 changes the drive signal output to the main relay 76 from on to off, the power supply to the engine ECU 1 is interrupted (see time t30), and the function of the engine ECU 1 is stopped.

そして、これ以降にキースイッチがオフ状態からオン状態に切り替わると、CPU21,31はそれぞれ、ROM22,32から制御プログラムを読み出すことにより処理を実行する。   Thereafter, when the key switch is switched from the off state to the on state, the CPUs 21 and 31 execute processing by reading the control programs from the ROMs 22 and 32, respectively.

このように構成されたエンジンECU1では、ROM22に、電子スロットル制御プログラムと、インジェクタ制御プログラム、点火プラグ制御プログラムおよびEGRバルブ制御プログラムとが記憶される。またROM32に、電子スロットル制御プログラムと、電動ファン制御プログラムおよびメインリレー制御プログラムとが記憶される。   In the engine ECU 1 configured as described above, the ROM 22 stores an electronic throttle control program, an injector control program, a spark plug control program, and an EGR valve control program. The ROM 32 stores an electronic throttle control program, an electric fan control program, and a main relay control program.

さらにエンジンECU1では、まずメインコア11が、ROM22に記憶された電子スロットル制御プログラム、インジェクタ制御プログラム、点火プラグ制御プログラムおよびEGRバルブ制御プログラムに従って処理を行う(S20,S500,S1010)。またサブコア12が、ROM32に記憶された電子スロットル制御プログラム、電動ファン制御プログラムおよびメインリレー制御プログラムに従って処理を行う(S20,S500,S1010)。そして、電子スロットル制御プログラムのプログラム書換要求を受信した場合において(S30:YES)、さらに、エンジン停止状態であり且つ車両停止状態であるときに(S150:YES)、ROM22に記憶されている電子スロットル制御プログラムと、ROM32に記憶されている電子スロットル制御プログラムを書き換える(S420)。また、メインコア11における電子スロットル制御プログラム以外の制御プログラムについてのプログラム書換要求を受信した場合において(S60:YES)、さらに、エンジン停止状態であり且つ車両停止状態であるとき(S150:YES)、またはアイドル運転状態であり且つ車両停止状態であるときに(S170:YES)、プログラム書換要求のあった制御プログラムを書き換える(S450)。また、サブコア12における電子スロットル制御プログラム以外の制御プログラムについてのプログラム書換要求を受信した場合において(S90:YES)、さらに、エンジン停止状態であり且つ車両停止状態であるとき(S150:YES)、またはアイドル運転状態であり且つ車両停止状態であるときに(S170:YES)、プログラム書換要求のあった制御プログラムを書き換える(S480)。   Further, in the engine ECU 1, first, the main core 11 performs processing according to the electronic throttle control program, injector control program, spark plug control program, and EGR valve control program stored in the ROM 22 (S20, S500, S1010). The sub-core 12 performs processing according to the electronic throttle control program, the electric fan control program, and the main relay control program stored in the ROM 32 (S20, S500, S1010). When a request for rewriting the electronic throttle control program is received (S30: YES), and when the engine is stopped and the vehicle is stopped (S150: YES), the electronic throttle stored in the ROM 22 is stored. The control program and the electronic throttle control program stored in the ROM 32 are rewritten (S420). Further, when a program rewrite request for a control program other than the electronic throttle control program in the main core 11 is received (S60: YES), and when the engine is stopped and the vehicle is stopped (S150: YES), Alternatively, when the vehicle is in the idle operation state and the vehicle is in a stopped state (S170: YES), the control program for which a program rewrite request has been made is rewritten (S450). Further, when a program rewrite request for a control program other than the electronic throttle control program in the sub-core 12 is received (S90: YES), and when the engine is stopped and the vehicle is stopped (S150: YES), or When the vehicle is in the idle operation state and the vehicle is stopped (S170: YES), the control program for which the program rewrite request has been made is rewritten (S480).

このように、ROM22とROM32に記憶された電子スロットル制御プログラムの書き換えは、エンジンが停止しており且つ車両が停止しているときに実行される。このため、電子スロットル制御プログラムの書き換えが実行されている最中に電源遮断等により電子スロットル制御プログラムの書き換えが中断し、これにより、ROM22に記憶されている電子スロットル制御プログラムの内容と、ROM32に記憶されている電子スロットル制御プログラムの内容とが相違してしまうという事態が発生したとしても、このときにはエンジンが停止しているため、メインコア11およびサブコア12は電子スロットル制御プログラムに従った処理を行っていない。したがって、電子スロットル制御プログラムの書き換えの中断により、メインコア11が電子スロットル制御プログラムに従って行う処理の内容と、サブコア12が電子スロットル制御プログラムに従って行う処理の内容とが相違してしまうことに起因してエンジンの動作に異常が発生するという事態の発生を回避することができる。   As described above, the rewriting of the electronic throttle control program stored in the ROM 22 and the ROM 32 is executed when the engine is stopped and the vehicle is stopped. For this reason, during rewriting of the electronic throttle control program, rewriting of the electronic throttle control program is interrupted due to power interruption or the like, whereby the contents of the electronic throttle control program stored in the ROM 22 and the ROM 32 are stored. Even if the situation of the stored electronic throttle control program is different, since the engine is stopped at this time, the main core 11 and the sub-core 12 perform processing according to the electronic throttle control program. not going. Therefore, due to interruption of rewriting of the electronic throttle control program, the content of processing performed by the main core 11 according to the electronic throttle control program and the content of processing performed by the sub-core 12 according to the electronic throttle control program are different. It is possible to avoid a situation in which an abnormality occurs in the operation of the engine.

またエンジンECU1では、ROM22に記憶されたインジェクタ制御プログラム、点火プラグ制御プログラムおよびEGRバルブ制御プログラム(以下、メイン側非ロックステップ対応プログラムともいう)の書き換えと、ROM32に記憶された電動ファン制御プログラムおよびメインリレー制御プログラム(以下、サブ側非ロックステップ対応プログラムともいう)の書き換えは、エンジンが停止しており且つ車両が停止しているときだけではなく、エンジンが稼動しており且つ車両が停止しているときも実行される。このため、メイン側非ロックステップ対応プログラムとサブ側非ロックステップ対応プログラムを書き換えるために、車両を停止させ更にエンジンを停止させておく時間を短縮することができ、車両利用者の利便性を向上させることができる。   Further, the engine ECU 1 rewrites the injector control program, spark plug control program, and EGR valve control program (hereinafter also referred to as a main-side non-locking step correspondence program) stored in the ROM 22, the electric fan control program stored in the ROM 32, and Rewriting of the main relay control program (hereinafter also referred to as a sub-side non-locking step compatible program) is not only performed when the engine is stopped and the vehicle is stopped, but also when the engine is operating and the vehicle is stopped. It is also executed when For this reason, it is possible to shorten the time for stopping the vehicle and further stopping the engine in order to rewrite the main-side non-lock step corresponding program and the sub-side non-lock step corresponding program, improving the convenience for the vehicle user. Can be made.

例えば、エンジンが停止しており且つ車両が停止している状態でメイン側非ロックステップ対応プログラムおよびサブ側非ロックステップ対応プログラムの少なくとも一方の書き換えが行われている最中にキースイッチがオフ状態からオン状態に切り替わった場合に、エンジンを始動させることができる。また例えば、電子スロットル制御プログラムと非ロックステップ対応プログラムの両方を書き換える場合には、エンジンを停止させる前に非ロックステップ対応プログラムの書き換えを行うことができる。このため、エンジンを停止させた後に電子スロットル制御プログラムと非ロックステップ対応プログラムの両方を書き換える場合と比較して、制御プログラムを書き換えるためにエンジンを停止させておく時間を短縮することができる。   For example, when the engine is stopped and the vehicle is stopped, the key switch is turned off while at least one of the main-side non-lock step corresponding program and the sub-side non-lock step corresponding program is being rewritten. The engine can be started when the engine is switched from on to off. For example, when both the electronic throttle control program and the non-lock step corresponding program are rewritten, the non-lock step corresponding program can be rewritten before the engine is stopped. For this reason, compared with the case where both the electronic throttle control program and the non-lock step corresponding program are rewritten after the engine is stopped, the time for which the engine is stopped to rewrite the control program can be shortened.

以上、エンジンECU1によれば、メインコア11およびサブコア12の両方で実行される処理、すなわち重要度が高い処理に関しては、制御プログラムの書き換えによりエンジンの動作に異常が発生するという事態の発生を回避することができるとともに、メインコア11およびサブコア12の何れか一方で実行される処理、すなわち比較的重要度が低い処理に関しては、エンジンが稼動しており且つ車両が停止しているときにも制御プログラムの書き換えを可能とすることで、車両利用者の利便性を向上させることができる。   As described above, according to the engine ECU 1, with respect to processing executed by both the main core 11 and the sub-core 12, that is, processing with high importance, the occurrence of a situation in which an abnormality occurs in engine operation due to rewriting of the control program is avoided. In addition, the process executed by one of the main core 11 and the sub-core 12, that is, the process of relatively low importance, is controlled even when the engine is running and the vehicle is stopped. The convenience of the vehicle user can be improved by enabling the rewriting of the program.

またエンジンECU1では、ROM22に記憶されている電子スロットル制御プログラムと、ROM22に記憶されているメイン側非ロックステップ対応プログラムをRAM23に格納するとともに、ROM32に記憶されている電子スロットル制御プログラムと、ROM32に記憶されているサブ側非ロックステップ対応プログラムをRAM33に格納する(S290)。そしてメインコア11は、少なくとも、電子スロットル制御プログラムの書き換え、またはメイン側非ロックステップ対応プログラムの書き換えを実行している場合において、RAM23に格納されている電子スロットル制御プログラムおよびメイン側非ロックステップ対応プログラムを読み出すことにより、電子スロットル制御プログラムおよびメイン側非ロックステップ対応プログラムに従って処理を行う。またサブコア12は、少なくとも、電子スロットル制御プログラムの書き換え、またはサブ側非ロックステップ対応プログラムの書き換えを実行している場合において、RAM33に格納されている電子スロットル制御プログラムおよびサブ側非ロックステップ対応プログラムを読み出すことにより、電子スロットル制御プログラムおよびサブ側非ロックステップ対応プログラムに従って処理を行う。   In the engine ECU 1, the electronic throttle control program stored in the ROM 22 and the main-side non-locking step corresponding program stored in the ROM 22 are stored in the RAM 23, the electronic throttle control program stored in the ROM 32, and the ROM 32. Is stored in the RAM 33 (S290). The main core 11 is compatible with the electronic throttle control program stored in the RAM 23 and the main non-locking step when at least rewriting the electronic throttle control program or rewriting the main non-locking step compatible program. By reading the program, processing is performed in accordance with the electronic throttle control program and the main-side non-lock step correspondence program. In addition, the sub-core 12 at least performs rewriting of the electronic throttle control program or rewriting of the sub-side non-locking step compatible program, and the electronic throttle control program and the sub-side non-locking step corresponding program stored in the RAM 33. Is read out in accordance with the electronic throttle control program and the sub-side non-lock step corresponding program.

これによりエンジンECU1は、エンジンを制御する処理の実行を継続しながら、電子スロットル制御プログラム、メイン側非ロックステップ対応プログラムおよびサブ側非ロックステップ対応プログラムの書き換えを行うことができる。   Thus, the engine ECU 1 can rewrite the electronic throttle control program, the main-side non-lock step corresponding program, and the sub-side non-lock step corresponding program while continuing to execute the process for controlling the engine.

またエンジンECU1は、電子スロットル制御プログラムの書き換えとメイン側非ロックステップ対応プログラムの書き換えの実行の両方が可能である場合に、メイン側非ロックステップ対応プログラムの書き換えよりも電子スロットル制御プログラムの書き換えを優先させる(S410,S440)とともに、電子スロットル制御プログラムの書き換えとサブ側非ロックステップ対応プログラムの書き換えの実行の両方が可能である場合に、サブ側非ロックステップ対応プログラムの書き換えよりも電子スロットル制御プログラムの書き換えを優先させる(S410,S470)。   The engine ECU 1 also rewrites the electronic throttle control program rather than the main side non-lock step corresponding program when both the electronic throttle control program and the main side non-lock step corresponding program can be rewritten. In addition to giving priority (S410, S440), when both the rewriting of the electronic throttle control program and the rewriting of the sub-side non-locking step compatible program are possible, the electronic throttle control is performed rather than the rewriting of the sub-side non-locking step compatible program. Prioritizing program rewriting (S410, S470).

これにより、エンジン停止状態であり且つ車両停止状態である場合に許可される電子スロットル制御プログラムの書き換えが、エンジン停止状態であり且つ車両停止状態である場合に実行されないという事態の発生を抑制することができる。一方、非ロックステップ対応プログラムの書き換えは、エンジンが稼動しており且つ車両が停止しているときにも実行される。このため、電子スロットル制御プログラムと非ロックステップ対応プログラムの両方を書き換える場合において、両方のプログラムの書き換えが完了するまでの時間を可能な限り短縮することができる。したがって、更新された制御プログラムを可能な限り早い時点で利用可能とすることができ、車両利用者の利便性を向上させることができる。   This suppresses the occurrence of a situation in which rewriting of the electronic throttle control program permitted when the engine is stopped and the vehicle is stopped is not executed when the engine is stopped and the vehicle is stopped. Can do. On the other hand, the rewriting of the program corresponding to the non-lock step is executed also when the engine is running and the vehicle is stopped. For this reason, when both the electronic throttle control program and the non-lock step corresponding program are rewritten, it is possible to shorten the time required to complete the rewriting of both programs as much as possible. Therefore, the updated control program can be used at the earliest possible time, and convenience for the vehicle user can be improved.

またエンジンECU1は、エンジンが稼動しており且つエンジンがアイドル状態ではない場合に(S140:NO,S170:NO)、メイン側非ロックステップ対応プログラムおよびサブ側非ロックステップ対応プログラムの書き換えを禁止する。   Further, when the engine is operating and the engine is not in an idle state (S140: NO, S170: NO), the engine ECU 1 prohibits rewriting of the main-side non-lock step corresponding program and the sub-side non-lock step corresponding program. .

これにより、エンジン回転数が高い場合、すなわちエンジンECU1の処理負荷が高い場合に、制御プログラムの書き換えが更に実行されるという事態が発生するのを回避することが可能となり、エンジンECU1の処理負荷の増加を抑制することができる。   As a result, when the engine speed is high, that is, when the processing load of the engine ECU 1 is high, it is possible to avoid a situation in which the rewriting of the control program is further performed, and the processing load of the engine ECU 1 is reduced. Increase can be suppressed.

またエンジンECU1は、RAM23,33が故障しているか否かを判断し(S120)、RAM23,33が故障している場合に(S130:YES)、電子スロットル制御プログラム、メイン側非ロックステップ対応プログラムおよびサブ側非ロックステップ対応プログラムの書き換えを禁止する。これにより、エンジンを制御する処理の実行を継続しながら制御プログラムの書き換えを行う場合に、エンジン制御の信頼性を向上させることができる。   Further, the engine ECU 1 determines whether or not the RAMs 23 and 33 are malfunctioning (S120). If the RAMs 23 and 33 are malfunctioning (S130: YES), the electronic throttle control program, the main-side non-locking step correspondence program In addition, rewriting of the program corresponding to the sub-side non-locking step is prohibited. As a result, when the control program is rewritten while the process for controlling the engine is continued, the reliability of the engine control can be improved.

またエンジンECU1は、電子スロットル制御プログラムをメインコア11とサブコア12の両方で実行する。これにより、エンジン動作への影響が大きい電子スロットル制御の信頼性を向上させることができる。   The engine ECU 1 executes an electronic throttle control program on both the main core 11 and the sub core 12. Thereby, the reliability of the electronic throttle control that has a great influence on the engine operation can be improved.

以上説明した実施形態において、エンジンECU1は本発明における電子制御装置、ROM22は本発明における第1記憶部、ROM32は本発明における第2記憶部、CPU21およびS20,S500,S1010の処理は本発明における第1処理実行手段、CPU31およびS20,S500,S1010の処理は本発明における第2処理実行手段、S420の処理は本発明における第1書換手段、S450の処理は本発明における第2書換手段、S480の処理は本発明における第3書換手段、電子スロットル制御プログラムは本発明における第1制御プログラム、メイン側非ロックステップ対応プログラムは本発明における第2制御プログラム、サブ側非ロックステップ対応プログラムは本発明における第3制御プログラムである。   In the embodiment described above, the engine ECU 1 is the electronic control device in the present invention, the ROM 22 is the first storage unit in the present invention, the ROM 32 is the second storage unit in the present invention, and the processes of the CPU 21 and S20, S500, S1010 are in the present invention. The first process execution means, the CPU 31 and the processes of S20, S500, S1010 are the second process execution means in the present invention, the process of S420 is the first rewrite means in the present invention, the process of S450 is the second rewrite means in the present invention, S480. Is the third rewriting means in the present invention, the electronic throttle control program is the first control program in the present invention, the main side unlock step corresponding program is the second control program in the present invention, and the sub side unlock step corresponding program is in the present invention. Is the third control program in

また、RAM23,33は本発明におけるメモリ、S290の処理は本発明における格納手段、S410,S440,S470の処理は本発明における優先手段、S170の処理は本発明における第1禁止手段、S120の処理は本発明における故障判断手段、S130の処理は本発明における第2禁止手段である。   The RAMs 23 and 33 are memories in the present invention, the process in S290 is storage means in the present invention, the processes in S410, S440, and S470 are priority means in the present invention, the process in S170 is the first prohibition means in the present invention, and the process in S120. Is the failure determination means in the present invention, and the processing of S130 is the second prohibition means in the present invention.

以上、本発明の一実施形態について説明したが、本発明は上記実施形態に限定されるものではなく、本発明の技術的範囲に属する限り種々の形態を採ることができる。
例えば上記実施形態では、2つのコア11,12の両方で電子スロットル制御プログラムを実行するものを示したが、3つ以上のコアで電子スロットル制御プログラムを実行するようにしてもよい。
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-described embodiment, the electronic throttle control program is executed by both the two cores 11 and 12, but the electronic throttle control program may be executed by three or more cores.

また上記実施形態では、ROM22,32にそれぞれ制御プログラムを記憶するものを示したが、コア11,12が実行する制御プログラムを1つのROMに記憶するようにしてもよい。   In the above embodiment, the control programs are stored in the ROMs 22 and 32, respectively. However, the control programs executed by the cores 11 and 12 may be stored in one ROM.

また上記実施形態では、ロックステップ対応プログラムが電子スロットル制御プログラムであるものを示したが、ロックステップ対応プログラムが電子スロットル制御プログラム以外の制御プログラムであるようにしてもよい。   In the above-described embodiment, the lock step corresponding program is an electronic throttle control program. However, the lock step corresponding program may be a control program other than the electronic throttle control program.

1…エンジンECU、11…メインコア、12…サブコア、21…CPU、22…ROM、31…CPU、32…ROM
DESCRIPTION OF SYMBOLS 1 ... Engine ECU, 11 ... Main core, 12 ... Sub core, 21 ... CPU, 22 ... ROM, 31 ... CPU, 32 ... ROM

Claims (6)

車両のエンジンを制御する電子制御装置(1)であって、
前記エンジンを制御するために設けられた第1制御プログラムと、前記エンジンを制御するために設けられ前記第1制御プログラムとは異なる第2制御プログラムとを記憶する第1記憶部(22)と、
前記第1制御プログラムと、前記エンジンを制御するために設けられ前記第1制御プログラムおよび前記第2制御プログラムとは異なる第3制御プログラムとを記憶する第2記憶部(32)と、
前記第1記憶部に記憶された前記第1制御プログラムおよび前記第2制御プログラムに従って処理を行う第1処理実行手段(21,S20,S500,S1010)と、
前記第2記憶部に記憶された前記第1制御プログラムおよび前記第3制御プログラムに従って処理を行う第2処理実行手段(31,S20,S500,S1010)と、
前記第1制御プログラムの書き換えを要求する第1書換要求を取得した場合において、さらに、前記エンジンが停止しており且つ前記車両が停止しているときに、前記第1記憶部に記憶されている前記第1制御プログラムと、前記第2記憶部に記憶されている前記第1制御プログラムを書き換える第1書換手段(S420)と、
前記第2制御プログラムの書き換えを要求する第2書換要求を取得した場合において、さらに、前記エンジンが停止しており且つ前記車両が停止しているとき、または前記エンジンが稼動しており且つ前記車両が停止しているときに、前記第1記憶部に記憶されている前記第2制御プログラムを書き換える第2書換手段(S450)と、
前記第3制御プログラムの書き換えを要求する第3書換要求を取得した場合において、さらに、前記エンジンが停止しており且つ前記車両が停止しているとき、または前記エンジンが稼動しており且つ前記車両が停止しているときに、前記第2記憶部に記憶されている前記第3制御プログラムを書き換える第3書換手段(S480)とを備える
ことを特徴とする電子制御装置。
An electronic control device (1) for controlling a vehicle engine,
A first storage unit (22) for storing a first control program provided for controlling the engine and a second control program provided for controlling the engine and different from the first control program;
A second storage unit (32) for storing the first control program and a third control program provided to control the engine and different from the first control program and the second control program;
First processing execution means (21, S20, S500, S1010) for performing processing according to the first control program and the second control program stored in the first storage unit;
Second process execution means (31, S20, S500, S1010) for performing processing according to the first control program and the third control program stored in the second storage unit;
When the first rewriting request for requesting rewriting of the first control program is acquired, the first storage unit stores the information when the engine is stopped and the vehicle is stopped. A first rewriting means (S420) for rewriting the first control program and the first control program stored in the second storage unit;
In the case where a second rewriting request for requesting rewriting of the second control program is acquired, the engine is stopped and the vehicle is stopped, or the engine is operating and the vehicle Is rewritten, the second rewriting means (S450) for rewriting the second control program stored in the first storage unit,
When the third rewriting request for requesting rewriting of the third control program is acquired, the engine is stopped and the vehicle is stopped, or the engine is operating and the vehicle is stopped. An electronic control device comprising: third rewriting means (S480) for rewriting the third control program stored in the second storage unit when the computer is stopped.
書き換えが可能なメモリ(23,33)と、
前記第1記憶部に記憶されている前記第1制御プログラム、前記第1記憶部に記憶されている前記第2制御プログラム、前記第2記憶部に記憶されている前記第1制御プログラム、および前記第2記憶部に記憶されている前記第3制御プログラムを前記メモリに格納する格納手段(S290)とを備え、
前記第1処理実行手段は、少なくとも、前記第1書換手段または前記第2書換手段が書き換えを実行している場合において、前記メモリに格納されている前記第1制御プログラムおよび前記第2制御プログラムを読み出すことにより、前記第1制御プログラムおよび前記第2制御プログラムに従って処理を行い、
前記第2処理実行手段は、少なくとも、前記第1書換手段または前記第3書換手段が書き換えを実行している場合において、前記メモリに格納されている前記第1制御プログラムおよび前記第3制御プログラムを読み出すことにより、前記第1制御プログラムおよび前記第3制御プログラムに従って処理を行う
ことを特徴とする請求項1に記載の電子制御装置。
Rewritable memory (23, 33);
The first control program stored in the first storage unit, the second control program stored in the first storage unit, the first control program stored in the second storage unit, and the Storage means (S290) for storing the third control program stored in the second storage unit in the memory;
The first process execution means executes at least the first control program and the second control program stored in the memory when the first rewrite means or the second rewrite means is executing rewrite. By reading, processing is performed according to the first control program and the second control program,
The second process execution means executes at least the first control program and the third control program stored in the memory when the first rewrite means or the third rewrite means is executing rewrite. The electronic control device according to claim 1, wherein the electronic control device performs processing according to the first control program and the third control program by reading.
前記第1書換手段の実行と前記第2書換手段の実行の両方が可能である場合に、前記第2書換手段の実行よりも前記第1書換手段の実行を優先させるとともに、前記第1書換手段の実行と前記第3書換手段の実行の両方が可能である場合に、前記第3書換手段の実行よりも前記第1書換手段の実行を優先させる優先手段(S410,S440,S470)を備える
ことを特徴とする請求項1または請求項2に記載の電子制御装置。
When both the execution of the first rewriting means and the execution of the second rewriting means are possible, the execution of the first rewriting means is prioritized over the execution of the second rewriting means, and the first rewriting means And priority means (S410, S440, S470) that prioritizes execution of the first rewriting means over execution of the third rewriting means when both execution of the first rewriting means and execution of the third rewriting means are possible. The electronic control device according to claim 1 or 2, wherein
前記エンジンが稼動しており且つ前記エンジンがアイドル状態ではない場合に、前記第2書換手段および前記第3書換手段の実行を禁止する第1禁止手段(S170)を備える
ことを特徴とする請求項1〜請求項3の何れか1項に記載の電子制御装置。
The first prohibiting means (S170) for prohibiting execution of the second rewriting means and the third rewriting means when the engine is operating and the engine is not in an idle state. The electronic control device according to any one of claims 1 to 3.
前記メモリが故障しているか否かを判断する故障判断手段(S120)と、
前記メモリが故障していると前記故障判断手段が判断した場合に、前記第1書換手段、前記第2書換手段および前記第3書換手段の実行を禁止する第2禁止手段(S130)とを備える
ことを特徴とする請求項2に記載の電子制御装置。
Failure determination means (S120) for determining whether or not the memory has failed;
And a second prohibiting unit (S130) for prohibiting execution of the first rewriting unit, the second rewriting unit, and the third rewriting unit when the failure determining unit determines that the memory is faulty. The electronic control device according to claim 2.
前記第1制御プログラムは、前記エンジンに設けられた電子スロットルを制御するためのプログラムである
ことを特徴とする請求項1〜請求項5の何れか1項に記載の電子制御装置。
The electronic control device according to any one of claims 1 to 5, wherein the first control program is a program for controlling an electronic throttle provided in the engine.
JP2013118053A 2013-06-04 2013-06-04 Electronic control unit Active JP5954261B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013118053A JP5954261B2 (en) 2013-06-04 2013-06-04 Electronic control unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013118053A JP5954261B2 (en) 2013-06-04 2013-06-04 Electronic control unit

Publications (2)

Publication Number Publication Date
JP2014235652A JP2014235652A (en) 2014-12-15
JP5954261B2 true JP5954261B2 (en) 2016-07-20

Family

ID=52138288

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013118053A Active JP5954261B2 (en) 2013-06-04 2013-06-04 Electronic control unit

Country Status (1)

Country Link
JP (1) JP5954261B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6573819B2 (en) * 2015-01-20 2019-09-11 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America Fraud detection rule update method, fraud detection electronic control unit and in-vehicle network system
KR102013050B1 (en) * 2015-01-23 2019-10-21 코벨코 겐키 가부시키가이샤 Control means, a rewriting device of the on-board program having the same, and a rewriting method of the on-board program
JP6418081B2 (en) * 2015-06-29 2018-11-07 コベルコ建機株式会社 Construction machine and program rewriting system provided with the same
DE102017210151A1 (en) * 2017-06-19 2018-12-20 Zf Friedrichshafen Ag Device and method for controlling a vehicle module in response to a state signal

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4578289B2 (en) * 2005-03-15 2010-11-10 富士通テン株式会社 Machine control device, maintenance control system, and maintenance control method
JP2006323776A (en) * 2005-05-20 2006-11-30 Denso Corp Information processor
JP2010198307A (en) * 2009-02-25 2010-09-09 Hitachi Automotive Systems Ltd Controller for automobile

Also Published As

Publication number Publication date
JP2014235652A (en) 2014-12-15

Similar Documents

Publication Publication Date Title
JP5954261B2 (en) Electronic control unit
US8656216B2 (en) Failure diagnostic system, electronic control unit for vehicle, failure diagnostic method
JP6011379B2 (en) Tamper detection system, electronic control unit
JP2013254264A (en) Electronic control unit
JP2007126024A (en) Vehicular electronic control device
JP2010198307A (en) Controller for automobile
US11709697B2 (en) Vehicle control device, vehicle control method, and recording medium storing vehicle control program
JP2012102664A (en) Vehicle control device
JP2012224315A (en) In-vehicle electronic control device, diagnostic tool and diagnostic system
JP5533789B2 (en) In-vehicle electronic control unit
US20220222062A1 (en) Information processing apparatus, control system, system, information processing method, control method and computer-readable storage medium
JP2016188016A (en) Program rewriting device and program rewriting method
WO2022004324A1 (en) Vehicle control device
JP2007062632A (en) Electronic control unit and storing method of data for abnormality generated time storage
JP2013254263A (en) Electronic control device
WO2021103966A1 (en) Vehicle start/stop control method and apparatus, vehicle, and electronic device
US11157004B2 (en) Real-time control system for a vehicle and a method of executing control of the vehicle via the real-time control system
US20220291919A1 (en) Communication apparatus, movable object, control system, server, communication control method
WO2023166759A1 (en) Update management system
US20220300274A1 (en) Program update control apparatus, program update control method, and computer-readable storage medium
US20220222057A1 (en) Control system, movable object, control method, and computer readable storage medium
US20220107678A1 (en) Vehicular apparatus
US20220269525A1 (en) Method for operating a microcontroller
US20230150503A1 (en) Apparatus, method and computer readable storage medium for preventing rolling of vehicle operating in auto vehicle hold mode
JP7134040B2 (en) Driving control device for hybrid vehicle

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150818

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160412

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160530

R151 Written notification of patent or utility model registration

Ref document number: 5954261

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