JP2011133974A - Data rewrite device - Google Patents
Data rewrite device Download PDFInfo
- Publication number
- JP2011133974A JP2011133974A JP2009290837A JP2009290837A JP2011133974A JP 2011133974 A JP2011133974 A JP 2011133974A JP 2009290837 A JP2009290837 A JP 2009290837A JP 2009290837 A JP2009290837 A JP 2009290837A JP 2011133974 A JP2011133974 A JP 2011133974A
- Authority
- JP
- Japan
- Prior art keywords
- program
- rewriting
- rewrite
- rom
- control
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Abstract
Description
本発明は、組み込みソフトを更新するデータ書き換え装置に関し、特に、書き換え時間を抑制するデータ書き換え装置に関する。 The present invention relates to a data rewriting device that updates embedded software, and more particularly, to a data rewriting device that suppresses rewriting time.
車両の電子化が進むにつれて車両に搭載されるECU(Electronic Control Unit)の数も増大しその機能も複雑化している。ECUは、例えばEEPROMやフラッシュメモリ(以下、単にROMという)に記憶されたプログラムを実行して、データ処理やアクチュエータの制御等を行っている。 As the computerization of vehicles progresses, the number of ECUs (Electronic Control Units) mounted on the vehicle also increases and its functions become complicated. The ECU executes a program stored in, for example, an EEPROM or a flash memory (hereinafter simply referred to as a ROM) to perform data processing, actuator control, and the like.
このプログラムは、バージョンアップなどの理由で書き換えられる必要が生じることがあり、この場合、一般的にはサービスステーションなどで書き換えツールを車外からECUに接続させ、プログラムを書き換える。書き換え時には、書き換えツールがECUのROMに記憶された書き換えプログラムを起動して、書き換えプログラムが制御用のプログラムを書き換えるという手順を取ることが多い。 This program may need to be rewritten for reasons such as version upgrade. In this case, the program is generally rewritten by connecting a rewriting tool to the ECU from outside the vehicle at a service station or the like. In rewriting, the rewriting tool often starts a rewriting program stored in the ROM of the ECU, and the rewriting program rewrites the control program.
このため、書き換えプログラムが何らかの理由で起動できないとプログラムを書き換えることができなくなる。そこで、書き換えプログラムを外部から提供する技術が考えられている(例えば、特許文献1参照。)。特許文献1には、プログラミングすべきデータをシリアルデータ伝送線路を介して外部から受け取り、制御プログラム(CONTROL)による制御なしで、ROMをリプログラミングするためのプログラムを導入する制御装置が開示されている。リプログラミングするための書き換えプログラムを外部から導入するので、ROMに欠陥があってもプログラムを書き換えることが可能になる。
For this reason, if the rewriting program cannot be started for some reason, the program cannot be rewritten. Therefore, a technique for providing a rewriting program from the outside has been considered (for example, see Patent Document 1).
しかしながら、特許文献1に記載の制御装置では、プログラムの書き換え時間や書き換え対象のプログラムサイズについては考慮されていないという問題がある。
However, the control device described in
制御用のプログラムを書き変える場合、バージョンアップにより制御用のプログラムのサイズが変わることが多い。コスト低減等のため、ROMには制御用のプログラムや書き換えプログラムだけでなく、これらのプログラムを起動させる起動プログラムも記憶されている。バージョンアップにより制御用のプログラムのサイズが変わると、起動プログラムや書き換えプログラムの領域に制御用のプログラムを記憶する必要が生じ、変更のない制御用のプログラムや起動プログラムも書き換える(同じものを場所を変えて記憶する)必要が生じる。万一、制御用のプログラムや起動プログラムの書き換え中に、ECUへの電源遮断等が生じて書き換えに失敗した場合、制御用のプログラムが破壊されたり制御用プログラムを起動させることができなくなる。 When rewriting a control program, the size of the control program often changes due to version upgrade. In order to reduce costs, the ROM stores not only a control program and a rewrite program, but also a startup program for starting these programs. If the size of the control program changes due to the upgrade, it will be necessary to store the control program in the boot program and rewrite program areas, and rewrite control programs and boot programs that have not changed. Need to change and store). In the unlikely event that the control program or the startup program is being rewritten and the power supply to the ECU is interrupted and the rewriting fails, the control program is destroyed or the control program cannot be started.
また、仮に、バージョンアップにより制御用のプログラムのサイズが変わらなくても、ROMの書き換えは、RAMと比べて時間がかかることが知られており、書き換えるプログラムのサイズが大きいほど時間がかかってしまうことになる。変更があった制御用のプログラムの一部だけを書き換えることも考えられるが、一部のプログラムロジックの追加が他のロジックの命令の番地をずらすため、変更部分がわずかであっても制御用のプログラムは全体を書き換えなければならない。 Even if the size of the control program does not change due to version upgrade, it is known that ROM rewriting takes time compared to RAM, and the larger the size of the rewriting program, the longer it takes. It will be. Although it is possible to rewrite only a part of the control program that has changed, the addition of some program logic shifts the address of the instruction of other logic, so even if there is a slight change, The program must be rewritten entirely.
したがって、従来のプログラムの書き換え方法では、プログラムの書き換えを一部だけに留めたり、プログラムの書き換え時間を短縮できないという問題があった。 Therefore, the conventional program rewriting method has a problem that the rewriting of the program is limited to a part or the rewriting time of the program cannot be shortened.
本発明は、上記課題に鑑み、プログラムの書き換えを一部だけに留めることができるデータ書き換え装置を提供することを目的とする。 In view of the above problems, an object of the present invention is to provide a data rewriting apparatus that can rewrite a program only in part.
上記課題に鑑み、本発明は、プログラムを実行するプログラム実行手段と、処理を記述した第1のプログラムと、前記第1のプログラムから読み出される第2のプログラムと、外部から取得した前記第2のプログラムと置き換えらえる更新用プログラムを、前記第2のプログラムと置き換える書き換えプログラムと、を一体に記憶した記憶手段と、を有し、前記第2のプログラムの書き換えを受け付けた場合、前記書き換えプログラムは、外部から前記更新用プログラムを取得して、前記第1のプログラム及び書き換え用プログラムを書き換えることなく、前記第2のプログラムのみを書き換える、ことを特徴とするプログラム書き換え装置を提供する。 In view of the above problems, the present invention provides a program execution means for executing a program, a first program describing processing, a second program read from the first program, and the second program acquired from the outside. A storage unit that integrally stores a renewal program that replaces the second program with an update program that can be replaced with a program, and when the rewriting of the second program is accepted, The present invention provides a program rewriting apparatus that obtains the update program from outside and rewrites only the second program without rewriting the first program and the rewriting program.
プログラムの書き換えを一部だけに留めることができるデータ書き換え装置を提供することができる。 It is possible to provide a data rewriting device that can rewrite a program only in part.
以下、本発明を実施するための形態について図面を参照しながら実施例を挙げて説明する。
図1は、本実施形態のプログラム書き換え方法に関するECU(Electronic Control Unit)100の構造を模式的に示す図の一例である。
本実施形態のプログラム書き換え方法の特徴は以下のとおりである。
(1)制御用のプログラムが、ロジック部分のプログラム32(以下、プログラムLという)と、データ部分のプログラム33(以下、プログラムDという)に分けてコーディングされていること
(2)プログラムDでは、データが処理単位に分けられており、処理そのものを記述することなく、処理の組み合わせ(制御パターン)の指定を受け付けるように構成されていること
(3)ROM14は、ブロック単位など、少なくともプログラムD単位で書き換え可能な物理的構造を有すること
この特徴により、プログラムDだけを書き換えることが可能になる。ロジック部分のプログラムLに比べてプログラムDはサイズが小さいので、制御用のプログラムの書き換え時間を、プログラムLとプログラムDの全体を書き換えるよりも大幅に短縮することができる。
DESCRIPTION OF EMBODIMENTS Hereinafter, embodiments for carrying out the present invention will be described with reference to the drawings.
FIG. 1 is an example of a diagram schematically showing the structure of an ECU (Electronic Control Unit) 100 relating to the program rewriting method of the present embodiment.
The features of the program rewriting method of the present embodiment are as follows.
(1) The control program is coded separately into a logic part program 32 (hereinafter referred to as program L) and a data part program 33 (hereinafter referred to as program D). (2) In program D, The data is divided into processing units, and it is configured to accept the designation of a combination (control pattern) of processing without describing the processing itself. (3) The
また、プログラムDは、処理そのものでなく処理の組み合わせが記述されているので、組み合わせに含まれる処理の指定に変更があってもプログラムDのサイズに影響しない。このため、プログラムDを書き換えてもプログラムL、書き換えプログラム及び起動プログラムを書き換える必要が生じない。 In addition, since the program D describes a combination of processes, not the process itself, the size of the program D is not affected even if the designation of the process included in the combination is changed. For this reason, even if the program D is rewritten, it is not necessary to rewrite the program L, the rewrite program, and the startup program.
〔ECU100〕
ECU100について説明する。ECU100には種々のものがあるが図1のECU100の構成は、プログラムの書き換えの説明に好適な部分だけを取り出したものである。本実施形態のプログラム書き換え方法は、車載された種々のECU(エンジンECU、ボデイECU、マルチメディア系ECU、ナビECU、画像処理ECU等)に適用できる。
[ECU 100]
The ECU 100 will be described. Although there are various types of
ECU100は、主に、ドライバ12及びマイコン13を有する。この他、リセット回路、判定回路、アクチュエータやスイッチ素子と接続するI/OやASIC(Application Specific Integrated Circuit)を有していることがある。
The ECU 100 mainly includes a
ECU100は、コネクタ11を介して書き換えツール200と接続される。コネクタ11は、サービスステーションにある書き換えツール200やOBD2に対応した外部診断ツールを接続するインターフェイスである。コネクタ11は、例えば車両の運転席の周囲に設けられている。書き換えツール200とECU100は、車載ネットワークと同じプロトコル(例えば、CAN(Controller Area Network)やFlexRay等)により通信する。なお、物理的にコネクタ11を介してECU100と書き換えツール200を接続するのでなく、書き換えツール200と車両側の無線通信装置が通信してもよい。無線通信装置は、例えば、携帯電話、無線LAN装置等である。
The ECU 100 is connected to the
ドライバ12は、例えばCAN通信のプロトコルのうち物理層やデータリンク層における通信制御を提供する。したがって、ドライバ12は書き換えツール200から受信した電気信号を規定された電圧の電気信号に変換するなど、物理的な通信経路を提供する。
The
マイコン13は、内部バスを介して接続されたCOM15、CPU16、RAM17及びROM14と接続されている。COM15はドライバ12と接続されており、CAN通信のプロトコルに従って、書き換えツール200から書き込み対象のプログラムDを受信する。
The
CPU16は、ROM14に記憶されたプログラムD及びプログラムLを実行することで、センサの検出した信号の処理、車両制御用の信号の演算、アクチュエータの制御、等を実行する。なお、プログラムDはほぼデータのみしか保持していないので、CPU16がプログラムDだけを実行することはない。また、プログラムDを書き換える際、CPU16はROM14に記憶された書き換えプログラム34を実行して、一連の書き換え処理を統合的に制御する。RAM17は、CPU16が書き換えツール200から受信したプログラムDを一時的に保管する記憶手段である。また、RAM17は、CPU16が書き換えプログラム34を実行する際の作業メモリとなる。
The
ROM14について説明する。ROM14は、例えばフラッシュメモリを実体とするEEPROM(Electrically Erasable and Programmable Read Only Memory)である。ROM14は、書き換え可能な不揮発メモリであればよく、例えばFeRAM(Ferroelectric Random Access Memory)、MRAM(Magnetoresistive Random Access Memory)等でもよい。ただしブロック毎の書き換えが可能である必要がある。ROM14がフラッシュメモリの場合、ROM14へのアクセスはフラッシュメモリコントローラと呼ばれるICが制御するが図では省略した。フラッシュメモリコントローラは、RAM17又は不図示のバッファメモリからROM14へ、又は、ROM14からRAM17又は不図示のバッファメモリへ、データを転送する。
The
また、ROM14がフラッシュメモリの場合、消去できる最少のサイズが決まっている。このサイズは、例えば、8Kbytes〜64Kbytesなどであり、このサイズを1ブロックという。消去単位をブロック化することで、消去の高速化、内部構造の簡略化、大容量化等が可能になる。
Further, when the
〔プログラムL、プログラムDのデータ構造〕
図2を用いて、ROM14に記憶されているデータについて説明する。図2は、ROM14に記憶されたプログラムD、プログラムLを模式的に説明する図の一例である。上記のとおり、ROM14には、プログラムL、プログラムD、書き換えプログラム34、又は、起動プログラム31が記憶されている。図2ではソースコードだが実際にはコンパイル後に記憶されている。
[Data structure of program L and program D]
The data stored in the
起動プログラム31と書き換えプログラム34は公知のものである。起動プログラム31は、IGオンやACCオンにより、リセット回路がマイコン13をリセットすると起動される。例えばIGオンにより、各ECU100の端子にHigh信号が入力されるとそれぞれのリセット回路がCPU16やレジスタなどの回路にリセット信号を出力する。これによりマイコン13が初期化される。CPU16はリセット割込みがあったことを検知してROM14の特定のアドレスに記憶されているリセットベクタの内容をPC(プログラムカウンタ)に設定する。この特定のアドレスの先頭に起動プログラム31が記憶されている。
The
CPU16は、PCが指定するアドレスの起動プログラム31の実行を開始する。起動プログラム31は、例えば、アクチュエータやセンサのパラメータ、レジスタ等を設定し、アクチュエータ等の制御に必要なデータをRAM17に読み込む。最終的に起動プログラム31は、ROM14に記憶されているプログラムLの先頭アドレス(例えば、Main関数のアドレス)をPCに設定して終了する。以降、CPU16は、車両制御のためにプログラムLを実行していく。
The
書き換えプログラム34は、プログラムDのみ、プログラムD及びプログラムL、又は、ROM14の全体を書き換えることができるプログラムである。本実施形態ではプログラムDのみを書き換える手順を説明する。書き換えプログラム34を起動する方法は種々あるが、例えば、リセット回路によるリセット信号を利用する方法や、書き換えツール200から受信する信号(書き換え指示信号)を利用する方法がある。
The
リセット信号を利用する方法の場合、上記のようにリセット回路がマイコン13をリセットした際、CPU16がCOM15から割り込みを検出することで、ECU100に書き換えツール200が接続されていることを検出する。リセット信号により起動した起動プログラム31は、書き換えツール200が接続されていることをCOM15からの割り込みを示すフラグ等により検出し、制御用のプログラムLでなく、書き換えプログラム34を起動すべきであると判定する。なお、書き換えプログラム34は、ROM14の全体を書き換えることもできるため、書き換えプログラム34を退避しておかないと書き換え中にCPU16が書き換えプログラム34を実行できない状況となってしまう。このため、起動プログラム31は、書き換えプログラム34をRAM17にコピーして、RAM17における書き換えプログラム34のアドレスをPCにセットする。
In the case of a method using a reset signal, when the reset circuit resets the
また、書き換えツール200から受信した書き換え指示信号を利用する場合、すでにプログラムLが起動しているので、プログラムLに記述された起動関数(起動プログラム31と同等の機能を有する)が、書き換えプログラム34に制御を移すと判定する。起動関数は、書き換えプログラム34をRAM17にコピーして、RAM17における書き換えプログラム34のアドレスをPCにセットする。
When the rewrite instruction signal received from the
いずれの場合も、CPU16がRAM17から書き換えプログラム34を実行できるようになる。なお、書き換えプログラム34は、安全のためROM14の全体又はプログラムDのみを書き換えツール200に転送してから書き換えを実行してもよい。
In either case, the
起動した書き換えプログラム34は、プログラムDの送信を書き換えツール200に要求する。書き換えツール200はプログラムDの送信を開始するので、マイコン13はCOM15経由でプログラムDを受信する。プログラムDはCANフレームに格納された状態で何回かに分けて送信される。書き換えプログラム34は、受信したプログラムDを順番にRAM17に記憶していく。そして、RAM17にある程度の容量のプログラムDが記憶されると、不図示のフラッシュメモリコントローラにプログラムDをROM14に書き込むように要求する。
The activated
本実施形態では、ROM14におけるプログラムDのアドレスは固定であるので、書き換えプログラム34は、既知の又は診断ツール200から指示されたプログラムDの先頭アドレスをフラッシュメモリコントローラに通知する。したがって、フラッシュメモリコントローラは、ROM14のプログラムDのための領域にRAM17のプログラムDを記憶させることができる。書き換えプログラム34とフラッシュメモリコントローラは、以上の作業を繰り返してプログラムDをROM14に記憶していく。
In the present embodiment, since the address of the program D in the
書き換えプログラム34は、書き換えツール200からプログラムDの送信が終わった旨の終了通知を受け取ると、終了処理を実行する。例えば、書き換えツール200からマイコン13にリセット信号を入力してもよいし、ACCをオフ→オンとすることでマイコン13をリセットしてもよい。リセット後は、起動プログラム31はプログラムLをCPU16に実行させることができる。
When the
<プログラムL>
本実施形態では制御用のプログラムをプログラムLとプログラムDに区分している。プログラムLは、制御のための処理を記述したロジックを有する。制御のための処理とは、センサが検出した信号の取得処理、信号値と閾値の比較処理、信号値に対する演算処理、演算結果に基づく制御処理、等である。ECU100が可能な制御は決まっており、制御のための処理も決まっている。例えば、設計者は、このECU100で必要な各制御の各処理を抽出し、プログラムとして関数化、サブルーチン化等する。関数化やサブルーチン化という言葉は、プログラム言語の仕様に応じたものであり、実際の呼称は問わない。
<Program L>
In this embodiment, the control program is divided into a program L and a program D. The program L has a logic describing a process for control. Processing for control includes acquisition processing of a signal detected by a sensor, comparison processing of a signal value and a threshold value, calculation processing for a signal value, control processing based on a calculation result, and the like. Controls that can be performed by the
なお、設計者が抽出する処理は、着目しているECU100が現在可能な処理に限られない。というのは、車両にオプション(例えば、ムーンルーフ)が装着されることで必要になる処理(ムーンルーフの開閉等)もある等、ECU100は将来的に利用される機能も有するためである。
Note that the process extracted by the designer is not limited to the process that can be currently performed by the
設計者は、このように、ECU100が可能な処理を所定の粒度で抽出する。粒度は、例えば、それ以上、細分化できない1つの処理であるが、より細分化できても処理1と処理2が必ず連続して実行されるような場合は処理1と処理2で1つの処理とすることができる。
In this way, the designer extracts the processing that can be performed by the
図2では、fancA、fancB…がそれぞれ1つの処理であり、それぞれ処理に対応したロジックが記述されているとする。本実施形態では説明のためfancA〜fancZの計26個の処理が関数化されているものとするが、処理の数は1以上であればいくつでもよい。なお、例えばfancAの処理は温度センサの値をチェックする処理で、fancBの処理は前回値と現在の値を比較する処理である。 In FIG. 2, it is assumed that fancA, fancB... Are each one process, and logic corresponding to each process is described. In the present embodiment, for the sake of explanation, it is assumed that a total of 26 processes of fancA to fancZ are functioned. However, the number of processes may be any number as long as it is 1 or more. For example, the process of fancA is a process of checking the value of the temperature sensor, and the process of fancB is a process of comparing the previous value with the current value.
各関数は、プログラム言語の仕様に沿った位置に記述される。図2では、C言語を例にしているため、main_routine() よりも前にプロトタイプが宣言され、プロトタイプの宣言に続いて関数の内容も記述されている。なお、「void funcA(void)」のうち、最初のvoidは返却値がないことを、括弧内のvoidは引数がないことをそれぞれ意味する。したがって、処理の内容によっては「double funcA(double)」のような関数もある。 Each function is described at a position according to the specification of the programming language. In FIG. 2, since the C language is taken as an example, a prototype is declared before main_routine (), and the contents of the function are also described following the declaration of the prototype. In “void funcA (void)”, the first void means that there is no return value, and the void in parentheses means that there is no argument. Therefore, there is a function such as “double funcA (double)” depending on the contents of processing.
main_routine()は、関数を呼び出す、プログラムLの実行部分である。
「for(i = 0; i<26 ; i++)」は、整数「i」を「0〜25」まで順番に変化させることを意味し、「FuctionTbl[i][mode]()」は、プログラムDのFuctionTblに格納された関数(正確には関数が格納されたアドレスを示すポインタ)を呼び出すことを意味する。[mode]は固定である。関数はテーブル状に登録されているので、この例では最大で26個の関数を連続的に呼び出すことができる。
main_routine () is an execution part of the program L that calls a function.
“For (i = 0; i <26; i ++)” means that the integer “i” is changed in order from “0 to 25”, and “FuctionTbl [i] [mode] ()” This means that the function stored in the FuctionTbl of D (to be exact, a pointer indicating the address where the function is stored) is called. [mode] is fixed. Since the functions are registered in a table, in this example, a maximum of 26 functions can be called continuously.
ここで、「mode」は、所定の範囲の整数を取り得る。「mode」は、車両の制御モードや車両状況等により定まる。プログラムLの不図示の記述が、車両の制御モードを他のECU100から取得したり、車両の状況等を判別するなどして、「mode」を指定する。例えば、運転者がecoモードをオンにしている場合には、プログラムLはそのことを示す「mode」を設定し、アダプティブクルーズコントロールが作動している場合には、プログラムLはそのことを示す「mode」を設定する。こうすることで、プログラムLは制御パターンを「mode」により指定することができる。
Here, “mode” can take an integer in a predetermined range. The “mode” is determined by the vehicle control mode, the vehicle status, and the like. A description (not shown) of the program L designates “mode” by acquiring the control mode of the vehicle from another
<プログラムD>
プログラムDは、2次元配列にポインタを格納したテーブル状のデータである。「void(*const FunctionTbl[26][5](void))は、2次元配列の要素(変数)が定数であることを示す。「*」から分かるように、2次元配列の要素には関数のポインタが格納される。ROM14に記憶されたプログラムLの各関数のアドレスは固定であるので、設計者にとっては既知である。なお、プログラムLにおいて各関数が記述されたアドレスは固定であるので、const修飾子により要素の変更を防止している。
<Program D>
The program D is table-like data in which pointers are stored in a two-dimensional array. “Void (* const FunctionTbl [26] [5] (void)) indicates that the element (variable) of the two-dimensional array is a constant. As can be seen from“ * ”, the element of the two-dimensional array is a function. Is stored. Since the address of each function of the program L stored in the
2次元配列について説明する。設計者は全ての関数から制御パターンに応じて実行するもの、しないものを指定するようにテーブルを設計する。このため、プログラムDを作成するに当たり、設計者は制御パターンを決定する。制御パターンは、制御モードや車両状況等により定まる。具体的には、制御パターンは、関数の呼び出しの有無及び呼び出しの順序と同じものである。例えば、車両がecoモードの場合、fancAの処理の次にfancBの処理が必要になるのであれば、fancA→fancBが制御パターンである。このように制御パターンは、関数(すなわち処理)の組み合わせで表すことができる。 A two-dimensional array will be described. The designer designs the table so that all functions are specified according to the control pattern and not. For this reason, when creating the program D, the designer determines a control pattern. The control pattern is determined by the control mode, the vehicle situation, and the like. Specifically, the control pattern is the same as the presence / absence of function calls and the order of calls. For example, when the vehicle is in the eco mode, fancA → fancB is the control pattern if fancB processing is required after fancA processing. Thus, the control pattern can be expressed by a combination of functions (that is, processes).
また、funcAの次に何も処理がないような制御パターンでは、設計者は、関数を呼び出さないように「NULL(なにもしない)」を処理に指定する。したがって、関数の指定とNULLの組み合わせで、車両の制御パターンを全て表すことができる。設計者は、着目しているECU100において生じうる制御パターンを全て網羅し、2次元配列に格納する。図では制御パターンの数は5つになっている。
In a control pattern in which no processing is performed after funcA, the designer designates “NULL (do nothing)” for the processing so as not to call the function. Therefore, all the control patterns of the vehicle can be expressed by a combination of function designation and NULL. The designer covers all control patterns that can occur in the
関数の数とパターンの数から、図では、「26×5」の2次元配列になっている。プログラムLの「for(i = 0; i<26 ; i++)」「FuctionTbl[i][mode]()」は、横軸の位置は固定で縦軸の方向に2次元配列の要素を指定するので、制御パターンに応じて必要な関数を順番に呼び出すことができる。 From the number of functions and the number of patterns, in the figure, it is a “26 × 5” two-dimensional array. "For (i = 0; i <26; i ++)" and "FuctionTbl [i] [mode] ()" of program L specify the elements of the two-dimensional array in the direction of the vertical axis with the position of the horizontal axis fixed. Therefore, necessary functions can be called in order according to the control pattern.
図では、縦軸に順番にfuncA〜funcZを配置し、その有効・無効を指定することで制御パターンが形成されている。funcA〜funcZの処理順が変わる制御パターンがあれば、縦軸方向のfuncA〜funcZの配置順を変えることもできる。 In the figure, funcA to funcZ are arranged in order on the vertical axis, and a control pattern is formed by designating the validity / invalidity thereof. If there is a control pattern that changes the processing order of funcA to funcZ, the arrangement order of funcA to funcZ in the vertical axis direction can be changed.
処理の順番が変わらないのであれば、ECU100が提供しうる処理を順番に2次元配列に配置して、使用しない処理は無効化(NULL)しておくことで、1つの制御パターンを生成できる。図では5つの制御パターンが生成されている。制御パターンに変更があった場合、変更対象の関数を有効化又は無効化すればよいことになる。また、処理の順番が変わる場合でも、関数のポインタを換えるだけでよいことになる。各要素のバイト数は固定なので、NULLから有効化、又は、有効化からNULLに書き換えても2次元配列のサイズすなわちプログラムDのサイズに変更が生じることを防止できる。また、有効化/無効化、関数のポインタの変更は他の関数に影響しない。
If the order of the processes does not change, one control pattern can be generated by arranging the processes that can be provided by the
したがって、プログラムDを書き換える場合でも、プログラムDの書き換えのために他のプログラムである起動プログラム31、プログラムL、及び、書き換えプログラム34の領域に侵食することがないので、書き換えるプログラムはプログラムDのみでよいことになる。
Therefore, even when the program D is rewritten, the program D is rewritten only by the program D because the areas of the
〔プログラムDの書き換え〕
例えば、オプションの脱着等によりいずれかの制御パターンにおいて所定の有効化や無効が必要になることがある。このような場合、設計者は、2次元配列の要素を変更したプログラムDを用意する。
[Rewriting program D]
For example, a predetermined validation or invalidation may be required in any one of the control patterns due to optional attachment / detachment or the like. In such a case, the designer prepares a program D in which the elements of the two-dimensional array are changed.
プログラムDの書き換えの例について説明する。図3は、制御パターンが変更された2次元配列の一例を示す図である。図3では、要素[1][1]、要素[2][3]、要素[3][3]が、図2から変更されている。 An example of rewriting program D will be described. FIG. 3 is a diagram illustrating an example of a two-dimensional array in which the control pattern is changed. In FIG. 3, element [1] [1], element [2] [3], element [3] [3] are changed from FIG.
しかし、上記のように、2次元配列のサイズには変更がないので、書き換えプログラム34はプログラムDのみを書き換えることができる。
However, since the size of the two-dimensional array is not changed as described above, the
なお、プログラムDが、2次元配列以外のデータを記憶している場合もある。このような場合、プログラムDの全体を書き換えることなく、プログラムDの2次元配列のデータのみを書き換えることができる。例えば、書き換えツール200が2次元配列のアドレスを書き換えプログラム34に通知することで、書き換えプログラム34は受信した書き換え用の2次元配列を、指定されたROM14のアドレスに書き込むことができる。
Note that the program D may store data other than the two-dimensional array. In such a case, only the data of the two-dimensional array of the program D can be rewritten without rewriting the entire program D. For example, when the
また、ROM14の書き換え可能なブロックの大きさが、各要素のサイズ以下であれば、要素[1][1]、要素[2][3]、要素[3][3]だけを書き換えることもできる。この場合、同様に、書き換えツール200が2次元配列の要素のアドレスを書き換えプログラム34に通知することで、書き換えプログラム34は受信した書き換え用の2次元配列の各要素を、指定されたROM14のアドレスに書き込むことができる。
If the size of the rewritable block in the
以上のように、プログラムDに、処理の有効/無効の組み合わせのパターンをいくつか抽出しておくことで、制御パターンの処理に変更があっても、プログラムDのサイズに変更が生じることを防止できる。書き換えるプログラムのサイズを最小限にできるので、ROM14の全体を書き換えるよりも書き換え時間を短縮することができる。
As described above, by extracting some patterns of valid / invalid combinations of processing in the program D, it is possible to prevent the size of the program D from being changed even if the control pattern processing is changed. it can. Since the size of the program to be rewritten can be minimized, the rewriting time can be shortened compared to rewriting the
実施例1では、1つのROM14に4つのプログラムを記憶していたが、本実施例ではプログラムDを、書き換える必要のないプログラムL等とは別のROM14に記憶する書き換え方法を説明する。
In the first embodiment, four programs are stored in one
図4は、それぞれのROM14に記憶される各プログラムを模式的に説明する図の一例である。プログラムLのロジック及びプログラムDの2次元配列の設計方法は、実施例1と同様なので説明を省略する。
FIG. 4 is an example of a diagram schematically illustrating each program stored in each
図4では、ROM14とROM21は、物理的に分離されたROMである。したがって、書き換えプログラム34がプログラムDを書き換える際、プログラムD、起動プログラム31又は書き換えプログラム34を破壊するおそれをほぼ無くすことができる。
In FIG. 4, the
実施例1と同様に、書き換えプログラム34は、プログラムDの全体を書き換えてもよいし、プログラムDのうち2次元配列のデータのみを書き換えてもよいし、2次元配列の所定の要素のみを書き換えてもよい。
Similar to the first embodiment, the
本実施例では、プログラムDの格納方法が適用された診断装置300にについて説明する。
図5は、診断装置300の概略構成図の一例を示す。診断装置300は、専用のECU100、一部のECU100又は各ECU100に搭載されている。
In the present embodiment, a
FIG. 5 shows an example of a schematic configuration diagram of the
診断装置300は、診断プログラム35により制御され、起動プログラム31、書き換えプログラム34、及び、診断パラメータ情報36をROM14に記憶している。ROM14は、セグメントに分かれており、セグメントを識別するセグメント識別子に対応づけてセグメント情報を記憶する。本実施例ではセグメントはブロックの集合であるとする。ROM14はブロック毎に消去、書き込みできるので、セグメント毎に消去、書き込みが可能である。
セグメント情報は、具体的には、起動プログラム31、書き換えプログラム34、及び、診断パラメータ情報36であり、どのセグメントにどのセグメント情報が記憶されているかは、設計者にとって既知である。
The
Specifically, the segment information is a
診断装置300は、コネクタ11を介して外部診断ツール400と接続可能になっている。COM15、起動プログラム31及び書き換えプログラム34については、実施例1,2と同様なので説明を省略する。
The
〔診断プログラム35〕
本実施例では診断プログラム35がプログラムLに対応し、診断パラメータ情報36がプログラムDに対応する。
[Diagnosis program 35]
In this embodiment, the
診断プログラム35について説明する。診断プログラム35は書き換え可能なROM14に記憶されており、例えば、IGオンにより診断プログラム35が起動する。診断プログラム35は、異常の有無を監視しており、異常を検出した場合、診断パラメータ情報36から異常識別子に対応づけられた異常コード、異常詳細識別子、及び、警告手段識別子を読み出す。
The
異常識別子は、異常を識別するIDであり、異常コードは例えばダイアグコードであり、異常詳細識別子は異常発生時に格納すべき異常詳細情報番号であり、警告手段識別子は異常発生時に運転者に知らせるべき警告手段番号である。 The abnormality identifier is an ID for identifying an abnormality, the abnormality code is, for example, a diagnostic code, the abnormality detailed identifier is an abnormality detailed information number to be stored when an abnormality occurs, and the warning means identifier should be notified to the driver when the abnormality occurs. Warning means number.
異常を検出した診断プログラム35は、異常詳細識別子に基づき詳細を不揮発メモリに記憶し、警告手段識別子に基づき運転者に異常の発生を通知する。
The
警告手段番号は、異常識別子と警告手段を対応づける。警告手段には、例えば、メータパネルのランプ点灯、警報音の吹鳴、メータパネルへのメッセージ表示、メッセージの読み上げ等がある。警告手段番号は、このような警告手段を指定する番号である。 The warning means number associates the abnormality identifier with the warning means. The warning means includes, for example, lighting of a lamp on the meter panel, sounding an alarm sound, displaying a message on the meter panel, reading a message, and the like. The warning means number is a number that designates such warning means.
〔診断パラメータ情報36の変更〕
診断パラメータ情報36の警告手段識別子の変更について説明する。警告手段識別子は単なる番号なので、警告手段識別子の警告手段番号を変更することで警告手段を切り替えることができる。しかしながら、番号の種類や1つの番号のビット数が増えるわけではないので、診断パラメータ情報36のサイズや警告手段識別子のサイズに変更は生じない。したがって、診断パラメータ情報36の書き換えが、ROM14に記憶された診断プログラム35、起動プログラム31又は書き換えプログラム34に影響することがない。
[Change of diagnostic parameter information 36]
The change of the warning means identifier of the
設計者が、診断パラメータ情報36を変更した場合、外部診断ツール400はセグメント識別子により診断パラメータ情報36が記憶されているセグメントを指定して、診断パラメータ情報36を診断装置300に送信する。書き換えプログラム34は、そのセグメントのセグメント情報(古い診断パラメータ情報36)を、受信した診断パラメータ情報にて書き換えることができる。
When the designer changes the
また、ROM14がセグメントの一部だけを書き換え可能な場合、診断パラメータ情報36のうち警告手段番号が変更されたレコードだけを、書き換えてもよい。また、レコードのうち、変更された警告手段番号だけを書き換えてもよい。
When the
したがって、警告手段識別子を変更するだけで異常検出時に警告する警告手段を変更でき、診断パラメータ情報36のサイズにも影響がないので、起動プログラム31、書き換えプログラム34、及び、診断プログラム35に与える影響を最小限にして(破壊の危険なく)、診断パラメータ情報36を書き換えることができる。
Therefore, it is possible to change the warning means that warns when an abnormality is detected simply by changing the warning means identifier, and the size of the
また、書き換えるセグメント数を最少にできるので書き換え時間も短縮できる。 In addition, since the number of segments to be rewritten can be minimized, the rewriting time can be shortened.
11 コネクタ
13 マイコン
14 ROM
16 CPU
100 ECU
200 書き換えツール
11
16 CPU
100 ECU
200 rewriting tool
Claims (1)
処理を記述した第1のプログラムと、前記第1のプログラムから読み出される第2のプログラムと、外部から取得した前記第2のプログラムと置き換えらえる更新用プログラムを、前記第2のプログラムと置き換える書き換えプログラムと、を一体に記憶した記憶手段と、を有し、
前記第2のプログラムの書き換えを受け付けた場合、前記書き換えプログラムは、外部から前記更新用プログラムを取得して、前記第1のプログラム及び前記書き換え用プログラムを書き換えることなく、前記第2のプログラムのみを書き換える、
ことを特徴とするプログラム書き換え装置。 Program execution means for executing the program;
Rewrite that replaces the second program with a first program that describes processing, a second program that is read from the first program, and an update program that can be replaced with the second program acquired from the outside Storage means for integrally storing the program,
When rewriting of the second program is accepted, the rewriting program acquires the update program from the outside, and rewrites only the second program without rewriting the first program and the rewriting program. rewrite,
The program rewriting apparatus characterized by the above-mentioned.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009290837A JP2011133974A (en) | 2009-12-22 | 2009-12-22 | Data rewrite device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009290837A JP2011133974A (en) | 2009-12-22 | 2009-12-22 | Data rewrite device |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2011133974A true JP2011133974A (en) | 2011-07-07 |
Family
ID=44346672
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009290837A Pending JP2011133974A (en) | 2009-12-22 | 2009-12-22 | Data rewrite device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2011133974A (en) |
-
2009
- 2009-12-22 JP JP2009290837A patent/JP2011133974A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6393342B2 (en) | Method and device for controlling operating sequences in a vehicle | |
JP2007126024A (en) | Vehicular electronic control device | |
CN102124447B (en) | Control appliance for a vehicle, and method for updating data for a control appliance for a vehicle | |
CN110162315A (en) | The non-transitory storage medium of vehicle control device, method for updating program and storage for the program of more new procedures | |
JP4135220B2 (en) | Electronic control device for vehicle | |
CN110244958B (en) | Method and device for updating calibration data of a vehicle | |
CN110809755A (en) | Electronic control system | |
JP2009175947A (en) | In-vehicle electronic controller and information updating method for the same | |
JP2007287022A (en) | Information storage method for electronic control device | |
US20010027524A1 (en) | Method of detecting manipulation of a programable memory device of a digital controller | |
JP2007206827A (en) | Electronic control unit, and method for generating program for controlling on-vehicle device | |
JP2004310221A (en) | Data rewriting method and electronic control device | |
JP2009262787A (en) | Electronic control unit | |
JP2002323902A (en) | Electronic controller | |
WO2017033579A1 (en) | Electronic control device for vehicles | |
JP2005338955A (en) | Electronic control device | |
WO2022102385A1 (en) | On-vehicle ecu, program, and information processing method | |
JP2011133974A (en) | Data rewrite device | |
US9501434B2 (en) | Microcomputer | |
EP3961379B1 (en) | Software update device, software update method, non-transitory storage medium, and vehicle | |
JP2009026183A (en) | Electronic control apparatus for automobile | |
JP7327242B2 (en) | In-vehicle relay device, information processing method and program | |
JP2010286897A (en) | Electronic control unit, and program rewriting method | |
JP2007015643A (en) | Electronic control device for vehicle | |
JP7302250B2 (en) | electronic controller |