JP3568704B2 - Electronic control device, memory rewriting device, and memory rewriting system for electronic control device - Google Patents

Electronic control device, memory rewriting device, and memory rewriting system for electronic control device Download PDF

Info

Publication number
JP3568704B2
JP3568704B2 JP25459296A JP25459296A JP3568704B2 JP 3568704 B2 JP3568704 B2 JP 3568704B2 JP 25459296 A JP25459296 A JP 25459296A JP 25459296 A JP25459296 A JP 25459296A JP 3568704 B2 JP3568704 B2 JP 3568704B2
Authority
JP
Japan
Prior art keywords
identification information
electronic control
rewriting
control program
memory
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.)
Expired - Lifetime
Application number
JP25459296A
Other languages
Japanese (ja)
Other versions
JPH10105468A (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 JP25459296A priority Critical patent/JP3568704B2/en
Priority to US08/934,220 priority patent/US6275911B1/en
Priority to KR1019970047921A priority patent/KR100258147B1/en
Publication of JPH10105468A publication Critical patent/JPH10105468A/en
Priority to US09/625,402 priority patent/US6249848B1/en
Priority to US09/625,403 priority patent/US6477626B1/en
Priority to US09/843,821 priority patent/US6505280B2/en
Priority to US10/062,541 priority patent/US6957296B2/en
Priority to US10/270,578 priority patent/US20030041217A1/en
Application granted granted Critical
Publication of JP3568704B2 publication Critical patent/JP3568704B2/en
Priority to US11/217,385 priority patent/US7493455B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、電気的にデータの書き換えが可能な不揮発性メモリに格納された制御プログラムや制御データを、該不揮発性メモリを電子制御装置に搭載した状態で書き換える技術に関する。
【0002】
【従来の技術】
従来より、例えば自動車のエンジンを制御する電子制御装置として、電気的にデータの書き換え(詳しくはデータの消去及び書き込み)が可能な不揮発性メモリにエンジン制御用の制御プログラム及び制御データを格納しておき、このような制御プログラムや制御データを、市場への供給後でも書き換え可能に構成されたものが提案されている。
【0003】
即ち、この種の電子制御装置は、通常時には、不揮発性メモリに格納されたデータにより構成される制御プログラム及び制御データに従ってエンジン等の制御対象を制御するのであるが、別途用意されたメモリ書換装置が接続されて、そのメモリ書換装置から書き換え指令を受けると、不揮発性メモリに格納されている現在のデータを消去し、その消去した領域に上記メモリ書換装置から送信されて来る新たなデータ(新たな制御プログラム及び制御データ)を書き込む、といった書換処理を行うように構成されている。
【0004】
一方、このような電子制御装置に接続される上記メモリ書換装置は、書き換えるべき新たなデータを記憶する記憶媒体を備えており、作業者によって所定の操作が行われると、上記記憶媒体に記憶されている新たなデータを電子制御装置へ送信するように構成されている。
【0005】
そして、こうした電子制御装置とメモリ書換装置とからなる、電子制御装置のメモリ書換システムでは、電子制御装置の不揮発性メモリに格納される制御プログラムや制御データを、メモリ書換装置から電子制御装置へ送信する新たな制御プログラムや制御データに書き換えることができ、これによって、電子制御装置の動作内容(制御内容)を任意に変更することができる。
【0006】
【発明が解決しようとする課題】
ところが、例えば自動車においては、異なる車種間ではもちろんであるが、同一車種であっても、グレード(搭載装備)やエンジンの型式、或いは仕向地(輸出国)等の違いによって、電子制御装置が行うべき制御の内容は異なっている。換言するならば、電子制御装置の不揮発性メモリに格納すべき制御プログラムや制御データは、その電子制御装置が制御する制御対象毎に異なっている。
【0007】
よって、この種の電子制御装置のメモリ書換システムでは、作業者が、電子制御装置(詳しくは、その制御対象)に不適合な制御プログラム等を構成するデータがメモリ書換装置側の記憶媒体に記憶されていることを知らずに、メモリ書換装置から電子制御装置へ、その不適合なデータを送信させてしまう可能性がある。そして、このような作業ミスが発生すると、電子制御装置が制御対象を適切に制御することができなくなるという問題があった。
【0008】
しかも、従来の電子制御装置では、不揮発性メモリの内容を書き換える書換処理を行うために実行される書換制御プログラムが、書き換え対象でない不揮発性メモリ(マスクROM等)に予め内蔵されているため、通常時においてCPUが暴走し、上記書換制御プログラムが誤って起動されると、不揮発性メモリに格納されていた正規の制御プログラムや制御データが失われたり変化したりしてしまうという可能性があった。
【0009】
本発明は、このような問題に鑑みなされたものであり、不揮発性メモリに格納される制御プログラムや制御データが不適合なものに書き換えられてしまうことを確実に防止できる電子制御装置と、この電子制御装置の不揮発性メモリに格納される制御プログラムや制御データを書き換えるのに好適なメモリ書換装置及び電子制御装置のメモリ書換システムを提供することを目的としている。
【0010】
【課題を解決するための手段、及び発明の効果】
上記目的を達成するためになされた請求項1に記載の電子制御装置は、電気的にデータの書き換えが可能な不揮発性メモリを備えており、通常時には、その不揮発性メモリに格納されたデータにより構成される制御プログラム及び制御データに従って所定の制御対象を制御するのであるが、外部からの書き換え指令を受けた場合には、外部装置から送信されて来る書換制御プログラムを揮発性のメモリ領域に転送して該メモリ領域上で実行することにより、前記不揮発性メモリ内のデータを前記外部装置から送信されて来る新たなデータに書き換えるための書換処理を行う。尚、以下の説明において、書換制御プログラムを揮発性のメモリ領域に転送して該メモリ領域上で実行することを、書換制御プログラムを揮発性のメモリ領域に転送して起動する、という。
【0011】
そして、請求項1に記載の電子制御装置は、当該電子制御装置の識別情報を予め記憶する識別情報記憶手段と、判定手段と、転送許可手段とを備えており、判定手段は、外部からの前記書き換え指令を受けると、外部装置から前記書換制御プログラムが送信されて来る前に、前記外部装置との間で通信を行うことにより、前記外部装置側にて前記新たなデータ(即ち、不揮発性メモリに書き込むべき新たなデータ)と対応して予め記憶された情報であって当該新たなデータに適合する装置を示す識別情報と、識別情報記憶手段に記憶された識別情報とが一致しているか否かを判定し、転送許可手段が、上記判定手段により前記両識別情報が一致していると判定された場合にのみ、前記書換制御プログラムの前記メモリ領域への転送を許可する。また、前記識別情報は、当該電子制御装置が制御するエンジンの型式や仕様、或いは、当該電子制御装置が搭載される車種名や車のグレード名毎に設定されている。
【0012】
つまり、請求項1に記載の電子制御装置では、外部からの書き換え指令を受けると、まず、外部装置との間で通信を行うことにより、外部装置側にて新たなデータと対応して予め記憶された識別情報と、識別情報記憶手段に記憶された自己の識別情報とが一致しているか否かを判定し、その両識別情報が一致している場合にのみ、外部装置から送信されて来る書換制御プログラムを揮発性のメモリ領域に転送して起動するようにしている。そして、この書換制御プログラムを起動して実行することにより、不揮発性メモリ内のデータを外部装置から送信されて来る新たなデータに書き換える書換処理を行うようにしている。
【0013】
このような請求項1に記載の電子制御装置によれば、外部装置側にて、当該電子制御装置に適合しない制御プログラム及び制御データを構成する新たなデータが記憶されており、その不適合なデータが電子制御装置へ送信されそうな場合には、外部装置側の識別情報(即ち、外部装置側にて新たなデータと対応して予め記憶された情報であって当該新たなデータに適合する装置を示す識別情報)と、識別情報記憶手段に記憶された自己の識別情報とが一致しないため、当該電子制御装置は、書換制御プログラムを揮発性のメモリ領域へ転送しなくなる。
【0014】
従って、請求項1に記載の電子制御装置によれば、不揮発性メモリ内の制御プログラムや制御データが、その電子制御装置に適合しない制御プログラムや制御データに、誤って書き換えられてしまうことを確実に防止することができる。
しかも、請求項1に記載の電子制御装置では、外部装置から送信されて来る書換制御プログラムを揮発性のメモリ領域に転送して起動することにより、不揮発性メモリ内のデータを書き換える書換処理を行うように構成されているため、不揮発性メモリの内容を書き換える作業を終了した後に、当該電子制御装置の電源を一旦遮断すれば、揮発性のメモリ領域に転送された書換制御プログラムは消失する。
【0015】
よって、請求項1に記載の電子制御装置によれば、所定の制御対象を制御する通常時において、当該電子制御装置への電源供給を開始した後、万が一、プログラムを実行するCPUが暴走したとしても、書換処理を行うための書換制御プログラムは内蔵されていないため、不揮発性メモリに格納されている正規の制御プログラムや制御データが失われたり変化したりしてしまうことを確実に防止できる。
【0016】
尚、電気的にデータの書き換えが可能な不揮発性メモリとしては、フラッシュEEPROM(以下、フラッシュROMという)或いはEEPROMが一般的であるが、電気的に書き換え可能な他のROMでも良い。また、書換制御プログラムが転送される揮発性のメモリ領域としては、データの読み出し及び書き込みが可能なRAMを用いることができる。
【0017】
ところで、請求項1に記載の電子制御装置において、判定手段としては、請求項2に記載のように、外部装置から送信されて来る前記外部装置側の識別情報を受信し、その受信した識別情報と識別情報記憶手段に記憶された識別情報とを比較することにより、前記外部装置側の識別情報と識別情報記憶手段に記憶された識別情報とが一致しているか否かを判定するように構成することができる。
【0018】
そして、請求項2に記載のように構成した電子制御装置に接続される外部装置は、請求項3に記載のメモリ書換装置の如く構成すれば良い。
即ち、請求項3に記載のメモリ書換装置は、請求項2に記載の電子制御装置へ、前記書換制御プログラムと前記新たなデータとを送信するのであるが、前記新たなデータを、当該新たなデータに適合する装置を示す識別情報と対応させて予め記憶するデータ記憶手段を備えており、前記書換制御プログラムを送信する前に、前記新たなデータに対応する前記識別情報を前記電子制御装置へ送信する。
【0019】
そして更に、請求項4に記載された本発明のように、このような請求項3に記載のメモリ書換装置と、請求項2に記載の電子制御装置とから、電子制御装置に搭載された不揮発性メモリの内容を書き換えるための電子制御装置のメモリ書換システムを構成すれば、メモリ書換装置から電子制御装置へ、書換制御プログラムが送信される前に、新たなデータに適合する装置を示す識別情報が送信され、電子制御装置側では、メモリ書換装置からの識別情報と、識別情報記憶手段に記憶された自己の識別情報とが一致している場合にのみ、書換制御プログラムの揮発性のメモリ領域への転送が許可されることとなり、前述した請求項1に記載の電子制御装置による効果を確実に得ることができる。
【0020】
一方、請求項1に記載の電子制御装置において、判定手段としては、請求項5に記載のように、識別情報記憶手段に記憶されている識別情報を外部装置へ送信し、その後、外部装置側の識別情報と前記送信した識別情報とが一致しているか否かを表す応答信号を前記外部装置から受信することにより、前記外部装置側の識別情報と識別情報記憶手段に記憶された識別情報とが一致しているか否かを判定するように構成することができる。
【0021】
そして、請求項5に記載のように構成した電子制御装置に接続される外部装置は、請求項6に記載のメモリ書換装置の如く構成すれば良い。
即ち、請求項6に記載のメモリ書換装置は、請求項5に記載の電子制御装置へ、前記書換制御プログラムと前記新たなデータとを送信するのであるが、前記新たなデータを、当該新たなデータに適合する装置を示す識別情報と対応させて予め記憶するデータ記憶手段を備えており、前記電子制御装置からの識別情報が、前記新たなデータに対応する識別情報と一致しているか否かを判定して、前記両識別情報が一致している場合に、前記電子制御装置へ、当該メモリ書換装置側の識別情報と前記電子制御装置の識別情報記憶手段に記憶された識別情報とが一致していることを表す前記応答信号を送信し、その後、前記書換制御プログラムを送信する。
【0022】
そして更に、請求項7に記載された本発明のように、このような請求項6に記載のメモリ書換装置と、請求項5に記載の電子制御装置とから、電子制御装置に搭載された不揮発性メモリの内容を書き換えるための電子制御装置のメモリ書換システムを構成すれば、まず、電子制御装置からメモリ書換装置へ、識別情報記憶手段に記憶された識別情報が送信され、メモリ書換装置側にて、その電子制御装置からの識別情報と、新たなデータに対応する識別情報とが一致しているか否かが判定される。そして、両識別情報が一致している場合に、メモリ書換装置から電子制御装置へ、メモリ書換装置側の識別情報と電子制御装置の識別情報記憶手段に記憶された識別情報とが一致していることを表す応答信号が送信され、その後、書換制御プログラムが送信される。
【0023】
すると、電子制御装置側では、メモリ書換装置からの応答信号に応じて、メモリ書換装置側の識別情報と識別情報記憶手段に記憶された識別情報とが一致している場合にのみ(即ち、メモリ書換装置からの応答信号が、メモリ書換装置側の識別情報と電子制御装置の識別情報記憶手段に記憶された識別情報とが一致していることを表している場合にのみ)、書換制御プログラムの揮発性のメモリ領域への転送が許可されることとなり、前述した請求項1に記載の電子制御装置による効果を確実に得ることができる。
【0024】
但し、請求項2に記載の如く構成した電子制御装置、或いは請求項4に記載の電子制御装置のメモリ書換システムによれば、識別情報記憶手段に記憶された識別情報が、電子制御装置の外部に送信されることが無いため、電子制御装置側に記憶された識別情報を解読して不揮発性メモリに格納されたデータを故意に他のデータに書き換える、といった行為をより確実に防止することができ、このような点では、請求項5に記載の電子制御装置、或いは請求項7に記載の電子制御装置のメモリ書換システムよりも優れている。
【0025】
一方、請求項8に記載の電子制御装置は、請求項1に記載の電子制御装置と同様に、通常時には、電気的にデータの書き換えが可能な不揮発性メモリに格納されたデータにより構成される制御プログラム及び制御データに従って所定の制御対象を制御し、外部からの書き換え指令を受けた場合には、外部装置から送信されて来る書換制御プログラムを揮発性のメモリ領域に転送して起動することにより、前記不揮発性メモリ内のデータを前記外部装置から送信されて来る新たなデータに書き換えるための書換処理を行う。
【0026】
そして、請求項8に記載の電子制御装置は、当該電子制御装置の識別情報を予め記憶する識別情報記憶手段と、判定手段と、転送許可手段とを備えており、判定手段は、外部からの前記書き換え指令を受けると、外部装置から前記書換制御プログラムが送信されて来る前に、前記外部装置から送信されて来る識別情報を受信して、その受信した識別情報と、識別情報記憶手段に記憶された識別情報とが一致しているか否かを判定し、転送許可手段が、上記判定手段により前記両識別情報が一致していると判定された場合にのみ、前記書換制御プログラムの前記メモリ領域への転送を許可する。また、前記識別情報は、当該電子制御装置が制御するエンジンの型式や仕様、或いは、当該電子制御装置が搭載される車種名や車のグレード名毎に設定されている。
【0027】
このような請求項8に記載の電子制御装置によれば、外部装置から書換制御プログラムを送信する前に、当該電子制御装置の識別情報記憶手段に記憶された識別情報と同一の識別情報を外部装置から送信してやらなければ、書換制御プログラムの揮発性のメモリ領域への転送が許可されない。よって、不揮発性メモリ内のデータ(制御プログラム及び制御データ)を、不用意に書き換えてしまうことや、故意に他のデータに書き換えることを確実に防止することができる。
【0028】
また、請求項8に記載の電子制御装置によれば、請求項1に記載の電子制御装置と同様に、外部装置から送信されて来る書換制御プログラムを揮発性のメモリ領域に転送して起動することにより、不揮発性メモリ内のデータを書き換える書換処理を行うように構成されているため、通常時において、プログラムを実行するCPUが暴走したとしても、不揮発性メモリに格納されている正規の制御プログラムや制御データが失われたり変化したりしてしまうことを確実に防止できる。
【0029】
【発明の実施の形態】
以下、本発明が適用された実施例について図面を用いて説明する。尚、本発明の実施の形態は、下記の実施例に何ら限定されることなく、本発明の技術的範囲に属する限り、種々の形態を採り得ることは言うまでもない。
【0030】
[第1実施例]
まず、図1は、自動車に搭載されて内燃機関型エンジンの制御を行うエンジン制御装置(以下、ECUという)2と、ECU2に内蔵されたエンジン制御用のプログラムやデータを書き換える際、或いは新規に書き込む際にECU2に接続されるメモリ書換装置4とからなる、実施例の電子制御装置のメモリ書換システム5の全体構成を表すブロック図である。
【0031】
図1に示すように、ECU2は、エンジンの運転状態を検出する様々なセンサからの信号を入力して波形処理する入力回路6と、入力回路6からのセンサ信号に基づき、エンジンを制御するための様々な処理を実行するシングルチップマイクロコンピュータ(以下、マイコンという)8と、マイコン8からの制御信号に基づき、エンジンに取り付けられたインジェクタ(燃料噴射弁)やイグナイタ等のアクチュエータへ駆動信号を出力する出力回路10とを備えている。
【0032】
そして、マイコン8には、プログラムに従い動作する周知のCPU18と、CPU18を動作させるのに必要なプログラム及びデータを格納する不揮発性のROM20と、CPU18の演算結果等を一時格納するRAM22と、前記入力回路6等からの信号を受けると共に、出力回路10に制御信号を出力するためのI/O24と、メモリ書換装置4との間でデータ通信を行うための通信回路25とが備えられている。
【0033】
ここで、ROM20としては、電気的にデータの消去及び書き込みが可能なフラッシュROM(フラッシュEEPROM)20aと、データの書き換えが不能なマスクROM20bとを備えている。
そして、フラッシュROM20aには、ECU2の製造工程において当該マイコン8がECU2へ実装された後に、エンジン制御用の制御プログラム及び制御データが新規に書き込まれ、また、マスクROM20bには、リセット直後に実行されるブートプログラムと、当該マイコン8が搭載されるECU2の識別コード(以下、IDという)とが、当該マイコン8のECU2への実装前に予め格納されている。
【0034】
尚、上記IDは、ECU2が制御するエンジンの型式や仕様、或いは、ECU2が搭載される車種名や車のグレード名など毎に設定されている。また、マスクROM20bに代えて、フラッシュROM20aと同様に電気的にデータの消去及び書き込みが可能な不揮発性メモリを用いても、データの書き換えが禁止されていれば良い。
【0035】
このようなECU2において、マイコン8(CPU18)は、リセット直後に、マスクROM20b内のブートプログラムを起動し、メモリ書換装置4が接続されていない通常時には、そのブートプログラムにてフラッシュROM20a内のエンジン制御プログラム(エンジン制御用の制御プログラム)をコールして、エンジンの制御を行う。
【0036】
また、マイコン8は、ブートプログラムを起動した際に、後述するように書換モードであると判定すると、フラッシュROM20a内の制御プログラムをコールすることなく、そのままブートプログラムを実行する。そして、後述する所定条件が成立すると、メモリ書換装置4から送信されて来る書込制御プログラムを受信してRAM22に格納し、その書込制御プログラムをコールしてRAM22上で実行することにより、フラッシュROM20aに格納されている現在の制御プログラム及び制御データを、その後メモリ書換装置4から送信されて来る新たな制御プログラム及び制御データに書き換える書換処理を行う。
【0037】
尚、フラッシュROM20aにエンジン制御用の制御プログラム及び制御データが未だ書き込まれていないECU2の製造時においても、フラッシュROM20aにエンジン制御用の制御プログラム及び制御データが新規に書き込まれるだけで全く同様である。
【0038】
一方、メモリ書換装置4は、ECU2側のマイコン8にフラッシュROM20aの書き換えを行わせるための処理を実行するCPU,ROM,RAM等を内蔵したマイコン30と、このマイコン30からの指令に応じて、ECU2側のマイコン8へ、フラッシュROM20aのデータ書換時に必要な書換電圧(本実施例では12V)Vppを供給する電源回路32と、ECU2の動作モードを、エンジンの制御を行う通常モードからフラッシュROM20aのデータを書き換える(或いは新規に書き込む)書換モードに変更させるための書換スイッチSWとを備えている。
【0039】
そして更に、メモリ書換装置4は、ECU2へ送信する書換制御プログラム(詳しくは、書換制御プログラムを構成するプログラムコード)が格納された第1のROM34と、ECU2のフラッシュROM20aに書き込むために用意される新たな制御プログラム及び制御データが格納された第2のROM36とを備えている。尚、第1のROM34と第2のROM36は、夫々、周知のICソケット38,40によって、当該メモリ書換装置4に着脱可能に設けられている。
【0040】
また、上記第2のRAM36には、それに格納されたエンジン制御用の制御プログラム及び制御データに適合するECUのID、即ち、データ書き換え対象であるECUのIDが格納されている。
このようなメモリ書換装置4とECU2との接続は、図1に示す如く、メモリ書換装置4側の雌コネクタ42FとECU2に設けられた雄コネクタ42Mとを嵌合することにより行われる。
【0041】
即ち、上記両コネクタ42F,42Mが嵌合されると、通信線44を介して、メモリ書換装置4側のマイコン30とECU2側のマイコン8との間におけるシリアルデータ通信が可能となり、また、電源供給線46を介して、メモリ書換装置4側の電源回路32からECU2側のマイコン8へフラッシュROM20aのデータ書換時に必要な書換電圧Vppが供給される。そして更に、メモリ書換装置4側で書換スイッチSWを介して接地電位(0V)に接続される信号線48が、ECU2側で抵抗器Rにより5Vにプルアップされたモード判定用信号ラインLに接続され、これにより、メモリ書換装置4側で書換スイッチSWがONされると、ECU2側においては上記モード判定用信号ラインLがハイレベル(5V)からロウレベル(0V)に変化することとなる。そして、ECU2のマイコン8は、前述の如くブートプログラムを起動した際に、モード判定用信号ラインLがロウレベルであれば、書換モードと判定する。
【0042】
次に、ECU2のマイコン8で実行される処理と、メモリ書換装置4のマイコン30で実行される処理について、図2及び図3を用いて説明する。
尚、図2は、ECU2のマイコン8で実行される処理を表すフローチャートであり、そのステップ(以下、単に「S」と記す)100〜S170の処理が、マスクROM20b内のブートプログラムによって実行され、S200の処理が、フラッシュROM20a内のエンジン制御プログラムによって実行される。そして、S300の処理が、メモリ書換装置4から送信されてRAM22に転送される書換制御プログラムによって実行される。また、図3は、メモリ書換装置4のマイコン30で実行される処理を表すフローチャートである。
【0043】
まず、ECU2では、車両のイグニッションスイッチがONされるなどして電源が投入され、マイコン8がリセット状態から動作を開始すると、マスクROM20bに格納されたブートプログラムが起動する。
そして、図2に示すように、まずS100にて、書換モードであるか否かを、モード判定用信号ラインLがロウレベルであるか否かによって判定し、モード判定用信号ラインLがロウレベルでなければ、書換モードではない通常モードであると判断して、S110に進み、エンジン制御プログラムへジャンプする。
【0044】
すると、フラッシュROM20aに格納されている制御プログラムが起動され、その後は、S200に示すように、エンジン制御用の制御データを参照して行われるエンジン制御処理が実行される。
尚、S200のエンジン制御処理は、入力回路6からの各種センサ信号とフラッシュROM20aに格納された制御データとに基づき、エンジンに対する最適な燃料噴射量や点火時期等を演算し、その演算結果に応じて、インジェクタやイグナイタ等のアクチュエータを駆動するための制御信号を出力回路10に出力する、といった手順で繰り返し実行される。そして、このようなエンジン制御処理が実行されることにより、エンジンの運転が可能となる。
【0045】
一方、ブートプログラムにおいて、上記S100で書換モードであると判断した場合、即ち、当該ECU2にメモリ書換装置4が接続されて書換スイッチSWがONされることにより、モード判定用信号ラインLがロウレベルであった場合には、フラッシュROM20a内のエンジン制御プログラムへジャンプすることなく、そのままS120に移行する。
【0046】
そして、このS120にて、後述するようにメモリ書換装置4から送信されて来るIDを受信するまで待機し、メモリ書換装置4からのIDを受信すると、次のS130に進んで、受信したメモリ書換装置4からのID(受信ID)と、マスクROM20bに格納されている自己のID(内蔵ID)とが一致しているか否かを判定する。そして、両IDが一致していると判定した場合には、S140に進んで、メモリ書換装置4へ、書換制御プログラムの送信を要求するための要求信号を送信する。
【0047】
すると、後述するようにメモリ書換装置4から当該ECU2へ書換制御プログラムが送信されて来るため、続くS150にて、メモリ書換装置4からの書換制御プログラムを受信して、RAM22の所定領域に転送・格納する。
そして、続くS160にて、S150でRAM22に格納した書換制御プログラムへジャンプする。
【0048】
これにより、メモリ書換装置4から送信されて来た書換制御プログラムがRAM22上で実行されて、フラッシュROM20aに格納されている現在の制御プログラム及び制御データを、メモリ書換装置4から送信されて来る新たな制御プログラム及び制御データに書き換えるための、S300の書換処理が行われる。
【0049】
尚、S300の書換処理は、例えば次のような手順で実行される。
1.まず、メモリ書換装置4からの消去指令に応じて、フラッシュROM20aに格納されているプログラム及びデータを消去する。
2.次に、メモリ書換装置4から新たな制御プログラム及び制御データが送信されて来るのを待ち、それらを受信すると、その受信した制御プログラム及び制御データを、旧来のプログラム及びデータが格納されていたフラッシュROM20aの記憶領域に順次書き込んで行く。
【0050】
3.そして、メモリ書換装置4からの全ての制御プログラム及び制御データを受信して、フラッシュROM20aの書き換えが完了すれば、その後、全ての処理を終了する。
そして、このようなS300の書換処理が実行されることにより、フラッシュROM20aに格納された制御プログラム及びデータが、メモリ書換装置4からの新たな制御プログラム及び制御データに書き換えられる。
【0051】
一方、ブートプログラムのS130にて、メモリ書換装置4から送信されて来たID(受信ID)と、マスクROM20bに格納されている自己のID(内蔵ID)とが一致していないと判定した場合には、S170に移行する。そして、このS170にて、メモリ書換装置4からのIDと当該ECU2側のIDとが一致していない旨を示すエラー信号を、メモリ書換装置4へ送信し、その後、当該ECU2側の処理を終了する。
【0052】
次に、メモリ書換装置4では、作業者によりECU2に接続されて書換スイッチSWがONされると、マイコン30が、図3に示す処理を実行する。
即ち、まずS400にて、第2のRM36に格納された新たな制御プログラム及び制御データに適合するECUのID(データ書き換え対象であるECUのID)を、第2のROM36から読み出し、その読み出したID(内蔵ID)をECU2へ送信する。
【0053】
すると、前述したように、ECU2側では、当該メモリ書換装置4からECU2へ送信したIDと、自己のマスクROM20bに格納されているIDとが一致しているか否かを判定し(S130)、両IDが一致していれば、当該メモリ書換装置4へ書換制御プログラムの要求信号を送信し(S140)、両IDが一致していなければ、当該メモリ書換装置4へエラー信号を送信するため(S170)、メモリ書換装置4側では、続くS410にて、ECU2から送信されて来る信号(要求信号或いはエラー信号)を受信し、その信号の種類を判定する。
【0054】
そして、ECU2からの信号が書換制御プログラムの要求信号であれば、S420に進んで、第1のROM34に格納されている書換制御プログラムをECU2へ送信する。そして更に、続くS430にて、ECU2へ、前述した消去指令を送信した後、第2のROM36に格納されている新たな制御プログラム及び制御データを送信する。
【0055】
すると、ECU2側では、前述した図2におけるS300の書換処理により(即ち、書換制御プログラムの実行により)、フラッシュROM20a内の制御プログラム及び制御データが、当該メモリ書換装置4から送信される新たな制御プログラム及び制御データに書き換えられることとなる。
【0056】
そして、メモリ書換装置4では、上記S430の処理を終えると、全ての処理が終了する。
一方、S410にて、ECU2からの信号がエラー信号であると判断した場合には、S440に移行して、所定の表示装置(図示省略)に、データの書き換えが出来ないことを示すエラー表示を行い、その後、当該メモリ書換装置4側の処理を終了する。
【0057】
尚、本第1実施例では、ECU2において、フラッシュROM20aが、電気的にデータの書き換えが可能な不揮発性メモリに相当し、RAM22が、揮発性のメモリ領域に相当し、マスクROM20bが、識別情報記憶手段に相当している。そして、図2におけるS120及びS130の処理が、判定手段及び転送許可手段に相当している。また、メモリ書換装置4において、第2のROM36が、データ記憶手段に相当している。
【0058】
このような第1実施例のメモリ書換システム5において、ECU2のフラッシュROM20aに格納された制御プログラム及び制御データを書き換える場合には、作業者は、まず、メモリ書換装置4のICソケット38に、ECU2側で実行させる書換制御プログラムが格納された第1のROM34を装着すると共に、ICソケット40に、新たな制御プログラム及び制御データと、それに適合するECUのIDとが格納された第2のROM36を装着する。そして、メモリ書換装置4をECU2に接続して、メモリ書換装置4の書換スイッチSWをONすると共に、車両のイグニッションスイッチをONしてECU2を初期状態から作動させる。
【0059】
すると、メモリ書換装置4からECU2へ、第2のRAM36に格納された新たな制御プログラム及び制御データに適合するECUのIDが送信され(S400)、ECU2では、メモリ書換装置4からのIDと、マスクROM20bに格納されている自己のIDとが一致しているか否かを判定する(S130)。
【0060】
そして、両IDが一致している場合(S130:YES)には、ECU2からメモリ書換装置4へ、書換制御プログラムの要求信号が送信され(S140)、これに応答して、メモリ書換装置4からECU2へ、書換制御プログラムが送信される(S410:要求信号,S420)。
【0061】
その後、ECU2においては、メモリ書換装置4からの書換制御プログラムがRAM22に転送されて実行され(S150,S160,S300)、また、メモリ書換装置4においては、ECU2への新たな制御プログラム及び制御データの送信が行われ(S430)、このような両装置の動作により、ECU2に搭載されたフラッシュROM20aのデータ書き換えが行われる。
【0062】
これに対して、メモリ書換装置4からECU2へ送信されたIDとECU2に内蔵されたIDとが一致していない場合には(S130:NO)、ECU2は、メモリ書換装置4へエラー信号を送信して、全ての処理を終了し(S170)、メモリ書換装置4は、ECU2からのエラー信号を受けると(S410:エラー信号)、ECU2へ書換制御プログラムを送信することなく、エラー表示を行う(S440)。
【0063】
以上詳述したように、第1実施例のメモリ書換システム5では、まず、メモリ書換装置4が、新たな制御プログラム及び制御データに適合するECUのIDを送信し、ECU2は、メモリ書換装置4から送信されて来たIDと、マスクROM20bに格納されている自己のIDとが一致しているか否かを判定する。そして、ECU2は、メモリ書換装置4からのIDと自己のIDとが一致している場合にのみ、メモリ書換装置4へ書換制御プログラムの送信要求を送信すると共に、それに応答してメモリ書換装置4から送信されて来る書換制御プログラムをRAM22に転送して実行し、これにより、フラッシュROM20a内の制御プログラム及び制御データを、その後、メモリ書換装置4から送信されて来る新たな制御プログラム及び制御データに書き換えるようにしている。
【0064】
従って、このような第1実施例のECU2及びメモリ書換システム5によれば、作業者が、メモリ書換装置4のICソケット40に、ECU2に適合しない制御プログラム及び制御データが格納されたROM(第2のROM)36を装着してしまい、その不適合な制御プログラム及び制御データがECU2へ送信されそうな場合には、メモリ書換装置4側のID(即ち、第2のROM36にて新たな制御プログラム等と対応して予め記憶されたID)と、マスクROM20bに記憶されたECU2のIDとが一致しないため、ECU2では、書換制御プログラムのRAM22への転送動作へ移行しなくなる。よって、フラッシュROM20a内の制御プログラムや制御データが、そのECU2に適合しない制御プログラムや制御データに、誤って書き換えられてしまうことを確実に防止することができる。
【0065】
尚、このように制御プログラム及び制御データの書き換えが行われない場合には、作業者は、メモリ書換装置4側の第2のROM36を、ECU2に適合した制御プログラム及び制御データを記憶したものに変更してから、再度、書き換えのための作業を行えばよい。
そして更に、第1実施例のECU2では、メモリ書換装置4から送信されて来る書換制御プログラムを揮発性のRAM22に転送して起動することにより、フラッシュROM20a内のデータを書き換える書換処理を行うように構成されているため、フラッシュROM20aの内容を書き換える作業を終了した後に、当該ECU2の電源を一旦遮断すれば、RAM22に転送された書換制御プログラムは消失する。よって、第1実施例のECU2によれば、エンジンを制御する通常時において、当該ECU2への電源供給を開始した後、万が一、プログラムを実行するCPU18が暴走したとしても、書換処理を行うための書換制御プログラムは内蔵されていないため、フラッシュROM20aに格納されている正規の制御プログラムや制御データが失われたり変化したりしてしまうことを確実に防止できる。
【0066】
また、第1実施例のECU2及びメモリ書換システム5では、ECU2が、メモリ書換装置4からのIDを受信して、そのIDと自己のID(即ち、マスクROM20bに格納されたID)とが一致しているか否かを判定するようにしており、マスクROM20bに格納されたIDはECU2の外部に送信されることが無いため、当該ECU2側のIDを解読して、フラッシュROM20a内の制御プログラム等を故意に他のものに書き換える、といった行為を確実に防止することができる。
【0067】
そして、同様の理由により、例えば、フラッシュROM20a内のデータを読み出して外部へ送信するといった読出処理を行うためのプログラムを、ECU2のRAM22に転送させて実行させ、フラッシュROM20aの記憶内容を不正に読み取る、といった行為も防止でき、機密性を高めることができる。
【0068】
一方、上記第1実施例のメモリ書換システム5では、ECU2は、メモリ書換装置4からのIDと自分側のIDとが一致していないと判定すると、メモリ書換装置4へエラー信号を送信し、メモリ書換装置4は、ECU2からのエラー信号を受けると、表示装置にエラー表示を行うようにしている。
【0069】
従って、作業者は、書き換えようとして用意した新たな制御プログラム及び制御データがECU2に適合していないことを、メモリ書換装置4側のエラー表示によって、確実に知ることができる。
[第2実施例]
次に、第2実施例の電子制御装置のメモリ書換システムについて説明する。第2実施例のメモリ書換システムは、上述した第1実施例のメモリ書換システム5に対して、ECU2側とメモリ書換装置4側とで夫々実行される処理が異なるだけであり、ハードウェア上の構成については全く同じである。
【0070】
そこで以下、第2実施例のメモリ書換システムにおいて、ECU2側のマイコン8で実行される処理と、メモリ書換装置4側のマイコン30で実行される処理について、図4及び図5を用いて説明する。
尚、図4は、ECU2のマイコン8で実行される処理を表すフローチャートであり、第1実施例の図2と同じ処理については、同じステップ番号を付しているため、詳細な説明は省略する。また、図5は、メモリ書換装置4のマイコン30で実行される処理を表すフローチャートであり、第1実施例の図3と同じ処理については、同じステップ番号を付しているため、詳細な説明は省略する。
【0071】
まず、図4に示すように、ECU2のマイコン8は、リセットスタート直後のS100にて書換モードであると判定した場合には、フラッシュROM20a内の制御プログラムへジャンプすることなく、S125に移行する。
そして、このS125にて、マスクROM20bに格納されている自己のIDをメモリ書換装置4へ送信し、続くS135にて、後述するようにメモリ書換装置4から送信されて来る信号(応答信号)が、正常信号であるかエラー信号であるかを判定する。
【0072】
そして、S135にて、メモリ書換装置4からの信号が正常信号であると判定した場合には、S150,S160,S300の処理、即ち、メモリ書換装置4からの書換制御プログラムを受信してRAM22に転送・格納し、その書換制御プログラムをRAM22上で実行することにより、フラッシュROM20aに格納されている制御プログラム及び制御データを、メモリ書換装置4から送信されて来る新たな制御プログラム及び制御データに書き換える処理を行う。
【0073】
これに対し、S135にて、メモリ書換装置4からの信号がエラー信号であると判定した場合には、そのまま当該ECU2側の処理を終了する。
尚、本第2実施例では、S125及びS135の処理が、判定手段及び転送許可手段に相当している。
【0074】
次に、図5に示すように、メモリ書換装置4のマイコン30は、まずS405にて、ECU2から送信されて来るIDを受信するまで待機し、ECU2からのIDを受信すると、S415に進んで、受信したECU2からのID(受信ID)と、第2のRAM36に格納されているECUのID(内蔵ID)とが一致しているか否かを判定する。
【0075】
そして、両IDが一致していると判定した場合には、S417に進んで、ECU2へ、当該メモリ書換装置4側のIDとECU2側のIDとが一致していることを表す正常信号を送信する。
すると、前述したように、ECU2側のマイコン8は図4のS150以降の処理実行を開始するため、当該メモリ書換装置4側では、上記S417で正常信号を送信した後、第1実施例の場合と同様に、S420及びS430の処理を実行して、第1のROM34に格納されている書換制御プログラムと、第2のROM36に格納されている新たな制御プログラム及び制御データとを、ECU2に順次送信する。
【0076】
一方、S415にて、ECU2からのID(受信ID)と、第2のRAM36に格納されているECUのID(内蔵ID)とが一致していないと判定した場合には、S445に移行して、ECU2へ、当該メモリ書換装置4側のIDとECU2側のIDとが一致していないことを表すエラー信号を送信した後、そのまま当該メモリ書換装置4側の処理を終了する。すると、ECU2では、前述したように、図4のS150以降の処理が実行されることなく、全ての処理が終了される。
【0077】
つまり、第2実施例のメモリ書換システムでは、第1実施例のメモリ書換システム5とは逆に、ECU2が、メモリ書換装置4へ自己のIDを送信し(S125)、メモリ書換装置4が、ECU2からのIDと、新たな制御プログラム及び制御データに適合するECUのIDとが一致しているか否かを判定するようにしている(S415)。そして、メモリ書換装置4は、両IDが一致している場合に(S415:YES)、ECU2へ、正常信号を送信し(S417)、その後、書換制御プログラムと新たな制御プログラム及び制御データを送信するようにしており(S420,S430)、ECU2は、メモリ書換装置4からの正常信号を受信した場合にのみ(S135:正常信号)、メモリ書換装置4側のIDと自己のIDとが一致していると判断して、メモリ書換装置4からの書換制御プログラムをRAM22に転送して実行する処理(S150,S160)を行うようにしている。
【0078】
そして、このような第2実施例のECU2及びメモリ書換システムによっても、第1実施例のものと同様に、作業者が、メモリ書換装置4のICソケット40に、ECU2に適合しない制御プログラム及び制御データが格納されたROM36を装着してしまい、その不適合な制御プログラム及び制御データがECU2へ送信されそうな場合には、メモリ書換装置4側のID(即ち、第2のROM36にて新たな制御プログラム等と対応して予め記憶されたID)と、マスクROM20bに記憶されたECU2のIDとが一致しないため、ECU2では、書換制御プログラムのRAM22への転送動作へ移行しなくなる。よって、フラッシュROM20a内の制御プログラムや制御データが、そのECU2に適合しない制御プログラムや制御データに、誤って書き換えられてしまうことを確実に防止することができる。
【0079】
また、第2実施例のECU2も、第1実施例のECU2と同様に、メモリ書換装置4から送信されて来る書換制御プログラムを揮発性のRAM22に転送して起動することにより、フラッシュROM20aの書換処理を行うように構成されているため、エンジンを制御する通常時において、プログラムを実行するCPU18が暴走したとしても、フラッシュROM20aに格納されている正規の制御プログラムや制御データが失われたり変化したりしてしまうことを確実に防止できる。
【0080】
[その他]
前述した第1実施例において、メモリ書換装置4側のIDは、第2のROM36に予め格納しておくのではなく、作業者が所定の入力装置を操作して入力するようにしても良い。
【0081】
そして、このようなメモリ書換システムによっても、メモリ書換装置4からECU2へ、ECU2のマスクROM20bに格納されたIDと同一のIDを送信してやらなければ、ECU2にて、書換制御プログラムのRAM22への転送が許可されないため、フラッシュROM20a内のデータ(制御プログラム及び制御データ)を、不用意に書き換えてしまうことや、故意に他のデータに書き換えようとする行為を確実に防止することができる。
【0082】
一方、前述した各実施例のECU2は、電気的にデータの書き込みが可能な不揮発性メモリとして、フラッシュROM20aを備えたものであったが、EEPROMを用いても良い。
また、上記実施例では、ECU2内にマスクROM20bとフラッシュROM20aとをそれぞれ持つ例を示したが、フラッシュROM20aのみとして、フラッシュROM20a内に、前述したマスクROM20bの内容(プログラムやID等)を、エンジン制御プログラムと領域を分けて記憶させても良い。
【0083】
また、上記各実施例では、エンジンを制御するECU2について説明したが、本発明の適用範囲は、これに限られない。即ち、例えばブレーキ、トランスミッション、サスペンション等の制御対象を制御する電子制御装置に対しても、全く同様に適用することができる。
【図面の簡単な説明】
【図1】第1実施例の電子制御装置のメモリ書換システムの全体構成を表すブロック図である。
【図2】第1実施例のエンジン制御装置(ECU)側で実行される処理を表すフローチャートである。
【図3】第1実施例のメモリ書換装置側で実行される処理を表すフローチャートである。
【図4】第2実施例のエンジン制御装置(ECU)側で実行される処理を表すフローチャートである。
【図5】第2実施例のメモリ書換装置側で実行される処理を表すフローチャートである。
【符号の説明】
2…エンジン制御装置(ECU) 4…メモリ書換装置
5…メモリ書換システム 6…入力回路
8,30…シングルチップマイクロコンピュータ(マイコン)
10…出力回路 18…CPU 20…ROM
20a…フラッシュROM 20b…マスクROM
22…RAM 24…I/O 25…通信回路 32…電源回路
34…第1のROM 36…第2のROM 38,40…ICソケット
42F…雌コネクタ 42M…雄コネクタ 44…通信線
46…電源供給線 48…信号線 SW…書換スイッチ
L…モード判定用信号ライン R…抵抗器
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a technique for rewriting control programs and control data stored in an electrically rewritable nonvolatile memory while the nonvolatile memory is mounted on an electronic control unit.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, for example, as an electronic control device for controlling an engine of an automobile, a control program and control data for engine control are stored in a nonvolatile memory capable of electrically rewriting data (specifically, erasing and writing data). In addition, there has been proposed a configuration in which such a control program or control data can be rewritten even after being supplied to the market.
[0003]
That is, this type of electronic control device normally controls a control target such as an engine in accordance with a control program and control data constituted by data stored in a nonvolatile memory. Is connected, and upon receiving a rewrite command from the memory rewriting device, the current data stored in the nonvolatile memory is erased, and new data (new data) transmitted from the memory rewriting device to the erased area is erased. (A control program and control data).
[0004]
On the other hand, the memory rewriting device connected to such an electronic control device includes a storage medium for storing new data to be rewritten, and is stored in the storage medium when a predetermined operation is performed by an operator. The new data is transmitted to the electronic control unit.
[0005]
In a memory rewriting system for an electronic control device, which includes such an electronic control device and a memory rewriting device, a control program and control data stored in a nonvolatile memory of the electronic control device are transmitted from the memory rewriting device to the electronic control device. Thus, the operation content (control content) of the electronic control device can be arbitrarily changed.
[0006]
[Problems to be solved by the invention]
However, for example, in the case of automobiles, the electronic control unit performs the same type of vehicle depending on the grade (mounted equipment), the type of engine, the destination (exporting country), etc., as well as between different types of vehicles. The content of the control to be performed is different. In other words, control programs and control data to be stored in the non-volatile memory of the electronic control device are different for each control target controlled by the electronic control device.
[0007]
Therefore, in this type of memory rewriting system for an electronic control device, an operator stores data constituting a control program or the like that is incompatible with the electronic control device (specifically, the control target) in a storage medium on the memory rewriting device side. Irrelevant data may be transmitted from the memory rewriting device to the electronic control device without knowing that the data is being rewritten. Then, when such an operation error occurs, there is a problem that the electronic control device cannot appropriately control the control target.
[0008]
In addition, in the conventional electronic control device, a rewrite control program executed to perform a rewrite process for rewriting the content of the nonvolatile memory is previously stored in a non-rewriteable non-volatile memory (such as a mask ROM). In some cases, if the CPU runs away and the rewrite control program is started by mistake, the normal control program or control data stored in the nonvolatile memory may be lost or changed. .
[0009]
The present invention has been made in view of such a problem, and an electronic control device capable of reliably preventing a control program or control data stored in a nonvolatile memory from being rewritten to an incompatible one, It is an object of the present invention to provide a memory rewriting device suitable for rewriting a control program and control data stored in a nonvolatile memory of a control device and a memory rewriting system of an electronic control device.
[0010]
Means for Solving the Problems and Effects of the Invention
The electronic control device according to claim 1 has been provided for achieving the above object, and includes an electrically rewritable nonvolatile memory. Normally, the electronic control device uses data stored in the nonvolatile memory. A predetermined control target is controlled in accordance with the configured control program and control data. When an external rewrite command is received, a rewrite control program transmitted from an external device is transferred to a volatile memory area. do itExecute on the memory areaBy doing so, a rewriting process for rewriting data in the non-volatile memory to new data transmitted from the external device is performed.In the following description, transferring the rewrite control program to the volatile memory area and executing the rewrite control program in the volatile memory area is referred to as transferring the rewrite control program to the volatile memory area and starting the program.
[0011]
The electronic control device according to the first aspect includes an identification information storage unit that stores identification information of the electronic control device in advance, a determination unit, and a transfer permission unit. Upon receiving the rewrite command, the external device communicates with the external device before the rewrite control program is transmitted from the external device, so that the new data (ie, non-volatile (New data to be written to the memory) is stored in advance in correspondence with the identification information indicating a device conforming to the new data, and whether the identification information stored in the identification information storage means matches. Is determined, and the transfer permission unit permits the transfer of the rewrite control program to the memory area only when the determination unit determines that the two pieces of identification information match.. Further, the identification information is set for each model and specification of an engine controlled by the electronic control device, or for a vehicle type name and a vehicle grade name on which the electronic control device is mounted.
[0012]
That is, in the electronic control device according to the first aspect, upon receiving a rewrite command from the outside, first, the electronic control device communicates with the external device to store the new data in the external device in advance in association with the new data. It is determined whether or not the obtained identification information and the own identification information stored in the identification information storage means match. Only when the two pieces of identification information match, the identification information is transmitted from the external device. The rewrite control program is transferred to a volatile memory area and activated. Then, by starting and executing the rewriting control program, a rewriting process for rewriting data in the non-volatile memory with new data transmitted from the external device is performed.
[0013]
According to the electronic control device according to the first aspect of the invention, the external device stores a control program and new data that constitute control data that are not compatible with the electronic control device, and the incompatible data is stored. Is likely to be transmitted to the electronic control unit, the identification information on the external device side (that is, the information that is stored in advance in the external device side in association with the new data and is compatible with the new data) The electronic control unit does not transfer the rewrite control program to the volatile memory area because the identification information stored in the identification information storage means does not match the identification information of the electronic control unit.
[0014]
Therefore, according to the electronic control device of the first aspect, it is ensured that the control program and the control data in the non-volatile memory are erroneously rewritten to the control program and the control data that are not compatible with the electronic control device. Can be prevented.
In addition, in the electronic control device according to the first aspect, the rewrite control program transmitted from the external device is transferred to the volatile memory area and activated to perform the rewrite process for rewriting the data in the nonvolatile memory. With such a configuration, if the power of the electronic control device is temporarily turned off after the operation of rewriting the content of the nonvolatile memory is completed, the rewrite control program transferred to the volatile memory area disappears.
[0015]
Therefore, according to the electronic control device of the first aspect, at the time of normal control of a predetermined control target, after the power supply to the electronic control device is started, it is assumed that the CPU that executes the program runs away. However, since the rewrite control program for performing the rewrite process is not built in, it is possible to reliably prevent the normal control program and control data stored in the nonvolatile memory from being lost or changed.
[0016]
A flash EEPROM (hereinafter referred to as a flash ROM) or an EEPROM is generally used as the electrically rewritable nonvolatile memory, but another electrically rewritable ROM may be used. As a volatile memory area to which the rewrite control program is transferred, a RAM from which data can be read and to which data can be written can be used.
[0017]
In the electronic control device according to the first aspect, the determination unit receives the identification information of the external device transmitted from the external device and receives the received identification information. And comparing the identification information stored in the identification information storage means with the identification information stored in the identification information storage means to determine whether the identification information on the external device side matches the identification information stored in the identification information storage means. can do.
[0018]
The external device connected to the electronic control device configured as described in claim 2 may be configured as the memory rewriting device described in claim 3.
That is, the memory rewriting device according to claim 3 transmits the rewrite control program and the new data to the electronic control device according to claim 2, and stores the new data in the new data. A data storage unit that stores the identification information corresponding to the data corresponding to the new data before transmitting the rewrite control program to the electronic control device. Send.
[0019]
Further, as in the present invention described in claim 4, the memory rewriting device according to claim 3 and the electronic control device according to claim 2 provide a nonvolatile memory mounted in the electronic control device. If the memory rewriting system of the electronic control device for rewriting the contents of the volatile memory is configured, the identification information indicating the device adapted to the new data before the rewriting control program is transmitted from the memory rewriting device to the electronic control device. Is transmitted to the electronic control unit, and only when the identification information from the memory rewriting device matches its own identification information stored in the identification information storage means, the volatile memory area of the rewriting control program is used. The transfer to the electronic control unit is permitted, and the effect of the electronic control device according to claim 1 can be reliably obtained.
[0020]
On the other hand, in the electronic control device according to the first aspect, as the determination means, the identification information stored in the identification information storage means is transmitted to an external device as described in the fifth aspect. By receiving from the external device a response signal indicating whether or not the identification information and the transmitted identification information match, the identification information stored in the external device-side identification information and identification information storage means. Can be determined so as to determine whether or not.
[0021]
The external device connected to the electronic control device configured as described in claim 5 may be configured as the memory rewriting device described in claim 6.
That is, the memory rewriting device according to claim 6 transmits the rewriting control program and the new data to the electronic control device according to claim 5, and stores the new data in the new data. Data storage means for storing in advance in association with identification information indicating a device conforming to the data, and determining whether or not the identification information from the electronic control device matches the identification information corresponding to the new data. Is determined, and when the two pieces of identification information match each other, the identification information on the memory rewriting device side and the identification information stored in the identification information storage unit of the electronic control device are transmitted to the electronic control device. The response signal indicating that the rewriting is performed, and then the rewrite control program is transmitted.
[0022]
Further, as in the present invention described in claim 7, the memory rewriting device according to claim 6 and the electronic control device according to claim 5 provide a nonvolatile memory mounted in the electronic control device. If the memory rewriting system of the electronic control device for rewriting the contents of the non-volatile memory is configured, first, the identification information stored in the identification information storage unit is transmitted from the electronic control device to the memory rewriting device, and transmitted to the memory rewriting device side. Then, it is determined whether the identification information from the electronic control device matches the identification information corresponding to the new data. When the two pieces of identification information match each other, the identification information on the memory rewriting device side matches the identification information stored in the identification information storage means of the electronic control device from the memory rewriting device to the electronic control device. Is transmitted, and then the rewrite control program is transmitted.
[0023]
Then, the electronic control device side responds to the response signal from the memory rewriting device only when the identification information of the memory rewriting device matches the identification information stored in the identification information storage means (that is, the memory rewriting device). Only when the response signal from the rewriting device indicates that the identification information on the memory rewriting device side matches the identification information stored in the identification information storage means of the electronic control device), the rewriting control program Since the transfer to the volatile memory area is permitted, the effect of the electronic control device according to the first aspect can be reliably obtained.
[0024]
However, according to the electronic control device configured as described in claim 2, or according to the memory rewriting system of the electronic control device described in claim 4, the identification information stored in the identification information storage means is stored in an external device of the electronic control device. To prevent the act of decrypting the identification information stored in the electronic control unit and intentionally rewriting the data stored in the non-volatile memory to other data. In this respect, the present embodiment is superior to the electronic control device according to claim 5 or the memory rewriting system of the electronic control device according to claim 7.
[0025]
On the other hand, the electronic control device according to the eighth aspect is, similarly to the electronic control device according to the first aspect, configured by data stored in an electrically rewritable non-volatile memory at normal times. A predetermined control target is controlled according to the control program and the control data, and when a rewrite command is received from the outside, the rewrite control program transmitted from the external device is transferred to the volatile memory area and activated. A rewriting process for rewriting data in the nonvolatile memory with new data transmitted from the external device.
[0026]
The electronic control device according to the eighth aspect includes an identification information storage unit that stores identification information of the electronic control device in advance, a determination unit, and a transfer permission unit. Upon receiving the rewrite command, before the rewrite control program is transmitted from the external device, the identification information transmitted from the external device is received, and the received identification information and the received identification information are stored in the identification information storage unit. It is determined whether or not the two pieces of identification information match with each other, and the transfer permission means determines whether or not the two pieces of identification information match each other only when the determination means determines that the two pieces of identification information match each other. Allow transfer to. Further, the identification information is set for each model and specification of an engine controlled by the electronic control device, or for a vehicle type name and a vehicle grade name on which the electronic control device is mounted.
[0027]
According to the electronic control device of the eighth aspect, before transmitting the rewrite control program from the external device, the same identification information as the identification information stored in the identification information storage means of the electronic control device is stored in the external device. Unless it is transmitted from the device, the transfer of the rewrite control program to the volatile memory area is not permitted. Therefore, it is possible to reliably prevent data (control program and control data) in the non-volatile memory from being carelessly rewritten or intentionally rewritten with other data.
[0028]
According to the electronic control device of the eighth aspect, similarly to the electronic control device of the first aspect, the rewrite control program transmitted from the external device is transferred to the volatile memory area and activated. Thus, since the rewriting process for rewriting data in the non-volatile memory is performed, the normal control program stored in the non-volatile memory can be stored in the non-volatile memory at normal times even if the CPU that executes the program runs away. And loss or change of control data can be reliably prevented.
[0029]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments to which the present invention is applied will be described with reference to the drawings. It is needless to say that the embodiments of the present invention are not limited to the following examples, and can take various forms within the technical scope of the present invention.
[0030]
[First embodiment]
First, FIG. 1 shows an engine control device (hereinafter referred to as an ECU) 2 which is mounted on an automobile and controls an internal combustion engine, and which is used when rewriting an engine control program or data built in the ECU 2 or newly. FIG. 2 is a block diagram illustrating an overall configuration of a memory rewriting system 5 of the electronic control device of the embodiment, which includes a memory rewriting device 4 connected to the ECU 2 when writing.
[0031]
As shown in FIG. 1, the ECU 2 receives an input signal from various sensors for detecting the operating state of the engine and performs waveform processing on the input signal, and controls the engine based on the sensor signal from the input circuit 6. A single chip microcomputer (hereinafter, referred to as a microcomputer) 8 for executing various processes of the above, and a drive signal is output to an actuator such as an injector (fuel injection valve) or an igniter attached to the engine based on a control signal from the microcomputer 8. And an output circuit 10.
[0032]
The microcomputer 8 includes a well-known CPU 18 that operates according to a program, a non-volatile ROM 20 that stores programs and data necessary for operating the CPU 18, a RAM 22 that temporarily stores calculation results of the CPU 18, and the like. An I / O 24 for receiving a signal from the circuit 6 and the like and outputting a control signal to the output circuit 10 and a communication circuit 25 for performing data communication with the memory rewriting device 4 are provided.
[0033]
Here, the ROM 20 includes a flash ROM (flash EEPROM) 20a in which data can be electrically erased and written, and a mask ROM 20b in which data cannot be rewritten.
After the microcomputer 8 is mounted on the ECU 2 in the manufacturing process of the ECU 2, a control program and control data for engine control are newly written in the flash ROM 20 a, and the flash ROM 20 a is executed immediately after the reset in the mask ROM 20 b. A boot program and an identification code (hereinafter referred to as ID) of the ECU 2 on which the microcomputer 8 is mounted are stored in advance before the microcomputer 8 is mounted on the ECU 2.
[0034]
Note that the ID is set for each model and specification of the engine controlled by the ECU 2, or for a vehicle type name or a vehicle grade name on which the ECU 2 is mounted. Further, instead of the mask ROM 20b, a nonvolatile memory capable of electrically erasing and writing data may be used similarly to the flash ROM 20a, as long as the data rewriting is prohibited.
[0035]
In such an ECU 2, the microcomputer 8 (CPU 18) starts the boot program in the mask ROM 20b immediately after the reset, and normally executes the engine control in the flash ROM 20a by the boot program when the memory rewriting device 4 is not connected. A program (a control program for engine control) is called to control the engine.
[0036]
When the microcomputer 8 determines that the rewrite mode is set as described later when the boot program is started, the microcomputer 8 executes the boot program without calling the control program in the flash ROM 20a. When a predetermined condition described later is satisfied, a write control program transmitted from the memory rewriting device 4 is received and stored in the RAM 22, and the write control program is called and executed on the RAM 22. A rewrite process is performed to rewrite the current control program and control data stored in the ROM 20a with a new control program and control data transmitted from the memory rewriting device 4 thereafter.
[0037]
Incidentally, even when the ECU 2 in which the engine control program and control data are not yet written in the flash ROM 20a is manufactured, the same is true except that the engine control program and control data are newly written in the flash ROM 20a. .
[0038]
On the other hand, the memory rewriting device 4 includes a microcomputer 30 having a built-in CPU, ROM, RAM and the like for executing a process for causing the microcomputer 8 of the ECU 2 to rewrite the flash ROM 20a, and in response to a command from the microcomputer 30, A power supply circuit 32 for supplying a rewrite voltage (12 V in this embodiment) Vpp necessary for rewriting data in the flash ROM 20a to the microcomputer 8 on the ECU 2 side, and an operation mode of the ECU 2 is changed from a normal mode for controlling the engine to the flash ROM 20a. A rewriting switch SW for changing the mode to a rewriting mode for rewriting (or newly writing) data.
[0039]
Further, the memory rewriting device 4 is prepared for writing in the first ROM 34 storing a rewrite control program (specifically, a program code constituting the rewrite control program) to be transmitted to the ECU 2 and the flash ROM 20a of the ECU 2. And a second ROM 36 in which a new control program and control data are stored. The first ROM 34 and the second ROM 36 are detachably provided to the memory rewriting device 4 by well-known IC sockets 38 and 40, respectively.
[0040]
Further, the second RAM 36 stores the ID of an ECU that matches the control program and control data for engine control stored in the second RAM 36, that is, the ID of the ECU whose data is to be rewritten.
Such connection between the memory rewriting device 4 and the ECU 2 is performed by fitting the female connector 42F of the memory rewriting device 4 and the male connector 42M provided in the ECU 2 as shown in FIG.
[0041]
That is, when the two connectors 42F and 42M are fitted, serial data communication between the microcomputer 30 on the memory rewriting device 4 side and the microcomputer 8 on the ECU 2 becomes possible via the communication line 44. A rewrite voltage Vpp necessary for rewriting data in the flash ROM 20a is supplied from the power supply circuit 32 on the memory rewriting device 4 side to the microcomputer 8 on the ECU 2 side via the supply line 46. Further, the signal line 48 connected to the ground potential (0 V) via the rewriting switch SW on the memory rewriting device 4 side is connected to the mode determination signal line L pulled up to 5 V by the resistor R on the ECU 2 side. As a result, when the rewriting switch SW is turned on on the memory rewriting device 4 side, the mode determination signal line L changes from the high level (5 V) to the low level (0 V) on the ECU 2 side. If the mode determination signal line L is at a low level when the boot program is started as described above, the microcomputer 8 of the ECU 2 determines the rewrite mode.
[0042]
Next, a process executed by the microcomputer 8 of the ECU 2 and a process executed by the microcomputer 30 of the memory rewriting device 4 will be described with reference to FIGS.
FIG. 2 is a flowchart showing processing executed by the microcomputer 8 of the ECU 2. The processing of steps (hereinafter simply referred to as "S") 100 to S170 is executed by a boot program in the mask ROM 20b. The process of S200 is executed by the engine control program in the flash ROM 20a. Then, the process of S300 is executed by the rewriting control program transmitted from the memory rewriting device 4 and transferred to the RAM 22. FIG. 3 is a flowchart illustrating a process executed by the microcomputer 30 of the memory rewriting device 4.
[0043]
First, in the ECU 2, when the power is turned on by turning on the ignition switch of the vehicle or the like and the microcomputer 8 starts operating from the reset state, the boot program stored in the mask ROM 20b starts.
Then, as shown in FIG. 2, first, in S100, it is determined whether or not the mode is the rewrite mode based on whether or not the mode determination signal line L is at a low level, and the mode determination signal line L must be at a low level. For example, it is determined that the normal mode is not the rewrite mode, the process proceeds to S110, and jumps to the engine control program.
[0044]
Then, the control program stored in the flash ROM 20a is started, and thereafter, as shown in S200, an engine control process performed with reference to the control data for engine control is executed.
The engine control process of S200 calculates the optimum fuel injection amount and ignition timing for the engine based on the various sensor signals from the input circuit 6 and the control data stored in the flash ROM 20a. Then, a control signal for driving an actuator, such as an injector or an igniter, is output to the output circuit 10 in a repeated manner. Then, by executing such an engine control process, the engine can be operated.
[0045]
On the other hand, in the boot program, when it is determined in S100 that the mode is the rewrite mode, that is, when the memory rewrite device 4 is connected to the ECU 2 and the rewrite switch SW is turned on, the mode determination signal line L becomes low level. If there is, the process directly proceeds to S120 without jumping to the engine control program in the flash ROM 20a.
[0046]
Then, in S120, as described later, the process waits until an ID transmitted from the memory rewriting device 4 is received, and when an ID from the memory rewriting device 4 is received, the process proceeds to the next S130, and the received memory rewriting is performed. It is determined whether or not the ID (reception ID) from the device 4 matches its own ID (built-in ID) stored in the mask ROM 20b. If it is determined that the two IDs match, the process proceeds to S140, and transmits a request signal for requesting transmission of the rewrite control program to the memory rewriting device 4.
[0047]
Then, since the rewrite control program is transmitted from the memory rewrite device 4 to the ECU 2 as described later, the rewrite control program is received from the memory rewrite device 4 and transferred to a predetermined area of the RAM 22 at S150. Store.
Then, in S160, the process jumps to the rewrite control program stored in the RAM 22 in S150.
[0048]
As a result, the rewriting control program transmitted from the memory rewriting device 4 is executed on the RAM 22, and the current control program and control data stored in the flash ROM 20a are transferred to the new rewriting control program transmitted from the memory rewriting device 4. The rewriting process in S300 for rewriting the control data and control data is performed.
[0049]
The rewriting process in S300 is executed, for example, in the following procedure.
1. First, a program and data stored in the flash ROM 20a are erased in response to an erase command from the memory rewriting device 4.
2. Next, it waits for a new control program and control data to be transmitted from the memory rewriting device 4 and, upon receiving them, replaces the received control program and control data with the flash memory in which the old programs and data are stored. The data is sequentially written to the storage area of the ROM 20a.
[0050]
3. Then, when all the control programs and control data from the memory rewriting device 4 are received and the rewriting of the flash ROM 20a is completed, all the processes are thereafter terminated.
Then, by executing the rewriting process in S300, the control program and data stored in the flash ROM 20a are rewritten with new control programs and control data from the memory rewriting device 4.
[0051]
On the other hand, when it is determined in S130 of the boot program that the ID (received ID) transmitted from the memory rewriting device 4 does not match its own ID (built-in ID) stored in the mask ROM 20b. Then, the process proceeds to S170. In this S170, an error signal indicating that the ID from the memory rewriting device 4 does not match the ID on the ECU 2 side is transmitted to the memory rewriting device 4, and then the processing on the ECU 2 side ends. I do.
[0052]
Next, in the memory rewriting device 4, when the worker is connected to the ECU 2 and turns on the rewriting switch SW, the microcomputer 30 executes the processing shown in FIG.
That is, first, in S400, the second ROThe ECU ID (the ID of the ECU whose data is to be rewritten) conforming to the new control program and control data stored in the M36 is read from the second ROM 36, and the read ID (built-in ID) is transmitted to the ECU 2. .
[0053]
Then, as described above, the ECU 2 determines whether the ID transmitted from the memory rewriting device 4 to the ECU 2 matches the ID stored in its own mask ROM 20b (S130). If the IDs match, a rewrite control program request signal is transmitted to the memory rewriting device 4 (S140). If the IDs do not match, an error signal is transmitted to the memory rewriting device 4 (S170). In step S410, the memory rewriting device 4 receives a signal (request signal or error signal) transmitted from the ECU 2 and determines the type of the signal.
[0054]
If the signal from the ECU 2 is a request signal of the rewrite control program, the process proceeds to S420, and the rewrite control program stored in the first ROM 34 is transmitted to the ECU 2. Further, in S430, after transmitting the above-described erasure command to the ECU 2, a new control program and control data stored in the second ROM 36 are transmitted.
[0055]
Then, on the ECU 2 side, the control program and control data in the flash ROM 20a are transmitted from the memory rewriting device 4 by the rewriting process of S300 in FIG. 2 described above (that is, by executing the rewriting control program). It will be rewritten with program and control data.
[0056]
Then, in the memory rewriting device 4, when the process of S430 ends, all the processes end.
On the other hand, if it is determined in S410 that the signal from the ECU 2 is an error signal, the process proceeds to S440, and an error display indicating that data cannot be rewritten is displayed on a predetermined display device (not shown). After that, the process on the memory rewriting device 4 side ends.
[0057]
In the first embodiment, in the ECU 2, the flash ROM 20a in the ECU 2 corresponds to an electrically rewritable nonvolatile memory, the RAM 22 corresponds to a volatile memory area, and the mask ROM 20b stores identification information. It corresponds to storage means. Then, the processes of S120 and S130 in FIG. 2 correspond to the determination unit and the transfer permission unit. In the memory rewriting device 4, the second ROM 36 corresponds to a data storage unit.
[0058]
In the memory rewriting system 5 of the first embodiment, when rewriting the control program and the control data stored in the flash ROM 20a of the ECU 2, the operator first inserts the ECU 2 into the IC socket 38 of the memory rewriting device 4. A first ROM 34 storing a rewrite control program to be executed on the side is mounted, and a second ROM 36 storing a new control program and control data and an ECU ID corresponding thereto is stored in the IC socket 40. Installing. Then, the memory rewriting device 4 is connected to the ECU 2, the rewriting switch SW of the memory rewriting device 4 is turned on, and the ignition switch of the vehicle is turned on to operate the ECU 2 from the initial state.
[0059]
Then, the ECU ID that matches the new control program and the control data stored in the second RAM 36 is transmitted from the memory rewriting device 4 to the ECU 2 (S400). It is determined whether or not the own ID stored in the mask ROM 20b matches (S130).
[0060]
If the two IDs match (S130: YES), a request signal for the rewrite control program is transmitted from the ECU 2 to the memory rewrite device 4 (S140). The rewriting control program is transmitted to the ECU 2 (S410: request signal, S420).
[0061]
Thereafter, in the ECU 2, the rewriting control program from the memory rewriting device 4 is transferred to the RAM 22 and executed (S150, S160, S300). In the memory rewriting device 4, a new control program and control data for the ECU 2 are transmitted. Is transmitted (S430), and the data of the flash ROM 20a mounted on the ECU 2 is rewritten by the operation of the two devices.
[0062]
On the other hand, if the ID transmitted from the memory rewriting device 4 to the ECU 2 does not match the ID stored in the ECU 2 (S130: NO), the ECU 2 transmits an error signal to the memory rewriting device 4. Then, when the memory rewriting device 4 receives the error signal from the ECU 2 (S410: error signal), the memory rewriting device 4 displays an error without transmitting the rewriting control program to the ECU 2 (S170). S440).
[0063]
As described in detail above, in the memory rewriting system 5 of the first embodiment, first, the memory rewriting device 4 transmits the ID of the ECU that conforms to the new control program and the new control data, and the ECU 2 executes the memory rewriting device 4 It is determined whether or not the ID transmitted from the MFP 1 matches its own ID stored in the mask ROM 20b. Only when the ID from the memory rewriting device 4 matches the ID of the own device, the ECU 2 transmits a transmission request of the rewriting control program to the memory rewriting device 4 and responds to the request. Is transferred to the RAM 22 and executed, whereby the control program and control data in the flash ROM 20a are converted into a new control program and control data transmitted from the memory rewriting device 4. I try to rewrite.
[0064]
Therefore, according to the ECU 2 and the memory rewriting system 5 of the first embodiment, the operator can store the control program and the control data which are not compatible with the ECU 2 in the IC socket 40 of the memory rewriting device 4 (the ROM (the second). If the incompatible control program and control data are likely to be transmitted to the ECU 2 after the second ROM 36 is mounted, the ID of the memory rewriting device 4 (that is, the new control program is stored in the second ROM 36). And the ID of the ECU 2 stored in the mask ROM 20b do not match, so that the ECU 2 does not shift to the operation of transferring the rewrite control program to the RAM 22. Therefore, it is possible to reliably prevent the control program and the control data in the flash ROM 20a from being erroneously rewritten to the control program and the control data that are not compatible with the ECU 2.
[0065]
When the control program and the control data are not rewritten as described above, the operator sets the second ROM 36 of the memory rewriting device 4 to the one in which the control program and the control data suitable for the ECU 2 are stored. After the change, the work for rewriting may be performed again.
Further, in the ECU 2 of the first embodiment, the rewriting control program transmitted from the memory rewriting device 4 is transferred to the volatile RAM 22 and activated to perform the rewriting process for rewriting the data in the flash ROM 20a. Since the configuration is configured, if the power supply of the ECU 2 is once turned off after the operation of rewriting the contents of the flash ROM 20a is completed, the rewrite control program transferred to the RAM 22 disappears. Therefore, according to the ECU 2 of the first embodiment, during normal operation of controlling the engine, after the power supply to the ECU 2 is started, even if the CPU 18 that executes the program runs out of control, the rewriting process is performed. Since the rewrite control program is not incorporated, it is possible to reliably prevent the normal control program and control data stored in the flash ROM 20a from being lost or changed.
[0066]
In the ECU 2 and the memory rewriting system 5 of the first embodiment, the ECU 2 receives the ID from the memory rewriting device 4 and matches the ID with its own ID (that is, the ID stored in the mask ROM 20b). Since the ID stored in the mask ROM 20b is not transmitted to the outside of the ECU 2, the ID on the ECU 2 side is decoded and the control program in the flash ROM 20a is determined. Can be reliably prevented from being intentionally rewritten to another one.
[0067]
For the same reason, for example, a program for performing a reading process of reading data in the flash ROM 20a and transmitting the data to the outside is transferred to the RAM 22 of the ECU 2 and executed, and the storage content of the flash ROM 20a is illegally read. Can be prevented, and confidentiality can be increased.
[0068]
On the other hand, in the memory rewriting system 5 of the first embodiment, when the ECU 2 determines that the ID from the memory rewriting device 4 does not match the ID of the own device, the ECU 2 transmits an error signal to the memory rewriting device 4, When receiving the error signal from the ECU 2, the memory rewriting device 4 displays an error on the display device.
[0069]
Therefore, the worker can surely know from the error display on the memory rewriting device 4 that the new control program and control data prepared for rewriting are not suitable for the ECU 2.
[Second embodiment]
Next, a memory rewriting system of the electronic control unit according to the second embodiment will be described. The memory rewriting system of the second embodiment differs from the memory rewriting system 5 of the first embodiment only in the processing executed on the ECU 2 side and the memory rewriting device 4 side, respectively. The configuration is exactly the same.
[0070]
Therefore, in the memory rewriting system of the second embodiment, a process executed by the microcomputer 8 of the ECU 2 and a process executed by the microcomputer 30 of the memory rewriting device 4 will be described below with reference to FIGS. .
FIG. 4 is a flowchart showing a process executed by the microcomputer 8 of the ECU 2. The same processes as those in FIG. 2 of the first embodiment are denoted by the same step numbers, and therefore detailed description is omitted. . FIG. 5 is a flowchart showing processing executed by the microcomputer 30 of the memory rewriting device 4. Since the same steps as those in FIG. 3 of the first embodiment are denoted by the same step numbers, detailed description will be made. Is omitted.
[0071]
First, as shown in FIG. 4, when the microcomputer 8 of the ECU 2 determines that the rewrite mode is set in S100 immediately after the reset start, the microcomputer 8 proceeds to S125 without jumping to the control program in the flash ROM 20a.
Then, in S125, the self-ID stored in the mask ROM 20b is transmitted to the memory rewriting device 4, and in S135, a signal (response signal) transmitted from the memory rewriting device 4 will be described later. , A normal signal or an error signal.
[0072]
If it is determined in S135 that the signal from the memory rewriting device 4 is a normal signal, the processing in S150, S160, and S300, that is, the rewriting control program from the memory rewriting device 4 is received and stored in the RAM 22. The control program and the control data stored in the flash ROM 20a are transferred and stored, and the rewrite control program is executed on the RAM 22, thereby rewriting the control program and the control data stored in the flash ROM 20a with the new control program and the control data transmitted from the memory rewriting device 4. Perform processing.
[0073]
On the other hand, if it is determined in S135 that the signal from the memory rewriting device 4 is an error signal, the processing on the ECU 2 side is terminated as it is.
In the second embodiment, the processing of S125 and S135 corresponds to the determination unit and the transfer permission unit.
[0074]
Next, as shown in FIG. 5, the microcomputer 30 of the memory rewriting device 4 first waits in step S405 until an ID transmitted from the ECU 2 is received, and when the ID is received from the ECU 2, the process proceeds to step S415. It is determined whether the received ID from the ECU 2 (received ID) matches the ID (built-in ID) of the ECU stored in the second RAM 36.
[0075]
If it is determined that the two IDs match, the process proceeds to S417, and transmits a normal signal to the ECU 2 indicating that the ID of the memory rewriting device 4 and the ID of the ECU 2 match. I do.
Then, as described above, the microcomputer 8 of the ECU 2 starts the execution of the processing after S150 in FIG. 4, so that the memory rewriting device 4 transmits the normal signal in S417, and then returns to the case of the first embodiment. Similarly, the processes of S420 and S430 are executed, and the rewrite control program stored in the first ROM 34 and the new control program and control data stored in the second ROM 36 are sequentially transmitted to the ECU 2. Send.
[0076]
On the other hand, if it is determined in S415 that the ID (reception ID) from the ECU 2 does not match the ID (built-in ID) of the ECU stored in the second RAM 36, the process proceeds to S445. After transmitting an error signal indicating that the ID of the memory rewriting device 4 does not match the ID of the ECU 2 to the ECU 2, the processing of the memory rewriting device 4 is terminated. Then, as described above, the ECU 2 terminates all the processes without executing the processes after S150 in FIG.
[0077]
That is, in the memory rewriting system of the second embodiment, contrary to the memory rewriting system 5 of the first embodiment, the ECU 2 transmits its own ID to the memory rewriting device 4 (S125), and the memory rewriting device 4 It is determined whether or not the ID from the ECU 2 matches the ID of the ECU that matches the new control program and control data (S415). When both IDs match (S415: YES), the memory rewriting device 4 transmits a normal signal to the ECU 2 (S417), and then transmits a rewriting control program, a new control program, and control data. Only when a normal signal is received from the memory rewriting device 4 (S135: normal signal), the ECU 2 matches the ID of the memory rewriting device 4 with its own ID (S420, S430). Then, the rewriting control program from the memory rewriting device 4 is transferred to the RAM 22 and executed (S150, S160).
[0078]
Also, according to the ECU 2 and the memory rewriting system of the second embodiment, similarly to the first embodiment, the operator can control the IC socket 40 of the memory rewriting device 4 with the control program and the control program which are not compatible with the ECU 2. If the ROM 36 storing the data is mounted and the incompatible control program and control data are likely to be transmitted to the ECU 2, the ID of the memory rewriting device 4 (that is, the new control Since the ID stored in advance corresponding to the program or the like) does not match the ID of the ECU 2 stored in the mask ROM 20b, the ECU 2 does not shift to the operation of transferring the rewrite control program to the RAM 22. Therefore, it is possible to reliably prevent the control program and the control data in the flash ROM 20a from being erroneously rewritten to the control program and the control data that are not compatible with the ECU 2.
[0079]
Also, similarly to the ECU 2 of the first embodiment, the ECU 2 of the second embodiment transfers the rewrite control program transmitted from the memory rewriting device 4 to the volatile RAM 22 and starts up, thereby rewriting the flash ROM 20a. Since the processing is performed, the normal control program and control data stored in the flash ROM 20a are lost or changed even if the CPU 18 executing the program runs away during normal operation of controlling the engine. Can be reliably prevented.
[0080]
[Others]
In the above-described first embodiment, the ID of the memory rewriting device 4 may not be stored in the second ROM 36 in advance, but may be input by an operator operating a predetermined input device.
[0081]
Even with such a memory rewriting system, unless the same ID as the ID stored in the mask ROM 20b of the ECU 2 is transmitted from the memory rewriting device 4 to the ECU 2, the ECU 2 transfers the rewriting control program to the RAM 22. Is not permitted, it is possible to reliably prevent data (control program and control data) in the flash ROM 20a from being carelessly rewritten and from intentionally rewriting data into other data.
[0082]
On the other hand, the ECU 2 of each of the above-described embodiments includes the flash ROM 20a as a nonvolatile memory to which data can be electrically written, but may use an EEPROM.
Further, in the above-described embodiment, the example in which the mask ROM 20b and the flash ROM 20a are provided in the ECU 2 has been described. However, only the flash ROM 20a stores the contents (programs, IDs, and the like) of the mask ROM 20b in the flash ROM 20a. The control program and the area may be stored separately.
[0083]
Further, in each of the above embodiments, the ECU 2 that controls the engine has been described, but the scope of the present invention is not limited to this. That is, the present invention can be similarly applied to an electronic control device that controls a control target such as a brake, a transmission, and a suspension.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating an overall configuration of a memory rewriting system of an electronic control device according to a first embodiment.
FIG. 2 is a flowchart illustrating a process executed on an engine control device (ECU) side of the first embodiment.
FIG. 3 is a flowchart illustrating a process executed on the memory rewriting device side of the first embodiment.
FIG. 4 is a flowchart illustrating a process executed on an engine control device (ECU) according to a second embodiment.
FIG. 5 is a flowchart illustrating a process executed on the memory rewriting device side of the second embodiment.
[Explanation of symbols]
2 ... Engine control device (ECU) 4 ... Memory rewriting device
5. Memory rewriting system 6. Input circuit
8,30 ... Single-chip microcomputer (microcomputer)
10 output circuit 18 CPU 20 ROM
20a: Flash ROM 20b: Mask ROM
22 RAM 24 I / O 25 Communication circuit 32 Power supply circuit
34 first ROM 36 second ROM 38, 40 IC socket
42F: Female connector 42M: Male connector 44: Communication line
46: power supply line 48: signal line SW: rewrite switch
L: signal line for mode determination R: resistor

Claims (8)

通常時には、電気的にデータの書き換えが可能な不揮発性メモリに格納されたデータにより構成される制御プログラム及び制御データに従って所定の制御対象を制御し、外部からの書き換え指令を受けた場合には、前記不揮発性メモリ内のデータを外部装置から送信されて来る新たなデータに書き換えるための書換処理を行う電子制御装置において、
当該電子制御装置は、前記外部装置から送信されて来る書換制御プログラムを、揮発性のメモリ領域に転送して該メモリ領域上で実行することにより、前記書換処理を行うように構成されていると共に、
当該電子制御装置の識別情報を予め記憶する識別情報記憶手段と、
前記書き換え指令を受けると、前記外部装置から前記書換制御プログラムが送信されて来る前に、前記外部装置との間で通信を行うことにより、前記外部装置側にて前記新たなデータと対応して予め記憶された情報であって当該新たなデータに適合する装置を示す識別情報と、前記識別情報記憶手段に記憶された識別情報とが一致しているか否かを判定する判定手段と、
該判定手段により前記両識別情報が一致していると判定された場合にのみ、前記書換制御プログラムの前記メモリ領域への転送を許可する転送許可手段とを備え、
更に、前記識別情報は、当該電子制御装置が制御するエンジンの型式や仕様、或いは、当該電子制御装置が搭載される車種名や車のグレード名毎に設定されていること、
特徴とする電子制御装置。
Normally, when a predetermined control target is controlled according to a control program and control data constituted by data stored in an electrically rewritable non-volatile memory and an external rewrite command is received, An electronic control unit that performs a rewriting process for rewriting data in the nonvolatile memory to new data transmitted from an external device,
The electronic control unit is configured to perform the rewriting process by transferring a rewriting control program transmitted from the external device to a volatile memory area and executing the rewriting control program on the volatile memory area. ,
Identification information storage means for storing identification information of the electronic control device in advance;
Upon receiving the rewrite command, before the rewrite control program is transmitted from the external device, by communicating with the external device, the external device side in correspondence with the new data Identification information that is information stored in advance and indicates a device that matches the new data, and a determination unit that determines whether the identification information stored in the identification information storage unit matches the identification information,
Transfer permission means for permitting transfer of the rewrite control program to the memory area only when it is determined that the two pieces of identification information match by the determination means ,
Further, the identification information is set for each model and specification of the engine controlled by the electronic control device, or for each vehicle type name and vehicle grade name on which the electronic control device is mounted,
Electronic control device according to claim.
請求項1に記載の電子制御装置において、
前記判定手段は、
前記外部装置から送信されて来る前記外部装置側の識別情報を受信し、該受信した識別情報と前記識別情報記憶手段に記憶された識別情報とを比較することにより、前記外部装置側の識別情報と前記識別情報記憶手段に記憶された識別情報とが一致しているか否かを判定すること、
を特徴とする電子制御装置。
The electronic control device according to claim 1,
The determining means includes:
By receiving the identification information of the external device transmitted from the external device, and comparing the received identification information with the identification information stored in the identification information storage means, the identification information of the external device side And determining whether or not the identification information stored in the identification information storage means matches,
An electronic control device characterized by the above-mentioned.
請求項2に記載の電子制御装置に前記外部装置として接続され、前記電子制御装置へ、前記書換制御プログラムと前記新たなデータとを送信するメモリ書換装置であって、
前記新たなデータを、当該新たなデータに適合する装置を示す識別情報と対応させて予め記憶するデータ記憶手段を備えると共に、前記書換制御プログラムを送信する前に、前記新たなデータに対応する前記識別情報を前記電子制御装置へ送信するように構成されていること、
を特徴とするメモリ書換装置。
A memory rewriting device that is connected to the electronic control device according to claim 2 as the external device and transmits the rewriting control program and the new data to the electronic control device,
A data storage unit for storing the new data in advance in association with identification information indicating a device conforming to the new data is provided, and before transmitting the rewriting control program, the new data corresponding to the new data is transmitted. Configured to transmit identification information to the electronic control unit,
A memory rewriting device characterized by the above-mentioned.
請求項2に記載の電子制御装置と、請求項3に記載のメモリ書換装置と、を備えたことを特徴とする電子制御装置のメモリ書換システム。A memory rewriting system for an electronic control device, comprising: the electronic control device according to claim 2; and the memory rewriting device according to claim 3. 請求項1に記載の電子制御装置において、
前記判定手段は、
前記識別情報記憶手段に記憶されている識別情報を前記外部装置へ送信し、その後、前記外部装置側の識別情報と前記送信した識別情報とが一致しているか否かを表す応答信号を前記外部装置から受信することにより、前記外部装置側の識別情報と前記識別情報記憶手段に記憶された識別情報とが一致しているか否かを判定するように構成されていること、
を特徴とする電子制御装置。
The electronic control device according to claim 1,
The determining means includes:
The identification information stored in the identification information storage means is transmitted to the external device, and thereafter, a response signal indicating whether the identification information of the external device matches the transmitted identification information is transmitted to the external device. By receiving from the device, it is configured to determine whether the identification information on the external device side and the identification information stored in the identification information storage means match,
An electronic control device characterized by the above-mentioned.
請求項5に記載の電子制御装置に前記外部装置として接続され、前記電子制御装置へ、前記書換制御プログラムと前記新たなデータとを送信するメモリ書換装置であって、
前記新たなデータを、当該新たなデータに適合する装置を示す識別情報と対応させて予め記憶するデータ記憶手段を備えると共に、前記電子制御装置からの識別情報が、前記新たなデータに対応する識別情報と一致しているか否かを判定して、前記両識別情報が一致している場合に、前記電子制御装置へ、当該メモリ書換装置側の識別情報と前記電子制御装置の識別情報記憶手段に記憶された識別情報とが一致していることを表す前記応答信号を送信し、その後、前記書換制御プログラムを送信するように構成されていること、
を特徴とするメモリ書換装置。
A memory rewriting device that is connected to the electronic control device according to claim 5 as the external device and transmits the rewriting control program and the new data to the electronic control device,
Data storage means for storing the new data in advance in association with identification information indicating a device conforming to the new data, and wherein the identification information from the electronic control device is an identification corresponding to the new data. It is determined whether or not the information matches the identification information.If the two pieces of identification information match each other, the identification information on the memory rewriting device side and the identification information storage means of the electronic control apparatus are transmitted to the electronic control device. Transmitting the response signal indicating that the stored identification information matches, and thereafter transmitting the rewrite control program,
A memory rewriting device characterized by the above-mentioned.
請求項5に記載の電子制御装置と、請求項6に記載のメモリ書換装置と、を備えたことを特徴とする電子制御装置のメモリ書換システム。A memory rewriting system for an electronic control device, comprising: the electronic control device according to claim 5; and the memory rewriting device according to claim 6. 通常時には、電気的にデータの書き換えが可能な不揮発性メモリに格納されたデータにより構成される制御プログラム及び制御データに従って所定の制御対象を制御し、外部からの書き換え指令を受けた場合には、前記不揮発性メモリ内のデータを外部装置から送信されて来る新たなデータに書き換えるための書換処理を行う電子制御装置において、
当該電子制御装置は、前記外部装置から送信されて来る書換制御プログラムを、揮発性のメモリ領域に転送して該メモリ領域上で実行することにより、前記書換処理を行うように構成されていると共に、
当該電子制御装置の識別情報を予め記憶する識別情報記憶手段と、
前記書き換え指令を受けると、前記外部装置から前記書換制御プログラムが送信されて来る前に、前記外部装置から送信されて来る識別情報を受信し、該受信した識別情報と前記識別情報記憶手段に記憶された識別情報とが一致しているか否かを判定する判定手段と、
該判定手段により前記両識別情報が一致していると判定された場合にのみ、前記書換制御プログラムの前記メモリ領域への転送を許可する転送許可手段とを備え、
更に、前記識別情報は、当該電子制御装置が制御するエンジンの型式や仕様、或いは、当該電子制御装置が搭載される車種名や車のグレード名毎に設定されていること、
特徴とする電子制御装置。
Normally, when a predetermined control target is controlled according to a control program and control data constituted by data stored in an electrically rewritable non-volatile memory and an external rewrite command is received, An electronic control unit that performs a rewriting process for rewriting data in the nonvolatile memory to new data transmitted from an external device,
The electronic control unit is configured to perform the rewriting process by transferring a rewriting control program transmitted from the external device to a volatile memory area and executing the rewriting control program on the volatile memory area. ,
Identification information storage means for storing identification information of the electronic control device in advance;
Upon receiving the rewrite command, before the rewrite control program is transmitted from the external device, the external device receives the identification information transmitted from the external device and stores the received identification information and the identification information in the identification information storage unit. Determining means for determining whether or not the identified identification information matches;
Transfer permission means for permitting transfer of the rewrite control program to the memory area only when it is determined that the two pieces of identification information match by the determination means ,
Further, the identification information is set for each model and specification of the engine controlled by the electronic control device, or for each vehicle type name and vehicle grade name on which the electronic control device is mounted,
Electronic control device according to claim.
JP25459296A 1996-09-20 1996-09-26 Electronic control device, memory rewriting device, and memory rewriting system for electronic control device Expired - Lifetime JP3568704B2 (en)

Priority Applications (9)

Application Number Priority Date Filing Date Title
JP25459296A JP3568704B2 (en) 1996-09-26 1996-09-26 Electronic control device, memory rewriting device, and memory rewriting system for electronic control device
US08/934,220 US6275911B1 (en) 1996-09-20 1997-09-19 Memory writing device for an electronic device
KR1019970047921A KR100258147B1 (en) 1996-09-20 1997-09-20 Memory writing device for an electronic device
US09/625,403 US6477626B1 (en) 1996-09-20 2000-07-25 Memory writing device for an electronic device
US09/625,402 US6249848B1 (en) 1996-09-20 2000-07-25 Memory writing device for an electronic device
US09/843,821 US6505280B2 (en) 1996-09-20 2001-04-30 Memory writing device for an electronic device
US10/062,541 US6957296B2 (en) 1996-09-20 2002-02-05 Memory writing device for an electronic device
US10/270,578 US20030041217A1 (en) 1996-09-20 2002-10-16 Memory writing device for an electronic device
US11/217,385 US7493455B2 (en) 1996-09-20 2005-09-02 Memory writing device for an electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP25459296A JP3568704B2 (en) 1996-09-26 1996-09-26 Electronic control device, memory rewriting device, and memory rewriting system for electronic control device

Publications (2)

Publication Number Publication Date
JPH10105468A JPH10105468A (en) 1998-04-24
JP3568704B2 true JP3568704B2 (en) 2004-09-22

Family

ID=17267190

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25459296A Expired - Lifetime JP3568704B2 (en) 1996-09-20 1996-09-26 Electronic control device, memory rewriting device, and memory rewriting system for electronic control device

Country Status (1)

Country Link
JP (1) JP3568704B2 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3785299B2 (en) * 2000-03-16 2006-06-14 本田技研工業株式会社 Memory rewriting system for vehicle control device
DE10112056A1 (en) * 2001-03-14 2002-09-26 Jungheinrich Ag Data modification method for nonvolatile electrically erasable memory by receiving modification routines via bus and storing in volatile memory
JP2006079168A (en) * 2004-09-07 2006-03-23 Denso Corp Electronic control unit and memory rewriting method thereof
JP4556653B2 (en) 2004-12-10 2010-10-06 株式会社デンソー Program rewriting system for in-vehicle electronic control device, boot loader for computer in in-vehicle electronic control device, recording medium, and in-vehicle electronic control device
JP2007148651A (en) * 2005-11-25 2007-06-14 Sanyo Electric Co Ltd Content distribution system
JP4281808B2 (en) 2007-02-09 2009-06-17 トヨタ自動車株式会社 VEHICLE CONTROL DEVICE AND ITS CONTROL METHOD
JP4935867B2 (en) * 2009-08-03 2012-05-23 株式会社デンソー Electronic control device

Also Published As

Publication number Publication date
JPH10105468A (en) 1998-04-24

Similar Documents

Publication Publication Date Title
US6275911B1 (en) Memory writing device for an electronic device
US5912512A (en) Engine start control apparatus
JP4061694B2 (en) Electronic control device and control system
JP2003256228A (en) Program rewriting device
EP1134748B1 (en) Memory rewriting system for vehicle controller
JP4539757B2 (en) Electronic control unit
JPH09160766A (en) Electronic controller
JP3870563B2 (en) Electronic control device and non-volatile memory rewrite count method
JP3568704B2 (en) Electronic control device, memory rewriting device, and memory rewriting system for electronic control device
JP2000259420A (en) Device for updating learning value for electronic controller
US6907495B2 (en) Rewriting system for rewriting a memory on a vehicle controller
JP3828335B2 (en) Rewriting system for vehicle control device
US8078352B2 (en) Electronic control unit for vehicle
JP4066499B2 (en) Electronic control device, electronic control system, and conformity determination method
JPH09128229A (en) Electronic controller
JP3796837B2 (en) Memory writing device for electronic device
JPH09171459A (en) Electronic control equipment
JP2002323990A (en) Electronic controller and method for initializing nonvolatile memory
JPH06259982A (en) Method and device for rewriting flash rom
JP2000181698A (en) Control program rewriting system
JP2003083155A (en) Memory writing system and method for electronic control unit, and general-purpose electronic control unit
KR20080018647A (en) Ecu in a vehicle and reprogramming method of the ecu
JP4633109B2 (en) Remote start control device
JPH11257151A (en) Electronic controller
JP2000145534A (en) Electronic control system for automobile

Legal Events

Date Code Title Description
A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040616

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100625

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110625

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110625

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120625

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120625

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130625

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140625

Year of fee payment: 10

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

EXPY Cancellation because of completion of term