JP3623481B2 - Vehicle control apparatus for controlling rewriting of nonvolatile memory - Google Patents

Vehicle control apparatus for controlling rewriting of nonvolatile memory Download PDF

Info

Publication number
JP3623481B2
JP3623481B2 JP2002005197A JP2002005197A JP3623481B2 JP 3623481 B2 JP3623481 B2 JP 3623481B2 JP 2002005197 A JP2002005197 A JP 2002005197A JP 2002005197 A JP2002005197 A JP 2002005197A JP 3623481 B2 JP3623481 B2 JP 3623481B2
Authority
JP
Japan
Prior art keywords
area
data
address
memory
erased
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
JP2002005197A
Other languages
Japanese (ja)
Other versions
JP2003208326A (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.)
Honda Motor Co Ltd
Original Assignee
Honda Motor Co Ltd
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 Honda Motor Co Ltd filed Critical Honda Motor Co Ltd
Priority to JP2002005197A priority Critical patent/JP3623481B2/en
Publication of JP2003208326A publication Critical patent/JP2003208326A/en
Application granted granted Critical
Publication of JP3623481B2 publication Critical patent/JP3623481B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
この発明は、外部の書き換え装置から転送されたデータで、車両制御装置の不揮発性メモリを書き換える書き換えシステムに関する。
【0002】
【従来の技術】
現在、車両は、複数の車両制御装置(以下、「ECU」という)によって様々に制御されている。ECUは、車両に搭載された様々なセンサによって検出された運転状態に基づいて、車両を制御する。これらの制御には、空燃比、燃料噴射量、エミッションなどのエンジンに関する制御、パワーウィンドウ、エアバッグ、ABSなどの車体に関する制御が含まれる。
【0003】
ECUは、中央演算処理装置(CPU)、制御プログラムおよびデータを格納するROM(読み取り専用メモリ)、CPUの作業領域を提供するRAM(ランダムアクセスメモリ)、各種センサからの信号を受け取り、およびエンジン各部に制御信号を送る入出力インターフェースを備えている。上記ROMは、典型的には、フラッシュメモリ、EEPROMのような書き換え可能(すなわち、消去および書き込み可能)な不揮発性メモリである。
【0004】
ECUの不揮発性メモリに格納されたデータを書き換えるシステムが知られている。このシステムは、書き換え装置、不揮発性メモリを有するECU、およびそれらを接続するシリアル通信路を備える。
【0005】
特開平9−128229号公報には、以下のステップからなる書き換え動作が開示されている。
【0006】
1)書き換え装置は、消去コマンドをECUに送信する。
【0007】
2)ECUは、消去コマンドに応答し、不揮発性メモリの全領域に対して消去操作を実行する。
【0008】
3)書き換え装置は、アドレスおよびデータを含むデータブロックをECUに送信する。
【0009】
4)ECUは、受信したアドレスによって示されるメモリ領域に、受信したデータを書き込む。
【0010】
5)すべてのデータブロックの書き込みが終了するまで、ステップ3)および4)を繰り返す。
【0011】
6)すべてのデータブロックの書き込みが終了したならば、ECUは、メモリの予め決められた領域に、予め決められたコードで表される終了データを書き込む。
【0012】
7)ECUは、書き換え完了信号を書き換え装置に送信する。
【0013】
フラッシュメモリおよびEEPROMのような不揮発性メモリにおいては、メモリ領域の一部に対する書き換え操作が可能である。図9に、このような不揮発性メモリに対する、従来の書き換え処理の概略的なフローを示す。最初に、書き換え装置は、ECUに、データを書き込むべきメモリ領域(書き換え領域)を消去するよう要求する。この要求は、通常、アドレスフィールド201およびサイズフィールド202を含む消去コマンドによって行われる。アドレスフィールド201は、書き換え領域の先頭アドレスを含む。サイズフィールド202は、書き換え領域の大きさを含む。ECUは、消去コマンドで指定された先頭アドレスおよびサイズから、消去領域を算出する。算出された消去領域に対し、消去操作が実行される。この例では、先頭アドレスは3F00であり、サイズは128バイトである。したがって、メモリのアドレス3F00から3F7Fまでの領域が消去される。
【0014】
消去された領域にデータを書き込むため、書き換え装置は、一連のデータブロックを順番にECUに送信する。データブロックは、通常、アドレスフィールド203およびデータフィールド204を含む。ECUは、データブロックを受信し、アドレスフィールド203からアドレスを抽出する。ECUは、該抽出したアドレスで指定されたメモリ場所に、データフィールド204に含まれるデータを書き込む。データブロック1を参照すると、該データブロック1は、メモリのアドレス3F00に書き込まれる。
【0015】
図10は、図9に示される書き換え処理において、書き換え装置が実行するプロセスのフローチャートの一例を示す。ステップS251において、前述した消去コマンドをECUに送信することにより、書き換え処理が開始する。ECUから消去完了信号を受信したならば(S252)、データブロックをECUに送信する(S253)。ECUから書き込み完了信号を受信したならば(S254)、ステップS255において、送信待ちのデータブロックがあるかどうか判断される。送信待ちのデータブロックがあるならば、次のデータブロックをECUに送信する。こうして、図9に示されるように、データブロック1〜nが順番にECUに送信される。ステップS255において送信待ちのデータブロックが無ければ、書き換え装置は書き換え処理を終了する。
【0016】
図11に、図9に示される書き換え処理において、ECUが実行するプロセスのフローチャートの一例を示す。ステップS271において書き換え装置から消去コマンドを受信したとき、またはステップS274において書き換え装置からデータブロックを受信したとき、このルーチンに入る。ステップS271において書き換え装置から消去コマンドを受信したならば、前述したように、消去コマンドで示される消去領域に対して消去操作を実行する(S272)。消去操作を終えたならば、消去完了信号を書き換え装置に送信し(S273)、このルーチンを抜ける。
【0017】
図9を参照して前述したように、消去完了信号を書き換え装置に送信した後、書き換え装置からECUへのデータブロックの転送が開始される。書き換え装置からデータブロックを受信したとき、ステップS271の判断はNoとなり、ステップS274の判断はYesとなり、再びこのルーチンに入る。ステップS275において、受信したデータブロックのアドレスフィールドからアドレスを抽出する。データフィールドからは、データが抽出される(S276)。抽出されたアドレスで示されるメモリ場所に、抽出したデータが書き込まれる(S277)。書き込み操作を終えたならば、書き込み完了信号を書き換え装置に送信する(S278)。
【0018】
【発明が解決しようとする課題】
書き換え装置は、ECUとの通信を介してメモリの書き換え処理を実施するための制御プログラムを有している。書き換え領域の開始および終了アドレスは、この制御プログラムに指定される。終了アドレスに代えて、書き換え領域のサイズを指定してもよい。制御プログラムは、指定された開始および終了アドレスに従って、消去コマンドを作成する。
【0019】
ECUの不揮発性メモリには、様々なプログラムおよびデータが記憶されている。このようなプログラム/データを修正することによって該プログラム/データのサイズが変わるということは頻繁に起こる。プログラム/データのサイズが変わったとき、制御プログラムにおいて指定されている該プログラム/データについての書き換え領域の終了アドレスを変更しなければならない。プログラム/データの修正を行うたびに制御プログラムを変更することは、該プログラム/データの仕様変更の管理を煩雑にする。
【0020】
また、意図していないメモリ領域に対して消去操作が実行されるのを防ぐために、制御プログラムに指定される書き換え領域は正確でなければならない。しかしながら、プログラム/データの修正を行うたびに制御プログラムを変更するので、書き換え領域の誤った指定を完全に防ぐことはできない。
【0021】
したがって、メモリの書き換え処理において、書き換え領域の終了アドレスを管理する必要のない書き換えシステムが必要とされている。
【0022】
【課題を解決するための手段】
この発明の一つの側面によると、車両制御装置は、書き換え可能な不揮発性メモリを有し、外部の書き換え装置から転送されたデータで該メモリを書き換える。それぞれのデータブロックは、メモリに書き込むべきデータを含むデータフィールドと、該データが書き込まれるべきメモリアドレスを含むアドレスフィールドとを有する。車両制御装置は、書き換え装置から転送されたデータブロックを受信する。受信されたデータブロックのアドレスフィールドからアドレスが抽出される。抽出されたアドレスによって示されるメモリ領域が消去済み領域かどうか判断される。メモリの領域が消去済み領域と判断されたならば、車両制御装置は、受信されたデータブロックのデータフィールドからデータを抽出し、アドレスによって示されるメモリ領域に、該データを書き込む。
【0023】
この発明によると、データブロックのアドレスフィールドに含まれるアドレスを使用して、データが書き込まれるべきメモリ領域が消去済み領域かどうか判断される。消去済み領域と判断されれば、書き込み操作が実施される。データブロックに含まれるアドレスを用いて書き換え処理を実行することができるので、書き換え装置の制御プログラムに書き換え領域の終了アドレスを指定する必要がない。プログラム/データの仕様変更における管理項目が減り、よって管理の煩雑さを低減することができる。
【0024】
この発明の他の側面によると、メモリ領域が消去済み領域でないと判断されたならば、該領域に書き込まれているデータを消去して消去済み領域にする。データフィールドから抽出されたデータは、該消去済み領域に書き込まれる。
【0025】
この発明によると、データブロックのアドレスフィールドに含まれるアドレスを使用して、データが書き込まれるべき領域に対する消去操作が確実に行われる。データブロックに含まれるアドレスを用いて書き換え処理を実行することができるので、プログラム/データの仕様変更における管理項目が減り、よって管理の煩雑さを低減することができる。また、消去コマンドが不要となるので、書き換え処理の効率が向上する。
【0026】
この発明の他の側面によると、データブロックから抽出されたアドレスと、メモリの消去済み領域のアドレスとを比較することにより、該抽出されたアドレスによって示されるメモリ領域が消去済み領域かどうか判断される。アドレスの比較によって、消去済み領域かどうかを容易に判断することができる。したがって、車両制御装置の負荷を増やすことなく、かつ仕様変更における管理負荷を低減する書き換え処理を実現することができる。
【0027】
【発明の実施の形態】
次に図面を参照してこの発明の実施の形態を説明する。図1は、この発明に従う書き換えシステムの全体的な機能ブロック図を示す。書き換えシステムは、ECU10およびその外部に設けられた書き換え装置20を備える。
【0028】
書き換え装置20は、ECU10が搭載される車両のメーカーによって認可された正規の書き換え装置である。書き換え装置20は、シリアル通信バスを介してECU10に接続される。
【0029】
書き換え装置20は、送受信部21およびデータブロック組立部22を備える。データブロック組立部22は、ECU10に送信されるプログラムおよび/またはデータから、一連のデータブロックを組み立てる。プログラムおよび/またはデータは、一連のデータブロックとして、送受信部21からECU10に送信される。
【0030】
ECU10は、典型的にはマイクロコンピュータおよびこれに付随する回路素子で構成される。ECU10は、中央演算処理装置(以下「CPU」という)、実行するプログラムおよびデータを格納するROM16、実行時の作業領域を提供し演算結果などを記憶するRAM(ランダムアクセスメモリ)を備える。ECU10は、さらに、車両に設けられた様々なセンサから検出信号を受け取り、車両の各部に制御信号を送る入出力インターフェースを備える。センサからの検出信号には、エンジン回転数、エンジン水温、吸気温、バッテリ電圧、イグニションスイッチなどの信号が含まれる。CPUは、入出力インターフェースから入力された検出信号に基づいて、ROM16に記憶された制御プログラムおよびデータを用いて演算を行う。CPUは、演算結果を、入出力インターフェースを介して車両の各部に出力し、車両の様々な機能を制御する。簡単にするため、図1には、ROM16のみが表されている。
【0031】
ROM16は、所定の領域に記憶されたデータを消去して、該領域に新たなデータを書き込むことができる不揮発性メモリである。フラッシュメモリおよびEEPROMなどの不揮発性メモリによって、ROM16を実現することができる。
【0032】
アドレス抽出部12、領域判断部13、データ抽出部14および書き込み部15は、典型的にはソフトウェアプログラムとして実現される。これらのプログラムは、たとえば書き換え不可能なROM(図示せず)に格納される。書き換え不可能なROMは、記憶されたデータを変更することができない不揮発性メモリである。
【0033】
書き換え不可能なROMは、製造時にデータが決められ、その後に消去および書き込みができないマスクROM、または1度だけデータを書き込むことができるPROMなどによって実現することができる。
【0034】
代替的に、フラッシュメモリ、EEPROMのような書き換え可能(すなわち、消去および書き込みが可能)なROM16の所定のメモリ領域を変更不可領域に設定することによって実現してもよい。
【0035】
書き換え装置20から受信したデータブロックは、アドレス抽出部12およびデータ抽出部14によって、アドレスおよびデータがそれぞれ抽出される。領域判断部13は、抽出されたアドレスによって示されるROM16のメモリ領域が、消去済み領域かどうか判断する。消去済み領域と判断されたならば、書き込み部15は、抽出されたデータを該消去済み領域に書き込む。消去済み領域でないと判断されたならば、領域判断部13は、該領域に記憶されているデータを消去する。その後、書き込み部15が、該データが消去された領域に、抽出されたデータを書き込む。
【0036】
以下、ROM16に格納されているプログラムを書き換える動作の実施例について説明する。しかし、以下の実施例は、ROM16に格納されている任意のデータを書き換える場合にも同様に適用される。
【0037】
図2は、書き換え装置20からECU10に転送されるプログラムの一例を示す。プログラム30のサイズは、560バイトである。プログラム30は、それぞれが所定の長さ(この例では、8バイト)を持つプログラムコードに細分される。データブロックは、プログラムコードを含むデータフィールド32と、該プログラムコードが書き込まれるべきメモリアドレスを含むアドレスフィールド33を有する。プログラム30から、70個のデータブロックが作成される。図2に示されるプログラムのサイズ、プログラムコードの長さおよびデータブロック数は単なる例であることに注意されたい。
【0038】
図3は、この発明の第1の実施例に従う、ROM16を実現する不揮発性メモリ40のメモリ領域の一例を示す。不揮発性メモリ40は、それぞれが予め決められた大きさを持つ複数のメモリブロックに区切られている。不揮発性メモリ40の仕様により、消去操作はメモリブロック単位に実行されるよう規定されている。書き込み操作はビット単位に実行されることができる。
【0039】
図3には、例として2つのメモリブロック41および42が示されている。メモリブロックの大きさはメモリ40の仕様に依存する。この例では、メモリブロック41および42のそれぞれの大きさが512バイトと仮定する。書き換え装置から転送されるデータブロックは、領域44、45、...49に順番に書き込まれる。
【0040】
ECU10は、それぞれのメモリブロックの開始アドレスおよび終了アドレスを有している。また、ECU10は、それぞれのメモリブロックについて消去済みフラグを有する。あるメモリブロックに対して消去操作が実行されたとき、該メモリブロックの消去済みフラグがセットされる。
【0041】
図4は、この発明の第1の実施例に従う書き換え処理の概略的なフローを示す。データブロックは、メモリブロックの先頭アドレスから書き込まれると仮定する。
【0042】
ステップS51において、書き換え装置20は、データブロック1をECU10に送信する。ECU10は、データブロック1を受け取る。ECU10は、データブロック1のアドレスフィールドからアドレス3F00を抽出する。
【0043】
ECU10は、アドレス3F00と、それぞれのメモリブロックの開始および終了アドレスを比較する。その結果、アドレス3F00はメモリブロック41(図3)に含まれると判断される。ECU10は、メモリブロック41の消去済みフラグを調べる。
【0044】
メモリブロック41の消去済みフラグがセットされていれば、ECU10は、メモリブロック41は消去済み領域と判断する。一方、メモリブロック41の消去済みフラグがセットされていなければ、ECU10は、メモリブロック41が消去済み領域ではないと判断する。消去済み領域でないと判断した場合、ECU10は、メモリブロック41に対して消去操作を実行する(ステップS51)。消去操作を終えた後、メモリブロック41について消去済みフラグがセットされる。
【0045】
ECU10は、データブロック1のデータフィールドからプログラムコードを抽出し、それをメモリブロック1のアドレス3F00から開始する書き込み領域44(図3)に書き込む(ステップS51)。データブロック1のプログラムコードの書き込みを終了したとき、ECU10は、書き換え装置20に書き込み完了信号を送信する(ステップS52)。ここで、ステップS51およびS52に示される処理は、書き換え処理の1サイクルを示す。
【0046】
ステップS53およびS54において、次の書き換え処理サイクルが実行される。ステップS53において、書き換え装置20は、データブロック2をECU10に送信する。ECU10は、データブロック2のアドレスフィールドから、アドレス3F08を抽出する。ECU10は、メモリブロック1にアドレス3F08が含まれることを確認する。メモリブロック41の消去済みフラグがセットされているので、ECU10は、メモリブロック41は消去済み領域であると判断する。
【0047】
ECU10は、データブロック2のデータフィールドからプログラムコードを抽出し、それをメモリブロック41のアドレス3F08から開始する書き込み領域45(図3)に書き込む(ステップS53)。データブロック2のプログラムコードの書き込みを終了したとき、ECU10は、書き換え装置20に書き込み完了信号を送信する(ステップS53)。
【0048】
書き換え装置20は、データブロック3〜64を順番にECU10に送信し、ECU10は、これらのデータブロックに含まれるプログラムコードをメモリブロック41に書き込む。
【0049】
ステップS57およびS58の書き換え処理サイクルにおいて、書き換え装置20は、データブロック65をECU10に送信する。ECU10は、データブロック65を受け取る。ECU10は、データブロック65のアドレスフィールドから、アドレス4100を抽出する。
【0050】
ECU10は、アドレス4100がメモリブロック1に含まれないので、その他のメモリブロックの開始および終了アドレスと比較する。その結果、アドレス4100は、メモリブロック42(図3)に含まれると判断される。ECU10は、メモリブロック42の消去済みフラグを調べる。
【0051】
メモリブロック42の消去済みフラグがセットされていれば、ECU10は、メモリブロック42は消去済み領域と判断する。メモリブロック42の消去済みフラグがセットされていなければ、ECU10は、メモリブロック42が消去済み領域でないと判断する。消去済み領域でないと判断した場合、ECU10は、メモリブロック42に対して消去操作を実行する(ステップS57)。消去操作を終えた後、メモリブロック42について消去済みフラグがセットされる。
【0052】
ECU10は、データブロック65のデータフィールドからプログラムコードを抽出し、それをメモリブロック42のアドレス4100から開始する領域48(図3)に書き込む(ステップS57)。データブロック65のプログラムコードの書き込みを終了したとき、ECU10は、書き換え装置20に書き込み完了信号を送信する(ステップS58)。
【0053】
ステップS59およびS60において、最後の書き換え処理サイクルが実行される。ステップS59において、書き換え装置20はデータブロック70をECU10に送信する。ECU10は、データブロック70のアドレスフィールドから、アドレス4128を抽出する。ECU10は、アドレス4128がメモリブロック42に含まれると判断する。メモリブロック42には消去済みフラグがセットされている。したがって、ECU10は、メモリブロック42は消去済み領域であると判断する。
【0054】
ECU10は、データブロック70のデータフィールドからプログラムコードを抽出し、それをメモリブロック42のアドレス4128から開始する領域49(図3)に書き込む(ステップS59)。データブロック70のプログラムコードの書き込みを終了したとき、ECU10は、書き換え装置20に書き込み完了信号を送信する(ステップS60)。
【0055】
こうして、プログラム30のプログラムコードのすべてがECU10に送信される。書き換え装置20は、データブロック70の書き込み完了信号をECU10から受信したとき、書き換え処理を終了するための信号をECU10に送信する。ECU10は、それに応答して、メモリブロック41および42についての消去済みフラグをリセットする。メモリブロック41の消去済みフラグのリセットのタイミングは、メモリブロックの書き込み領域47に対する書き込みが完了したときでもよい。
【0056】
代替的に、書き換え装置からECUに転送されるデータブロックは可変長でもよい。たとえば、転送効率を向上させるため、データフィールドに含まれるプログラムコードに、メモリの空きを示す“FF”バイトを含めないようデータブロックを作成することができる。また、データブロックのアドレスフィールドに含まれる書き込み開始アドレスは、任意のアドレスを指定することができる。言い換えると、メモリブロック内の任意のアドレスから書き込みを開始するようにしてもよい。
【0057】
こうして、ECU10は、データブロックのアドレスフィールドに含まれる書き込み開始アドレスを使用して、メモリブロックに対して消去操作を行うかどうかを判断する。本発明に従う書き換え処理においては、書き換え領域の終了アドレス(図3の例では、アドレス412F)は使用されない。該終了アドレスを書き換え装置20に指定する必要がない。したがって、不揮発性メモリに含まれるプログラムおよび/またはデータの仕様変更における管理項目を減らして、管理負荷を低減させることができる。
【0058】
図5は、この発明の第2の実施例に従う、ROM16を実現する不揮発性メモリ70のメモリ領域の一例を示す。不揮発性メモリ70は、消去および書き込み操作をビット単位に実行することができるように構成されたメモリである。言い換えると、消去および書き込み操作を不揮発性メモリ80の任意の領域に対して実施することができる。
【0059】
書き換え装置20から転送されるデータブロックのそれぞれは、書き込み領域71、72、...76に書き込まれる。ECU10は、それぞれの書き込み領域の開始アドレスを有している。また、ECU10は、それぞれの書き込み領域について消去済みフラグを有している。ある書き込み領域に対して消去操作が実行されたとき、該書き込み領域についての消去済みフラグがセットされる。
【0060】
図6は、第2の実施例に従う書き換え処理の概略的なフローを示す。ステップS81において、書き換え装置20は、データブロック1をECU10に送信する。ECU10は、データブロック1を受け取る。ECU10は、データブロック1のアドレスフィールドから、アドレス3F00を抽出する。
【0061】
ECU10は、先頭アドレスがアドレス3F00である書き込み領域71(図5)の消去済みフラグを調べる。消去済みフラグがセットされていれば、書き込み領域が消去済み領域であることを示す。ECU10は、データブロック1のデータフィールドからプログラムコードを抽出し、それをメモリブロック1のアドレス3F00から開始する領域71に書き込む。
【0062】
消去済みフラグがセットされていなければ、書き込み領域71が消去されていないことを示す。ECU10は、書き込み領域71に対して消去操作を実行する(ステップS81)。消去操作を終えた後、書き込み領域71についての消去済みフラグがセットされる。ECU10は、データブロック1のデータフィールドからプログラムコードを抽出し、消去操作が実行された書き込み領域71に該プログラムコードを書き込む(ステップS81)。
【0063】
データブロック1のプログラムコードの書き込みを終了したとき、ECU10は、書き換え装置20に書き込み完了信号を送信する(ステップS82)。ECU10は、書き込み領域71について消去済みフラグをリセットする。
【0064】
ステップS81およびS82に示される処理は、書き換え処理の1サイクルを示す。ECU10は、データブロックを受信するたびに、ステップS81およびS82で示されるものと同様の書き換え処理サイクルを実行する。
【0065】
代替的に、書き換え装置20からECU10に転送されるデータは、それぞれの書き込み領域(図5)の大きさ以下である可変長データであってもよい。
【0066】
こうして、ECU10は、データブロックのアドレスフィールドに含まれるアドレスを使用して、該データブロックのデータが書き込まれる領域に対して消去操作を行うかどうか判断する。この第2の実施例に従う書き換え処理においても、書き換え領域の終了アドレス(図5の例では、アドレス412F)は使用されない。したがって、不揮発性メモリに含まれるプログラムおよび/またはデータの仕様変更における管理項目を減らして、管理負荷を低減させることができる。
【0067】
図3に示されるような不揮発性メモリにおいて、メモリブロックの大きさとそれぞれのデータブロックに含まれるデータの大きさとが同じである場合、上記の第2の実施例に従って書き換え処理を実施することができる。
【0068】
消去する領域の大きさは、1回の転送によってメモリに書き込まれるデータ量以上の大きさをもつ。この条件を満たす限り、第1および第2のいずれの実施例においても、また不揮発性メモリの仕様にかかわらず、消去する領域の大きさを任意に定めることができる。
【0069】
図7は、この発明の一実施形態に従う、書き換え装置が実行するプロセスのフローチャートを示す。このプロセスは、図4の第1の実施例および図6の第2の実施例の両方に適用されることができる。この場合、図4に示されるそれぞれの書き換え処理サイクル(たとえば、ステップS51およびS52)において、または図6に示されるそれぞれの書き換え処理サイクル(たとえば、ステップS81およびS82)において、ステップS101〜S103が実施される。
【0070】
ステップS101において、書き換え装置がデータブロックをECUに送信することにより、書き換え処理が開始する。書き換え装置は、書き換え完了信号をECUから受信するまで待つ(S102)。書き換え完了信号を受信したならば、送信待ちのデータブロックが存在するかどうか判断する(S103)。送信待ちのデータブロックが存在するならば、ステップS101に戻り、次のデータブロックをECUに送信する。送信待ちのデータブロックが存在しなければ、書き換え処理を終了する。
【0071】
図8は、この発明の一実施形態に従う、ECUが実行するプロセスのフローチャートを示す。このプロセスは、図4の第1の実施例および図6の第2の実施例の両方に適用されることができる。この場合、図4に示されるそれぞれの書き換え処理サイクル(たとえば、ステップS51およびS52)、および図6に示されるそれぞれの書き換え処理サイクル(たとえば、ステップS81およびS82)において、ステップS111〜S117が実施される。
【0072】
ステップS111においてデータブロックを受信したとき、このルーチンに入る。ステップS112に進み、受信したデータブロックのアドレスフィールドから、アドレスを抽出する(S112)。ステップS113に進み、抽出したアドレスによって示される領域が消去済み領域かどうか判断する。前述した第1の実施例に従うと、抽出したアドレスによって示される領域は、該アドレスが含まれるメモリブロックである。前述した第2の実施例に従うと、抽出したアドレスによって示される領域は、該アドレスから開始する、1個のデータブロックに含まれるデータが書き込まれる書き込み領域である。
【0073】
消去済み領域と判断されたならば、ステップS115に進む。消去済み領域でないと判断されたならば、ステップS114に進む。ステップS114において、抽出されたアドレスによって示される領域に記憶されているデータを消去し、該領域を消去済み領域にする。
【0074】
ステップS115において、受信したデータブロックのデータフィールドから、データを抽出する。抽出されたデータを、抽出したアドレスによって示される消去済み領域に書き込む(S116)。書き込みが終了したならば、書き込み完了信号を書き換え装置に送信する(S117)。
【0075】
【発明の効果】
この発明によると、不揮発性メモリにおけるプログラム/データの仕様変更におけるアドレス管理の負荷を低減することができる。
【図面の簡単な説明】
【図1】この発明の一実施例における、書き換えシステムの全体を示すブロック図。
【図2】この発明の一実施例における、転送されるプログラムおよびデータブロックの形態を示す図。
【図3】この発明の第1の実施例における、不揮発性メモリの領域を示す図。
【図4】この発明の第1の実施例における、書き換え処理の概略的なフローを示す図。
【図5】この発明の第2の実施例における、不揮発性メモリの領域を示す図。
【図6】この発明の第2の実施例における、書き換え処理の概要的なフローを示す図。
【図7】この発明の一実施例における、書き換え装置によって実行される書き換え処理のフローチャート。
【図8】この発明の一実施例における、ECUによって実行される書き換え処理のフローチャート。
【図9】従来技術における、書き換え処理の概要的なフローを示す図。
【図10】従来技術における、書き換え装置によって実行される書き換え処理のフローチャート。
【図11】従来技術における、ECUによって実行される書き換え処理のフローチャート。
【符号の説明】
10 ECU
16 ROM
20 書き換え装置
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a rewriting system for rewriting a nonvolatile memory of a vehicle control device with data transferred from an external rewriting device.
[0002]
[Prior art]
Currently, vehicles are variously controlled by a plurality of vehicle control devices (hereinafter referred to as “ECUs”). The ECU controls the vehicle based on driving states detected by various sensors mounted on the vehicle. These controls include controls related to the engine such as air-fuel ratio, fuel injection amount, and emissions, and controls related to the vehicle body such as power windows, airbags, and ABS.
[0003]
The ECU receives a central processing unit (CPU), a ROM (read-only memory) that stores control programs and data, a RAM (random access memory) that provides a work area for the CPU, receives signals from various sensors, and various parts of the engine I / O interface for sending control signals to The ROM is typically a rewritable (that is, erasable and writable) nonvolatile memory such as a flash memory or an EEPROM.
[0004]
A system for rewriting data stored in a nonvolatile memory of an ECU is known. This system includes a rewriting device, an ECU having a nonvolatile memory, and a serial communication path connecting them.
[0005]
Japanese Patent Laid-Open No. 9-128229 discloses a rewriting operation comprising the following steps.
[0006]
1) The rewriting device transmits an erase command to the ECU.
[0007]
2) In response to the erase command, the ECU executes an erase operation on the entire area of the nonvolatile memory.
[0008]
3) The rewriting device transmits a data block including an address and data to the ECU.
[0009]
4) The ECU writes the received data in the memory area indicated by the received address.
[0010]
5) Repeat steps 3) and 4) until all data blocks have been written.
[0011]
6) When writing of all data blocks is completed, the ECU writes end data represented by a predetermined code in a predetermined area of the memory.
[0012]
7) The ECU transmits a rewrite completion signal to the rewriting device.
[0013]
In a nonvolatile memory such as a flash memory and an EEPROM, a rewrite operation can be performed on a part of the memory area. FIG. 9 shows a schematic flow of a conventional rewriting process for such a nonvolatile memory. First, the rewriting device requests the ECU to erase the memory area (rewriting area) in which data is to be written. This request is usually made by an erase command including an address field 201 and a size field 202. The address field 201 includes the start address of the rewrite area. The size field 202 includes the size of the rewrite area. The ECU calculates the erase area from the start address and size specified by the erase command. An erase operation is executed on the calculated erase area. In this example, the start address is 3F00 and the size is 128 bytes. Therefore, the area from memory addresses 3F00 to 3F7F is erased.
[0014]
In order to write data to the erased area, the rewriting device sequentially transmits a series of data blocks to the ECU. A data block typically includes an address field 203 and a data field 204. The ECU receives the data block and extracts an address from the address field 203. The ECU writes the data included in the data field 204 in the memory location designated by the extracted address. Referring to the data block 1, the data block 1 is written to the memory address 3F00.
[0015]
FIG. 10 shows an example of a flowchart of a process executed by the rewriting device in the rewriting process shown in FIG. In step S251, the above-described erasure command is transmitted to the ECU, whereby the rewriting process is started. If an erasure completion signal is received from the ECU (S252), the data block is transmitted to the ECU (S253). If a write completion signal is received from the ECU (S254), it is determined in step S255 whether there is a data block waiting for transmission. If there is a data block waiting for transmission, the next data block is transmitted to the ECU. Thus, as shown in FIG. 9, data blocks 1 to n are sequentially transmitted to the ECU. If there is no data block waiting for transmission in step S255, the rewriting device ends the rewriting process.
[0016]
FIG. 11 shows an example of a flowchart of a process executed by the ECU in the rewriting process shown in FIG. This routine is entered when an erase command is received from the rewrite device in step S271 or when a data block is received from the rewrite device in step S274. If an erase command is received from the rewriting device in step S271, as described above, an erase operation is executed on the erase area indicated by the erase command (S272). When the erasing operation is completed, an erasing completion signal is transmitted to the rewriting device (S273), and this routine is exited.
[0017]
As described above with reference to FIG. 9, after the erasure completion signal is transmitted to the rewriting device, transfer of the data block from the rewriting device to the ECU is started. When a data block is received from the rewriting device, the determination in step S271 is No, the determination in step S274 is Yes, and this routine is entered again. In step S275, an address is extracted from the address field of the received data block. Data is extracted from the data field (S276). The extracted data is written in the memory location indicated by the extracted address (S277). When the writing operation is finished, a writing completion signal is transmitted to the rewriting device (S278).
[0018]
[Problems to be solved by the invention]
The rewriting device has a control program for performing a memory rewriting process through communication with the ECU. The start and end addresses of the rewrite area are specified in this control program. Instead of the end address, the size of the rewrite area may be specified. The control program creates an erase command according to the specified start and end addresses.
[0019]
Various programs and data are stored in the nonvolatile memory of the ECU. It often happens that the size of the program / data is changed by modifying the program / data. When the program / data size changes, the end address of the rewrite area for the program / data specified in the control program must be changed. Changing the control program each time the program / data is corrected complicates the management of the program / data specification change.
[0020]
Further, in order to prevent an erasing operation from being performed on an unintended memory area, the rewrite area specified in the control program must be accurate. However, since the control program is changed every time the program / data is corrected, it is impossible to completely prevent the erroneous designation of the rewrite area.
[0021]
Therefore, there is a need for a rewrite system that does not require managing the end address of the rewrite area in memory rewrite processing.
[0022]
[Means for Solving the Problems]
According to one aspect of the present invention, the vehicle control device has a rewritable nonvolatile memory and rewrites the memory with data transferred from an external rewriting device. Each data block has a data field containing data to be written to the memory and an address field containing a memory address to which the data is to be written. The vehicle control device receives the data block transferred from the rewriting device. The address is extracted from the address field of the received data block. It is determined whether the memory area indicated by the extracted address is an erased area. If it is determined that the memory area is an erased area, the vehicle control device extracts data from the data field of the received data block and writes the data in the memory area indicated by the address.
[0023]
According to the present invention, it is determined whether the memory area into which data is to be written is an erased area using the address included in the address field of the data block. If it is determined that the area has been erased, a write operation is performed. Since the rewriting process can be executed using the address included in the data block, it is not necessary to specify the end address of the rewriting area in the control program of the rewriting device. The number of management items in the specification change of the program / data is reduced, so that the complexity of management can be reduced.
[0024]
According to another aspect of the present invention, if it is determined that the memory area is not an erased area, the data written in the area is erased to be an erased area. Data extracted from the data field is written into the erased area.
[0025]
According to the present invention, the erase operation for the area where data is to be written is reliably performed using the address included in the address field of the data block. Since the rewriting process can be executed using the address included in the data block, the management items in the program / data specification change can be reduced, thereby reducing the complexity of the management. In addition, since the erase command is unnecessary, the efficiency of the rewrite process is improved.
[0026]
According to another aspect of the present invention, by comparing the address extracted from the data block with the address of the erased area of the memory, it is determined whether the memory area indicated by the extracted address is an erased area. The By comparing the addresses, it is possible to easily determine whether the area is an erased area. Therefore, it is possible to realize a rewriting process that reduces the management load in the specification change without increasing the load on the vehicle control device.
[0027]
DETAILED DESCRIPTION OF THE INVENTION
Next, an embodiment of the present invention will be described with reference to the drawings. FIG. 1 shows an overall functional block diagram of a rewriting system according to the present invention. The rewriting system includes an ECU 10 and a rewriting device 20 provided outside thereof.
[0028]
The rewriting device 20 is a regular rewriting device approved by the manufacturer of the vehicle on which the ECU 10 is mounted. The rewriting device 20 is connected to the ECU 10 via a serial communication bus.
[0029]
The rewriting device 20 includes a transmission / reception unit 21 and a data block assembly unit 22. The data block assembling unit 22 assembles a series of data blocks from programs and / or data transmitted to the ECU 10. The program and / or data is transmitted from the transmission / reception unit 21 to the ECU 10 as a series of data blocks.
[0030]
The ECU 10 is typically composed of a microcomputer and circuit elements associated therewith. The ECU 10 includes a central processing unit (hereinafter referred to as “CPU”), a ROM 16 that stores programs to be executed and data, and a RAM (random access memory) that provides a work area during execution and stores calculation results and the like. The ECU 10 further includes an input / output interface that receives detection signals from various sensors provided in the vehicle and sends control signals to each part of the vehicle. The detection signal from the sensor includes signals such as engine speed, engine water temperature, intake air temperature, battery voltage, and ignition switch. The CPU performs an operation using the control program and data stored in the ROM 16 based on the detection signal input from the input / output interface. The CPU outputs the calculation result to each part of the vehicle via the input / output interface, and controls various functions of the vehicle. For simplicity, only ROM 16 is shown in FIG.
[0031]
The ROM 16 is a nonvolatile memory that can erase data stored in a predetermined area and write new data in the area. The ROM 16 can be realized by a nonvolatile memory such as a flash memory and an EEPROM.
[0032]
The address extraction unit 12, the area determination unit 13, the data extraction unit 14, and the writing unit 15 are typically realized as software programs. These programs are stored in, for example, a non-rewritable ROM (not shown). A non-rewritable ROM is a non-volatile memory that cannot change stored data.
[0033]
A non-rewritable ROM can be realized by a mask ROM in which data is determined at the time of manufacture and cannot be erased and written thereafter, or a PROM in which data can be written only once.
[0034]
Alternatively, it may be realized by setting a predetermined memory area of the rewritable (that is, erasable and writable) ROM 16 such as a flash memory or an EEPROM as an unchangeable area.
[0035]
An address and data are extracted from the data block received from the rewriting device 20 by the address extraction unit 12 and the data extraction unit 14, respectively. The area determination unit 13 determines whether the memory area of the ROM 16 indicated by the extracted address is an erased area. If the erased area is determined, the writing unit 15 writes the extracted data into the erased area. If it is determined that it is not an erased area, the area determination unit 13 erases the data stored in the area. Thereafter, the writing unit 15 writes the extracted data in the area where the data has been erased.
[0036]
Hereinafter, an embodiment of an operation for rewriting a program stored in the ROM 16 will be described. However, the following embodiments are similarly applied when rewriting arbitrary data stored in the ROM 16.
[0037]
FIG. 2 shows an example of a program transferred from the rewriting device 20 to the ECU 10. The size of the program 30 is 560 bytes. The program 30 is subdivided into program codes each having a predetermined length (8 bytes in this example). The data block has a data field 32 containing a program code and an address field 33 containing a memory address where the program code is to be written. From the program 30, 70 data blocks are created. Note that the program size, program code length, and number of data blocks shown in FIG. 2 are merely examples.
[0038]
FIG. 3 shows an example of a memory area of the non-volatile memory 40 that implements the ROM 16 according to the first embodiment of the present invention. The nonvolatile memory 40 is divided into a plurality of memory blocks each having a predetermined size. According to the specification of the nonvolatile memory 40, the erasing operation is defined to be executed in units of memory blocks. Write operations can be performed bit by bit.
[0039]
FIG. 3 shows two memory blocks 41 and 42 as an example. The size of the memory block depends on the specifications of the memory 40. In this example, it is assumed that the size of each of the memory blocks 41 and 42 is 512 bytes. Data blocks transferred from the rewriting device are stored in areas 44, 45,. . . 49 are written in order.
[0040]
The ECU 10 has a start address and an end address of each memory block. Further, the ECU 10 has an erased flag for each memory block. When an erase operation is performed on a memory block, the erased flag for the memory block is set.
[0041]
FIG. 4 shows a schematic flow of the rewrite processing according to the first embodiment of the present invention. It is assumed that the data block is written from the start address of the memory block.
[0042]
In step S <b> 51, the rewriting device 20 transmits the data block 1 to the ECU 10. The ECU 10 receives the data block 1. The ECU 10 extracts the address 3F00 from the address field of the data block 1.
[0043]
The ECU 10 compares the address 3F00 with the start and end addresses of each memory block. As a result, it is determined that the address 3F00 is included in the memory block 41 (FIG. 3). The ECU 10 checks the erased flag in the memory block 41.
[0044]
If the erased flag of the memory block 41 is set, the ECU 10 determines that the memory block 41 is an erased area. On the other hand, if the erased flag of the memory block 41 is not set, the ECU 10 determines that the memory block 41 is not an erased area. When determining that the area is not the erased area, the ECU 10 executes an erasing operation on the memory block 41 (step S51). After the erase operation is finished, the erased flag is set for the memory block 41.
[0045]
The ECU 10 extracts the program code from the data field of the data block 1 and writes it in the write area 44 (FIG. 3) starting from the address 3F00 of the memory block 1 (step S51). When the writing of the program code of the data block 1 is completed, the ECU 10 transmits a writing completion signal to the rewriting device 20 (step S52). Here, the process shown in steps S51 and S52 represents one cycle of the rewrite process.
[0046]
In steps S53 and S54, the next rewrite processing cycle is executed. In step S53, the rewriting device 20 transmits the data block 2 to the ECU 10. The ECU 10 extracts the address 3F08 from the address field of the data block 2. The ECU 10 confirms that the address 3F08 is included in the memory block 1. Since the erased flag of the memory block 41 is set, the ECU 10 determines that the memory block 41 is an erased area.
[0047]
The ECU 10 extracts the program code from the data field of the data block 2 and writes it in the write area 45 (FIG. 3) starting from the address 3F08 of the memory block 41 (step S53). When the writing of the program code of the data block 2 is completed, the ECU 10 transmits a writing completion signal to the rewriting device 20 (step S53).
[0048]
The rewriting device 20 sequentially transmits the data blocks 3 to 64 to the ECU 10, and the ECU 10 writes the program code included in these data blocks into the memory block 41.
[0049]
In the rewrite processing cycle of steps S57 and S58, the rewrite device 20 transmits the data block 65 to the ECU 10. The ECU 10 receives the data block 65. The ECU 10 extracts the address 4100 from the address field of the data block 65.
[0050]
Since the address 4100 is not included in the memory block 1, the ECU 10 compares it with the start and end addresses of other memory blocks. As a result, it is determined that the address 4100 is included in the memory block 42 (FIG. 3). The ECU 10 checks the erased flag in the memory block 42.
[0051]
If the erased flag of the memory block 42 is set, the ECU 10 determines that the memory block 42 is an erased area. If the erased flag of the memory block 42 is not set, the ECU 10 determines that the memory block 42 is not an erased area. When determining that the area is not the erased area, the ECU 10 executes an erasing operation on the memory block 42 (step S57). After the erase operation is finished, the erased flag is set for the memory block 42.
[0052]
The ECU 10 extracts the program code from the data field of the data block 65 and writes it in the area 48 (FIG. 3) starting from the address 4100 of the memory block 42 (step S57). When the writing of the program code of the data block 65 is completed, the ECU 10 transmits a writing completion signal to the rewriting device 20 (step S58).
[0053]
In steps S59 and S60, the last rewrite processing cycle is executed. In step S59, the rewriting device 20 transmits the data block 70 to the ECU 10. The ECU 10 extracts the address 4128 from the address field of the data block 70. The ECU 10 determines that the address 4128 is included in the memory block 42. An erased flag is set in the memory block 42. Therefore, the ECU 10 determines that the memory block 42 is an erased area.
[0054]
The ECU 10 extracts the program code from the data field of the data block 70 and writes it in the area 49 (FIG. 3) starting from the address 4128 of the memory block 42 (step S59). When the writing of the program code of the data block 70 is completed, the ECU 10 transmits a writing completion signal to the rewriting device 20 (step S60).
[0055]
In this way, all the program codes of the program 30 are transmitted to the ECU 10. When the rewriting device 20 receives a write completion signal of the data block 70 from the ECU 10, the rewriting device 20 transmits a signal for ending the rewriting process to the ECU 10. In response to this, the ECU 10 resets the erased flag for the memory blocks 41 and 42. The reset timing of the erased flag of the memory block 41 may be when writing to the write area 47 of the memory block is completed.
[0056]
Alternatively, the data block transferred from the rewriting device to the ECU may be of variable length. For example, in order to improve transfer efficiency, a data block can be created so that the program code included in the data field does not include the “FF” byte indicating the free space in the memory. An arbitrary address can be designated as the write start address included in the address field of the data block. In other words, writing may be started from an arbitrary address in the memory block.
[0057]
Thus, the ECU 10 determines whether to perform an erasing operation on the memory block using the write start address included in the address field of the data block. In the rewrite processing according to the present invention, the end address of the rewrite area (address 412F in the example of FIG. 3) is not used. There is no need to designate the end address in the rewriting device 20. Therefore, it is possible to reduce the management load by reducing the management items in the specification change of the program and / or data included in the nonvolatile memory.
[0058]
FIG. 5 shows an example of a memory area of the non-volatile memory 70 that implements the ROM 16 according to the second embodiment of the present invention. The nonvolatile memory 70 is a memory configured to be able to execute erase and write operations in bit units. In other words, erase and write operations can be performed on any area of the non-volatile memory 80.
[0059]
Each of the data blocks transferred from the rewriting device 20 has write areas 71, 72,. . . 76 is written. The ECU 10 has a start address for each writing area. Further, the ECU 10 has an erased flag for each writing area. When an erase operation is performed on a certain write area, an erased flag for the write area is set.
[0060]
FIG. 6 shows a schematic flow of a rewrite process according to the second embodiment. In step S81, the rewriting device 20 transmits the data block 1 to the ECU 10. The ECU 10 receives the data block 1. The ECU 10 extracts the address 3F00 from the address field of the data block 1.
[0061]
The ECU 10 checks the erased flag in the write area 71 (FIG. 5) whose start address is address 3F00. If the erased flag is set, it indicates that the write area is an erased area. The ECU 10 extracts the program code from the data field of the data block 1 and writes it in the area 71 starting from the address 3F00 of the memory block 1.
[0062]
If the erased flag is not set, it indicates that the write area 71 has not been erased. The ECU 10 performs an erasing operation on the writing area 71 (step S81). After the erase operation is finished, the erased flag for the write area 71 is set. The ECU 10 extracts the program code from the data field of the data block 1, and writes the program code in the writing area 71 where the erasing operation has been executed (step S81).
[0063]
When the writing of the program code of the data block 1 is completed, the ECU 10 transmits a writing completion signal to the rewriting device 20 (step S82). The ECU 10 resets the erased flag for the writing area 71.
[0064]
The process shown in steps S81 and S82 represents one cycle of the rewrite process. Each time the ECU 10 receives a data block, it executes a rewrite processing cycle similar to that shown in steps S81 and S82.
[0065]
Alternatively, the data transferred from the rewriting device 20 to the ECU 10 may be variable length data that is equal to or smaller than the size of each writing area (FIG. 5).
[0066]
Thus, the ECU 10 uses the address included in the address field of the data block to determine whether to perform an erasing operation on the area where the data of the data block is written. Also in the rewrite processing according to the second embodiment, the end address of the rewrite area (address 412F in the example of FIG. 5) is not used. Therefore, it is possible to reduce the management load by reducing the management items in the specification change of the program and / or data included in the nonvolatile memory.
[0067]
In the nonvolatile memory as shown in FIG. 3, when the size of the memory block and the size of the data included in each data block are the same, the rewrite processing can be performed according to the second embodiment. .
[0068]
The size of the area to be erased is larger than the amount of data written to the memory by one transfer. As long as this condition is satisfied, the size of the area to be erased can be arbitrarily determined in both the first and second embodiments and regardless of the specification of the nonvolatile memory.
[0069]
FIG. 7 shows a flowchart of a process executed by the rewriting device according to an embodiment of the present invention. This process can be applied to both the first embodiment of FIG. 4 and the second embodiment of FIG. In this case, steps S101 to S103 are performed in each rewrite processing cycle shown in FIG. 4 (for example, steps S51 and S52) or in each rewrite processing cycle shown in FIG. 6 (for example, steps S81 and S82). Is done.
[0070]
In step S101, the rewriting device starts the rewriting process by transmitting the data block to the ECU. The rewriting device waits until a rewriting completion signal is received from the ECU (S102). If a rewrite completion signal is received, it is determined whether there is a data block waiting for transmission (S103). If there is a data block waiting for transmission, the process returns to step S101, and the next data block is transmitted to the ECU. If there is no data block waiting for transmission, the rewriting process is terminated.
[0071]
FIG. 8 shows a flowchart of a process executed by the ECU according to one embodiment of the present invention. This process can be applied to both the first embodiment of FIG. 4 and the second embodiment of FIG. In this case, steps S111 to S117 are performed in each rewrite processing cycle (for example, steps S51 and S52) shown in FIG. 4 and each rewrite processing cycle (for example, steps S81 and S82) shown in FIG. The
[0072]
This routine is entered when a data block is received in step S111. In step S112, an address is extracted from the address field of the received data block (S112). In step S113, it is determined whether the area indicated by the extracted address is an erased area. According to the first embodiment described above, the area indicated by the extracted address is a memory block including the address. According to the second embodiment described above, the area indicated by the extracted address is a writing area in which data included in one data block is written starting from the address.
[0073]
If it is determined that the area has been erased, the process proceeds to step S115. If it is determined that the area is not erased, the process proceeds to step S114. In step S114, the data stored in the area indicated by the extracted address is erased to make the area an erased area.
[0074]
In step S115, data is extracted from the data field of the received data block. The extracted data is written into the erased area indicated by the extracted address (S116). When the writing is completed, a writing completion signal is transmitted to the rewriting device (S117).
[0075]
【The invention's effect】
According to the present invention, it is possible to reduce the load of address management in changing the program / data specifications in the nonvolatile memory.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an entire rewriting system in an embodiment of the present invention.
FIG. 2 is a diagram showing the form of transferred programs and data blocks in one embodiment of the present invention.
FIG. 3 is a diagram showing an area of a nonvolatile memory in the first embodiment of the present invention.
FIG. 4 is a diagram showing a schematic flow of rewrite processing in the first embodiment of the present invention.
FIG. 5 is a diagram showing an area of a nonvolatile memory in a second embodiment of the present invention.
FIG. 6 is a diagram showing a schematic flow of rewrite processing in the second embodiment of the present invention.
FIG. 7 is a flowchart of a rewriting process executed by the rewriting device in one embodiment of the present invention.
FIG. 8 is a flowchart of a rewrite process executed by the ECU in one embodiment of the present invention.
FIG. 9 is a diagram showing a schematic flow of rewrite processing in the prior art.
FIG. 10 is a flowchart of rewriting processing executed by a rewriting device in the prior art.
FIG. 11 is a flowchart of a rewrite process executed by an ECU according to a conventional technique.
[Explanation of symbols]
10 ECU
16 ROM
20 Rewriting device

Claims (2)

書き換え可能な不揮発性メモリを有し、外部の書き換え装置から転送された一連のデータブロックで該メモリを書き換える車両制御装置であって、
前記メモリは、所定のアドレス範囲により特定されるメモリ領域に区切られており、それぞれのメモリ領域は、少なくとも1つの書き込み領域を有しており、該書き込み領域は、所定の固定長に設定されており
前記一連のデータブロックのそれぞれは、前記書き込み領域の前記所定の固定長以下の大きさに設定される固定長または可変長のデータを含むデータフィールドと、該データが書き込まれるべき前記書き込み領域の先頭アドレスを含むアドレスフィールドとを有しており、該アドレスフィールドに含まれる該先頭アドレスは、該一連のデータブロック間で異なるよう設定されており、
該車両制御装置は、
前記書き換え装置から転送されたデータブロックを受信する受信手段と、
前記受信されたデータブロックのアドレスフィールドから前記先頭アドレスを抽出するアドレス抽出手段と、
前記抽出された先頭アドレスを、前記メモリ領域のそれぞれのアドレス範囲と比較して、該抽出された先頭アドレスを含むアドレス範囲を持つメモリ領域を識別する識別手段と、
前記識別されたメモリ領域が消去済み領域かどうかを判断する領域判断手段と、
前記識別されたメモリ領域が消去済み領域と判断されたならば、前記受信したデータブロックのデータフィールドの前記データを、前記識別されたメモリ領域の、前記抽出された先頭アドレスから開始する書き込み領域に書き込む第1の書き込み手段と、
前記識別されたメモリ領域が消去済み領域でないと判断されたならば、該メモリ領域に書き込まれているデータを消去して消去済み領域にし、前記受信したデータブロックのデータフィールドの前記データを、該消去済み領域の、前記抽出された先頭アドレスから開始する書き込み領域に書き込む第2の書き込み手段と、
を備える、車両制御装置。
A vehicle control device having a rewritable nonvolatile memory and rewriting the memory with a series of data blocks transferred from an external rewriting device,
The memory is divided into memory areas specified by a predetermined address range, and each memory area has at least one write area, and the write area is set to a predetermined fixed length. And
Each of the series of data blocks includes a data field including fixed-length or variable-length data set to a size equal to or smaller than the predetermined fixed length of the write area, and a head of the write area where the data is to be written. An address field including an address, and the head address included in the address field is set to be different between the series of data blocks,
The vehicle control device
Receiving means for receiving a data block transferred from the rewriting device;
Address extracting means for extracting the head address from an address field of the received data block;
The start address which is the extraction, as compared to the respective address ranges of said memory areas, identifying means for identifying a memory area having an address range including the head address issued extract,
Area determination means for determining whether the identified memory area is an erased area;
If it is determined that the identified memory area is an erased area, the data in the data field of the received data block is transferred to the write area starting from the extracted start address of the identified memory area. A first writing means for writing;
If it is determined that the identified memory area is not an erased area, the data written in the memory area is erased to an erased area, and the data in the data field of the received data block is A second writing means for writing to a writing area starting from the extracted start address of the erased area;
A vehicle control device comprising:
前記メモリ領域のそれぞれには、該メモリ領域が消去済みかどうかを示すフラグが関連づけられており、
前記領域判断手段は、前記識別されたメモリ領域の該フラグを調べることにより、該メモリ領域が消去済み領域かどうかを判断するよう構成されており、
前記一連のデータブロックの転送が終了する際に、該一連のデータブロックが書き込まれたメモリ領域についての前記フラグを、消去済みでないことを示す値にセットするフラグセット手段をさらに備える、
請求項1に記載の車両制御装置。
Each of the memory areas is associated with a flag indicating whether the memory area has been erased,
The area determination means is configured to determine whether the memory area is an erased area by examining the flag of the identified memory area;
When the transfer of the series of data blocks ends, the flag setting means for setting the flag for a memory area in which the series of data blocks are written to a value indicating that the series of data blocks has not been erased.
The vehicle control device according to claim 1.
JP2002005197A 2002-01-11 2002-01-11 Vehicle control apparatus for controlling rewriting of nonvolatile memory Expired - Fee Related JP3623481B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002005197A JP3623481B2 (en) 2002-01-11 2002-01-11 Vehicle control apparatus for controlling rewriting of nonvolatile memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002005197A JP3623481B2 (en) 2002-01-11 2002-01-11 Vehicle control apparatus for controlling rewriting of nonvolatile memory

Publications (2)

Publication Number Publication Date
JP2003208326A JP2003208326A (en) 2003-07-25
JP3623481B2 true JP3623481B2 (en) 2005-02-23

Family

ID=27644309

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002005197A Expired - Fee Related JP3623481B2 (en) 2002-01-11 2002-01-11 Vehicle control apparatus for controlling rewriting of nonvolatile memory

Country Status (1)

Country Link
JP (1) JP3623481B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4617816B2 (en) 2004-10-12 2011-01-26 株式会社デンソー Vehicle control device and rewrite program receiving / starting program
CN102358251B (en) * 2006-03-14 2014-11-19 三菱电机株式会社 Vehicle-mounted equipment
US10936236B2 (en) 2017-04-12 2021-03-02 Yazaki Corporation Rewriting system, rewriting device and computer
JP6765343B2 (en) * 2017-05-29 2020-10-07 矢崎総業株式会社 Rewriting system, rewriting device and computer

Also Published As

Publication number Publication date
JP2003208326A (en) 2003-07-25

Similar Documents

Publication Publication Date Title
US6898490B2 (en) Vehicle controller for controlling rewriting data in a nonvolatile memory
US6275911B1 (en) Memory writing device for an electronic device
EP1600981B1 (en) Stored data rewriting system for on-board control unit
US20030163664A1 (en) Method and apparatus for updating a distributed program
JP2001255907A (en) Method and device for controlling driving sequence in vehicle
JP3785299B2 (en) Memory rewriting system for vehicle control device
JP2000045858A (en) Rewriting number storing method for electronic control unit and non-volatile memory
US20070250254A1 (en) On-vehicle control apparatus
US6044014A (en) Electronic control unit and method for storing rewrite count of nonvolatile memory
JP3835969B2 (en) Rewriting system for vehicle control device
JP3828335B2 (en) Rewriting system for vehicle control device
JP3623481B2 (en) Vehicle control apparatus for controlling rewriting of nonvolatile memory
US6125309A (en) Vehicle control device
JP2008146521A (en) Automobile electronic controller
US6490663B1 (en) Electronic control apparatus having rewritable nonvolatile memory
CN112905498A (en) Processing method, processing device, electronic equipment and storage medium
US20050034034A1 (en) Control device with rewriteable control data
US9305409B2 (en) Electronic control unit
CN112732309B (en) Flash memory updating method and device and electronic equipment
JP2023010802A (en) Electronic control device for vehicle
JP2004287712A (en) Electronic device
CN111966363A (en) Method for initializing and reading configuration word, control device and vehicle
JPH01131927A (en) Program correcting method
JP5643708B2 (en) Electronic control unit
JPH08137514A (en) Engine controller

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040616

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040811

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040831

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20041021

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20041122

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20041124

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20081203

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20081203

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20091203

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20091203

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20101203

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20101203

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20111203

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20111203

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20121203

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees