JP2018067176A - Electronic control unit - Google Patents

Electronic control unit Download PDF

Info

Publication number
JP2018067176A
JP2018067176A JP2016205855A JP2016205855A JP2018067176A JP 2018067176 A JP2018067176 A JP 2018067176A JP 2016205855 A JP2016205855 A JP 2016205855A JP 2016205855 A JP2016205855 A JP 2016205855A JP 2018067176 A JP2018067176 A JP 2018067176A
Authority
JP
Japan
Prior art keywords
writing
ecu
program
writing device
data
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
Application number
JP2016205855A
Other languages
Japanese (ja)
Inventor
洋平 ▲高▼橋
洋平 ▲高▼橋
Yohei Takahashi
拓也 小林
Takuya Kobayashi
拓也 小林
新井 敏央
Toshinaka Arai
敏央 新井
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.)
Hitachi Astemo Ltd
Original Assignee
Hitachi Automotive Systems 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 Hitachi Automotive Systems Ltd filed Critical Hitachi Automotive Systems Ltd
Priority to JP2016205855A priority Critical patent/JP2018067176A/en
Publication of JP2018067176A publication Critical patent/JP2018067176A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To shorten transmission time of a writing program.SOLUTION: An electronic control unit (ECU) 100 initializes, before loading and executing a writing program into a RAM 130, at least the area of the RAM 130 into which the writing program is loaded. On the other hand, a writing unit 300 which transmits a writing program dividedly to the ECU 100 omits, when data of the writing program to be transmitted to the ECU 100 has been set with an initial value, the transmission of the data, thus, resulting in reducing the data amount of the writing program to be transmitted from the writing unit 300 to the ECU 100, and shortening the transmission time of the writing program.SELECTED DRAWING: Figure 9

Description

本発明は、自動車などに搭載される電子制御装置に関する。   The present invention relates to an electronic control device mounted on an automobile or the like.

自動車などに搭載される電子制御装置は、電気的にデータの消去及び書き込みが可能な不揮発性メモリを有し、ここに制御プログラム及び制御データ(以下、「制御プログラム」と略記する)が格納される。制御プログラムに不具合があった場合、不具合を修正した制御プログラムを外部装置から電子制御装置に転送し、電子制御装置は、制御プログラムを不揮発性メモリに書き込む。不揮発性メモリに制御プログラムを書き込むプログラムは、不具合対応などで一時的に使用されるため、これを不揮発性メモリに格納しておくことは得策ではない。そこで、特開平10−111863号公報(特許文献1)に記載されるように、外部装置から電子制御装置に書込みプログラムを転送し、電子制御装置が、この書込みプログラムを揮発性メモリに展開して実行することで、不揮発性メモリの使用量を削減する技術が提案されている。   An electronic control device mounted on an automobile or the like has a nonvolatile memory that can electrically erase and write data, and stores a control program and control data (hereinafter abbreviated as “control program”). The When there is a problem in the control program, the control program in which the problem is corrected is transferred from the external device to the electronic control device, and the electronic control device writes the control program in the nonvolatile memory. Since the program for writing the control program to the nonvolatile memory is temporarily used for dealing with problems, it is not a good idea to store it in the nonvolatile memory. Therefore, as described in JP-A-10-111863 (Patent Document 1), a writing program is transferred from an external device to the electronic control device, and the electronic control device expands the writing program in a volatile memory. A technique for reducing the amount of use of the nonvolatile memory by executing the technique has been proposed.

特開平10−111863号公報JP-A-10-111863

外部装置から電子制御装置への書込みプログラムの転送は、書込みプログラムをデータの転送単位である「データセット」に分割し、これを順次転送することで行われる。書込みプログラムの転送時間を短縮するため、データセットのデータ本体がすべて初期値(例えば、0xFF)に設定されている場合、そのデータセットは制御に何ら寄与しないため、その転送をスキップすることが考えられる。しかしながら、電子制御装置の揮発性メモリは、初期状態の値が不定であるため、データ本体のすべてが初期値に設定されているデータセットの転送をスキップすることができない。   The writing program is transferred from the external device to the electronic control device by dividing the writing program into “data sets” which are data transfer units and sequentially transferring the data. In order to shorten the transfer time of the writing program, when all the data bodies of the data set are set to the initial value (for example, 0xFF), the data set does not contribute to the control, so that the transfer may be skipped. It is done. However, since the initial value of the volatile memory of the electronic control unit is indefinite, transfer of a data set in which all of the data body is set to the initial value cannot be skipped.

そこで、本発明は、データ本体のすべてが初期値に設定されているデータセットの転送をスキップ可能とし、書込みプログラムの転送時間を短縮することができる、電子制御装置を提供することを目的とする。   SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to provide an electronic control device that can skip the transfer of a data set in which all of the data body is set to the initial value, and can shorten the transfer time of the writing program. .

このため、電子制御装置は、通信によって取得した任意のプログラムを揮発性メモリに展開して実行する手段と、プログラムを揮発性メモリに展開する前に、少なくともプログラムを展開する揮発性メモリの領域を初期化する手段と、を有する。   For this reason, the electronic control unit has a means for expanding and executing an arbitrary program acquired by communication in the volatile memory, and at least an area of the volatile memory for expanding the program before expanding the program in the volatile memory. Means for initializing.

本発明によれば、書込みプログラムの転送時間を短縮することができる。   According to the present invention, the transfer time of the writing program can be shortened.

データ書込みシステムの一例を示す構成図である。It is a block diagram which shows an example of a data writing system. 電子制御装置及び書込み装置の一例を示す構成図である。It is a block diagram which shows an example of an electronic controller and a writing device. 通信バッファ領域の詳細を示す図である。It is a figure which shows the detail of a communication buffer area. 電子制御装置の不揮発性メモリにアプリケーションプログラムを書き込む手順の一例を示すフローチャートである。It is a flowchart which shows an example of the procedure which writes an application program in the non-volatile memory of an electronic controller. プログラム書込み処理の概要を示す図である。It is a figure which shows the outline | summary of a program write process. 通信環境変更後の通信バッファ領域の詳細を示す図である。It is a figure which shows the detail of the communication buffer area | region after communication environment change. 書込み装置が実行するプログラム書込み処理の一例を示すフローチャートである。It is a flowchart which shows an example of the program writing process which a writing device performs. 電子制御装置が実行する書込みプログラム展開処理の一例を示すフローチャートである。It is a flowchart which shows an example of the writing program expansion | deployment process which an electronic controller performs. 電子制御装置の揮発性メモリに書込みプログラムを展開して実行する手順の説明図である。It is explanatory drawing of the procedure which expand | deploys and executes a writing program in the volatile memory of an electronic controller. 従来技術の問題点の説明図である。It is explanatory drawing of the problem of a prior art. 従来技術の問題点を解決する方法の説明図である。It is explanatory drawing of the method of solving the problem of a prior art. 書込み装置が実行するアプリケーション転送処理の一例を示すフローチャートである。It is a flowchart which shows an example of the application transfer process which a writing device performs. 電子制御装置が実行するプログラム書込み処理の一例を示すフローチャートである。It is a flowchart which shows an example of the program write process which an electronic controller performs. 電子制御装置が実行するプログラム書込み処理の一例を示すフローチャートである。It is a flowchart which shows an example of the program write process which an electronic controller performs. 電子制御装置が実行するプログラム書込み処理の一例を示すフローチャートである。It is a flowchart which shows an example of the program write process which an electronic controller performs. 電子制御装置が実行するデータコピー処理の一例を示すフローチャートである。It is a flowchart which shows an example of the data copy process which an electronic control apparatus performs.

以下、添付された図面を参照し、本発明を実施するための実施形態について詳述する。
図1は、電子制御装置(ECU:Electronic Control Unit)の不揮発性メモリに制御プログラムを書き込む、データ書込みシステムの一例を示す。
Hereinafter, embodiments for carrying out the present invention will be described in detail with reference to the accompanying drawings.
FIG. 1 shows an example of a data writing system that writes a control program in a non-volatile memory of an electronic control unit (ECU).

ECU100は、CAN(Controller Area Network),シリアル通信、FlexRay(登録商標)などのネットワークケーブル200を介して、作業者が操作する書込み装置300に着脱可能に接続される。   The ECU 100 is detachably connected to a writing device 300 operated by an operator via a network cable 200 such as CAN (Controller Area Network), serial communication, or FlexRay (registered trademark).

ECU100は、自動車に搭載された各種機器、例えば、燃料噴射弁,自動変速機,電動ブレーキシステム,ABS(Antilock Brake System),可変バルブタイミング機構などを制御する電子機器である。具体的には、ECU100は、図2に示すように、マイクロコンピュータ110、不揮発性メモリの一例であるROM(Read Only Memory)120、揮発性メモリの一例であるRAM(Random Access Memory)130及び通信回路140を備えている。ここで、ROM120としては、電気的にデータを消去及び書込むことで、任意のデータに書き換え可能なフラッシュROMを使用することができる。   The ECU 100 is an electronic device that controls various devices mounted on the automobile, for example, a fuel injection valve, an automatic transmission, an electric brake system, an ABS (Antilock Brake System), a variable valve timing mechanism, and the like. Specifically, as shown in FIG. 2, the ECU 100 includes a microcomputer 110, a ROM (Read Only Memory) 120 as an example of a nonvolatile memory, a RAM (Random Access Memory) 130 as an example of a volatile memory, and a communication. A circuit 140 is provided. Here, as the ROM 120, a flash ROM that can be rewritten to arbitrary data by electrically erasing and writing data can be used.

マイクロコンピュータ110は、CPU(Central Processing Unit)及びキャッシュメモリなどを内蔵し、ROM120及びRAM130に格納された各種プログラムを実行する。ROM120には、少なくとも、書込み装置300から送信された任意のプログラムをRAM130に展開するRAM展開プログラムと、RAM130の所定領域を初期化するRAM初期化プログラムと、が格納されている。なお、RAM初期化プログラムは、RAM展開プログラムに組み込まれていてもよい。RAM130には、ROM120に任意のデータを書き込むときに使用する、第1のバッファ領域132及び第2のバッファ領域134が夫々確保されている。通信回路140には、書込み装置300を含む他の装置と通信するときに使用する、通信バッファ領域142が確保されている。   The microcomputer 110 includes a CPU (Central Processing Unit), a cache memory, and the like, and executes various programs stored in the ROM 120 and the RAM 130. The ROM 120 stores at least a RAM expansion program for expanding an arbitrary program transmitted from the writing device 300 into the RAM 130 and a RAM initialization program for initializing a predetermined area of the RAM 130. Note that the RAM initialization program may be incorporated in the RAM expansion program. The RAM 130 has a first buffer area 132 and a second buffer area 134 that are used when arbitrary data is written to the ROM 120. The communication circuit 140 has a communication buffer area 142 that is used when communicating with other devices including the writing device 300.

書込み装置300は、例えば、パーソナルコンピュータから構成され、ハードディスクドライブ,SSD(Solid State Drive)などのストレージ310と、通信回路320と、マンマシンインタフェースとして機能するモニタ330及びキーボード340と、を内蔵する。ストレージ310には、ECU100に転送される書込みプログラム及びアプリケーションプログラムなどが格納されている。通信回路320には、ECU100と通信するときに使用する、通信バッファ領域322が確保されている。従って、書込み装置300を操作する作業者は、モニタ330及びキーボード340を操作することで、ECU100に転送する書込みプログラム及びアプリケーションプログラムを対話的に指定することができる。   The writing device 300 is constituted by, for example, a personal computer, and includes a storage 310 such as a hard disk drive or SSD (Solid State Drive), a communication circuit 320, a monitor 330 and a keyboard 340 functioning as a man-machine interface. The storage 310 stores a writing program and an application program that are transferred to the ECU 100. The communication circuit 320 has a communication buffer area 322 that is used when communicating with the ECU 100. Therefore, the operator who operates the writing device 300 can interactively specify the writing program and the application program to be transferred to the ECU 100 by operating the monitor 330 and the keyboard 340.

ここで、ECU100と書込み装置300とが通信するときに使用する、ECU100の通信バッファ領域142及び書込み装置300の通信バッファ領域322の詳細を説明する。   Here, details of the communication buffer area 142 of the ECU 100 and the communication buffer area 322 of the writing apparatus 300 used when the ECU 100 and the writing apparatus 300 communicate with each other will be described.

ECU100の通信バッファ領域142には、図3に示すように、例えば、CANにおけるメールボックスなど、一定のサイズの通信バッファが複数存在する。ECU100は、各装置と通信するとき、通信バッファ領域142の通信バッファのうち、通信相手となる装置との通信用として予め割り当てられている通信バッファを使用する。なお、それぞれの通信バッファは、データの送信に使用する送信バッファTX、データの受信に使用する受信バッファRXに分かれている。   In the communication buffer area 142 of the ECU 100, as shown in FIG. 3, for example, there are a plurality of communication buffers of a certain size such as a mailbox in CAN. When ECU 100 communicates with each device, ECU 100 uses a communication buffer allocated in advance for communication with a communication partner device among communication buffers in communication buffer area 142. Each communication buffer is divided into a transmission buffer TX used for data transmission and a reception buffer RX used for data reception.

一方、書込み装置300の通信バッファ領域322には、一定サイズの通信バッファが複数存在する。通信バッファ領域322の通信バッファのサイズは、ECU100における通信バッファ領域142の通信バッファのサイズと同じである。   On the other hand, the communication buffer area 322 of the writing device 300 has a plurality of communication buffers of a certain size. The size of the communication buffer in the communication buffer area 322 is the same as the size of the communication buffer in the communication buffer area 142 in the ECU 100.

図3において、ECU100の通信バッファ領域142には、ECU100が書込み装置300と通信するために使用する通信バッファ(以下、「書換え装置用通信バッファ」と略記する)として、2個の通信バッファ(送信バッファTX1個、受信バッファRX1個)が割り当てられている。また、通信バッファ領域142の他の通信バッファは、書込み装置300以外の装置との通信用に割り当てられている。   In FIG. 3, the communication buffer area 142 of the ECU 100 includes two communication buffers (transmissions) as communication buffers used by the ECU 100 to communicate with the writing device 300 (hereinafter abbreviated as “communication buffer for rewriting device”). 1 buffer TX and 1 reception buffer RX) are allocated. Further, other communication buffers in the communication buffer area 142 are allocated for communication with devices other than the writing device 300.

従って、通信バッファのサイズが8バイトであり、かつ、ECU100が、1つのデータの受信ごとに書込み装置300にその応答を返すように、ECU100と書込み装置300との間で同期をとりながら通信を行う場合、1つのデータの受信に1個の受信バッファRXを使用するため、ECU100が64バイトのデータを取得するまでに、16回の通信が必要になる。即ち、書込み装置300が64バイトのデータを8バイトごとに分けて転送し、ECU100は8バイト受信することに書込み装置300に応答を返すため、通信回数が16回となる。   Therefore, communication is performed between the ECU 100 and the writing device 300 so that the size of the communication buffer is 8 bytes and the ECU 100 returns a response to the writing device 300 every time one piece of data is received. When performing, since one reception buffer RX is used for reception of one data, it is necessary to communicate 16 times before the ECU 100 acquires 64-byte data. That is, the writing device 300 transfers 64 bytes of data in units of 8 bytes, and the ECU 100 returns a response to the writing device 300 in response to receiving 8 bytes, so the number of communications is 16.

図4は、データ書込みシステムを使用して、ECU100のROM120にアプリケーションプログラムを書き込む手順の一例を示す。
ステップ1(図では「S1」と略記する。以下同様。)では、作業者が、書込み装置300にECU100を接続する。ECU100は、書込み装置300に接続されると電源が投入され、書込み装置300と通信可能になり、書込み装置300から転送されるデータの受信待ち状態となる。
FIG. 4 shows an example of a procedure for writing an application program in the ROM 120 of the ECU 100 using the data writing system.
In step 1 (abbreviated as “S1” in the figure, the same applies hereinafter), the operator connects the ECU 100 to the writing device 300. When ECU 100 is connected to writing device 300, power is turned on, communication with writing device 300 is enabled, and reception of data transferred from writing device 300 is awaited.

ステップ2では、作業者が書込み装置300と対話して、ECU100のROM120に書き込むアプリケーションプログラム(例えば、エンジン制御プログラムなど)を指定する。書込み装置300は、アプリケーションプログラムが指定されると、そのアプリケーションプログラムをECU100に転送する。ECU100は、書込み装置300から転送されたアプリケーションプログラムを受信しながら、アプリケーションプログラムをROM120に書き込む。以下、このステップ2の処理を、「プログラム書込み処理」と呼ぶ。   In step 2, the operator interacts with the writing device 300 and designates an application program (for example, an engine control program) to be written in the ROM 120 of the ECU 100. When an application program is designated, writing device 300 transfers the application program to ECU 100. The ECU 100 writes the application program in the ROM 120 while receiving the application program transferred from the writing device 300. Hereinafter, the processing of step 2 is referred to as “program writing processing”.

ステップ3では、作業者が、書込み装置300からECU100を取り外す。ECU100は、書込み装置300から取り外されると電源が遮断され、RAM130に格納されている各種データが消失する。   In step 3, the worker removes the ECU 100 from the writing device 300. When the ECU 100 is removed from the writing device 300, the power is cut off, and various data stored in the RAM 130 are lost.

図5は、プログラム書込み処理の概要を示す。
ステップ11では、書込み装置300が、作業者によって書込みプログラム及びアプリケーションプログラムが指定されると、ECU100に対し、書込みプログラム(例えば、書込みプログラム2)の転送を開始するメッセージを送信した後、書込みプログラムを転送する。
FIG. 5 shows an outline of the program writing process.
In step 11, when a writing program and an application program are designated by the operator, the writing device 300 transmits a message for starting the transfer of the writing program (for example, the writing program 2) to the ECU 100, and then executes the writing program. Forward.

ここで、作業者が指定する書込みプログラムは、ストレージ310に構築された書込みプログラムデータベース312に格納されている。書込みプログラムは、ECU100に転送され、ECU100上で、通信環境(通信バッファの使用方法、通信速度、暗号化方式など)の変更などの初期化処理を実行すると共に、書込み装置300からの要求に応じて、データの受信処理及びこれをROM120の少なくとも一部に書き込む処理を実行する。   Here, the writing program designated by the operator is stored in the writing program database 312 constructed in the storage 310. The writing program is transferred to the ECU 100 and executes initialization processing such as a change of the communication environment (a method of using a communication buffer, a communication speed, an encryption method, etc.) on the ECU 100 and responds to a request from the writing device 300. Thus, a data reception process and a process of writing the data in at least a part of the ROM 120 are executed.

また、作業者が指定するアプリケーションプログラムは、ストレージ310に構築されたアプリケーションプログラムデータベース314に格納されている。各アプリケーションプログラムは、例えば、ECU100の制御対象となる自動車のエンジン制御用のプログラムである。   The application program designated by the worker is stored in the application program database 314 constructed in the storage 310. Each application program is, for example, a program for controlling the engine of an automobile to be controlled by the ECU 100.

ステップ12では、ECU100が、書込み装置300から書込みプログラムの転送を開始するメッセージを受信すると、ROM120に格納されているRAM初期化プログラムを起動し、少なくとも書込みプログラムを展開するRAM130の領域を初期化する。また、RAM130の初期化が完了すると、ECU100が、ROM120に格納されているRAM展開プログラムを起動する。ここで、RAM展開プログラムは、ECU100が受信した書込みプログラムをRAM130に展開する処理を行う。従って、ECU100は、書込みプログラムを受信しながら、RAM展開プログラムによって、受信した書込みプログラムをRAM130に展開する。   In step 12, when the ECU 100 receives a message for starting the transfer of the writing program from the writing device 300, the ECU 100 starts the RAM initialization program stored in the ROM 120 and initializes at least the area of the RAM 130 in which the writing program is developed. . Further, when initialization of the RAM 130 is completed, the ECU 100 activates a RAM expansion program stored in the ROM 120. Here, the RAM expansion program performs processing for expanding the writing program received by the ECU 100 into the RAM 130. Therefore, the ECU 100 develops the received writing program in the RAM 130 by the RAM developing program while receiving the writing program.

ステップ13では、書込みプログラムの展開が完了すると、ECU100が、RAM展開プログラムによって、RAM130に展開した書込みプログラムを起動する。
ステップ14では、ECU100が、書込みプログラムによって、ECU100と書込み装置300との間の通信環境を、その書込みプログラムに応じた通信環境に変更し、書込み装置300に対して、アプリケーションプログラムの送信を要求するメッセージを送信する。
In step 13, when the development of the writing program is completed, the ECU 100 activates the writing program developed in the RAM 130 by the RAM development program.
In step 14, the ECU 100 changes the communication environment between the ECU 100 and the writing device 300 to a communication environment corresponding to the writing program by the writing program, and requests the writing device 300 to transmit the application program. Send a message.

ステップ15では、書込み装置300が、アプリケーションプログラムの送信を要求するメッセージを受信すると、ECU100に対して、作業者によって指定されたアプリケーションプログラム(例えば、アプリケーションプログラム1)の転送を開始する。   In step 15, when the writing device 300 receives a message requesting transmission of an application program, the writing device 300 starts transferring an application program (for example, application program 1) designated by the operator to the ECU 100.

ステップ16では、ECU100が、書込み装置300からアプリケーションプログラムを受信しながら、書込みプログラムによって、受信したアプリケーションプログラムをROM120に書き込む。   In step 16, the ECU 100 writes the received application program in the ROM 120 by the writing program while receiving the application program from the writing device 300.

なお、アプリケーションプログラムの書込み完了後、ECU100は書込み装置300から取り外され、電源がOFFになる。次にECU100の電源が投入されたとき、ECU100の通信環境は、初期状態に戻る。また、プログラム書込み処理の途中で、何らかの異常(例えば、書込み装置300との通信が遮断されたなど)が発生した場合には、ECU100が自らをリセットし、その通信環境が初期状態に戻る。   Note that after the writing of the application program is completed, the ECU 100 is removed from the writing device 300 and the power is turned off. Next, when the power of the ECU 100 is turned on, the communication environment of the ECU 100 returns to the initial state. Further, when any abnormality (for example, communication with the writing device 300 is interrupted) occurs during the program writing process, the ECU 100 resets itself and the communication environment returns to the initial state.

従って、書込みプログラムを適宜選択することで、プログラム書込み処理において、通信環境及びアプリケーションプログラムの書込み条件などに適合した、書込みプログラムを動作させることができる。このため、例えば、通信速度がより高速な書込みプログラムを動作させることで高速に通信を行い、プログラム書込み処理を高速化することができる。また、プログラム書込み処理を実行するときに、書込みプログラムがECU100に転送されるため、書込みプログラムをROM120に格納する必要がなく、ROM120の使用量を削減することができる。さらに、書込みプログラムを変更することで、プログラム書込み処理に新しい機能を追加することができる。   Accordingly, by appropriately selecting the writing program, it is possible to operate the writing program suitable for the communication environment and the writing conditions of the application program in the program writing process. For this reason, for example, by operating a writing program having a higher communication speed, high-speed communication can be performed, and the program writing process can be speeded up. Further, since the writing program is transferred to the ECU 100 when the program writing process is executed, it is not necessary to store the writing program in the ROM 120, and the usage amount of the ROM 120 can be reduced. Furthermore, a new function can be added to the program writing process by changing the writing program.

なお、ECU100に書込み装置300に加えて他の装置が接続された状況でも、ECU100は、他の装置との通信を遮断し、書込み装置300のみと通信するようにすれば、プログラム書込み処理を実行することができる。ECU100に書込み装置300に加えて他の装置が接続された状況で、プログラム書込み処理を実行する例として、例えば、ECU100が自動車に組付けられた状態で、アプリケーションプログラムの書込みを実施することが挙げられる。この場合、通信路の競合を防ぐため、ECU100は、書込み装置300と通信するときに使用する通信環境を、他の装置と共通する通信環境(例えば、通信速度が共通)にする必要がある。このため、作業者は、他の装置と共通の通信環境を確立する書込みプログラムを指定し、プログラム書込み処理を実施する。   Note that even when other devices are connected to the ECU 100 in addition to the writing device 300, the ECU 100 executes the program writing process if the communication with the other device is interrupted and only the writing device 300 is communicated. can do. As an example of executing the program writing process in a situation where another device is connected to the ECU 100 in addition to the writing device 300, for example, writing the application program in a state in which the ECU 100 is assembled in a vehicle. It is done. In this case, in order to prevent communication path competition, the ECU 100 needs to use a communication environment used when communicating with the writing device 300 as a communication environment common to other devices (for example, a common communication speed). For this reason, the operator designates a writing program that establishes a common communication environment with other devices, and performs the program writing process.

次に、ECU100が、書込み装置300から転送されるアプリケーションプログラムを受信するときに使用する、通信バッファ領域142の使用方法を説明する。
ECU100は、ROM120にアプリケーションプログラムを書き込む場合、書込み装置300以外の装置と通信しないため、書込み装置300以外の装置と通信するために予め割り当てられている通信バッファ(以下、「他の装置用通信バッファ」と略記する)は使用されない。このため、書込みプログラムは、書込み装置用通信バッファに加えて、他の装置用通信バッファを、ECU100と書込み装置300との間の通信に使用するように変更することができる。
Next, a method of using the communication buffer area 142 used when the ECU 100 receives an application program transferred from the writing device 300 will be described.
When writing an application program in the ROM 120, the ECU 100 does not communicate with any device other than the writing device 300. Therefore, the ECU 100 preliminarily allocates a communication buffer (hereinafter referred to as “communication buffer for other devices”). "Is abbreviated as") is not used. For this reason, the writing program can be changed to use another device communication buffer for communication between the ECU 100 and the writing device 300 in addition to the writing device communication buffer.

図6は、変更後の通信バッファ領域142の詳細を示す。
ECU100は、書込み装置300と通信するとき、書込み装置用通信バッファとして2個の通信バッファ、及び、他の装置用通信バッファのうち7個の通信バッファを使用する。この場合、ECU100が使用する9個の通信バッファは、送信バッファTXが1個、受信バッファRXが8個となる。一方、書込み装置300における通信バッファ領域322の通信バッファは、送信バッファTXが8個、受信バッファRXが1個となる。
FIG. 6 shows details of the communication buffer area 142 after the change.
When communicating with the writing device 300, the ECU 100 uses two communication buffers as the writing device communication buffer and seven communication buffers among the other device communication buffers. In this case, the nine communication buffers used by the ECU 100 have one transmission buffer TX and eight reception buffers RX. On the other hand, the communication buffer in the communication buffer area 322 in the writing device 300 has eight transmission buffers TX and one reception buffer RX.

例えば、1つの通信バッファのサイズが8バイトであり、かつ、ECU100が、1つのデータの受信ごとに書込み装置300にその応答を返すように、ECU100と書込み装置300との間で同期をとりながら通信を行う場合、1つのデータの受信に8個の受信バッファRXが使用できるため、ECU100が64バイトのデータを書込み装置300から取得するまで、従来技術と比較して、9回の通信で済むことになる。即ち、書込み装置300が、64バイトのデータを1つのデータとして8バイトごとに分けて転送し、ECU100は、8バイトのデータを8個受信するごとに書込み装置300に応答を返す。このため、通信回数が9回となる。   For example, the size of one communication buffer is 8 bytes, and the ECU 100 and the writing device 300 are synchronized so that the ECU 100 returns a response to the writing device 300 every time one piece of data is received. When communication is performed, eight reception buffers RX can be used to receive one data. Therefore, until the ECU 100 acquires 64 bytes of data from the writing device 300, nine communications are required as compared with the prior art. It will be. That is, the writing device 300 divides and transfers 64-byte data as one data every 8 bytes, and the ECU 100 returns a response to the writing device 300 every time eight 8-byte data are received. For this reason, the number of communications is nine.

なお、書込みプログラムは、ECU100が書込み装置300との通信に使用する通信バッファの数を、データの送受信のサイズ、データの送受信のサイズの整数倍、ROM120への1回の書込みサイズ又はROM120への1回の書込みサイズの整数倍などにしてもよい。   Note that the writing program sets the number of communication buffers used by the ECU 100 for communication with the writing device 300 to the size of data transmission / reception, an integral multiple of the size of data transmission / reception, the size of writing to the ROM 120 once, It may be an integer multiple of a single write size.

このように、書込み装置用通信バッファに加えて他の装置用通信バッファを使用して通信することができるため、同期をとるような通信では、通信回数が少なくなり、データの転送に要する時間が短縮し、データ転送の高速化を図ることができる。また、他の装置用通信バッファを使用するため、通信バッファのオーバライトを気にすることなく、書込み装置300が連続してデータを転送することができる。   As described above, since communication can be performed using the communication buffer for other devices in addition to the communication buffer for the writing device, the number of times of communication is reduced and the time required for data transfer is reduced in communication such as synchronization. This shortens the data transfer speed. Further, since another apparatus communication buffer is used, the writing apparatus 300 can continuously transfer data without worrying about overwriting of the communication buffer.

なお、通信バッファ領域142のうち、どの装置にも割り当てられていない未使用の通信バッファがあれば、書込みプログラムが、未使用の通信バッファを、ECU100と書込み装置300との間の通信で使用するように変更することもできる。   If there is an unused communication buffer that is not assigned to any device in the communication buffer area 142, the writing program uses the unused communication buffer for communication between the ECU 100 and the writing device 300. It can also be changed as follows.

図7は、作業者がECU100を書込み装置300に接続して、書込みプログラム及びアプリケーションプログラムを指定したことを契機として、書込み装置300が実行するプログラム書込み処理の一例を示す。   FIG. 7 shows an example of a program writing process executed by the writing device 300 when an operator connects the ECU 100 to the writing device 300 and designates a writing program and an application program.

ステップ31では、書込み装置300が、書込みプログラムの転送を開始することを示す転送開始メッセージをECU100に送信する。ここで、転送開始メッセージは、例えば、ECU100と書込み装置300との間で送受信されるパケットのヘッダに格納することができる。   In step 31, the writing device 300 transmits to the ECU 100 a transfer start message indicating that transfer of the writing program is started. Here, the transfer start message can be stored in a header of a packet transmitted and received between the ECU 100 and the writing device 300, for example.

ステップ32では、書込み装置300が、作業者によって指定された書込みプログラムを、ECU100が1回の通信で受信可能なサイズに順次分割し、例えば、パケットのデータ本体(ペイロード)に格納する。また、書込み装置300は、書込みプログラムの書込み位置を示すアドレス(相対アドレス又は絶対アドレス)を、例えば、パケットのヘッダに格納する。なお、書込みプログラムの書込み位置を示すアドレスは、パケットのデータ本体に格納することもできる。   In step 32, the writing device 300 sequentially divides the writing program designated by the operator into sizes that can be received by the ECU 100 in one communication, and stores them in the data body (payload) of the packet, for example. Further, the writing device 300 stores an address (relative address or absolute address) indicating a writing position of the writing program, for example, in the header of the packet. The address indicating the writing position of the writing program can also be stored in the data body of the packet.

ステップ33では、書込み装置300が、ステップ32で作成したパケットのデータ本体を参照し、そこに格納されているデータのすべてが初期値(例えば、0xFF)になっているか否かを判定する。そして、書込み装置300は、データのすべてが初期値になっていると判定すれば(Yes)、そのパケットの転送をスキップすべく、処理をステップ35へと進める。一方、書込み装置300は、データのすべてが初期値になっていない、要するに、そのデータは書込みプログラムの機能を実現する一部であると判定すれば(No)、処理をステップ34へと進める。   In step 33, the writing device 300 refers to the data body of the packet created in step 32, and determines whether or not all of the data stored therein has an initial value (for example, 0xFF). If the writing device 300 determines that all of the data is the initial value (Yes), the writing device 300 advances the process to step 35 in order to skip the transfer of the packet. On the other hand, if the writing device 300 determines that all of the data is not the initial value, in other words, that the data is part of realizing the function of the writing program (No), the processing proceeds to step 34.

ステップ34では、書込み装置300が、ステップ32で作成したパケットをECU100に転送する。その後、書込み装置300は、処理をステップ35へと進める。
ステップ35では、書込み装置300が、ECU100からデータを要求するデータ要求メッセージを受信したか否かを判定する。ここで、データ要求メッセージであるか否かは、例えば、パケットのヘッダを参照することで判定することができる。そして、書込み装置300は、データ要求メッセージを受信したと判定すれば(Yes)、処理をステップ36へと進める。一方、書込み装置300は、データ要求メッセージを受信していないと判定すれば(No)、データ要求メッセージを受信するまで待機する。
In step 34, the writing device 300 transfers the packet created in step 32 to the ECU 100. Thereafter, the writing device 300 advances the process to Step 35.
In step 35, it is determined whether or not the writing device 300 has received a data request message requesting data from the ECU 100. Here, whether or not it is a data request message can be determined by referring to the header of the packet, for example. If the writing device 300 determines that the data request message has been received (Yes), the writing device 300 proceeds to step 36. On the other hand, if it is determined that the data request message has not been received (No), the writing device 300 waits until the data request message is received.

ステップ36では、書込み装置300が、作業者によって指定された書込みプログラムの転送を完了したか否かを判定する。そして、書込み装置300は、書込みプログラムの転送が完了したと判定すれば(Yes)、処理をステップ37へと進める。一方、書込み装置300は、書込みプログラムの転送が完了していないと判定すれば(No)、処理をステップ32へと戻す。   In step 36, it is determined whether the writing device 300 has completed the transfer of the writing program designated by the operator. If the writing device 300 determines that the transfer of the writing program has been completed (Yes), the processing proceeds to step 37. On the other hand, if the writing device 300 determines that the transfer of the writing program is not completed (No), the writing device 300 returns the process to step 32.

ステップ37では、書込み装置300が、書込みプログラムの転送が完了したことを示す転送完了メッセージをECU100に送信する。ここで、転送完了メッセージは、例えば、パケットのヘッダに格納することができる。   In step 37, the writing device 300 transmits to the ECU 100 a transfer completion message indicating that the transfer of the writing program has been completed. Here, the transfer completion message can be stored in the header of the packet, for example.

ステップ38では、書込み装置300が、ECU100から何らかのメッセージ(パケット)を受信したか否かを判定する。そして、書込み装置300は、メッセージを受信したと判定すれば(Yes)、処理をステップ39へと進める。一方、書込み装置300は、メッセージを受信していないと判定すれば(No)、メッセージを受信するまで待機する。   In step 38, the writing device 300 determines whether or not any message (packet) has been received from the ECU 100. If the writing device 300 determines that the message has been received (Yes), the writing device 300 proceeds to step 39. On the other hand, if the writing device 300 determines that a message has not been received (No), the writing device 300 waits until a message is received.

ステップ39では、書込み装置300が、ECU100から受信したメッセージは、書込みプログラムが正常に転送されたことを示す転送正常メッセージであるか否かを判定する。ここで、転送正常メッセージであるか否かは、例えば、パケットのヘッダを参照することで判定することができる。そして、書込み装置300は、転送正常メッセージであると判定すれば(Yes)、処理をステップ40へと進める。一方、書込み装置300は、転送正常メッセージでない、即ち、書込みプログラムが正常に転送されなかったことを示す転送異常メッセージであると判定すれば(No)、処理をステップ41へと進める。   In step 39, the writing device 300 determines whether or not the message received from the ECU 100 is a transfer normal message indicating that the writing program has been transferred normally. Here, whether or not it is a normal transfer message can be determined by referring to the header of the packet, for example. If the writing device 300 determines that the message is a normal transfer message (Yes), the writing device 300 proceeds to step 40. On the other hand, if the writing device 300 determines that the message is not a transfer normal message, that is, a transfer error message indicating that the writing program has not been transferred normally (No), the writing device 300 advances the process to step 41.

ステップ40では、書込み装置300が、作業者によって指定されたアプリケーションプログラムを分割しながらECU100に転送する、サブルーチン形式のアプリケーション転送処理を実行する。なお、アプリケーション転送処理は、サブルーチン形式に限らず、ステップ40の位置に展開されてもよい。   In step 40, the writing device 300 executes a subroutine-type application transfer process in which the application program designated by the operator is transferred to the ECU 100 while being divided. The application transfer process is not limited to the subroutine format, and may be developed at the position of step 40.

ステップ41では、書込みプログラムが正常に転送されなかったため、書込み装置300が、書込みプログラムを先頭から再送するための設定、例えば、書込みプログラムの位置を示すポインタを先頭に戻すなどの設定を行う。その後、書込み装置300は、処理をステップ32へと戻す。   In step 41, since the writing program has not been transferred normally, the writing device 300 performs settings for resending the writing program from the beginning, for example, setting the pointer indicating the position of the writing program to the beginning. Thereafter, the writing device 300 returns the process to step 32.

このようにすれば、書込み装置300は、作業者によって書込みプログラム及びアプリケーションプログラムが指定されたことを契機として、書込みプログラムを、ECU100が1回の通信で受信可能なサイズに順次分割し、これをパケットのデータ本体に格納する。そして、書込み装置300は、パケットのデータ本体のすべてが初期値に設定されていれば、そのパケットの転送をスキップすることで、書込み装置300からECU100へと転送するパケットの転送量を削減し、書込みプログラムの転送時間を短縮することができる。また、書込み装置300は、ECU100からのメッセージによって、書込みプログラムが正常に転送できたならば、アプリケーションプログラムを転送する処理を実行する一方、書込みプログラムが正常に転送できなかったならば、書込みプログラムを再送する。   In this way, the writing device 300 sequentially divides the writing program into sizes that can be received by the ECU 100 in one communication, when the writing program and the application program are designated by the operator. Store in the data body of the packet. Then, if all of the data body of the packet is set to the initial value, the writing device 300 skips the transfer of the packet, thereby reducing the transfer amount of the packet transferred from the writing device 300 to the ECU 100, The transfer time of the writing program can be shortened. The writing device 300 executes a process of transferring the application program if the writing program can be normally transferred by a message from the ECU 100. On the other hand, if the writing program cannot be transferred normally, the writing device 300 executes the writing program. resend.

図8は、ECU100が書込みプログラムの転送開始メッセージを受信したことを契機として、ECU100のマイクロコンピュータ110が実行する書込みプログラム展開処理の一例を示す。ここで、ECU100のマイクロコンピュータ110は、ROM120に格納されているRAM展開プログラム及びRAM初期化プログラムに従って、書込みプログラム展開処理を実行する。   FIG. 8 shows an example of a writing program development process executed by the microcomputer 110 of the ECU 100 when the ECU 100 receives the writing program transfer start message. Here, the microcomputer 110 of the ECU 100 executes a write program expansion process according to the RAM expansion program and the RAM initialization program stored in the ROM 120.

ステップ51では、ECU100のマイクロコンピュータ110が、RAM130の記憶領域のうち、少なくとも、書込みプログラムを展開する領域を初期値で初期化する。なお、RAM130を初期化するとき、第1のバッファ領域132及び第2のバッファ領域134も併せて初期化してもよい。   In step 51, the microcomputer 110 of the ECU 100 initializes at least an area for developing the writing program in the storage area of the RAM 130 with an initial value. When the RAM 130 is initialized, the first buffer area 132 and the second buffer area 134 may be initialized together.

ステップ52では、ECU100のマイクロコンピュータ110が、書込み装置300からパケットを受信したか否かを判定する。そして、ECU100のマイクロコンピュータ110は、パケットを受信したと判定すれば(Yes)、処理をステップ53へと進める。一方、ECU100のマイクロコンピュータ110は、パケットを受信していないと判定すれば(No)、パケットを受信するまで待機する。   In step 52, the microcomputer 110 of the ECU 100 determines whether a packet has been received from the writing device 300. If the microcomputer 110 of the ECU 100 determines that the packet has been received (Yes), the process proceeds to step 53. On the other hand, if the microcomputer 110 of the ECU 100 determines that the packet has not been received (No), the microcomputer 110 waits until the packet is received.

ステップ53では、ECU100のマイクロコンピュータ110が、例えば、パケットのヘッダを参照することで、書込み装置300からのパケットは書込みプログラムの転送完了メッセージであるか否かを判定する。そして、ECU100のマイクロコンピュータ110は、書込みプログラムの転送完了メッセージであると判定すれば(Yes)、処理をステップ54へと進める。一方、ECU100のマイクロコンピュータ110は、書込みプログラムの転送完了メッセージでない、即ち、書き込みプログラムのデータが転送されたと判定すれば(No)、処理をステップ57へと進める。   In step 53, the microcomputer 110 of the ECU 100 refers to, for example, the header of the packet to determine whether or not the packet from the writing device 300 is a write program transfer completion message. If the microcomputer 110 of the ECU 100 determines that the message is a transfer completion message of the writing program (Yes), the process proceeds to step 54. On the other hand, if the microcomputer 110 of the ECU 100 determines that it is not a write program transfer completion message, that is, the data of the write program has been transferred (No), the process proceeds to step 57.

ステップ54では、ECU100のマイクロコンピュータ110が、例えば、パケットのヘッダに格納されているチェックサムを参照し、書込み装置300から転送された書込みプログラムが正常に転送されたか否かを判定する。そして、ECU100のマイクロコンピュータ110は、書込みプログラムが正常に転送されたと判定すれば(Yes)、処理をステップ55へと進める。一方、ECU100のマイクロコンピュータ110は、書込みプログラムが正常に転送されなかったと判定すれば(No)、処理をステップ59へと進める。   In step 54, the microcomputer 110 of the ECU 100 refers to, for example, a checksum stored in the header of the packet, and determines whether or not the writing program transferred from the writing device 300 has been transferred normally. If the microcomputer 110 of the ECU 100 determines that the writing program has been transferred normally (Yes), the microcomputer 110 advances the process to step 55. On the other hand, if the microcomputer 110 of the ECU 100 determines that the writing program has not been transferred normally (No), the microcomputer 110 advances the process to step 59.

ステップ55では、ECU100のマイクロコンピュータ110が、転送正常メッセージを書込み装置300に送信する。ここで、転送正常メッセージは、例えば、ECU100から書込み装置300へと送信されるパケットのヘッダに格納することができる。
ステップ56では、ECU100のマイクロコンピュータ110が、RAM130に展開された書込みプログラムを起動する。
In step 55, the microcomputer 110 of the ECU 100 transmits a transfer normal message to the writing device 300. Here, the transfer normal message can be stored in the header of a packet transmitted from the ECU 100 to the writing device 300, for example.
In step 56, the microcomputer 110 of the ECU 100 starts the writing program developed in the RAM 130.

ステップ57では、書込み装置300から受信したパケットには書込みプログラムのデータが格納されているため、ECU100のマイクロコンピュータ110が、パケットのデータ本体をRAM130に展開する。このとき、ECU100のマイクロコンピュータ110は、書込み装置300から転送された書込みプログラムは連続していない可能性があるため、パケットのヘッダに格納されたアドレスから展開する。   In step 57, since the data of the writing program is stored in the packet received from the writing device 300, the microcomputer 110 of the ECU 100 expands the data body of the packet in the RAM 130. At this time, the microcomputer 110 of the ECU 100 develops from the address stored in the header of the packet because the writing program transferred from the writing device 300 may not be continuous.

ステップ58では、ECU100のマイクロコンピュータ110が、次のデータを要求するため、データ要求メッセージを書込み装置300に送信する。ここで、データ要求メッセージは、例えば、ECU100から書込み装置300へと送信されるパケットのヘッダに格納することができる。その後、ECU100のマイクロコンピュータ110は、処理をステップ52へと戻す。   In step 58, the microcomputer 110 of the ECU 100 transmits a data request message to the writing device 300 in order to request the next data. Here, the data request message can be stored in the header of a packet transmitted from the ECU 100 to the writing device 300, for example. Thereafter, the microcomputer 110 of the ECU 100 returns the process to step 52.

ステップ59では、書込み装置300から書込みプログラムが正常に転送されなかったため、ECU100のマイクロコンピュータ110が、転送異常メッセージを書込み装置300に送信する。ここで、転送異常メッセージは、例えば、ECU100から書込み装置300へと送信されるパケットのヘッダに格納することができる。その後、ECU100のマイクロコンピュータ110は、処理をステップ51へと戻す。   In step 59, since the writing program is not normally transferred from the writing device 300, the microcomputer 110 of the ECU 100 transmits a transfer abnormality message to the writing device 300. Here, the transfer abnormality message can be stored in a header of a packet transmitted from the ECU 100 to the writing device 300, for example. Thereafter, the microcomputer 110 of the ECU 100 returns the process to step 51.

このようにすれば、ECU100は、書込み装置300から書込みプログラムの転送開始メッセージを受信したことを契機として、RAM130の記憶領域のうち、少なくとも、書込みプログラムを展開する領域を初期化する。そして、ECU100は、RAM130の初期化が完了すると、書込み装置300から順次転送される書込みプログラムのデータをRAM130に展開して起動する。このとき、ECU100は、パケットのヘッダを参照し、そこに格納されているアドレスから書込みプログラムのデータを展開する。   In this way, the ECU 100 initializes at least an area for developing the writing program in the storage area of the RAM 130 when the writing program transfer start message is received from the writing device 300. When the initialization of the RAM 130 is completed, the ECU 100 expands the data of the writing program sequentially transferred from the writing device 300 to the RAM 130 and starts it. At this time, the ECU 100 refers to the header of the packet and develops the data of the writing program from the address stored therein.

即ち、ECU100は、図9に示すように、ROM120に格納されているRAM展開プログラム及びRAM初期化プログラムによって、RAM130を初期化した後、書込み装置300から順次転送される書込みプログラムをRAM130に展開する。そして、ECU100は、書込みプログラムを起動し、書込み装置300から順次転送される書込みデータをROM120に書き込む。   That is, as shown in FIG. 9, the ECU 100 initializes the RAM 130 with the RAM development program and RAM initialization program stored in the ROM 120 and then develops the write program sequentially transferred from the writing device 300 onto the RAM 130. . Then, ECU 100 activates a writing program and writes writing data sequentially transferred from writing device 300 to ROM 120.

従来技術では、図10に示すように、ECU100におけるRAM130の初期値が不定である場合、データ本体の全体が初期値に設定されているパケットの転送がスキップされると、これに対応するRAM130の領域が不定のままとなり、書込みプログラムが予期せぬ動作をしてしまう可能性がある。しかし、本実施形態では、RAM130に書込みプログラムを展開する前に、図11に示すように、RAM130の所定領域が初期化されるため、データ本体の全体が初期値に設定されているパケットの転送がスキップされても、これに対応するRAM130の領域が初期値となる。従って、データ本体のすべてが初期値に設定されているパケットの転送がスキップ可能となり、書込みプログラムの転送時間を短縮することができる。要するに、書込みプログラムは、所定サイズごとに分割されたデータであって、その全体が初期値に設定されていない状態で順次取得されるので、アプリケーションプログラムの書込みに寄与するデータのみが転送され、書込みプログラムの転送時間を短縮することができる。   In the prior art, as shown in FIG. 10, when the initial value of the RAM 130 in the ECU 100 is indefinite, if the transfer of the packet in which the entire data body is set to the initial value is skipped, the corresponding RAM 130 The area may remain undefined and the writing program may behave unexpectedly. However, in this embodiment, a predetermined area of the RAM 130 is initialized as shown in FIG. 11 before the writing program is expanded in the RAM 130, so that the transfer of packets in which the entire data body is set to the initial value is transferred. Even if is skipped, the area of the RAM 130 corresponding to this is the initial value. Therefore, it is possible to skip the transfer of packets in which all of the data body is set to the initial value, and the transfer time of the writing program can be shortened. In short, the writing program is data that is divided for each predetermined size and is acquired sequentially without being entirely set to the initial value, so only the data that contributes to the writing of the application program is transferred and written. Program transfer time can be shortened.

図12は、書込み装置300が実行する、アプリケーション転送処理の一例を示す。
ステップ61では、書込み装置300が、ECU100から何らかのメッセージを受信したか否かを判定する。そして、書込み装置300は、メッセージを受信したと判定すれば(Yes)、処理をステップ62へと進める。一方、書込み装置300は、メッセージを受信していないと判定すれば(No)、メッセージを受信するまで待機する(No)。
FIG. 12 shows an example of application transfer processing executed by the writing device 300.
In step 61, the writing device 300 determines whether or not any message is received from the ECU 100. If the writing device 300 determines that the message has been received (Yes), the writing device 300 advances the process to step 62. On the other hand, if it is determined that the message has not been received (No), the writing device 300 waits until the message is received (No).

ステップ62では、書込み装置300が、例えば、パケットのヘッダを参照することで、ECU100から受信したメッセージは分割データの送信要求を示す送信要求メッセージであるか否かを判定する。そして、書込み装置300は、送信要求メッセージでないと判定すれば(Yes)、処理をステップ63へと進める。一方、書込み装置300は、送信要求メッセージであると判定すれば(No)、処理をステップ67へと進める。   In step 62, for example, the writing device 300 refers to the header of the packet to determine whether the message received from the ECU 100 is a transmission request message indicating a transmission request for divided data. If the writing device 300 determines that the message is not a transmission request message (Yes), the writing device 300 advances the process to step 63. On the other hand, if the writing device 300 determines that the message is a transmission request message (No), the writing device 300 advances the process to step 67.

ステップ63では、書込み装置300が、例えば、パケットのヘッダを参照することで、ECU100から受信したメッセージは分割データの再送要求を示す再送要求メッセージであるか否かを判定する。そして、書込み装置300は、再送要求メッセージでないと判定すれば(Yes)、処理をステップ64へと進める。一方、書込み装置300は、再送要求メッセージであると判定すれば(No)、処理をステップ69へと進める(No)。   In step 63, for example, the writing device 300 refers to the header of the packet to determine whether the message received from the ECU 100 is a retransmission request message indicating a retransmission request for divided data. If the writing device 300 determines that the message is not a retransmission request message (Yes), the writing device 300 advances the process to step 64. On the other hand, if the writing device 300 determines that the message is a retransmission request message (No), the writing device 300 advances the process to Step 69 (No).

ステップ64では、書込み装置300が、例えば、パケットのヘッダを参照することで、ECU100から受信したメッセージは分割データがROM120に正常に書き込まれたことを示す書込み正常メッセージであるか否かを判定する。そして、書込み装置300は、書込み正常メッセージであると判定すれば(Yes)、処理をステップ65へと進める。一方、書込み装置300は、分割データが正常に書き込まれなかったことを示す書込み異常メッセージであると判定すれば(No)、処理をステップ70へと進める。   In step 64, the writing device 300 refers to, for example, the header of the packet to determine whether the message received from the ECU 100 is a normal writing message indicating that the divided data has been normally written in the ROM 120. . If the writing device 300 determines that the message is a normal writing message (Yes), the processing proceeds to step 65. On the other hand, if the writing device 300 determines that it is a writing abnormality message indicating that the divided data has not been written normally (No), the processing proceeds to step 70.

ステップ65では、書込み装置300が、作業者によって指定されたアプリケーションプログラムの転送が完了したか否かを判定する。そして、書込み装置300は、アプリケーションプログラムの転送が完了したと判定すれば(Yes)、処理をステップ66へと進める。一方、書込み装置300は、アプリケーションプログラムの転送が完了していないと判定すれば(No)、処理をステップ61へと戻す(No)。   In step 65, the writing device 300 determines whether or not the transfer of the application program designated by the operator has been completed. If the writing device 300 determines that the transfer of the application program has been completed (Yes), the writing device 300 advances the process to step 66. On the other hand, if the writing device 300 determines that the transfer of the application program is not completed (No), the writing device 300 returns the process to Step 61 (No).

ステップ66では、アプリケーションプログラムの転送が完了したので、書込み装置300が、アプリケーションプログラムの転送が完了したことを示す転送完了メッセージをECU100に送信する。   In step 66, since the transfer of the application program is completed, the writing device 300 transmits a transfer completion message indicating that the transfer of the application program is completed to the ECU 100.

ステップ67では、ECU100からのメッセージは分割データの送信要求メッセージであるため、書込み装置300が、作業者によって指定されたアプリケーションプログラムを所定サイズに分割した分割データを作成する。具体的には、書込み装置300は、アプリケーションプログラムを所定サイズに順次分割して、パケットのデータ本体に格納する。ここで、所定サイズとしては、ECU100へと転送された書込みプログラムによって変更される通信環境において使用する、複数の通信バッファ(受信バッファRX)の合計サイズとすることができる。また、書込み装置300は、アプリケーションプログラムの書込み位置を示すアドレス(相対アドレス又は絶対アドレス)を、例えば、パケットのヘッダに格納する。なお、アプリケーションプログラムの書込み位置を示すアドレスは、パケットのデータ本体に格納することもできる。   In step 67, since the message from the ECU 100 is a divided data transmission request message, the writing device 300 creates divided data obtained by dividing the application program designated by the operator into a predetermined size. Specifically, the writing device 300 sequentially divides the application program into a predetermined size and stores it in the data body of the packet. Here, the predetermined size may be the total size of a plurality of communication buffers (reception buffers RX) used in a communication environment that is changed by a writing program transferred to the ECU 100. Further, the writing device 300 stores an address (relative address or absolute address) indicating a writing position of the application program, for example, in a packet header. The address indicating the writing position of the application program can be stored in the data body of the packet.

ステップ68では、書込み装置300が、ステップ67で作成した分割データをECU100に転送する。このとき、書込み装置300は、分割データを通信バッファ領域322の送信バッファTXのサイズごとに分けて格納する。例えば、分割データが64バイト、1個あたり8バイトの送信バッファTXが通信バッファ領域322に8個ある場合、書込み装置300は、分割データを、8バイトごとに8個のデータに分けて各送信バッファTXに格納する。なお、送信バッファTXに格納されたデータは、通信回路320によって、ECU100に転送される。その後、書込み装置300は、処理をステップ61へと戻す。   In step 68, the writing device 300 transfers the divided data created in step 67 to the ECU 100. At this time, the writing device 300 stores the divided data separately for each size of the transmission buffer TX in the communication buffer area 322. For example, when there are 8 transmission buffers TX in the communication buffer area 322 with 64 bytes of divided data and 8 bytes per piece, the writing device 300 divides the divided data into 8 pieces of data every 8 bytes and transmits Store in buffer TX. The data stored in the transmission buffer TX is transferred to the ECU 100 by the communication circuit 320. Thereafter, the writing device 300 returns the process to step 61.

ステップ69では、ECU100からのメッセージは分割データの再送要求メッセージであるため、書込み装置300が、分割データをECU100に再送する。ここで、書込み装置300は、ステップ67で分割データを作成済であるため、新たに分割データを作成しなくとも、作成済の分割データを再送すればよい。その後、書込み装置300は、処理をステップ61へと戻す。   In step 69, since the message from ECU 100 is a divided data retransmission request message, writing device 300 retransmits the divided data to ECU 100. Here, since the writing device 300 has already created the divided data in step 67, the writing device 300 may retransmit the created divided data without creating new divided data. Thereafter, the writing device 300 returns the process to step 61.

ステップ70では、ECU100からのメッセージは書込み異常メッセージであるため、書込み装置300が、アプリケーションプログラムを先頭から再送するための設定、例えば、アプリケーションプログラムのポインタを先頭に戻すなどの設定を行う。その後、書込み装置300が、処理をステップ61へと戻す。   In step 70, since the message from the ECU 100 is a write error message, the writing device 300 performs settings for resending the application program from the top, for example, setting the application program pointer back to the top. Thereafter, the writing device 300 returns the process to step 61.

このようにすれば、書込み装置300は、ECU100からの分割データの送信要求メッセージに応答して、アプリケーションプログラムを所定サイズごとに順次分割した分割データをECU100に転送する。また、書込み装置300は、ECU100からの分割データの再送要求メッセージに応答して、作成済の分割データを再送する。さらに、書込み装置300は、ECU100からの書込み異常メッセージに応答して、アプリケーションプログラムを先頭から転送し直す。   In this way, in response to the divided data transmission request message from ECU 100, writing device 300 transfers to ECU 100 the divided data obtained by sequentially dividing the application program for each predetermined size. In response to the divided data retransmission request message from ECU 100, writing device 300 retransmits the created divided data. Furthermore, in response to the write abnormality message from ECU 100, writing device 300 retransfers the application program from the beginning.

図13〜図15は、書込みプログラムが起動されたことを契機として、ECU100のマイクロコンピュータ110が実行する、プログラム書込み処理の一例を示す。   13 to 15 show an example of a program writing process executed by the microcomputer 110 of the ECU 100 when the writing program is activated.

ステップ71では、ECU100のマイクロコンピュータ110が、ECU100が書込み装置300と通信するための通信環境を変更する。なお、ECU100が書込み装置300以外の装置と通信可能である場合には、ECU100のマイクロコンピュータ110は、通信環境を変更しなくてもよい。   In step 71, the microcomputer 110 of the ECU 100 changes the communication environment for the ECU 100 to communicate with the writing device 300. When ECU 100 can communicate with devices other than writing device 300, microcomputer 110 of ECU 100 does not have to change the communication environment.

ステップ72では、ECU100のマイクロコンピュータ110が、RAM130の第1のバッファ領域132を、書込み装置300から受信した分割データをコピーするためのコピー用の領域に設定する。   In step 72, the microcomputer 110 of the ECU 100 sets the first buffer area 132 of the RAM 130 as a copy area for copying the divided data received from the writing device 300.

ステップ73では、ECU100のマイクロコンピュータ110が、書込み装置300から受信した分割データをROM120に書き込む、書込みサブプログラムを起動する。
ステップ74では、ECU100のマイクロコンピュータ110が、ROM120に書き込むアプリケーションプログラムの分割データのうち、何番目の分割データを処理中であるかを示すカウンタ変数nに1を代入する。
In step 73, the microcomputer 110 of the ECU 100 starts a writing subprogram for writing the divided data received from the writing device 300 into the ROM 120.
In step 74, the microcomputer 110 of the ECU 100 assigns 1 to a counter variable n that indicates what part of the divided data of the application program written in the ROM 120 is being processed.

ステップ75では、ECU100のマイクロコンピュータ110が、初回の分割データを取得するために、分割データの送信要求メッセージを書込み装置300に送信する。
ステップ76では、ECU100のマイクロコンピュータ110が、書込み装置300から受信した分割データがコピー用の領域にコピーされたことを示すコピー完了メッセージが、書込みサブプログラムから通知されたか否かを判定する。そして、ECU100のマイクロコンピュータ110は、コピー完了メッセージが通知されていると判定すれば(Yes)、処理をステップ77へと進める。一方、ECU100のマイクロコンピュータ110は、コピー完了メッセージが通知されていないと判定すれば(No)、コピー完了メッセージが通知されるまで待機する。
In step 75, the microcomputer 110 of the ECU 100 transmits a divided data transmission request message to the writing device 300 in order to acquire the first divided data.
In step 76, the microcomputer 110 of the ECU 100 determines whether or not a copy completion message indicating that the divided data received from the writing device 300 has been copied to the copy area has been notified from the writing subprogram. If the microcomputer 110 of the ECU 100 determines that the copy completion message has been notified (Yes), the microcomputer 110 advances the process to step 77. On the other hand, if the microcomputer 110 of the ECU 100 determines that the copy completion message is not notified (No), the microcomputer 110 waits until the copy completion message is notified.

ステップ77では、ECU100のマイクロコンピュータ110が、コピー用の領域に格納された初回の分割データを参照し、例えば、分割データに含まれているチェックサムを利用することで、その分割データが正常に受信できたか否かを判定する。そして、ECU100のマイクロコンピュータ110は、初回の分割データが正常に受信できたと判定すれば(Yes)、処理をステップ78へと進める。一方、ECU100のマイクロコンピュータ110は、初回の分割データが正常に受信できていないと判定すれば(No)、処理をステップ84へと進める。   In step 77, the microcomputer 110 of the ECU 100 refers to the initial divided data stored in the copy area, and uses the checksum included in the divided data, for example, so that the divided data is normally displayed. It is determined whether or not reception is possible. If the microcomputer 110 of the ECU 100 determines that the first divided data has been successfully received (Yes), the process proceeds to step 78. On the other hand, if microcomputer 110 of ECU 100 determines that the first divided data cannot be received normally (No), the process proceeds to step 84.

ステップ78では、ECU100のマイクロコンピュータ110が、RAM130の第1のバッファ領域132を、書込み装置300から受信した分割データを書き込むときに使用する書込み用の領域に設定すると共に、RAM130の第2のバッファ領域134を、書込み装置300から受信した分割データをコピーするためのコピー用の領域に設定する。   In step 78, the microcomputer 110 of the ECU 100 sets the first buffer area 132 of the RAM 130 as an area for writing used when writing the divided data received from the writing device 300, and the second buffer of the RAM 130. The area 134 is set as a copy area for copying the divided data received from the writing device 300.

ステップ79では、ECU100のマイクロコンピュータ110が、2番目の分割データを取得するために、分割データの送信要求メッセージを書込み装置300に送信する。なお、ECU100のマイクロコンピュータ110は、分割データの送信要求メッセージと共に、前回の分割データを正常に受信できたことを示すメッセージを書込み装置300に送信してもよい。   In step 79, the microcomputer 110 of the ECU 100 transmits a divided data transmission request message to the writing device 300 in order to acquire the second divided data. The microcomputer 110 of the ECU 100 may transmit a message indicating that the previous divided data has been normally received to the writing device 300 together with the divided data transmission request message.

ステップ80では、ECU100のマイクロコンピュータ110が、書込み用の領域に格納されているn番目の分割データのデータ本体を、分割データのヘッダに格納されている書込みアドレスに応じて、ROM120に書き込む。   In step 80, the microcomputer 110 of the ECU 100 writes the data body of the nth divided data stored in the write area in the ROM 120 in accordance with the write address stored in the header of the divided data.

ステップ81では、ECU100のマイクロコンピュータ110が、例えば、書込み用の領域に格納されている分割データとROM120に書き込んだ分割データとを比較することで、n番目の分割データがROM120に正常に書き込まれたか否かを判定する。そして、ECU100のマイクロコンピュータ110は、分割データが正常に書き込まれたと判定すれば(Yes)、処理をステップ82へと進める。一方、ECU100のマイクロコンピュータ110は、分割データが正常に書き込まれなかったと判定すれば(No)、処理をステップ85へと進める。   In step 81, the microcomputer 110 of the ECU 100 compares the divided data stored in the writing area with the divided data written in the ROM 120, for example, so that the nth divided data is normally written in the ROM 120. It is determined whether or not. If the microcomputer 110 of the ECU 100 determines that the divided data has been written normally (Yes), the microcomputer 110 advances the process to step 82. On the other hand, if the microcomputer 110 of the ECU 100 determines that the divided data has not been written normally (No), the process proceeds to step 85.

ステップ82では、ECU100のマイクロコンピュータ110が、書込み装置300から受信した分割データがコピー用の領域にコピーされたことを示すコピー完了メッセージが、書込みサブプログラムから通知されたか否かを判定する。そして、ECU100のマイクロコンピュータ110は、コピー完了メッセージが通知されていると判定すれば(Yes)、処理をステップ83へと進める。一方、ECU100のマイクロコンピュータ110は、コピー完了メッセージが通知されていないと判定すれば(No)、コピー完了メッセージが通知されるまで待機する。   In step 82, the microcomputer 110 of the ECU 100 determines whether or not a copy completion message indicating that the divided data received from the writing device 300 has been copied to the copy area has been notified from the writing subprogram. If the microcomputer 110 of the ECU 100 determines that the copy completion message has been notified (Yes), the process proceeds to step 83. On the other hand, if the microcomputer 110 of the ECU 100 determines that the copy completion message is not notified (No), the microcomputer 110 waits until the copy completion message is notified.

ステップ83では、ECU100のマイクロコンピュータ110が、コピー用の領域に格納されたデータはアプリケーションプログラムの転送完了メッセージであるか否かを判定する。そして、ECU100のマイクロコンピュータ110は、転送完了メッセージであると判定すれば(Yes)、処理を終了する。一方、ECU100のマイクロコンピュータ110は、転送完了メッセージでないと判定すれば(No)、処理をステップ88へと進める。   In step 83, the microcomputer 110 of the ECU 100 determines whether or not the data stored in the copy area is an application program transfer completion message. If the microcomputer 110 of the ECU 100 determines that the message is a transfer completion message (Yes), the process ends. On the other hand, if microcomputer 110 of ECU 100 determines that the message is not a transfer completion message (No), the process proceeds to step 88.

ステップ84では、初回の分割データを正常に受信できなかったため、ECU100のマイクロコンピュータ110が、初回の分割データを再度取得するために、分割データの再送要求メッセージを書込み装置300に送信する。なお、ECU100のマイクロコンピュータ110は、分割データの再送要求メッセージと共に、分割データを正常に受信できなかったことを示すメッセージを書込み装置300に送信するようにしてもよい。その後、ECU100のマイクロコンピュータ100は、処理をステップ76へと戻す。   In step 84, since the first divided data could not be normally received, the microcomputer 110 of the ECU 100 transmits a divided data retransmission request message to the writing device 300 in order to obtain the first divided data again. Note that the microcomputer 110 of the ECU 100 may transmit a message indicating that the divided data could not be normally received to the writing device 300 together with the divided data retransmission request message. Thereafter, the microcomputer 100 of the ECU 100 returns the process to step 76.

ステップ85では、n番目の分割データがROM120に正常に書き込まれなかったため、ECU100のマイクロコンピュータ110が、分割データを正常に書き込むことができなかったことを示す書込み異常メッセージを書込み装置300に送信する。   In step 85, since the n-th divided data has not been normally written in the ROM 120, the microcomputer 110 of the ECU 100 transmits a writing abnormality message indicating that the divided data has not been normally written to the writing device 300. .

ステップ86では、ECU100のマイクロコンピュータ110が、分割データを書き込もうとしたROM120の領域を消去する。
ステップ87では、ECU100のマイクロコンピュータ110が、RAM130の第1のバッファ領域132を、書込み装置300から受信した分割データをコピーするためのコピー用の領域に設定する。その後、ECU100のマイクロコンピュータ110は、アプリケーションプログラムの書込みを最初から実行すべく、処理をステップ74へと戻す。
In step 86, the microcomputer 110 of the ECU 100 erases the area of the ROM 120 to which the divided data is to be written.
In step 87, the microcomputer 110 of the ECU 100 sets the first buffer area 132 of the RAM 130 as a copy area for copying the divided data received from the writing device 300. Thereafter, the microcomputer 110 of the ECU 100 returns the process to step 74 in order to execute the writing of the application program from the beginning.

ステップ88では、アプリケーションプログラムの転送が完了していないので、ECU100のマイクロコンピュータ110が、例えば、チェックサムを利用して、コピー用の領域にコピーされたn+1番目の分割データが正常に受信できたか否かを判定する。そして、ECU100のマイクロコンピュータ110は、分割データが正常に受信できたと判定すれば(Yes)、処理をステップ89へと進める。一方、分割データが正常に受信できなかったと判定すれば(No)、処理をステップ92へと進める。なお、n+1番目の分割データが正常に受信できた否かは、その分割データを受信した直後に判定してもよい。   In step 88, since the transfer of the application program has not been completed, the microcomputer 110 of the ECU 100 has successfully received the (n + 1) th divided data copied to the copy area using, for example, a checksum. Determine whether or not. If the microcomputer 110 of the ECU 100 determines that the divided data has been successfully received (Yes), the microcomputer 110 advances the process to step 89. On the other hand, if it is determined that the divided data cannot be received normally (No), the process proceeds to step 92. Note that whether or not the (n + 1) th divided data can be normally received may be determined immediately after receiving the divided data.

ステップ89では、ECU100のマイクロコンピュータ110が、コピー用に設定されていたバッファ領域を書込み用の領域に設定すると共に、書込み用に設定されていたバッファ領域をコピー用の領域に設定する。   In step 89, the microcomputer 110 of the ECU 100 sets the buffer area set for copying as the writing area, and sets the buffer area set for writing as the copying area.

ステップ90では、ECU100のマイクロコンピュータ110が、n+2番目の分割データを取得するために、分割データの送信要求メッセージを書込み装置300に送信する。なお、ECU100のマイクロコンピュータ110は、分割データの送信要求メッセージと共に、n番目の分割データをROM120に書き込んだ旨のメッセージ、及び、n+1番目の分割データを受信した旨のメッセージを書込み装置300に送信するようにしてもよい。   In step 90, the microcomputer 110 of the ECU 100 transmits a divided data transmission request message to the writing device 300 in order to acquire the (n + 2) th divided data. The microcomputer 110 of the ECU 100 transmits a message indicating that the nth divided data has been written to the ROM 120 and a message indicating that the (n + 1) th divided data has been received to the writing device 300 together with the divided data transmission request message. You may make it do.

ステップ91では、ECU100のマイクロコンピュータ110が、カウンタ変数nに1を加算、要するに、カウンタ変数nをインクリメントする。その後、ECU100のマイクロコンピュータ110は、処理をステップ80へと戻す。   In step 91, the microcomputer 110 of the ECU 100 adds 1 to the counter variable n, that is, increments the counter variable n. Thereafter, the microcomputer 110 of the ECU 100 returns the process to step 80.

ステップ92では、n+1番目の分割データを正常に受信できなかったため、ECU100のマイクロコンピュータ110が、n+1番目の分割データを再度取得するために、n+1番目の分割データの再送要求メッセージを書込み装置300に送信する。その後、ECU100のマイクロコンピュータ110は、処理をステップ82へと戻す。なお、ECU100のマイクロコンピュータ110は、分割データの再送要求メッセージと共に、n+1番目の分割データを正常に受信できなかったことを示すメッセージを書込み装置300に送信するようにしてもよい。   In step 92, since the (n + 1) th divided data could not be received normally, the microcomputer 110 of the ECU 100 sends a retransmission request message of the (n + 1) th divided data to the writing device 300 in order to acquire the (n + 1) th divided data again. Send. Thereafter, the microcomputer 110 of the ECU 100 returns the process to step 82. The microcomputer 110 of the ECU 100 may transmit a message indicating that the (n + 1) th divided data could not be normally received to the writing device 300 together with the divided data retransmission request message.

図16は、ECU100が書込み装置300から分割データを受信したことを契機として、書込みサブプログラムに従って、ECU100のマイクロコンピュータ110が実行するデータコピー処理の一例を示す。   FIG. 16 shows an example of a data copy process executed by the microcomputer 110 of the ECU 100 according to the writing subprogram when the ECU 100 receives the divided data from the writing device 300.

ステップ101では、ECU100のマイクロコンピュータ110が、書込み装置300から受信した分割データを、通信回路140における通信バッファ領域142の受信バッファRXからコピー用の領域にコピーする。   In step 101, the microcomputer 110 of the ECU 100 copies the divided data received from the writing device 300 from the reception buffer RX of the communication buffer area 142 in the communication circuit 140 to the copy area.

ステップ102では、ECU100のマイクロコンピュータ110が、分割データのコピー完了メッセージを書込みプログラムに通知する。なお、ECU100のマイクロコンピュータ110は、コピー用の領域を、通信バッファ領域142の受信バッファRXに相当する領域に設定し、このコピー用の領域を使用して分割データを受信するようにしてもよい。このようにすれば、通信バッファ領域142の受信バッファRXからコピー用の領域に分割データをコピーする処理が不要となる。   In step 102, the microcomputer 110 of the ECU 100 notifies the writing program of a divided data copy completion message. The microcomputer 110 of the ECU 100 may set the copy area to an area corresponding to the reception buffer RX of the communication buffer area 142, and receive the divided data using the copy area. . This eliminates the need to copy the divided data from the reception buffer RX in the communication buffer area 142 to the copy area.

また、分割データの送信要求からコピー完了までの処理時間と、分割データをROM120に書き込んで検証するまでの処理時間とで差がある場合、時間の長い方の処理が完了したときに、次の分割データの受信処理と、分割データをROM120に書き込む処理とを開始するようにしてもよい。   Also, if there is a difference between the processing time from the divided data transmission request to the completion of copying and the processing time from writing the divided data to the ROM 120 and verifying, when the processing with the longer time is completed, The divided data reception process and the process of writing the divided data into the ROM 120 may be started.

このように、書込み装置300から受信した分割データをECU100の受信バッファRXにコピーし、ROM120に書き込みを行うためのバッファ領域を2つ用意する。そして、2つのバッファ領域のうち、一方のバッファ領域を、ROM120に対する書き込む処理に使用している間、他方のバッファ領域を、ECU100が受信した分割データをコピーする処理に使用する。これにより、ECU100において、一方のバッファ領域を使用してROM120に分割データを書き込む処理と、分割データの受信及び分割データを他方のバッファ領域にコピーする処理とを並列に行うことができる。このため、プログラム書込み処理に要する時間を短縮することができる。   In this way, the divided data received from the writing device 300 is copied to the reception buffer RX of the ECU 100, and two buffer areas for writing to the ROM 120 are prepared. While one of the two buffer areas is used for the process of writing to the ROM 120, the other buffer area is used for the process of copying the divided data received by the ECU 100. Thereby, in ECU100, the process which writes division data in ROM120 using one buffer area, and the process which receives division data, and copies division data to the other buffer area can be performed in parallel. For this reason, the time required for the program writing process can be shortened.

また、これらの処理を実現するためには、ECU100で実行する処理を変更すればよいため、書込み装置300を大幅に変更せずに、プログラム書込み処理に要する時間を短縮することができる。   In order to realize these processes, the process executed by the ECU 100 may be changed. Therefore, the time required for the program writing process can be shortened without significantly changing the writing device 300.

なお、本実施形態は自動車に搭載したECU100を例にしたものであるが、ECU100に代えて、不揮発性メモリを搭載した他の電子制御装置にも適用することができる。また、1台の書込み装置300に対して複数のECU100を接続し、1台の書込み装置300が、各ECU100に対して時分割でデータを転送するようにしてもよい。   Although the present embodiment is an example of the ECU 100 mounted on the automobile, it can be applied to other electronic control devices mounted with a nonvolatile memory instead of the ECU 100. Further, a plurality of ECUs 100 may be connected to one writing device 300, and one writing device 300 may transfer data to each ECU 100 in a time division manner.

ここで、上述した実施形態から把握し得る技術的思想について、以下に記載する。
(1)電子制御装置は、通信によって取得した任意のプログラムを揮発性メモリに展開して実行する手段と、前記プログラムを前記揮発性メモリに展開する前に、少なくとも前記プログラムを展開する前記揮発性メモリの領域を初期化する手段と、を有する。
Here, the technical idea that can be understood from the above-described embodiment will be described below.
(1) The electronic control unit expands and executes an arbitrary program acquired by communication in a volatile memory, and expands at least the program before expanding the program in the volatile memory. Means for initializing an area of the memory.

(2)前記揮発性メモリの領域を初期化する手段は、不揮発性メモリに予め格納されているプログラムによって実現される。
(3)前記プログラムは、外部からの要求に応答して、不揮発性メモリの少なくとも一部のデータを書き換える。
(2) The means for initializing the area of the volatile memory is realized by a program stored in advance in the nonvolatile memory.
(3) The program rewrites at least a part of data in the nonvolatile memory in response to a request from the outside.

(4)前記プログラムは、所定サイズごとに分割されたデータであって、その全体が初期値に設定されていない状態で順次取得され、前記プログラムを揮発性メモリに展開して実行する手段は、前記分割データに含まれる前記揮発性メモリのアドレスに、前記データ本体を展開する。 (4) The program is data divided for each predetermined size, and is sequentially acquired in a state where the whole is not set to an initial value, and the program is expanded in a volatile memory and executed. The data body is expanded at the address of the volatile memory included in the divided data.

(5)前記プログラムは、前記電子制御装置に着脱自由に接続される書込み装置から通信によって取得される。
(6)前記電子制御装置は、前記書込み装置に接続されると電源がONになり、前記書込み装置から取り外されると電源がOFFになる。
(5) The program is acquired by communication from a writing device that is detachably connected to the electronic control device.
(6) The electronic control device is turned on when connected to the writing device, and turned off when it is removed from the writing device.

(7)前記書込み装置は、前記分割データのデータ本体の全体が初期値に設定されている場合、その転送をスキップする。
(8)前記電子制御装置及び前記書込み装置は、パケットを介して通信する。
(7) When the entire data body of the divided data is set to an initial value, the writing device skips the transfer.
(8) The electronic control device and the writing device communicate via a packet.

100 ECU(電子制御装置)
120 ROM(不揮発性メモリ)
130 RAM(揮発性メモリ)
100 ECU (electronic control unit)
120 ROM (nonvolatile memory)
130 RAM (volatile memory)

Claims (4)

通信によって取得した任意のプログラムを揮発性メモリに展開して実行する手段と、
前記プログラムを前記揮発性メモリに展開する前に、少なくとも前記プログラムを展開する前記揮発性メモリの領域を初期化する手段と、
を有することを特徴とする電子制御装置。
Means for developing and executing an arbitrary program acquired by communication in a volatile memory;
Means for initializing at least an area of the volatile memory in which the program is expanded before the program is expanded in the volatile memory;
An electronic control device comprising:
前記揮発性メモリの領域を初期化する手段は、不揮発性メモリに予め格納されているプログラムによって実現される、
ことを特徴とする請求項1に記載の電子制御装置。
The means for initializing the area of the volatile memory is realized by a program stored in advance in the nonvolatile memory.
The electronic control device according to claim 1.
前記プログラムは、外部からの要求に応答して、不揮発性メモリの少なくとも一部のデータを書き換える、
ことを特徴とする請求項1又は請求項2に記載の電子制御装置。
The program rewrites at least part of data in the nonvolatile memory in response to an external request.
The electronic control device according to claim 1 or 2, characterized by the above.
前記プログラムは、所定サイズごとに分割されたデータであって、その全体が初期値に設定されていない状態で順次取得され、
前記プログラムを揮発性メモリに展開して実行する手段は、前記分割データに含まれる前記揮発性メモリのアドレスに、前記データ本体を展開する、
ことを特徴とする請求項1〜請求項3のいずれか1つに記載の電子制御装置。
The program is data divided for each predetermined size, and is sequentially acquired in a state where the whole is not set to an initial value,
The means for expanding and executing the program in a volatile memory expands the data body at an address of the volatile memory included in the divided data.
The electronic control device according to any one of claims 1 to 3, wherein
JP2016205855A 2016-10-20 2016-10-20 Electronic control unit Pending JP2018067176A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016205855A JP2018067176A (en) 2016-10-20 2016-10-20 Electronic control unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016205855A JP2018067176A (en) 2016-10-20 2016-10-20 Electronic control unit

Publications (1)

Publication Number Publication Date
JP2018067176A true JP2018067176A (en) 2018-04-26

Family

ID=62087082

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016205855A Pending JP2018067176A (en) 2016-10-20 2016-10-20 Electronic control unit

Country Status (1)

Country Link
JP (1) JP2018067176A (en)

Similar Documents

Publication Publication Date Title
JP5451705B2 (en) Electronic control device for automobile and data communication method
JP5547701B2 (en) Electronic control unit for automobile
TWI715926B (en) Firmware update in a storage backed memory package
US20190294343A1 (en) Electronic Control Unit for Vehicle and Method of Writing Data
JP2017059211A (en) Gateway device, vehicle-mounted network system, and firmware update method
JP7419557B2 (en) Software version rollback methods, devices, and systems
CN102089753B (en) System and method for safely updating thin client operating system over a network
US20160246538A1 (en) Data transfer method and data transfer program
US11914871B2 (en) Electronic control device and program-update method
CN104317716B (en) Data transmission method and distributed node equipment between distributed node
JP5945044B2 (en) Electronic control device for automobile, writing system for electronic control device for automobile, and writing method of control program for vehicle control
JP2018160207A (en) On-vehicle controller and program update software
JP6302004B2 (en) Writing program
JP2018067176A (en) Electronic control unit
US9015385B2 (en) Data storage device and method of controlling data storage device
US10860509B1 (en) Multi-device burst update method
JP7161427B2 (en) Automotive electronic controller and program writing method
CN110278716B (en) PLC, network unit, CPU unit, and data transfer method
WO2020122024A1 (en) Network interface card, computer, circuit information rewriting method and program
JP5956505B2 (en) Electronic control unit for automobile
JP2013192092A (en) On-vehicle device
JP5813833B2 (en) Electronic control unit for automobile
CN111124451A (en) Distributed backup upgrading method
KR102333448B1 (en) Apparatus and method for updating software of guided weapon embedded devices
JP2022170949A (en) Control device and data rewriting method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190304

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200129

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200204

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20200804