JP3489306B2 - Electronic control unit - Google Patents

Electronic control unit

Info

Publication number
JP3489306B2
JP3489306B2 JP33228195A JP33228195A JP3489306B2 JP 3489306 B2 JP3489306 B2 JP 3489306B2 JP 33228195 A JP33228195 A JP 33228195A JP 33228195 A JP33228195 A JP 33228195A JP 3489306 B2 JP3489306 B2 JP 3489306B2
Authority
JP
Japan
Prior art keywords
data
area
rewriting
program
stored
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 - Fee Related
Application number
JP33228195A
Other languages
Japanese (ja)
Other versions
JPH09171459A (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 JP33228195A priority Critical patent/JP3489306B2/en
Publication of JPH09171459A publication Critical patent/JPH09171459A/en
Application granted granted Critical
Publication of JP3489306B2 publication Critical patent/JP3489306B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 【0001】 【発明の属する技術分野】本発明は、読み出し専用の記
憶手段に格納された制御プログラム及び制御データに従
って所定の制御対象を制御する電子制御装置に関し、特
に、上記記憶手段内の制御プログラムや制御データを書
き換え可能な電子制御装置に関する。 【0002】 【従来の技術】従来より、例えば特開平6−27261
1号公報に開示されているように、自動車のエンジンを
制御する電子制御装置として、電気的にデータの書き換
え(詳しくは、データの消去及び書き込み)が可能な読
み出し専用のROMに、エンジン制御用の制御プログラ
ム及び制御データを構成するデータを格納しておき、こ
のようなROM内のデータを市場への供給後でも書き換
え可能に構成されたものが提案されている。 【0003】即ち、この種の電子制御装置は、通常時に
は、上記ROMに格納されたデータにより構成される制
御プログラム及び制御データに従ってエンジン等の制御
対象を制御するのであるが、別途用意された外部装置が
接続されて、所定の書き換え指令を受けると、ROM内
のデータ(つまり制御プログラムや制御データ)を書き
換えるための書換処理を実行するように構成されてい
る。尚、この書換処理は、ROM内のデータを消去し
て、その消去した記憶領域に、上記外部装置から送信さ
れて来る新たなデータを書き込む、といった手順で実行
される。 【0004】そして、このような電子制御装置によれ
ば、市場への供給後に、何等かの原因で動作内容(制御
内容)を変更しなければならない事態が起こったとして
も、極めて簡単に対応することができる。一方、この種
の電子制御装置において、上述したようにROM内のデ
ータを書き換える際には、ROMの内容を一旦消去する
こととなるため、上記書換処理を実行するための書換プ
ログラムは、書き換え対象となるROM上では起動する
ことができない。 【0005】そこで、上記公報に開示の電子制御装置で
は、書換処理を実行するための書換プログラムを予めR
OMに格納しているのであるが、ROMの書き換えを行
う際には、ROM内の書換プログラムを、データの読み
出し及び書き込みが可能なRAMに転送して、そのRA
M上で書換プログラムを起動させるようにしている。 【0006】 【発明が解決しようとする課題】ところで、通常、この
種の電子制御装置において、制御対象をより正確に制御
するためには、例えば、RAMの記憶領域の一部を、電
源供給の停止後もデータを保持可能なバックアップ領域
として設定し、制御対象を制御する際に演算した学習値
データやフェールセーフ用のデータ等を上記バックアッ
プ領域に格納しておく必要がある。つまり、このように
構成することで、演算した学習値データ等を電源供給の
停止後も継続して記憶することができ、そのデータに基
づき制御対象の経時変化や故障等の影響を抑制可能な制
御量を設定して、制御の信頼性を向上させることができ
るようになるのである。 【0007】しかしながら、上記従来の装置では、RO
M内のデータを書き換える際に、書換プログラムをRA
Mに転送することで、バックアップ領域に格納しておい
た学習値データ等を破壊してしまうという問題があっ
た。尚、上記公報に開示の装置のように、書換処理を実
行するための書換プログラムを予めROMに格納してお
くのではなく、ROM内のデータを書き換える際に、書
換プログラムを外部装置から受信する、といった構成も
考えられるが、この場合にも、外部装置から受信した書
換プログラムをRAMに転送してから起動することとな
るため、上記問題は同様に生じてしまう。 【0008】本発明は、このような問題に鑑みなされた
ものであり、データの読み出し及び書き込みが可能な記
憶手段のバックアップ領域に格納されたデータを消失し
てしまうことなく、読み出し専用の記憶手段に格納され
た制御プログラムや制御データを書き換えることのでき
る電子制御装置を提供することを目的としている。 【0009】 【課題を解決するための手段、及び発明の効果】上記目
的を達成するためになされた請求項1に記載の本発明の
電子制御装置は、電気的にデータの書き換えが可能な読
み出し専用の第1記憶手段と、データの読み出し及び書
き込みが可能であると共に、記憶領域の一部が電源供給
の停止後も継続してデータを保持するためのバックアッ
プ領域として設定された第2記憶手段と、外部装置との
間で通信を行うための通信手段と、を備えている。そし
て、通常時には、第1記憶手段に格納されたデータによ
り構成される制御プログラム及び制御データに従って所
定の制御対象を制御する。また、外部からの書き換え指
令を受けた場合には、第1記憶手段内のデータを外部装
置から送信されて来る新たなデータに書き換える処理を
実行するための書換プログラムを、第2記憶手段内へ転
送して起動させ、この書換プログラムの実行により、第
1記憶手段内のデータを外部装置から送信されて来る新
たなデータに書き換える。 【0010】 【0011】 【0012】 【0013】 ここで特に、請求項に記載の電子制御
装置は、第2記憶手段内におけるバックアップ領域を表
すアドレス情報を記憶するアドレス情報記憶手段を備え
ており、書き換え指令を受けた場合には、書換プログラ
ムを、アドレス情報記憶手段に記憶されたアドレス情報
に基づき、第2記憶手段の記憶領域のうちバックアップ
領域以外の記憶領域に転送して起動させる。そして更
に、請求項1に記載の電子制御装置は、バックアップ領
域変更手段とアドレス情報更新手段とを備えている。そ
して、バックアップ領域変更手段は、当該電子制御装置
が通常時の制御動作を行う際に、第2記憶手段のバック
アップ領域に格納すべきデータの量に応じて、第2記憶
手段内におけるバックアップ領域を変更し、アドレス情
報更新手段は、バックアップ領域変更手段によるバック
アップ領域の変更に応じて、アドレス情報記憶手段に記
憶されたアドレス情報を更新する。 【0014】 そして、このような請求項に記載の電
子制御装置によれば、書換プログラムを、第2記憶手段
内におけるバックアップ領域以外の記憶領域に確実に転
送することができるため、第2記憶手段のバックアップ
領域に格納された貴重なデータを消失してしまうことな
く、第1記憶手段内の制御プログラムや制御データを書
き換えることができる。また、請求項1に記載の電子制
御装置では、第2記憶手段のバックアップ領域に格納す
べきデータの量に応じて、第2記憶手段のバックアップ
領域を変更すると共に、そのバックアップ領域の変更に
応じて、第2記憶手段内におけるバックアップ領域を表
すアドレス情報を更新するようにしている。よって、第
2記憶手段のバックアップ領域が変更されても、書換プ
ログラムを、第2記憶手段のバックアップ領域以外の記
憶領域に確実に転送できるようになる。従って、請求項
1に記載の電子制御装置によれば、第2記憶手段のバッ
クアップ領域に格納すべきデータの量に応じた上記バッ
クアップ領域の変更動作と、上記バックアップ領域に格
納されたデータを書換プログラムの転送により消失して
しまうことの防止とを、確実に両立することができる。 【0015】 尚、請求項1に記載の電子制御装置にお
いて、電気的にデータの書き換えが可能な読み出し専用
の第1記憶手段としては、フラッシュEEPROM(通
称、フラッシュROM或いはフラッシュメモリ)やEE
PROMが一般的であるが、他のROMでも良い。ま
た、データの読み出し及び書き込みが可能な第2記憶手
段としては、通常の揮発性RAMが一般的であるが、フ
ラッシュEEPROMやEEPROMでも良い。そし
て、第2記憶手段として、揮発性のRAMを用いた場合
には、その記憶領域の一部を電池等で電源バックアップ
することにより、バックアップ領域を設けることがで
き、また、第2記憶手段として、フラッシュEEPRO
MやEEPROM等の不揮発性メモリを用いた場合に
は、その記憶領域の一部をバックアップ領域として用い
るように設定すればよい。 【0016】 一方、請求項1に記載の電子制御装置に
おいて、上記書換プログラムは、外部装置から受信して
第2記憶手段内へ転送するようにしても良いし、また、
第1記憶手段内に予め格納しておき、第1記憶手段から
第2記憶手段へ転送するようにしても良い。そして、前
者の場合には、書換プログラムを格納しておくための記
憶領域が不要であるため、メモリ容量の面で特に有利で
ある。また、後者の場合でも、第1記憶手段内のデータ
を書き換える際に、外部装置との間で行わなければなら
ない通信手順が減るという面では利点がある。 【0017】 【0018】 【0019】 【0020】 【0021】 【0022】 【0023】 【0024】 【0025】 【0026】 【0027】 【発明の実施の形態】以下、本発明が適用された実施例
について図面を用いて説明する。尚、本発明の実施の形
態は、下記の実施例に何ら限定されることなく、本発明
の技術的範囲に属する限り、種々の形態を採り得ること
は言うまでもない。 【0028】[第1実施例]まず、図1は、自動車に搭
載されて内燃機関型エンジンの制御を行うエンジン制御
装置(以下、ECUという)1と、ECU1に内蔵され
たエンジン制御用のプログラムやデータを書き換える際
にECU1に接続されるメモリ書換装置2とからなる、
第1実施例の電子制御装置のメモリ書換システム3の全
体構成を表すブロック図である。 【0029】図1に示すように、ECU1は、エンジン
の運転状態を検出する様々なセンサ4からの信号を入力
して波形処理する入力処理回路6と、入力処理回路6か
らのセンサ信号に基づきエンジンに対する最適制御量を
演算し、その演算結果に基づき制御信号を出力するCP
U8と、CPU8からの制御信号を受けて、エンジンに
取付けられたインジェクタ(燃料噴射弁)やイグナイタ
等のアクチュエータ10を駆動する出力回路12とを備
えている。 【0030】そして、CPU8には、プログラムに従い
動作するマイクロ・プロセッサ・ユニット(以下、MP
Uという)18と、MPU18を動作させるのに必要な
プログラム及びデータを格納する不揮発性のROM20
と、MPU18の演算結果等を格納するRAM22と、
前記入力処理回路6等からの信号を受けると共に、出力
回路12に制御信号を出力するI/O24と、メモリ書
換装置2との間でシリアルデータ通信を行うための、通
信手段としての通信回路25とが備えられている。 【0031】ここで、CPU8のROM20及びRAM
22について説明する。まず、ROM20としては、電
気的にデータの消去及び書き込みが可能なフラッシュE
EPROM(通称、フラッシュROM又はフラッシュメ
モリ)が用いられており、ROM20の記憶領域は、デ
ータの書き換えが可能な、書き換え可能領域20aと、
データの書き換えが不能な(又はデータの書き換えが禁
止された)、書き換え不能領域20bとに分けられてい
る。 【0032】そして、ROM20及びRAM22の記憶
領域を表す図2に示すように、書き換え可能領域20a
は、エンジン制御用の制御プログラム及び制御データを
構成するデータを格納するためのエリアとして用いられ
ており、この書き換え可能領域20aには、該当する上
記データ(即ち制御プログラム及び制御データ)が既に
格納されている。また、書き換え不能領域20bは、リ
セット直後に実行されるブートプログラムを構成するデ
ータを格納するためのエリアとして用いられており、こ
の書き換え不能領域20bには、該当するデータ(即ち
ブートプログラム)が既に格納されている。 【0033】次に、RAM22の記憶領域は、図2に示
すように、電源供給の停止後もデータを保持可能なバッ
クアップ領域22aと、電源供給の停止によりデータが
消失する演算用ワーク領域(即ち通常のRAM領域)2
2bとに分けられている。そして、バックアップ領域2
2aには、MPU18が上記制御プログラムを実行した
際に演算し且つ電源供給の停止後も記憶しておかなけれ
ばならない学習値データやフェールセーフ用のデータ等
が格納され、また特に、アドレス情報記憶手段としての
バックアップ領域22aの先頭領域には、当該バックア
ップ領域22aの開始アドレスを示す情報及び終了アド
レスを示す情報(以下、開始・終了アドレス情報とい
う)が格納されている。これに対して、RAMの演算用
ワーク領域22bは、MPU18の演算結果等が一時的
に格納される。また、演算用ワーク領域22b、或い
は、演算用ワーク領域22b及びバックアップ領域22
aには、後述するように、ROM20の書き換え可能領
域20aに格納されたデータを書き換える際にメモリ書
換装置2から送信されて来るROM書換プログラムが格
納される。 【0034】尚、本実施例においては、ROM20の書
き換え可能領域20aが第1記憶手段に相当しており、
RAM22が第2記憶手段に相当している。また、RA
M22は、バックアップ領域22aと演算用ワーク領域
(通常のRAM領域)22bとの割り振りが、ソフトウ
ェアにより任意に設定可能なものが用いられている。そ
して、RAM22には、アドレス1番地当りに8ビット
(=1バイト)のデータが格納される。 【0035】一方、図1に示すように、外部装置として
のメモリ書換装置2は、ECU1側のROM20の書き
換え可能領域20aに格納された制御プログラムや制御
データを書き換えるためにECU1側のCPU8とシリ
アルデータ通信を行うCPU14aと、CPU14aに
より制御されて、ECU1側のCPU8へ、ROM20
(書き換え可能領域20a)の書き換え時に必要な高電
圧(本実施例では12V)を供給する12V電源回路1
4bと、ECU1に対してROM20の書き換え指令を
行うための指令スイッチSWとを備えている。 【0036】そして、ECU1とメモリ書換装置2との
接続は、接続用コネクタ26を介して互いの通信ライン
28,電源供給ライン29,及びモード判定用信号ライ
ン30が夫々接続されることにより行われる。即ち、接
続用コネクタ26が嵌合されると、通信ライン28を介
して、メモリ書換装置2側のCPU14aとECU1側
のCPU8との間におけるシリアルデータ通信が可能と
なり、また、電源供給ライン29を介して、メモリ書換
装置2側の12V電源回路14bからECU1側のCP
U8へROM20の書き換えに必要な電圧(12V)が
供給される。そして更に、モード判定用信号ライン30
は、ECU1側で抵抗器Rにより5Vにプルアップされ
ていると共に、メモリ書換装置2側で指令スイッチSW
を介して接地電位(0V)に接続されるようになってい
るため、接続用コネクタ26が嵌合されて指令スイッチ
SWがオンされると、ECU1側においてはモード判定
用信号ライン30がハイレベル(5V)からロウレベル
(0V)に変化することとなり、CPU8は、モード判
定用信号ライン30がロウレベルであれば、当該ECU
1にメモリ書換装置2が接続されて、ROM20の書き
換え指令があったものと判定する。 【0037】このように構成されたメモリ書換システム
3では、上述したように、ECU1において、ROM2
0の書き換え可能領域20aには、エンジン制御用の制
御プログラム及び制御データが格納されており、また、
ROM20の書き換え不能領域20bには、書き換え対
象とならないブートプログラムが格納されている。 【0038】そして、ECU1のCPU8は、車両のイ
グニッションスイッチがオンされて、ECU1内の電源
回路(図示省略)から動作電圧(5V)が供給される
と、リセット状態から動作を開始して、ROM20の書
き換え不能領域20bに格納されているブートプログラ
ムを起動する。そして、メモリ書換装置2が接続されて
いないか或いは上記指令スイッチSWがオンされていな
い通常時には、ブートプログラムにてROM20の書き
換え可能領域20aに格納されている制御プログラムを
コールして、エンジンの制御を行っている。 【0039】また、CPU8は、ブートプログラムを起
動した際に、メモリ書換装置2が接続されて上記指令ス
イッチSWがオンされたと判定すると、メモリ書換装置
2(CPU14a)から通信ライン28を介して送信さ
れて来るROM書換プログラムを、RAM22に転送
し、そのROM書換プログラムをRAM22上で起動す
ることにより、ROM20の書き換え可能領域20a内
に格納されているデータを、その後メモリ書換装置2か
ら送られて来る新たなデータ(つまり、新たな制御プロ
グラム及び制御データ)に書き換える。 【0040】一方、メモリ書換装置2は、ECU1に接
続された後に作業者によって所定の操作が行われると、
後述する図3の処理に則って、ECU1へ、2種類のR
OM書換プログラムの内の何れか一方と、エンジン制御
用の新たな制御プログラム及び制御データを構成するデ
ータとを、順次送信するように構成されている。 【0041】そこで次に、メモリ書換装置2のCPU1
4aにて実行される処理と、ECU1のCPU8にて実
行される処理について、図3〜図6を用いて説明する。
尚、図3は、メモリ書換装置2のCPU14aにて実行
される処理を表すフローチャートである。また、図4
は、ECU1のCPU8にて実行される処理を表すフロ
ーチャートであり、そのステップ(以下、単に「S」と
記す)100〜S150の処理が、書き換え不能領域2
0b内のブートプログラムによって実行され、S200
の処理が、書き換え可能領域20a内の制御プログラム
によって実行される。そして、S300〜S315の処
理が、後述するようにメモリ書換装置2から送信されて
RAM22に転送される第1のROM書換プログラムに
よって実行され、また、S400,S405の処理が、
後述するようにメモリ書換装置2から送信されてRAM
22に転送される第2のROM書換プログラムによって
実行される。 【0042】まず、メモリ書換装置2では、作業者が所
定の操作を行うと、CPU14aが図3に示す処理を実
行する。即ち、最初のS10にて、後述するようにEC
U1から送信されて来るRAM容量情報を受信して、E
CU1側のRAM22におけるバックアップ領域22a
以外の記憶領域、即ち演算用ワーク領域22bの容量を
チェックし、続くS20にて、ECU1側のRAM22
のバックアップ領域22aに格納されたデータを吸い上
げる必要があるか否かを判定する。尚、この判定では、
ECU1からのRAM容量情報によって検出される演算
用ワーク領域22bの容量と、今からECU1へ送信し
ようとしているROM書換プログラム(特に後述する第
2のROM書換プログラム)の容量とを比較し、前者よ
りも後者の方が大きくて、RAM22の演算用ワーク領
域22bに第2のROM書換プログラムが格納できない
場合に、データの吸い上げが必要であると判定する。 【0043】そして、S20で、バックアップ領域22
a内のデータを吸い上げる必要があると判定した場合に
は、S30に進んで、ECU1へ、バックアップ領域2
2a内のデータを送信させるための吸い上げ要求を送信
し、続くS40にて、上記吸い上げ要求に応じてECU
1から送信されて来るバックアップ領域22a内のデー
タを受信して、所定の記憶媒体に保存する。そして、こ
の場合には、続くS50にて、ECU1へ、図4のS3
00〜S315の処理を実行させるための第1のROM
書換プログラムを送信する。 【0044】これに対し、S20で、データの吸い上げ
が不要と判断した場合には、S60に移行して、ECU
1へ、図4のS400,S405の処理を実行させるた
めの第2のROM書換プログラムを送信する。そして、
S50或いはS60の処理を実行すると、S70に移行
して、ECU1へ、ROM20の書き換え可能領域20
aに旧来の制御プログラム及び制御データに代えて格納
すべき新たな制御プログラム及び制御データを送信し、
続くS80にて、S20で肯定判定してECU1側から
バックアップ領域22a内のデータを吸い上げたか否か
を判定する。そして、データの吸い上げを行ったと判定
した場合には、S90に進んで、上記S40で所定の記
憶媒体に保存したバックアップ領域22a内のデータを
ECU1へ送信し、その後、当該メモリ書換装置側の処
理を終了する。また、S80で、データの吸い上げを行
わなかったと判定した場合には、そのまま当該メモリ書
換装置側の処理を終了する。 【0045】よって、メモリ書換装置2のCPU14a
が図3の処理を実行することにより、メモリ書換装置2
とECU1との間では、図6の通信タイムチャートに示
すような通信が行われることとなる。即ち、メモリ書換
装置2は、ECU1から後述するように送信されて来る
RAM容量情報を受信すると(S10)、ECU1側の
RAM22のバックアップ領域22aに格納されたデー
タを吸い上げる必要がある場合にだけ(S20:YE
S)、ECU1へ吸い上げ要求を送信する(S30)。
そして、吸い上げ要求を送信した場合には、その要求に
応じてECU1から送信されて来るバックアップ領域2
2a内のデータを受信して保存した後(S40)、EC
U1へ第1のROM書換プログラムを送信し(S5
0)、また、吸い上げ要求を送信しなかった場合には
(S20:NO)、ECU1からのRAM容量情報を受
信した後に、ECU1へ第2のROM書換プログラムを
送信する(S60)。そして更に、第1及び第2のRO
M書換プログラムの内の何れか一方を送信した後、EC
U1へ新たな制御プログラム及び制御データを送信し
(S70)、その後、吸い上げ要求信号を送信した場合
には(S80:YES)、上記保存しておいたECU1
側からのデータをECU1へ送信して(S90)、一連
の通信を終了する。尚、図6において、点線で示す通信
データは、メモリ書換装置2から吸い上げ要求を送信し
た場合のものであり、また、t1〜t5で示される時間
は、各通信データを送信する間のアイドル時間である。 【0046】次に、ECU1では、電源が投入される
と、CPU8がリセット状態から動作を開始して、図4
に示す処理を実行する。即ち、最初に、ROM20の書
き換え不能領域20bに格納されたブートプログラムを
起動して、まずS100にて、ROM書換モードである
か否かを、モード判定用信号ライン30がロウレベルで
あるか否かによって判定し、ロウレベルでなければRO
M書換モードではない通常モードであると判断して、S
105に進む。 【0047】そして、S105にて、RAM22のバッ
クアップ領域22aの次以降の記憶領域、即ち演算用ワ
ーク領域22bをクリアして初期設定を行い、その後、
エンジン制御プログラムへジャンプする。すると、RO
M20の書き換え可能領域20aに格納されている制御
プログラムが起動され、その後は、図4のS200に示
すように、エンジン制御データを参照して行われるエン
ジン制御処理が実行される。尚、S200のエンジン制
御処理は、入力処理回路6からの各種センサ信号とRO
M20の書き換え可能領域20aに格納された制御デー
タとに基づき、エンジンに対する最適な燃料噴射量や点
火時期等を演算し、その演算結果に応じてインジェクタ
やイグナイタ等のアクチュエータ10を駆動するための
制御信号を出力する、といった手順で実行される。そし
て、このようなエンジン制御処理が実行されることによ
り、エンジンの運転が可能となる。 【0048】一方、ブートプログラムにおいて、上記S
100でROM書換モードであると判断した場合には、
S110に移行して、上述したRAM容量情報をメモリ
書換装置2へ送信する。尚、このRAM容量情報は、R
AM22におけるバックアップ領域22a以外の演算用
ワーク領域22bの容量を表す情報であり、CPU8
は、既述したようにRAM22のバックアップ領域22
aに格納されている開始・終了アドレス情報に基づい
て、RAM容量情報を生成する。よって、メモリ書換装
置2は、上述した図3のS10にて、このRAM容量情
報を受信することにより、当該ECU1のRAM22に
おける演算用ワーク領域22bの容量をチェックするこ
とができる。なお、メモリ書換装置2側でRAM22の
全容量が分かっていれば、RAM容量情報として、上記
開始・終了アドレス情報をそのまま送信するようにして
もよい。つまり、この場合には、メモリ書換装置2側
で、開始・終了アドレス情報に基づきバックアップ領域
22aの容量を知ることができ、延いては、演算用ワー
ク領域22bの容量も知ることができるのである。 【0049】そして、S110でRAM容量情報を送信
した後、続くS115にて、所定時間内にメモリ書換装
置2からの上記吸い上げ要求を受信したか否かに基づ
き、メモリ書換装置2から送信されて来るROM書換プ
ログラムが、RAM22のバックアップ領域22a以外
の演算用ワーク領域22bに格納可能であるか否かを判
定する、判定手段としての処理を実行する。そして、吸
い上げ要求を受信した場合には、ROM書換プログラム
が演算用ワーク領域22bに格納しきれないと判定し
て、S120に進み、RAM22のバックアップ領域2
2aに現在格納されているデータを、メモリ書換装置2
に保存させるべく当該データをメモリ書換装置2へ送信
する。そして、続くS125にて、メモリ書換装置2か
らのシリアルデータを受信するまで待機し、シリアルデ
ータを受信したと判定すると、この場合は、当該データ
が図3のS50で送信された第1のROM書換プログラ
ムを構成するデータであることから、S130に進み、
メモリ書換装置2からの第1のROM書換プログラムを
受信して、RAM22の先頭番地(即ちバックアップ領
域22aの先頭番地)より順次格納する。そして、続く
S135にて、RAM22の先頭番地へジャンプする。 【0050】すると、上記S125,S130の処理に
よってメモリ書換装置2からRAM22に転送された第
1のROM書換プログラムが起動され、これによりS3
00〜S315の処理が実行される。尚、第1のROM
書換プログラムは、S300及びS305の処理を実行
するための、ROM20の書き換え可能領域20aに関
する書換プログラムと、S310及びS315を実行す
るための、RAM22のバックアップ領域22aに関す
る書換プログラムとからなり、図5(A)に示すよう
に、少なくとも後者のバックアップ領域22aに関する
書換プログラムは、バックアップ領域22a以外の演算
用ワーク領域22b内に格納される。つまり、後述する
ようにS310及びS315の処理では、バックアップ
領域22a内のデータを取り扱うため、その処理を実行
するためのプログラムは、バックアップ領域22a以外
に配置するのである。 【0051】このようにして第1のROM書換プログラ
ムが起動されると、まずS300にて、メモリ書換装置
2からのシリアルデータを受信するまで待機し、シリア
ルデータを受信したと判定すると、この場合は、当該デ
ータが図3のS70で送信された新たな制御プログラム
及び制御データを構成するデータであることから、S3
05に進んで、メモリ書換装置2からの新たな制御プロ
グラム及び制御データを受信すると共に、ROM20の
書き換え可能領域20aを消去して、消去した領域に受
信した新たな制御プログラム及び制御データを書き込
む。そして更に、続くS310にて、再びメモリ書換装
置2からのシリアルデータを受信するまで待機し、シリ
アルデータを受信したと判定すると、この場合は、当該
データが図3のS90で送信されたデータ、即ち、元々
バックアップ領域22aに格納されていたデータである
ことから、S315に進み、メモリ書換装置2からのデ
ータを受信して、RAM22のバックアップ領域22a
に格納し、その後、全ての処理を終了する。 【0052】一方、上記S115で、所定時間内にメモ
リ書換装置2からの吸い上げ要求を受信しなかった場合
には、メモリ書換装置2からのROM書換プログラム
が、RAM22のバックアップ領域22a以外の演算用
ワーク領域22bに格納可能であると判定して、S14
0に移行する。そして、このS140にて、メモリ書換
装置2からのシリアルデータを受信するまで待機し、シ
リアルデータを受信したと判定すると、この場合は、当
該データが図3のS60で送信された第2のROM書換
プログラムを構成するデータであることから、S145
に進んで、メモリ書換装置2からの第2のROM書換プ
ログラムを受信する。そして更に、このS145にて、
RAM22のバックアップ領域22aに格納されている
開始・終了アドレス情報に基づきバックアップ領域22
aの最終アドレスを検出し、上記受信した第2のROM
書換プログラムを、RAM22のバックアップ領域22
aの後に(換言すれば、演算用ワーク領域22bの先頭
番地より)順次格納する。そして、続くS150にて、
RAM22のバックアップ領域22aの最終アドレス直
後(換言すれば、演算用ワーク領域22bの先頭番地)
へジャンプする。 【0053】すると、上記S140,S145の処理に
よってメモリ書換装置2からRAM22に転送された第
2のROM書換プログラムが起動され、これによりS4
00及びS405の処理が実行される。尚、第2のRO
M書換プログラムは、ROM20の書き換え可能領域2
0aに関する書換プログラムだけからなり、図5(B)
に示すように、バックアップ領域22a以外の演算用ワ
ーク領域22bにのみ格納される。 【0054】このようにして第2のROM書換プログラ
ムが起動されると、まずS400にて、メモリ書換装置
2からのシリアルデータを受信するまで待機する。そし
て、シリアルデータを受信したと判定すると、この場合
は、当該データが図3のS70で送信された新たな制御
プログラム及び制御データを構成するデータであること
から、S405に進んで、メモリ書換装置2からの新た
な制御プログラム及び制御データを受信すると共に、R
OM20の書き換え可能領域20aを消去して、消去し
た領域に受信した新たな制御プログラム及び制御データ
を書き込む。そして、S405の処理を実行した後、全
ての処理を終了する。以上のように、本第1実施例のメ
モリ書換システム3におけるECU1では、モード判定
用信号ライン30がロウレベルであると判定すると(S
100:YES)、RAM22のバックアップ領域22
aに格納されている開始・終了アドレス情報に基づき生
成したRAM容量情報をメモリ書換装置2へ送信し、こ
れに応答してメモリ書換装置2が吸い上げ要求を送信し
たか否かに基づき、ROM書換プログラムがRAM22
のバックアップ領域22a以外の演算用ワーク領域22
bに格納可能であるか否かを判定するようにしている
(S110,S115)。 【0055】そして、ROM書換プログラムが演算用ワ
ーク領域22bに格納不能であると判定した場合には
(S115:YES)、RAM22のバックアップ領域
22aに現在格納されているデータをメモリ書換装置2
へ送信して(S120)、そのデータをメモリ書換装置
2側に保存させてから、メモリ書換装置2からの第1の
ROM書換プログラムをRAM22の全領域へ転送して
起動させることにより(S125〜S135)、ROM
22内のデータをメモリ書換装置2からの新たなデータ
に書き換え(S300,S305)、更にその後、元々
RAM22のバックアップ領域22aに格納されていた
データを、メモリ書換装置2から受信してバックアップ
領域22aに戻すようにいている(S310,S31
5)。 【0056】また、ROM書換プログラムがRAM22
の演算用ワーク領域22bに格納可能であると判定した
場合には(S115:NO)、バックアップ領域22a
内のデータをメモリ書換装置2へ送信することなく、メ
モリ書換装置2からの第2のROM書換プログラムを、
バックアップ領域22aに格納されている開始・終了ア
ドレス情報に基づきRAM22の演算用ワーク領域22
bに転送して起動させ(S140〜S150)、これに
より、ROM22内のデータをメモリ書換装置2からの
新たなデータに書き換えるようにしている(S400,
S405)。 【0057】つまり、本実施例のECU1では、ROM
書換プログラムが、RAM22のバックアップ領域22
a以外の記憶領域に格納可能であるか否かを判定して、
格納不能であれば、ROM書換プログラムのRAM22
への転送によりバックアップ領域22a内のデータを消
失してしまうことから、バックアップ領域22a内のデ
ータをメモリ書換装置2側へ退避させた後、ROM書換
プログラムをRAM22の任意領域に転送して起動させ
るようにしており、また逆に、格納可能であれば、RO
M書換プログラムをRAM22のバックアップ領域22
a以外の記憶領域だけに転送して起動させるようにして
いる。 【0058】従って、本実施例のECU1によれば、R
AM22のバックアップ領域22aに格納された学習値
データやフェールセーフ用のデータ等を消失してしまう
ことなく、ROM20の内容を書き換えることができ
る。しかも、本実施例のECU1では、ROM書換プロ
グラムをRAM22へ転送することでバックアップ領域
22a内のデータが本当に消失されてしまう場合にの
み、バックアップ領域22a内のデータをメモリ書換装
置2側へ退避させるようにしているため、バックアップ
領域22a内のデータをメモリ書換装置2との間で送受
信するという動作を、最小限に抑えることができる。 【0059】[第2実施例]次に、第2実施例の電子制
御装置のメモリ書換システムについて説明する。第2実
施例のメモリ書換システムは、上述した第1実施例に対
して、ECU1のCPU8が、図4のS200で実行す
るエンジン制御処理の中で、図7に示すフェールセーフ
処理を所定時間毎に繰り返して実行する点だけが異なっ
ている。 【0060】そこで以下、このフェールセーフ処理につ
いて説明する。図7に示すように、CPU8がフェール
セーフ処理の実行を開始すると、まず、S500にて、
センサ4やアクチュエータ10或いはエンジン自体等に
異常が発生したか否かを検出するための異常検出処理を
実行し、続くS505にて、異常があったか否かを判定
する。そして、異常がないと判定した場合には、そのま
ま当該フェールセーフ処理を終了するが、異常があった
と判定した場合には、S510に進む。 【0061】そして、このS510にて、RAM22の
バックアップ領域22aに前述の如く格納されている終
了アドレス情報を読み出し、続くS515にて、S50
0の処理で検出した異常の種別を表す異常発生コードの
容量分(本実施例では2バイト)だけ、RAM22のバ
ックアップ領域22aを拡張設定する、バックアップ領
域変更手段としての処理を実行し、その拡張した領域に
上記異常発生コードを格納する。そして更に、続くS5
20にて、異常検出時のエンジン状態を表すデータの容
量分(本実施例では14バイト)だけ、RAM22のバ
ックアップ領域22aを拡張設定する、バックアップ領
域変更手段としての処理を実行し、その拡張した領域に
上記データを格納する。 【0062】そして、続くS525にて、バックアップ
領域22aの終了アドレス情報を更新する、アドレス情
報更新手段としての処理を実行した後、当該フェールセ
ーフ処理を終了する。尚、S525で行われる終了アド
レス情報の更新は、S510で読み出した終了アドレス
情報の値に、S515及びS520の処理で格納した合
計16バイトのデータに相当するアドレス増加分(本実
施例ではRAM22の1番地当りに1バイトのデータが
格納されるため「16」となる。)を加算し、その加算
後の値を、新たな終了アドレス情報としてバックアップ
領域22aの先頭領域に格納する、といった手順で行わ
れる。 【0063】従って、例えば図8に示すように、RAM
22の$F0000番地から$F1000番地までが最
初にバックアップ領域22aとして設定されている場合
に、図7のS500によって異常が検出された場合に
は、上記S510〜S525の実行により、バックアッ
プ領域22aが$F0000番地から$F1010番地
までに拡張されると共に、終了アドレス情報の値も$F
1000から$F1010に更新されこととなる。そし
て、その後更に、もう1回異常が検出された場合には、
バックアップ領域22aが$F0000番地から$F1
020番地までに拡張されると共に、終了アドレス情報
の値も$F1010から$F1020に更新されことと
なる。尚、「$」は、その後に続く文字(0〜9,A〜
F)が16進数を表すことを示している。 【0064】つまり、第2実施例のECU1では、RA
M22のバックアップ領域22aに格納すべきデータの
量に応じて、RAM22のバックアップ領域22aを変
更すると共に、そのバックアップ領域22aの変更に応
じて、バックアップ領域22aの終了アドレス情報を更
新するようにしている。 【0065】そして、本第2実施例のECU1では、メ
モリ書換装置2が接続されて指令スイッチSWがオンさ
れた場合、即ち図4のS100でROM書換モードであ
ると判定した場合には、図7のS525で更新された最
新の終了アドレス情報に基づき図4のS110以降の処
理を実行することとなるため、RAM22のバックアッ
プ領域22aが変更されても、ROM書換プログラムが
RAM22のバックアップ領域22a以外の記憶領域
(即ち演算用ワーク領域22b)に格納可能であるか否
かを確実に判定でき、且つ、ROM書換プログラムが演
算用ワーク領域22bに格納可能である場合に、ROM
書換プログラムをRAM22の演算用ワーク領域22b
に確実に転送することができる。 【0066】従って、第2実施例のECU1によれば、
バックアップ領域22aに格納すべきデータの量に応じ
たバックアップ領域22aの変更動作と、バックアップ
領域22aに格納されたデータをROM書換プログラム
の転送により消失してしまうことの防止とを、確実に両
立することができる。 【0067】[その他] (1)上記第1及び第2実施例のECU1において、ブ
ートプログラムにより実行される図4のS100〜S1
50の処理の内、S110,S115,S140〜S1
50を削除して、S110で肯定判定された場合にS1
20以降の処理を実行するようにしてもよい。尚、この
場合に、メモリ書換装置2のCPU14aは、図3のS
40,S50,S70,及びS90の処理だけを順次実
行する。 【0068】つまり、このようにすれば、ECU1は、
メモリ書換装置2が接続されて指令スイッチSWがオン
されると、ROM書換プログラムがRAM22の演算用
ワーク領域22bに格納可能か否かに関わらず、バック
アップ領域22aに現在格納されているデータを、メモ
リ書換装置2へ送信して一時保存させることとなる。そ
して、このようにしても、RAM22のバックアップ領
域22aに格納された学習値データ等を消失してしまう
ことなく、ROM20の内容を書き換えることができ
る。 【0069】(2)上記第1及び第2実施例のECU1
において、ROM書換プログラム(特に第2のROM書
換プログラム)がRAM22の演算用ワーク領域22b
に格納可能であることが確定しているのであれば、ブー
トプログラムにより実行される図4のS100〜S15
0の処理の内、S110〜S135を削除して、S11
0で肯定判定された場合にS140以降の処理を実行す
るようにしてもよい。尚、この場合に、メモリ書換装置
2のCPU14aは、図3のS60及びS70の処理だ
けを順次実行する。 【0070】つまり、このようにしても、ECU1は、
メモリ書換装置2が接続されて指令スイッチSWがオン
されると、メモリ書換装置2からのROM書換プログラ
ム(第2のROM書換プログラム)を、RAM22の演
算用ワーク領域22bに確実に転送することができるた
め、バックアップ領域22a内の学習値データ等を消失
してしまうこを防止することができる。 【0071】(3)第1実施例のECU1のように、R
AM22のバックアップ領域22a及び演算用ワーク領
域22bの容量が変化しない場合には、バックアップ領
域22aの開始・終了アドレス情報は、ROM20の書
き換え不能領域20b内に、或いは、ROM20の書き
換え可能領域20a内にて制御プログラム及び制御デー
タと一緒に、格納しておくようにしてもよい。 【0072】(4)第1実施例のECU1に対して上記
(2)の形態を採用した場合には、外部装置であるメモ
リ書換装置2からECU1へ、バックアップ領域22a
の開始・終了アドレス情報を送信するようにしてもよ
い。 (5)上記各実施例において、バックアップ領域22a
の開始・終了アドレス情報(特に終了アドレス情報)の
代わりに、演算用ワーク領域22bの開始アドレス情報
を用いてもよい。 【0073】(6)上記各実施例のECU1では、RO
M書換プログラムをメモリ書換装置2から受信してRA
M22へ転送するものであったが、ROM20の書き換
え不能領域20bにROM書換プログラムを格納してお
き、そのROM書き換えプログラムをROM20からR
AM22へ転送する構成の場合でも同様である。 【0074】例えば、第1及び第2実施例の場合につい
て説明すると、ECU1は、図4のS110及びS11
5の処理に代えて、バックアップ領域22aの開始・終
了アドレス情報に基づきRAM22の演算用ワーク領域
22bの容量を判別し、その判別した容量と第2のRO
M書換プログラムの容量とを比較して、第2のROM書
換プログラムがRAM22の演算用ワーク領域22bに
格納可能であるか否かを判定すればよい。そして、S1
25,S130或いはS140,S145の処理では、
ROM20の書き換え不能領域20bから、第1及び第
2のROM書換プログラムの内の対応する方を読み出し
て、RAM22へ格納するようにすればよい。尚、この
場合、メモリ書換装置2は、ECU1から最初にバック
アップ領域22a内のデータが送信されて来た場合に
は、図3のS40,S70,S90の処理を実行し、そ
うでなければ、図3のS70の処理だけを実行すればよ
い。そして、このような構成は、第2実施例のように、
RAM22のバックアップ領域22a及び演算用ワーク
領域22bの容量が変化するような場合に、特に有効で
ある。 【0075】(7)上記各実施例では、エンジンを制御
するECU1について説明したが、本発明の適用範囲
は、これに限られない。即ち、例えばブレーキ、トラン
スミッション、サスペンション等の制御対象を制御する
電子制御装置に対しても、全く同様に適用することがで
きる。
DETAILED DESCRIPTION OF THE INVENTION [0001] BACKGROUND OF THE INVENTION 1. Field of the Invention
According to the control program and control data stored in the storage means.
The present invention relates to an electronic control device for controlling a predetermined control object.
The control program and control data in the storage means.
The present invention relates to a replaceable electronic control device. [0002] 2. Description of the Related Art Conventionally, for example, Japanese Patent Application Laid-Open No. 6-27261.
As disclosed in Japanese Patent Publication No.
Electronically rewrites data as an electronic control unit
(Specifically, data erasing and writing)
A control program for engine control is stored in the read-only ROM.
Data that constitutes the
Rewrites data in ROM such as after it is supplied to the market
One that has been proposed has been proposed. That is, this kind of electronic control device is usually
Is a control composed of data stored in the ROM.
Control of engine etc. according to control program and control data
It controls the target, but an external device prepared separately
When connected and receiving a predetermined rewrite command,
Data (that is, control programs and control data)
Is configured to execute a rewriting process for rewriting.
You. This rewriting process erases data in the ROM.
To the deleted storage area from the external device.
Write new data that comes in
Is done. [0004] According to such an electronic control device,
For example, after supply to the market, the operation content (control
Content) has to be changed
Can be handled very easily. On the other hand, this species
In the electronic control device, the data in the ROM as described above is used.
When rewriting data, erase the contents of ROM once
Therefore, a rewriting program for executing the rewriting process
The program starts on the ROM to be rewritten
I can't. Therefore, the electronic control device disclosed in the above publication is
Specifies a rewriting program for executing the rewriting process in advance.
Although it is stored in the OM, the ROM is rewritten.
When rewriting, the rewriting program in ROM is read
Transfer to a read / write RAM, and
The rewriting program is started on M. [0006] By the way, usually,
More precise control of controlled objects in various electronic control units
To do this, for example, a part of the storage area of the RAM is
Backup area that can retain data even after power supply is stopped
Learning value calculated when controlling the controlled object
Back up data and data for fail-safe
Must be stored in the backup area. In other words, like this
By configuring, the calculated learning value data etc.
The data can be stored continuously after the stop, and based on the data
System that can suppress the effects of time-dependent changes and failures of controlled objects.
Control volume to improve control reliability.
It comes to be. However, in the above-mentioned conventional apparatus, RO
When rewriting data in M, the rewriting program
M to be stored in the backup area
There is a problem of destroying the learned value data
Was. The rewriting process is performed as in the device disclosed in the above publication.
The rewrite program for executing
Rather than rewriting the data in the ROM
Configuration that receives a replacement program from an external device.
It is conceivable that, in this case, too,
Transfer to RAM before starting
Therefore, the above problem similarly occurs. The present invention has been made in view of such a problem.
Data that can be read and written.
Lost data stored in the backup area
Stored in read-only storage
Control programs and control data can be rewritten.
It is an object of the present invention to provide an electronic control device. [0009] Means for Solving the Problems and Effects of the Invention
Claim 1 of the present invention has been made to achieve
The electronic control unit has an electrically rewritable data reader.
First storage means exclusively for reading, reading and writing of data
Writing is possible, and a part of the storage area is supplied with power.
Backup to keep data even after the
Between the second storage means set as the backup area and the external device.
Communication means for performing communication between them. Soshi
At normal times, the data stored in the first storage means is used.
According to the configured control program and control data.
Controls certain control targets. In addition, external rewriting finger
Command, the data in the first storage means is stored in an external device.
The process of rewriting with new data sent from the device
Transfer the rewriting program to be executed into the second storage means.
And start it, and by executing this rewriting program,
1 The data in the storage means is transmitted from the external device to the new
Rewrite to the data. [0010] [0011] [0012] [0013]Especially here, Claims1Electronic control described in
The device displays a backup area in the second storage means.
Address information storage means for storing address information
If a rewrite command is received, the rewrite program
The address information stored in the address information storage means.
Of the storage area of the second storage means based on the
Transfer to a storage area other than the area and activate it.And update
In addition, the electronic control device according to claim 1 is a backup storage device.
It is provided with an area changing means and an address information updating means. So
And the backup area changing means includes the electronic control device.
When performing the normal control operation, the back-up of the second storage means is performed.
The second storage according to the amount of data to be stored in the up area
Change the backup area in the
The information updating means is a backup
Information in the address information storage
Update the stored address information. And such a claim1Described in
According to the slave control device, the rewriting program is stored in the second storage unit.
Transfer to a storage area other than the backup area in the
Can be sent, so backup of the second storage means
Do not lose valuable data stored in the area
The control program and control data in the first storage means.
Can be replaced.The electronic system according to claim 1.
The control device stores the data in the backup area of the second storage means.
Backup of the second storage means according to the amount of data to be
Change the area and change the backup area
The backup area in the second storage means is displayed accordingly.
Address information is updated. Therefore,
2 Even if the backup area of the storage
Program in a location other than the backup area of the second storage means.
Transfer to the storage area. Therefore, the claims
According to the electronic control device described in Item 1, the battery of the second storage means is
The backup according to the amount of data to be stored in the backup area
Backup area change operation and the backup area
The stored data is lost by rewriting program transfer
It is possible to surely achieve both prevention and prevention. [0015] The claimsIn oneThe electronic control unit described
Read-only, electrically rewritable data
The first storage means is a flash EEPROM (communication
Name, flash ROM or flash memory) or EE
A PROM is generally used, but another ROM may be used. Ma
A second memory device capable of reading and writing data.
As the stage, a normal volatile RAM is generally used.
Rush EEPROM or EEPROM may be used. Soshi
When a volatile RAM is used as the second storage means
Power supply backup part of the storage area with batteries etc.
By doing so, it is possible to provide a backup area
Flash EEPROM as the second storage means.
When using non-volatile memory such as M or EEPROM
Uses a part of the storage area as a backup area
What is necessary is just to set. On the other hand,In oneTo the electronic control unit described
The rewriting program is received from an external device
It may be transferred to the second storage means,
It is stored in advance in the first storage means, and from the first storage means
You may make it transfer to 2nd memory | storage means. And before
In the case of the
This is particularly advantageous in terms of memory capacity because no storage area is required.
is there. Even in the latter case, the data in the first storage means
Must be exchanged with external devices when rewriting
There is an advantage in that the number of unnecessary communication procedures is reduced. [0017] [0018] [0019] [0020] [0021] [0022] [0023] [0024] [0025] [0026] [0027] DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments to which the present invention is applied
Will be described with reference to the drawings. The embodiment of the present invention
Embodiments of the present invention are not limited to the following examples.
Can take various forms as long as it belongs to the technical scope of
Needless to say. [First Embodiment] First, FIG.
Engine control to control an internal combustion engine type engine mounted
Device (hereinafter referred to as ECU) 1 and built in ECU 1
When rewriting the engine control program or data
And a memory rewriting device 2 connected to the ECU 1.
All of the memory rewriting system 3 of the electronic control unit of the first embodiment.
It is a block diagram showing a body structure. As shown in FIG. 1, the ECU 1 includes an engine
Inputs signals from various sensors 4 that detect the operating state of the vehicle
Input processing circuit 6 for performing waveform processing by
Optimum control amount for the engine based on these sensor signals
CP that calculates and outputs a control signal based on the calculation result
U8 and the control signal from CPU8 receive engine
Attached injectors (fuel injection valves) and igniters
And an output circuit 12 for driving an actuator 10 such as
I have. Then, according to the program, the CPU 8
An operating microprocessor unit (hereinafter MP)
U) 18 and necessary for operating the MPU 18
Non-volatile ROM 20 for storing programs and data
And a RAM 22 for storing the operation result of the MPU 18 and the like,
While receiving signals from the input processing circuit 6 and the like,
An I / O 24 for outputting a control signal to the circuit 12,
For performing serial data communication with the switching device 2.
A communication circuit 25 is provided as communication means. Here, the ROM 20 and the RAM of the CPU 8
22 will be described. First, the ROM 20
Flash E that can erase and write data
EPROM (commonly called flash ROM or flash memory)
Memory), and the storage area of the ROM 20 is
A rewritable area 20a in which data can be rewritten;
Data rewriting is not possible (or data rewriting is prohibited)
Stopped) and a non-rewritable area 20b.
You. Then, the storage of the ROM 20 and the RAM 22
As shown in FIG. 2 showing the area, the rewritable area 20a
Stores control programs and control data for engine control.
Used as an area for storing constituent data
In the rewritable area 20a,
The data (ie control program and control data) is already
Is stored. The non-rewritable area 20b is
Data that constitutes the boot program executed immediately after setting
This is used as an area for storing data.
In the non-rewritable area 20b, the corresponding data (that is,
Boot program) has already been stored. Next, the storage area of the RAM 22 is shown in FIG.
In this way, the backup data can be retained even after the power supply is stopped.
Backup area 22a and the data is
Computing work area (that is, normal RAM area) that disappears 2
2b. And backup area 2
In 2a, the MPU 18 executed the control program
At the time of calculation and memorize it even after the power supply is stopped.
Learning value data and fail-safe data that must be used
Is stored, and in particular, as address information storage means.
The head area of the backup area 22a includes the backup
Information indicating the start address and the end address of the
Address (hereinafter referred to as start / end address information).
U) is stored. On the other hand, RAM
In the work area 22b, the operation result of the MPU 18 is temporarily stored.
Is stored in The calculation work area 22b or
Is the work area for calculation 22b and the backup area 22
a has a rewritable area of the ROM 20 as described later.
When rewriting the data stored in the area 20a,
ROM rewrite program transmitted from the rewriting device 2
Will be delivered. In this embodiment, the ROM 20
The replaceable area 20a corresponds to a first storage unit,
The RAM 22 corresponds to a second storage unit. Also, RA
M22 is a backup area 22a and an operation work area
(Normal RAM area) 22b
What can be set arbitrarily by the software is used. So
The RAM 22 has 8 bits per address.
(= 1 byte) is stored. On the other hand, as shown in FIG.
The memory rewriting device 2 of FIG.
Control programs and controls stored in the replaceable area 20a
In order to rewrite data, the CPU 8 on the ECU 1 side
CPU 14a for performing data communication and CPU 14a
The ROM 20 is controlled by the CPU
(High voltage required for rewriting (rewritable area 20a))
12V power supply circuit 1 for supplying voltage (12V in this embodiment)
4b and a command to rewrite the ROM 20 to the ECU 1
And a command switch SW for performing the operation. The ECU 1 and the memory rewriting device 2
The connection is made via the connection connector 26 to each other's communication line.
28, a power supply line 29, and a mode determination signal line.
The connection is performed by connecting each of the terminals 30. That is,
When the connection connector 26 is fitted, the connection
The CPU 14a of the memory rewriting device 2 and the ECU 1
Data communication with CPU 8
Memory rewriting via the power supply line 29.
From the 12V power supply circuit 14b on the device 2 side to the CP on the ECU 1 side
Voltage (12V) necessary for rewriting ROM 20 is written to U8
Supplied. Further, the mode determination signal line 30
Is pulled up to 5V by the resistor R on the ECU1 side
Command switch SW on the memory rewriting device 2 side.
Is connected to the ground potential (0 V) through
Therefore, the connection connector 26 is fitted and the command switch
When the switch is turned on, the ECU 1 determines a mode.
Signal line 30 from high level (5V) to low level
(0 V), and the CPU 8 determines the mode
If the fixed signal line 30 is at a low level, the ECU
1 is connected to the memory rewriting device 2 and
It is determined that a change command has been issued. The memory rewriting system configured as described above
3, in the ECU 1, as described above, the ROM 2
In the rewritable area 20a of 0, there is a control for engine control.
Control program and control data are stored.
The non-rewritable area 20b of the ROM 20 has
A boot program that is not an elephant is stored. Then, the CPU 8 of the ECU 1 controls the vehicle
When the ignition switch is turned on, the power
An operating voltage (5 V) is supplied from a circuit (not shown)
Operation from the reset state, and
The boot program stored in the non-replaceable area 20b
Start the system. And the memory rewriting device 2 is connected
Or the command switch SW is not turned on.
Normally, the ROM 20 is written by the boot program.
The control program stored in the replaceable area 20a is
Call and control the engine. The CPU 8 starts a boot program.
The memory rewriting device 2 is connected when the
When it is determined that the switch SW is turned on, the memory rewriting device
2 (CPU 14a) via the communication line 28.
ROM rewrite program transferred to RAM 22
And starts the ROM rewriting program on the RAM 22.
As a result, in the rewritable area 20a of the ROM 20,
Data stored in the memory rewriting device 2
New data (i.e., new control
And control data). On the other hand, the memory rewriting device 2 is connected to the ECU 1.
When a predetermined operation is performed by the operator after being continued,
According to the processing of FIG.
Any one of OM rewriting programs and engine control
Of new control programs and control data for
Data is sequentially transmitted. Then, next, the CPU 1 of the memory rewriting device 2
4a and the processing executed by the CPU 8 of the ECU 1.
The processing to be performed will be described with reference to FIGS.
FIG. 3 is executed by the CPU 14a of the memory rewriting device 2.
It is a flowchart showing the process performed. FIG.
Is a flowchart showing processing executed by the CPU 8 of the ECU 1.
Chart, and its steps (hereinafter simply referred to as “S”)
The processing from 100 to S150 is performed in the non-rewritable area 2
0b is executed by the boot program in S200
Is executed by the control program in the rewritable area 20a.
Performed by Then, the processing of S300 to S315
Is transmitted from the memory rewriting device 2 as described later.
The first ROM rewriting program transferred to the RAM 22
Therefore, the processing of S400 and S405 is
As will be described later, the RAM transmitted from the memory rewriting device 2
22 by the second ROM rewriting program transferred to
Be executed. First, in the memory rewriting device 2, an operator
When a certain operation is performed, the CPU 14a executes the processing shown in FIG.
Run. That is, in the first S10, as described later, EC
Upon receiving the RAM capacity information transmitted from U1,
Backup area 22a in RAM 22 of CU1
Storage area other than the above, that is, the capacity of the calculation work area 22b.
Check, and in S20, the RAM 22 on the ECU 1 side
The data stored in the backup area 22a
It is determined whether or not it is necessary to change the position. In this determination,
Calculation detected based on RAM capacity information from ECU 1
And the capacity of the work area 22b
The ROM rewriting program (especially
2 ROM rewriting program) and compare the capacity
The latter is larger and the work area
The second ROM rewrite program cannot be stored in the area 22b.
In this case, it is determined that data download is necessary. Then, in S20, the backup area 22
When it is determined that it is necessary to download the data in a
Proceeds to S30, and transfers the backup area 2 to the ECU 1.
Sends a siphoning request to send data in 2a
Then, in S40, the ECU responds to the siphoning request.
1 in the backup area 22a transmitted from
The data is received and stored in a predetermined storage medium. And this
In the case of (3), at S50, the ECU 1
First ROM for executing processing of 00 to S315
Send the rewrite program. On the other hand, in S20, data is downloaded.
If it is determined that is unnecessary, the process proceeds to S60, where the ECU
1 to execute the processing of S400 and S405 in FIG.
The second ROM rewriting program for the second is transmitted. And
After performing the processing of S50 or S60, the process proceeds to S70.
The rewritable area 20 of the ROM 20 is stored in the ECU 1
Stored in a in place of the old control program and control data
To send a new control program and control data to be
In the following S80, an affirmative determination is made in S20 and the ECU 1
Whether data in the backup area 22a has been downloaded
Is determined. Then, it is determined that data has been downloaded
If so, the process proceeds to S90, and a predetermined record is made in S40.
The data in the backup area 22a saved in the storage medium
The data is transmitted to the ECU 1 and then processed by the memory rewriting device.
End the process. In S80, data is downloaded.
If it is determined that it has not been
The processing on the switching device side ends. Therefore, the CPU 14a of the memory rewriting device 2
Executes the processing of FIG.
The communication time chart of FIG.
Such communication will be performed. That is, memory rewriting
The device 2 is transmitted from the ECU 1 as described later.
When the RAM capacity information is received (S10), the ECU 1
The data stored in the backup area 22a of the RAM 22
Only when it is necessary to siphon the data (S20: YE
S), a siphoning request is transmitted to the ECU 1 (S30).
And if you send a siphoning request,
Backup area 2 sent from ECU 1 in response
After receiving and storing the data in 2a (S40), the EC
The first ROM rewriting program is transmitted to U1 (S5).
0) Also, if no siphoning request is sent
(S20: NO), the RAM capacity information from the ECU 1 is received.
After the communication, the second ROM rewriting program
It is transmitted (S60). And further, the first and second ROs
After sending one of the M rewrite programs, the EC
Send new control program and control data to U1
(S70) After that, when a siphoning request signal is transmitted
(S80: YES), the ECU 1
The data from the side is transmitted to the ECU 1 (S90), and
The communication of is ended. Note that, in FIG.
The data is transmitted from the memory rewriting device 2 by transmitting a siphoning request.
And time indicated by t1 to t5
Is an idle time during transmission of each communication data. Next, the ECU 1 is turned on.
And the CPU 8 starts the operation from the reset state.
The processing shown in is performed. That is, first, the ROM 20
The boot program stored in the non-replaceable area 20b is
Upon activation, first in S100, the ROM rewrite mode is set.
It is determined whether or not the mode determination signal line 30 is at a low level.
It is determined based on whether there is any
It is determined that the mode is the normal mode other than the M rewrite mode, and
Proceed to 105. Then, in S105, the RAM 22
Storage area subsequent to the backup area 22a,
Clear the work area 22b and perform initial settings.
Jump to the engine control program. Then, RO
Control stored in rewritable area 20a of M20
The program is started, and thereafter, as shown in S200 of FIG.
In this way, the engine is executed with reference to the engine control data.
A gin control process is executed. The engine system of S200
The control process is performed based on various sensor signals from the input processing circuit 6 and the RO.
The control data stored in the rewritable area 20a of M20
The optimal fuel injection amount and point for the engine
Calculate the fire timing, etc., and use the injector according to the calculation result.
For driving the actuator 10 such as the
The control signal is output. Soshi
As a result, such an engine control process is executed.
Thus, the engine can be operated. On the other hand, in the boot program, the S
If it is determined at 100 that the mode is the ROM rewriting mode,
The process proceeds to S110 and stores the above RAM capacity information in the memory.
The data is transmitted to the rewriting device 2. This RAM capacity information is represented by R
For operations other than backup area 22a in AM22
This is information representing the capacity of the work area 22b.
Is the backup area 22 of the RAM 22 as described above.
Based on the start / end address information stored in a
Then, RAM capacity information is generated. Therefore, memory rewriting
The RAM 2 stores the RAM capacity information in S10 of FIG.
Receiving the information, the information is stored in the RAM 22 of the ECU 1.
Check the capacity of the work area 22b for calculation in
Can be. Note that the memory rewriting device 2 side
If the total capacity is known, the above
Send start / end address information as it is
Is also good. That is, in this case, the memory rewriting device 2 side
And backup area based on start / end address information
22a can be known, and the
The capacity of the work area 22b can also be known. Then, RAM capacity information is transmitted in S110.
Then, at S115, the memory rewriting is performed within a predetermined time.
Based on whether or not the siphoning request from device 2 has been received.
ROM rewriting program transmitted from the memory rewriting device 2
The program is outside the backup area 22a of the RAM 22
It is determined whether the data can be stored in the calculation work area 22b.
A process as a determining means is executed. And sucking
When the update request is received, the ROM rewrite program
Is not stored in the calculation work area 22b.
Then, the process proceeds to S120, where the backup area 2 of the RAM 22 is
2a is stored in the memory rewriting device 2
The data is transmitted to the memory rewriting device 2 to be stored in the memory rewriting device 2.
I do. Then, in subsequent S125, the memory rewriting device 2
Wait until the serial data is received,
Data is received, in this case, the data
Is the first ROM rewriting program transmitted in S50 of FIG.
Since the data constitutes the system, the process proceeds to S130,
The first ROM rewriting program from the memory rewriting device 2
Upon reception, the start address of the RAM 22 (that is, the backup area
(The first address of the area 22a). And continue
In S135, the process jumps to the start address of the RAM 22. Then, the processing in S125 and S130 is performed.
Therefore, the first data transferred from the memory rewriting device 2 to the RAM 22
1 ROM rewriting program is started, thereby
The processing of 00 to S315 is executed. The first ROM
The rewriting program executes the processing of S300 and S305
The rewritable area 20a of the ROM 20 for
S310 and S315 are executed.
The backup area 22a of the RAM 22 for
A rewriting program, as shown in FIG.
At least regarding the latter backup area 22a.
The rewrite program performs operations on areas other than the backup area 22a.
Is stored in the work area 22b. In other words, it will be described later
As described above, in the processing of S310 and S315, the backup
Executes processing to handle data in area 22a
The program to execute is other than the backup area 22a.
It is placed in. In this manner, the first ROM rewriting program
When the program is started, first in S300, the memory rewriting device
Wait until receiving serial data from
If it is determined that the data has been received, in this case,
The new control program transmitted in step S70 of FIG.
And S3 because it is data constituting control data.
05, a new control program from the memory rewriting device 2
Program and control data, and
The rewritable area 20a is erased and received in the erased area.
Write new control program and control data received
No. Then, in the following S310, the memory rewriting is performed again.
Wait until serial data is received from device 2
If it is determined that the full data has been received,
The data is the data transmitted in S90 of FIG.
Data stored in the backup area 22a
Therefore, the process proceeds to S315, where the data from the memory rewriting device 2 is read.
The data is received and the backup area 22a of the RAM 22 is received.
And thereafter, all the processing ends. On the other hand, in step S115, the memo is
When the siphoning request from the rewriting device 2 is not received
Contains a ROM rewriting program from the memory rewriting device 2.
Are used for operations other than the backup area 22a of the RAM 22.
It is determined that the data can be stored in the work area 22b, and S14
Move to 0. Then, in S140, the memory rewriting is performed.
Wait until serial data is received from device 2, and
If it is determined that real data has been received,
The data is rewritten in the second ROM rewrite transmitted in S60 of FIG.
Since the data constitutes the program, S145
To the second ROM rewriting program from the memory rewriting device 2.
Receive the program. And further, in this S145,
Stored in the backup area 22a of the RAM 22
Backup area 22 based on start / end address information
a the last address of the second ROM
The rewriting program is stored in the backup area 22 of the RAM 22.
after a (in other words, at the beginning of the operation work area 22b)
(From the address). Then, in the following S150,
Immediately after the last address of the backup area 22a of the RAM 22
Later (in other words, the start address of the work area for calculation 22b)
Jump to Then, the processing in S140 and S145 is performed.
Therefore, the first data transferred from the memory rewriting device 2 to the RAM 22
The ROM rewriting program of Step 2 is started, and thereby, S4
00 and S405 are executed. Note that the second RO
The M rewrite program is stored in the rewritable area 2 of the ROM 20.
FIG. 5 (B), which consists of only the rewriting program for 0a
As shown in FIG.
Is stored only in the work area 22b. In this manner, the second ROM rewriting program
When the program is started, first in S400, the memory rewriting device
And waits until serial data is received. Soshi
If it is determined that serial data has been received,
Is the new control whose data was transmitted in S70 of FIG.
Data that constitutes program and control data
Then, the process proceeds to S405, where a new
Control programs and control data, and
The rewritable area 20a of the OM 20 is erased and erased.
Control program and control data received in the area
Write. Then, after executing the processing of S405,
Ends the processing. As described above, the method of the first embodiment is described.
The mode is determined by the ECU 1 in the memory rewriting system 3.
Is determined to be at the low level (S
100: YES), the backup area 22 of the RAM 22
a based on the start / end address information stored in
The generated RAM capacity information is transmitted to the memory rewriting device 2, and
In response to this, the memory rewriting device 2 transmits a siphoning request.
Whether or not the ROM rewriting program
Work area 22 other than the backup area 22a
b to determine whether or not it can be stored.
(S110, S115). Then, the ROM rewriting program executes
When it is determined that the data cannot be stored in the work area 22b,
(S115: YES), backup area of RAM22
22a is stored in the memory rewriting device 2
To the memory rewriting device (S120).
2 and then the first from the memory rewriting device 2
Transfer the ROM rewrite program to all areas of the RAM 22
By activating (S125 to S135), the ROM
22 is replaced with new data from the memory rewriting device 2.
(S300, S305), and then
Stored in the backup area 22a of the RAM 22
Data is received from the memory rewriting device 2 and backed up
It returns to the area 22a (S310, S31
5). The ROM rewriting program is stored in the RAM 22
Is determined to be storable in the calculation work area 22b.
In this case (S115: NO), the backup area 22a
Without sending the data in the memory to the memory rewriting device 2.
The second ROM rewriting program from the memory rewriting device 2
The start / end addresses stored in the backup area 22a
Calculation work area 22 of RAM 22 based on dress information
b to be activated (S140 to S150).
Thus, the data in the ROM 22 is read from the memory rewriting device 2.
The data is rewritten with new data (S400,
S405). That is, in the ECU 1 of this embodiment, the ROM
The rewrite program is stored in the backup area 22 of the RAM 22.
It is determined whether the data can be stored in a storage area other than a, and
If it cannot be stored, the RAM 22 of the ROM rewriting program
To erase the data in the backup area 22a
Data in the backup area 22a.
Data to the memory rewriting device 2 and then rewrite the ROM
Transfer the program to an arbitrary area of the RAM 22 and start it
Conversely, if it can be stored, RO
The M rewrite program is stored in the backup area 22 of the RAM 22.
Transfer to only the storage area other than a and start it
I have. Therefore, according to the ECU 1 of this embodiment, R
Learning value stored in backup area 22a of AM 22
Data or fail-safe data is lost
Without rewriting the contents of ROM 20
You. In addition, the ECU 1 of this embodiment has a ROM rewriting program.
Transfer the data to the RAM 22 to save the backup area.
When the data in 22a is really lost
Rewrites the data in the backup area 22a to the memory
Backup because it is evacuated to storage 2 side
Sends / receives data in the area 22a to / from the memory rewriting device 2.
The operation of communicating can be minimized. [Second Embodiment] Next, the electronic control of the second embodiment will be described.
The memory rewriting system of the control device will be described. 2nd real
The memory rewriting system of the present embodiment corresponds to the first embodiment described above.
Then, the CPU 8 of the ECU 1 executes in S200 of FIG.
In the engine control process, the fail safe shown in FIG.
The only difference is that the process is repeated every predetermined time.
ing. Therefore, the following describes this fail-safe processing.
Will be described. As shown in FIG.
When the execution of the safe processing is started, first, in S500,
For sensor 4, actuator 10, engine itself, etc.
Error detection processing to detect whether an error has occurred
And then, in S505, determine whether there is an abnormality.
I do. If it is determined that there is no abnormality,
Also, the fail-safe processing is terminated, but there is an abnormality.
If it is determined, the process proceeds to S510. Then, in S510, the RAM 22
The end stored in the backup area 22a as described above.
Address information is read, and in S515, S50
0 of the error occurrence code indicating the type of error detected in the process of 0
Only the capacity (2 bytes in this embodiment) of the RAM 22
Backup area to extend the backup area 22a
Execute the process as the area change means, and in the expanded area
The above error occurrence code is stored. And further, the following S5
At 20, the contents of the data indicating the engine state at the time of abnormality detection
Only the amount (14 bytes in this embodiment) of the RAM 22
Backup area to extend the backup area 22a
Execute the process as the area change means, and in the expanded area
Store the above data. Then, in S525, the backup is performed.
Address information for updating the end address information of the area 22a
After executing the process as the
End the process. Note that the end ad performed in S525
Update of the address information is based on the end address read in S510.
The value stored in the processing of S515 and S520 is added to the value of the information.
Address increase equivalent to a total of 16 bytes of data (actual
In the embodiment, one byte of data is stored per address of the RAM 22.
Because it is stored, it becomes “16”. ) And add
Back up later value as new end address information
Stored in the first area of the area 22a.
It is. Therefore, for example, as shown in FIG.
22 from $ F0000 to $ F1000
When initially set as the backup area 22a
In the case where an abnormality is detected by S500 in FIG.
Is backed up by executing S510 to S525.
Area 22a is from $ F0000 to $ F1010
And the value of the end address information is also $ F
It will be updated from 1000 to $ F1010. Soshi
Then, if another abnormality is detected once more,
The backup area 22a starts at address $ F0000 and ends at $ F1
020 and end address information
Is also updated from $ F1010 to $ F1020.
Become. In addition, "@" is a character (0-9, A-
F) represents a hexadecimal number. That is, in the ECU 1 of the second embodiment, the RA
Of data to be stored in the backup area 22a of the M22.
The backup area 22a of the RAM 22 is changed according to the amount.
At the same time as the backup area 22a is changed.
Then, the end address information of the backup area 22a is updated.
I am trying to make it new. The ECU 1 according to the second embodiment has a
The command rewriting device 2 is connected and the command switch SW is turned on.
In other words, in the ROM rewrite mode in S100 of FIG.
When it is determined that the
Based on the new end address information, the process after S110 in FIG.
The backup of the RAM 22.
Even if the storage area 22a is changed, the ROM rewriting program
Storage area of RAM 22 other than backup area 22a
(Ie, whether or not it can be stored in the calculation work area 22b)
The ROM rewriting program
When the data can be stored in the work area 22b, the ROM
The rewrite program is stored in the work area 22b for operation of the RAM 22.
Can be reliably transferred. Therefore, according to the ECU 1 of the second embodiment,
According to the amount of data to be stored in the backup area 22a
Operation for changing the backup area 22a
The data stored in the area 22a is stored in a ROM rewriting program.
To ensure that they are not lost due to
Can stand up. [Others] (1) In the ECU 1 of the first and second embodiments,
S100 to S1 of FIG.
Of the 50 processes, S110, S115, S140 to S1
50 is deleted, and if a positive determination is made in S110, S1
The processing after 20 may be executed. In addition, this
In this case, the CPU 14a of the memory rewriting device 2
Only the processes of S40, S50, S70, and S90 are sequentially executed.
Run. That is, by doing so, the ECU 1
Command switch SW is turned on when memory rewriting device 2 is connected
Then, the ROM rewrite program is
Regardless of whether it can be stored in the work area 22b,
The data currently stored in the up area 22a is
The data is transmitted to the rewriting device 2 and is temporarily stored. So
Then, even in this case, the backup area of the RAM 22 is
Learning value data and the like stored in the area 22a are lost
Without rewriting the contents of ROM 20
You. (2) The ECU 1 of the first and second embodiments
In the ROM rewriting program (particularly the second ROM
Conversion program) is a work area 22b for operation in the RAM 22.
If it is determined that it can be stored in
S15 to S15 of FIG.
0, S110 to S135 are deleted and S11
If the determination is affirmative, the processing after S140 is executed.
You may make it so. In this case, the memory rewriting device
The second CPU 14a performs the processing of S60 and S70 of FIG.
Are sequentially executed. That is, even in this case, the ECU 1
Command switch SW is turned on when memory rewriting device 2 is connected
The ROM rewriting program from the memory rewriting device 2
Program (second ROM rewriting program) in RAM 22
The data can be reliably transferred to the arithmetic work area 22b.
Learning data in the backup area 22a is lost
Can be prevented. (3) As in the ECU 1 of the first embodiment, R
Backup area 22a and work area for operation of AM22
If the capacity of the area 22b does not change, the backup area
The start / end address information of the area 22a is written in the ROM 20.
In the non-rewritable area 20b or in the ROM 20
The control program and control data are stored in the exchangeable area 20a.
It may be stored together with the data. (4) For the ECU 1 of the first embodiment,
In the case of adopting the mode (2), a memo as an external device is used.
From the rewriting device 2 to the ECU 1, a backup area 22a
May send start / end address information
No. (5) In each of the above embodiments, the backup area 22a
Start / end address information (especially end address information)
Instead, the start address information of the work area for calculation 22b
May be used. (6) In the ECU 1 of each of the above embodiments, the RO
Receiving the M rewriting program from the memory rewriting device 2
Transfer to M22, but rewrite ROM20
The ROM rewrite program is stored in the
The ROM rewrite program from the ROM 20 to R
The same applies to the case of a configuration for transferring data to the AM 22. For example, in the case of the first and second embodiments,
Explaining this, the ECU 1 determines that S110 and S11 in FIG.
5 starts and ends the backup area 22a.
Work area in the RAM 22 based on the
22b, and the determined capacity and the second RO
Compare the capacity of the M rewrite program to the second ROM
The replacement program is stored in the operation work area 22b of the RAM 22.
What is necessary is just to determine whether or not storage is possible. And S1
25, S130 or S140, S145,
From the non-rewritable area 20b of the ROM 20, the first and
Read out the corresponding one of the ROM rewriting programs
Then, it may be stored in the RAM 22. In addition, this
In this case, the memory rewriting device 2
When data in the up area 22a is transmitted
Executes the processes of S40, S70, and S90 in FIG.
Otherwise, only the process of S70 in FIG.
No. And, such a configuration, as in the second embodiment,
Backup area 22a of RAM 22 and work for calculation
This is particularly effective when the capacitance of the region 22b changes.
is there. (7) In each of the above embodiments, the engine is controlled.
Although the description has been given of the ECU 1 that
Is not limited to this. That is, for example,
Control objects to be controlled, such as missions and suspensions
The same applies to electronic control units.
Wear.

【図面の簡単な説明】 【図1】 第1実施例の電子制御装置のメモリ書換シス
テムの全体構成を表すブロック図である。 【図2】 ROM及びRAMの記憶領域を説明する説明
図である。 【図3】 メモリ書換装置側で実行される処理を表すフ
ローチャートである。 【図4】 エンジン制御装置(ECU)側で実行される
処理を表すフローチャートである。 【図5】 ROM書換プログラムのRAMへの格納状態
を説明する説明図である。 【図6】 メモリ書換装置とECUとの間で行われる通
信を説明するタイムチャートである。 【図7】 第2実施例のECU側でエンジン制御中に実
行されるフェールセーフ処理を表すフローチャートであ
る。 【図8】 図7の処理の実行状態を説明する説明図であ
る。 【符号の説明】 1…エンジン制御装置(ECU) 2…メモリ書換装
置 SW…指令スイッチ 3…メモリ書換システム 4
…センサ 6…入力処理回路 8…CPU 10…アクチュエ
ータ 12…出力回路 18…マイクロ・プロセッサ・ユニ
ット(MPU) 20…ROM 20a…書き換え可能領域 20b
…書き換え不能領域 22…RAM 22a…バックアップ領域 22b
…演算用ワーク領域 24…I/O 25…通信回路 26…接続用コネ
クタ 28…通信ライン 30…モード判定用信号ライン
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram illustrating an overall configuration of a memory rewriting system of an electronic control unit according to a first embodiment. FIG. 2 is an explanatory diagram illustrating storage areas of a ROM and a RAM. FIG. 3 is a flowchart illustrating a process executed on the memory rewriting device side. FIG. 4 is a flowchart showing processing executed on an engine control device (ECU) side. FIG. 5 is an explanatory diagram illustrating a storage state of a ROM rewriting program in a RAM. FIG. 6 is a time chart illustrating communication performed between the memory rewriting device and the ECU. FIG. 7 is a flowchart illustrating a fail-safe process executed during engine control on the ECU side according to the second embodiment. FIG. 8 is an explanatory diagram illustrating an execution state of the processing in FIG. 7; [Description of Signs] 1 ... Engine control device (ECU) 2 ... Memory rewriting device SW ... Command switch 3 ... Memory rewriting system 4
... Sensor 6 ... Input processing circuit 8 ... CPU 10 ... Actuator 12 ... Output circuit 18 ... Microprocessor unit (MPU) 20 ... ROM 20a ... Writable area 20b
... non-rewritable area 22 ... RAM 22a ... backup area 22b
... Calculation work area 24. I / O 25. Communication circuit 26. Connector 28. Communication line 30. Mode determination signal line.

Claims (1)

(57)【特許請求の範囲】 【請求項1】 電気的にデータの書き換えが可能な読み
出し専用の第1記憶手段と、データの読み出し及び書き
込みが可能であると共に、記憶領域の一部が電源供給の
停止後も継続してデータを保持するためのバックアップ
領域として設定された第2記憶手段と、外部装置との間
で通信を行うための通信手段とを備え、 通常時には、前記第1記憶手段に格納されたデータによ
り構成される制御プログラム及び制御データに従って所
定の制御対象を制御し、外部からの書き換え指令を受け
た場合には、前記第1記憶手段内のデータを前記外部装
置から送信されて来る新たなデータに書き換える処理を
実行するための書換プログラムを、前記第2記憶手段内
へ転送して起動させることにより、前記第1記憶手段内
のデータを前記外部装置から送信されて来る新たなデー
タに書き換える電子制御装置であって、 前記第2記憶手段内における前記バックアップ領域を表
すアドレス情報を記憶するアドレス情報記憶手段を備え
ると共に、前記書き換え指令を受けた場合には、前記書
換プログラムを、前記アドレス情報記憶手段に記憶され
た前記アドレス情報に基づき、前記第2記憶手段の記憶
領域のうち前記バックアップ領域以外の記憶領域に転送
して起動させるように構成され、更に、 当該電子制御装置が通常時の制御動作を行う際に、前記
第2記憶手段のバックアップ領域に格納すべきデータの
量に応じて、前記第2記憶手段内における前記バックア
ップ領域を変更するバックアップ領域変更手段と、 該バックアップ領域変更手段による前記バックアップ領
域の変更に応じて、前記アドレス情報記憶手段に記憶さ
れた前記アドレス情報を更新するアドレス情報更新手段
と、 を備えたこと を特徴とする電子制御装置。
(57) [Claim 1] A read-only first storage means capable of electrically rewriting data, and a power supply capable of reading and writing data and a part of a storage area being provided with a power supply. A second storage unit that is set as a backup area for continuously holding data even after the supply is stopped; and a communication unit that communicates with an external device. A predetermined control target is controlled in accordance with a control program and control data constituted by data stored in the means, and when an external rewrite command is received, data in the first storage means is transmitted from the external device. By transferring a rewriting program for executing a process of rewriting to new data that has been transferred into the second storage means and starting the rewriting program, the data in the first storage means is transferred. An electronic control unit for rewriting to new data transmitted from the external device, wherein the backup area in the second storage unit is displayed.
Address information storage means for storing address information
In addition, when receiving the rewriting instruction,
Conversion program stored in the address information storage means.
Storing the second storage means based on the address information
Transfer to storage area other than the backup area
And when the electronic control unit performs a normal control operation,
Of data to be stored in the backup area of the second storage means
The backup in the second storage means, depending on the volume.
Backup area changing means for changing a backup area, and the backup area by the backup area changing means.
The address information is stored in the address information storage means according to the change of the area.
Address information updating means for updating the address information obtained
Electronic control equipment, characterized in that it comprises a and.
JP33228195A 1995-12-20 1995-12-20 Electronic control unit Expired - Fee Related JP3489306B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP33228195A JP3489306B2 (en) 1995-12-20 1995-12-20 Electronic control unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP33228195A JP3489306B2 (en) 1995-12-20 1995-12-20 Electronic control unit

Publications (2)

Publication Number Publication Date
JPH09171459A JPH09171459A (en) 1997-06-30
JP3489306B2 true JP3489306B2 (en) 2004-01-19

Family

ID=18253204

Family Applications (1)

Application Number Title Priority Date Filing Date
JP33228195A Expired - Fee Related JP3489306B2 (en) 1995-12-20 1995-12-20 Electronic control unit

Country Status (1)

Country Link
JP (1) JP3489306B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6854000B2 (en) 1997-12-27 2005-02-08 Canon Kabushiki Kaisha Image forming apparatus and control method for the same
TW200417852A (en) * 2002-12-19 2004-09-16 Komatsu Mfg Co Ltd Rewrite control apparatus for onboard program
JP4026495B2 (en) 2002-12-19 2007-12-26 株式会社小松製作所 Server switching control device
JP2007224921A (en) * 2007-03-30 2007-09-06 Fujitsu Ten Ltd Electronic control device for automobile
JP6132573B2 (en) * 2013-02-08 2017-05-24 株式会社東芝 Information processing apparatus and information processing method
JP7331818B2 (en) * 2019-03-18 2023-08-23 株式会社オートネットワーク技術研究所 In-vehicle update device, update processing program, and program update method

Also Published As

Publication number Publication date
JPH09171459A (en) 1997-06-30

Similar Documents

Publication Publication Date Title
JP3491419B2 (en) Electronic control unit
US20030163664A1 (en) Method and apparatus for updating a distributed program
US6275911B1 (en) Memory writing device for an electronic device
JP4302113B2 (en) In-vehicle control device
US20040199825A1 (en) Redundant boot memory
US8135533B2 (en) Electronic engine control apparatus having improved configuration for ensuring excellent engine startability
US6401163B1 (en) Apparatus and method for rewriting data from volatile memory to nonvolatile memory
JPH11272498A (en) Electronic controller
JP2002278783A (en) System for rewriting firmware
JPH11238005A (en) Electronic controller and control system
JP3870563B2 (en) Electronic control device and non-volatile memory rewrite count method
JP3489306B2 (en) Electronic control unit
JPH10149282A (en) Memory rewriting system for electronic device
JP4311067B2 (en) Data rewriting method and electronic control device
JP3284772B2 (en) Water heater
JP3796837B2 (en) Memory writing device for electronic device
JP2002323990A (en) Electronic controller and method for initializing nonvolatile memory
JP2002175193A (en) Device and method for rewriting program
JP2019008693A (en) Vehicle-purpose electronic control unit
JP2001136085A (en) Digital broadcast receiver
JPH10105468A (en) Electronic controller, memory rewriting device and memory rewriting system of electronic controller
JP2001229014A (en) Non-volatile memory rewriting device
JP2001051844A (en) Computer peripheral equipment and firmware updating method
JPH09305395A (en) Electronic equipment
JPH09305394A (en) Electronic equipment

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101107

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20111107

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20111107

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20121107

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees