JP2017157202A - On-vehicle control device - Google Patents

On-vehicle control device Download PDF

Info

Publication number
JP2017157202A
JP2017157202A JP2017018667A JP2017018667A JP2017157202A JP 2017157202 A JP2017157202 A JP 2017157202A JP 2017018667 A JP2017018667 A JP 2017018667A JP 2017018667 A JP2017018667 A JP 2017018667A JP 2017157202 A JP2017157202 A JP 2017157202A
Authority
JP
Japan
Prior art keywords
program
slave node
communication
rewriting
master node
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.)
Granted
Application number
JP2017018667A
Other languages
Japanese (ja)
Other versions
JP6696452B2 (en
Inventor
上原 一浩
Kazuhiro Uehara
一浩 上原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Corp
Original Assignee
Denso Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Corp filed Critical Denso Corp
Priority to DE102017202280.9A priority Critical patent/DE102017202280A1/en
Publication of JP2017157202A publication Critical patent/JP2017157202A/en
Application granted granted Critical
Publication of JP6696452B2 publication Critical patent/JP6696452B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)
  • Stored Programmes (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an on-vehicle control device that can prevent false writing of writing object data from occurring.SOLUTION: A master node receives, from a rewriting tool, various request commands, rewriting object data, and a relay program for converting a communication format with a slave node so that the slave node can receive the data when a program on the slave node is rewritten. In addition, the master node temporarily stores the received relay program in a RAM 13 (S13). Then, the master node 10 converts the communication format by using the relay program so that the slave node can receive the data when the program on the slave node is rewritten, and transmits the data to the slave node by using a communication format after conversion (S18, S24 and S30).SELECTED DRAWING: Figure 5

Description

本発明は、車載制御装置に関する。   The present invention relates to an in-vehicle control device.

従来、特許文献1に開示された電子制御装置がある。この電子制御装置は、外部装置に接続された第1マイコンと、後続の第2マイコンとを有している。第1マイコンは、後続の第2マイコンに対する書込対象データを、外部装置から受信すると、これを変換した後、自身内蔵のRAMに保存して、一旦、書込対象データ全てをRAMに記録する。その後、第1マイコンは、第2マイコンに対して書換コマンドを入力すると共に、第2マイコンからハンドシェイク信号を受信する度に、RAMに蓄積した書込対象データを、第2マイコンが一度に受信可能なNMバイト分ずつ、第2マイコンに送信する。   Conventionally, there is an electronic control device disclosed in Patent Document 1. This electronic control device has a first microcomputer connected to an external device and a subsequent second microcomputer. When the first microcomputer receives the write target data for the subsequent second microcomputer from the external device, the first microcomputer converts the data and stores it in its own built-in RAM, and once records all the write target data in the RAM. . After that, the first microcomputer inputs a rewrite command to the second microcomputer, and every time the handshake signal is received from the second microcomputer, the second microcomputer receives the write target data stored in the RAM at a time. The possible NM bytes are transmitted to the second microcomputer.

特開2006−268107号公報JP 2006-268107 A

ところで、上記電子制御装置は、第1マイコンと外部装置との通信態様と、第1マイコンと第2マイコンとの通信態様とが異なることも考えられる。このような場合、第1マイコンに相当する車載制御装置としては、外部装置から受信した書込対象データなどを含む書換用データを第2マイコンに送信する際に、スレーブノードが書換用データを受信できるように、通信態様を変換する変換機能を予め備えた構成が考えられる。   By the way, the said electronic control apparatus can also consider that the communication aspect of a 1st microcomputer and an external device differs from the communication aspect of a 1st microcomputer and a 2nd microcomputer. In such a case, the in-vehicle control device corresponding to the first microcomputer receives the rewrite data when the slave node transmits the rewrite data including the data to be written received from the external device to the second microcomputer. In order to be able to do so, a configuration having a conversion function for converting the communication mode is conceivable.

しかしながら、車載制御装置は、外部装置から受信した書換用データの送信先であるスレーブノードが常に同じものとは限らず、通信態様が異なるスレーブノードに変わることもありうる。この場合、スレーブノードは、車載制御装置から送信された書換用データを受信できないことがある。そのため、車載制御装置は、スレーブノードが変わるたびに、変換機能を更新する必要がある。また、車載制御装置は、スレーブノードの種類の増加や管理の煩雑化により、変換機能が適切に更新されず、書込対象データの誤書込みが発生する可能性がある。   However, in the in-vehicle control device, the slave node that is the transmission destination of the rewrite data received from the external device is not always the same, and the communication mode may change to a different slave node. In this case, the slave node may not receive the rewriting data transmitted from the in-vehicle control device. Therefore, the in-vehicle control device needs to update the conversion function every time the slave node changes. In addition, in the in-vehicle control device, there is a possibility that the conversion function is not properly updated due to an increase in the types of slave nodes and complicated management, and erroneous writing of data to be written may occur.

本開示は、上記問題点に鑑みなされたものであり、書込対象データの誤書込みの発生を抑制できる車載制御装置を提供することを目的とする。   The present disclosure has been made in view of the above problems, and an object thereof is to provide an in-vehicle control device capable of suppressing the occurrence of erroneous writing of write target data.

上記目的を達成するために本開示は、
車両の外部に設けられた外部装置(200)から送信された書込対象データを含む書換用データを、車載ネットワークにおけるスレーブノード(20)に送信して、スレーブノードのプログラムを書換える車載制御装置であって、
外部装置から書換用データと、スレーブノードのプログラムを書換える際にスレーブノードが書換用データを受信可能となるように、スレーブノードとの通信態様を変換するための中継プログラムを受信する受信部(S121、S161、S221、S281)と、
受信部で受信した中継プログラムを一時的に揮発性記憶部に保存する格納部(S13)と、
スレーブノードのプログラムを書換える際に、スレーブノードが書換用データを受信可能となるように、格納部に保存した中継プログラムを用いて通信態様を変換する変換部(S17、S23、S29)と、
スレーブノードのプログラムを書換える際に、変換部で変換された後の通信態様で、外部装置から受信した書換用データをスレーブノードに送信する送信部(S18、S18a、S24、S24a、S30、S30a)と、備えていることを特徴とする。
In order to achieve the above object, the present disclosure
A vehicle-mounted control device that rewrites data for rewriting including data to be written transmitted from an external device (200) provided outside the vehicle to the slave node (20) in the vehicle-mounted network and rewrites the program of the slave node. Because
A receiving unit that receives a relay program for converting the communication mode with the slave node so that the slave node can receive the rewriting data when rewriting the rewriting data and the slave node program from the external device ( S121, S161, S221, S281),
A storage unit (S13) for temporarily storing the relay program received by the reception unit in the volatile storage unit;
A conversion unit (S17, S23, S29) for converting the communication mode using the relay program stored in the storage unit so that the slave node can receive the data for rewriting when the program of the slave node is rewritten;
When rewriting the program of the slave node, the transmission unit (S18, S18a, S24, S24a, S30, S30a) that transmits the rewriting data received from the external device to the slave node in the communication mode after being converted by the conversion unit. ) And is provided.

このように、本開示は、外部装置から書換用データだけでなく、スレーブノードが書換用データを受信可能となるように通信態様に変換するための中継プログラムを受信し、受信した中継プログラムを一時的に揮発性記憶部に保存しておく。そして、本開示は、一時的に揮発性記憶部に保存している中継プログラムを用いて通信態様を変換して、変換された後の通信態様で、書換用データをスレーブノードに送信することで、スレーブノードのプログラムを書込対象データに書換える。このため、本開示は、スレーブノードの通信態様が変わったとしても、スレーブノードが書換用データを受信可能となるように通信態様を変換できる。よって、本開示は、書込対象データの誤書込みの発生を抑制できる。   As described above, the present disclosure receives not only rewrite data from an external device but also a relay program for converting into a communication mode so that the slave node can receive the rewrite data, and temporarily receives the received relay program. Therefore, it is stored in a volatile storage unit. Then, the present disclosure converts the communication mode using a relay program temporarily stored in the volatile storage unit, and transmits the rewriting data to the slave node in the converted communication mode. Then, the slave node program is rewritten to the data to be written. For this reason, this indication can change a communication mode so that a slave node can receive data for rewriting, even if a communication mode of a slave node changes. Therefore, the present disclosure can suppress the occurrence of erroneous writing of data to be written.

なお、特許請求の範囲、及びこの項に記載した括弧内の符号は、一つの態様として後述する実施形態に記載の具体的手段との対応関係を示すものであって、発明の技術的範囲を限定するものではない。   It should be noted that the reference numerals in parentheses described in the claims and in this section indicate the correspondence with the specific means described in the embodiments described later as one aspect, and the technical scope of the invention It is not limited.

第1実施形態におけるマスタノードを含む車載制御システムの概略構成を示すブロック図である。It is a block diagram which shows schematic structure of the vehicle-mounted control system containing the master node in 1st Embodiment. 第1実施形態におけるマスタノードの概略構成を示すブロック図である。It is a block diagram which shows schematic structure of the master node in 1st Embodiment. 第1実施形態におけるマスタノードの処理動作の一部を示すフローチャートである。It is a flowchart which shows a part of processing operation of the master node in 1st Embodiment. 第1実施形態におけるマスタノードの処理動作の他の一部を示すフローチャートである。It is a flowchart which shows a part of other processing operation of the master node in 1st Embodiment. 第1実施形態におけるマスタノードとスレーブノードと書換ツールとの処理動作を示すシーケンス図である。It is a sequence diagram which shows the processing operation of the master node in the 1st Embodiment, a slave node, and the rewriting tool. 第2実施形態におけるマスタノードの処理動作の一部を示すフローチャートである。It is a flowchart which shows a part of processing operation of the master node in 2nd Embodiment. 第2実施形態におけるマスタノードの処理動作の他の一部を示すフローチャートである。It is a flowchart which shows a part of other processing operation of the master node in 2nd Embodiment. 第3実施形態におけるマスタノードを含む車載制御システムの概略構成を示すブロック図である。It is a block diagram which shows schematic structure of the vehicle-mounted control system containing the master node in 3rd Embodiment. 第3実施形態におけるマスタノードの処理動作の一部を示すフローチャートである。It is a flowchart which shows a part of processing operation of the master node in 3rd Embodiment. 第3実施形態におけるマスタノードの処理動作の他の一部を示すフローチャートである。It is a flowchart which shows a part of other processing operation of the master node in 3rd Embodiment.

以下において、図面を参照しながら、発明を実施するための複数の形態を説明する。各形態において、先行する形態で説明した事項に対応する部分には同一の参照符号を付して重複する説明を省略する場合がある。各形態において、構成の一部のみを説明している場合は、構成の他の部分については先行して説明した他の形態を参照し適用することができる。   Hereinafter, a plurality of embodiments for carrying out the invention will be described with reference to the drawings. In each embodiment, portions corresponding to the matters described in the preceding embodiment may be denoted by the same reference numerals and redundant description may be omitted. In each embodiment, when only a part of the configuration is described, the other configurations described above can be applied to other portions of the configuration.

(第1実施形態)
図1〜図5を用いて、第1実施形態に関して説明する。なお、本実施形態では、車載制御装置としてマスタノード10を採用する。
(First embodiment)
The first embodiment will be described with reference to FIGS. In the present embodiment, the master node 10 is employed as the in-vehicle control device.

まず、図1、図2を用いて、マスタノード10の構成、マスタノード10を含む車載制御システム、及び書換えシステムの構成に関して説明する。車載制御システムは、車両に搭載可能に構成されている。また、車載制御装置100は、車両に設けられた車載ネットワークの一部として設けられていると言える。   First, the configuration of the master node 10, the in-vehicle control system including the master node 10, and the configuration of the rewriting system will be described with reference to FIGS. The in-vehicle control system is configured to be mountable on a vehicle. Moreover, it can be said that the vehicle-mounted control apparatus 100 is provided as a part of vehicle-mounted network provided in the vehicle.

車載制御システムは、図1に示すように、例えば、マスタノード10に加えて、スレーブノード20を備えて構成されている。つまり、本実施形態では、車載制御システムに含まれている複数のノード10、20の一つであるマスタノード10が車載制御装置100に相当すると言える。なお、各ノード10、20は、実行モードとして、制御プログラムを実行して制御を行う制御モードと、制御プログラムに基づいた制御を行うことなくリプロプログラムを実行して制御プログラムの書換えを行うリプロモードとを有している。制御プログラムは、特許請求の範囲におけるプログラムに相当する。   As shown in FIG. 1, the in-vehicle control system includes, for example, a slave node 20 in addition to the master node 10. That is, in this embodiment, it can be said that the master node 10 which is one of the plurality of nodes 10 and 20 included in the in-vehicle control system corresponds to the in-vehicle control device 100. Each of the nodes 10 and 20 has, as an execution mode, a control mode in which a control program is executed and controlled, and a repro mode in which the repro program is executed without performing control based on the control program and the control program is rewritten And have. The control program corresponds to the program in the claims.

なお、以下においては、制御プログラムの書換えを、単に書換えとも記載する。また、マスタノード10とスレーブノード20の実行モードを区別する場合、マスタノード10の実行モードは、マスタ側実行モードとも称する。同様の理由によって、マスタノード10の制御プログラムは、マスタ用プログラムとも称する。そして、マスタノード10のリプロプログラムは、マスタ用リプロプログラムとも称する。   In the following description, rewriting the control program is also simply referred to as rewriting. Moreover, when distinguishing the execution mode of the master node 10 and the slave node 20, the execution mode of the master node 10 is also called master side execution mode. For the same reason, the control program of the master node 10 is also referred to as a master program. The repro program of the master node 10 is also referred to as a master repro program.

車載制御システムは、第1通信バス31を介して、マスタノード10と、後程説明する車両外部の書換ツール200とが通信可能に構成されている。また、車載制御システムは、第2通信バス32を介して、マスタノード10とスレーブノード20とが通信可能に構成されている。つまり、書換えシステムは、車載制御システムに加えて、外部装置に相当する書換ツール200を備えている。   The in-vehicle control system is configured so that the master node 10 and a rewriting tool 200 outside the vehicle, which will be described later, can communicate with each other via the first communication bus 31. The in-vehicle control system is configured so that the master node 10 and the slave node 20 can communicate with each other via the second communication bus 32. That is, the rewriting system includes a rewriting tool 200 corresponding to an external device in addition to the in-vehicle control system.

このように、車載制御システムは、マスタノード10とスレーブノード20とが直列的に接続された構成となっている。よって、スレーブノード20は、書換ツール200と直接通信することができない。つまり、スレーブノード20は、マスタノード10を介して書換ツール400と通信可能に構成されているとも言える。例えば、マスタノード10と書換ツール200との間、及びマスタノード10とスレーブノード20との間では、後程説明する各要求コマンドや書込対象データや中継プログラムやACKなどを含む通信フレームの送受信が行われる。   Thus, the in-vehicle control system has a configuration in which the master node 10 and the slave node 20 are connected in series. Therefore, the slave node 20 cannot directly communicate with the rewriting tool 200. That is, it can be said that the slave node 20 is configured to be able to communicate with the rewriting tool 400 via the master node 10. For example, between the master node 10 and the rewriting tool 200, and between the master node 10 and the slave node 20, transmission / reception of communication frames including each request command, write target data, relay program, ACK, and the like which will be described later is performed. Done.

車載制御システムは、第1通信バス31を介して行われる通信と、第2通信バス32を介して行われる通信とで通信態様が異なる。つまり、マスタノード10と書換ツール200との間での通信態様は、マスタノード10とスレーブノード20との間での通信態様と異なる。よって、スレーブノード20は、リプロモード時において、例えば受信できる通信フレームの通信フォーマットが、マスタノード10が書換ツール200から受信できる通信フレームの通信フォーマットと異なる。また、スレーブノード20がリプロモード時に送信する通信フレームは、書換ツール200で受信可能な通信フォーマットではない。本実施形態では、一例として、第1通信バス31を介して行われる通信と、第2通信バス32を介して行われる通信とで通信プロトコルが異なる例を採用する。   The in-vehicle control system differs in communication mode between communication performed via the first communication bus 31 and communication performed via the second communication bus 32. That is, the communication mode between the master node 10 and the rewriting tool 200 is different from the communication mode between the master node 10 and the slave node 20. Therefore, in the slave node 20, in the repro mode, for example, the communication format of the communication frame that can be received is different from the communication format of the communication frame that the master node 10 can receive from the rewriting tool 200. The communication frame transmitted by the slave node 20 in the repro mode is not a communication format that can be received by the rewriting tool 200. In the present embodiment, as an example, an example is employed in which the communication protocol differs between communication performed via the first communication bus 31 and communication performed via the second communication bus 32.

さらに、車載制御システムは、マスタノード10とスレーブノード20とで、リプロプログラムのバージョンや、プログラムの書換え仕様が異なる。この場合、両ノード10、20がリプロモード時、マスタノード10と書換ツール200との間で行なわれる手順や手続きは、マスタノード10とスレーブノード20との間で行なわれる手順や手続きと異なる。また、手順や手続きが異なることによって、書換え時のマスタノード10と書換ツール200との間でやり取りされるデータ量は、マスタノード10とスレーブノード20との間でやり取りされるデータ量と異なる。このため、車載制御システムは、第1通信バス31を介して行われる通信と、第2通信バス32を介して行われる通信とで、手順や手続き、さらにはデータ量が異なることになる。よって、通信態様は、手順や手続き、さらにはデータ量も含んでいると言える。   Further, in the in-vehicle control system, the version of the repro program and the rewrite specification of the program are different between the master node 10 and the slave node 20. In this case, when both nodes 10 and 20 are in the repro mode, the procedure and procedure performed between the master node 10 and the rewriting tool 200 are different from the procedure and procedure performed between the master node 10 and the slave node 20. Further, the amount of data exchanged between the master node 10 and the rewriting tool 200 at the time of rewriting differs from the amount of data exchanged between the master node 10 and the slave node 20 due to different procedures and procedures. For this reason, in the in-vehicle control system, the procedure and procedure, and further the amount of data are different between the communication performed via the first communication bus 31 and the communication performed via the second communication bus 32. Therefore, it can be said that the communication mode includes procedures, procedures, and data amount.

各ノード10、20は、書換えを行う場合、書換ツール200との通信を行う。この場合、各ノード10、20は、書換ツール200から送信された複数の要求コマンドや書込対象データを個別に含む複数の通信フレームを受信する。そして、各ノード10、20は、各要求コマンドを実行することで制御プログラムの消去や書込対象データの書込みなどの各種処理を行いつつ、ACKを含む通信フレームを複数回返信することで書換ツール200に応答する。   Each node 10 and 20 communicates with the rewriting tool 200 when rewriting. In this case, each of the nodes 10 and 20 receives a plurality of communication frames individually including a plurality of request commands and write target data transmitted from the rewriting tool 200. Each node 10 and 20 executes each request command to perform various processes such as erasing the control program and writing data to be written, while returning a communication frame including ACK multiple times to rewrite the tool. Respond to 200.

しかしながら、スレーブノード20は、上記のように書換ツール200と直接通信できない。このため、スレーブノード20は、書換えを行う場合、書換ツール200から送信された通信フレームをマスタノード10から受信し、且つ、書換ツール200への通信フレームをマスタノード10を介して送信する。つまり、マスタノード10は、書換ツール200とスレーブノード20との間で通信フレームの中継を行う。   However, the slave node 20 cannot directly communicate with the rewriting tool 200 as described above. For this reason, when rewriting, the slave node 20 receives the communication frame transmitted from the rewriting tool 200 from the master node 10 and transmits the communication frame to the rewriting tool 200 via the master node 10. That is, the master node 10 relays a communication frame between the rewriting tool 200 and the slave node 20.

ところが、マスタノード10と書換ツール200との間と、マスタノード10とスレーブノード20との間では、上記のように通信プロトコルが異なる。このため、マスタノード10は、通信フレームを中継する場合、通信プロトコルの変換を行う必要がある。つまり、マスタノード10は、通信フレームをスレーブノード20が受信できるように、通信プロトコルを変換してスレーブノード20に送信したり、通信フレームを書換ツール200が受信できるように通信プロトコルを変換して書換ツール200に送信したりする。なお、マスタノード10は、通信プロトコルを変換することで、スレーブノード20や書換ツール200が受信できるように通信フレームの通信フォーマットを変換することになる。   However, the communication protocol is different between the master node 10 and the rewriting tool 200 and between the master node 10 and the slave node 20 as described above. Therefore, the master node 10 needs to convert the communication protocol when relaying a communication frame. That is, the master node 10 converts the communication protocol so that the slave node 20 can receive the communication frame and transmits it to the slave node 20, or converts the communication protocol so that the rewrite tool 200 can receive the communication frame. Or transmitted to the rewriting tool 200. The master node 10 converts the communication format of the communication frame so that the slave node 20 and the rewriting tool 200 can receive the communication protocol by converting the communication protocol.

書換ツール200は、ディーラや工場の作業者によって操作可能に構成されている。書換ツール200は、作業者による操作に応じて、書換えを行う。書換ツール200は、各要求コマンドや書込対象データをマスタノード10に送信する。各要求コマンド及び書込対象データは、マスタノード10に対するものと、スレーブノード20に対するものとがある。   The rewriting tool 200 is configured to be operable by a dealer or a factory worker. The rewriting tool 200 performs rewriting according to the operation by the operator. The rewrite tool 200 transmits each request command and write target data to the master node 10. Each request command and write target data are for the master node 10 and for the slave node 20.

このため、書換ツール200は、マスタノード10とスレーブノード20の夫々に個別に対応したID情報と共に、各要求コマンド及び書込対象データを送信する。これによって、マスタノード10とスレーブノード20の夫々は、各要求コマンド及び書込対象データが自身に対するものであるか否かを判定できる。また、作業者は、スレーブノード20に適した中継プログラムを把握している。よって、作業者は、書換ツール200を操作することで、スレーブノード20に適した中継プログラムをマスタノード10に送信する。なお、書換ツール200と車載制御システムとを含み、書換ツール200でスレーブノード20における書換えを行うシステムを、書換システムと言うこともできる。   Therefore, the rewriting tool 200 transmits each request command and write target data together with ID information individually corresponding to the master node 10 and the slave node 20. Thereby, each of the master node 10 and the slave node 20 can determine whether each request command and the write target data are for itself. Further, the worker knows a relay program suitable for the slave node 20. Therefore, the operator operates the rewriting tool 200 to transmit a relay program suitable for the slave node 20 to the master node 10. A system that includes the rewriting tool 200 and the in-vehicle control system and performs rewriting in the slave node 20 with the rewriting tool 200 can also be referred to as a rewriting system.

さらに、書換ツール200は、各要求コマンド及び書込対象データに加えて、書換え時にマスタノード10がスレーブノード20及び書換ツール200と通信を行う場合に用いられる中継プログラムを送信する。この中継プログラムは、上記のように通信プロトコルを変換するためのプログラムである。さらに、中継プログラムは、マスタノード10がスレーブノード20及び書換ツール200と通信を行うための通信ドライバとしての機能も含んでいる。   Furthermore, the rewriting tool 200 transmits a relay program used when the master node 10 communicates with the slave node 20 and the rewriting tool 200 at the time of rewriting, in addition to each request command and data to be written. This relay program is a program for converting the communication protocol as described above. Further, the relay program includes a function as a communication driver for the master node 10 to communicate with the slave node 20 and the rewriting tool 200.

詳述すると、中継プログラムは、書換え時、マスタノード10からスレーブノード20へ通信フレームを送信する際の通信プロトコルを変換するためのプログラムである。中継プログラムは、書換え時に、スレーブノード20が各要求コマンド及び書込対象データを受信可能となるように、スレーブノード20との通信プロトコルを変換するためのプログラムと言える。   More specifically, the relay program is a program for converting a communication protocol when transmitting a communication frame from the master node 10 to the slave node 20 at the time of rewriting. The relay program can be said to be a program for converting a communication protocol with the slave node 20 so that the slave node 20 can receive each request command and write target data at the time of rewriting.

また、中継プログラムは、書換え時、マスタノード10から書換ツール200へ通信フレームを送信する際の通信プロトコルを変換するためのプログラムである。中継プログラムは、書換え時に、書換ツール200がスレーブノード20からのACKを受信可能となるように、書換ツール200との通信プロトコルを変換するためのプログラムと言える。   The relay program is a program for converting a communication protocol when transmitting a communication frame from the master node 10 to the rewriting tool 200 at the time of rewriting. The relay program can be said to be a program for converting the communication protocol with the rewriting tool 200 so that the rewriting tool 200 can receive ACK from the slave node 20 at the time of rewriting.

マスタノード10は、中継プログラムを実行して通信プロトコルを変換することで、通信フレームの通信フォーマットを変換する。このため、中継プログラムは、変換プログラとも言える。   The master node 10 converts the communication format of the communication frame by executing the relay program and converting the communication protocol. For this reason, the relay program can be said to be a conversion program.

なお、マスタノード10は、スレーブノード20が一つの場合、中継プログラムを受信したことで、各要求コマンド及び書込対象データがスレーブノード20に対するものであると判定することもできる。つまり、マスタノード10は、中継プログラムを受信した直後に受信した各要求コマンド及び書込対象データを、スレーブノード20に対するものであると判定する。言い換えると、マスタノード10は、中継プログラムを受信した後で最初に受信した書込対象データと、中継プログラムを受信してから最初に書込対象データを受信するまでの間に受信した各要求コマンドを、スレーブノード20に対するものであると判定する。また、マスタノード10は、中継プログラムを受信した後で、且つ、最初に書込対象データを受信した後に受信した各要求コマンド及び書込対象データを、自ノード10に対するものであると判定する。   Note that, when there is one slave node 20, the master node 10 can determine that each request command and data to be written are for the slave node 20 by receiving the relay program. That is, the master node 10 determines that each request command and write target data received immediately after receiving the relay program are for the slave node 20. In other words, the master node 10 receives the write target data received first after receiving the relay program, and each request command received from when the relay program is received until the first write target data is received. Are determined for the slave node 20. Further, the master node 10 determines that each request command and write target data received after receiving the relay program and after receiving the write target data for the first time are for the own node 10.

書換ツール200は、書換えを行う際に、ケーブルとコネクタなどを介して車両と接続される。また、書換ツール200は、書換えが完了した後など書換えを行わないとき車両から外されている。さらに、書換ツール200は、無線通信によって、マスタノード10と通信可能に構成されていてもよい。   The rewriting tool 200 is connected to the vehicle via a cable and a connector when rewriting. The rewriting tool 200 is removed from the vehicle when rewriting is not performed, for example, after rewriting is completed. Furthermore, the rewriting tool 200 may be configured to be able to communicate with the master node 10 by wireless communication.

マスタノード10は、図2に示すように、CPU11、ROM12、RAM13、第1データ送受信部14、第2データ送受信部15などを備えている。よって、マスタノード10は、ECU(Electronic Control Unit)とも言える。   As shown in FIG. 2, the master node 10 includes a CPU 11, a ROM 12, a RAM 13, a first data transmission / reception unit 14, a second data transmission / reception unit 15, and the like. Therefore, it can be said that the master node 10 is an ECU (Electronic Control Unit).

CPU11は、後程説明するROM12に予め記憶されたマスタ用プログラムやマスタ用リプロプログラムを実行する。ROM12には、マスタ用プログラム、マスタ用リプロプログラム、通信ドライバが記憶されている。RAM13は、CPU11が演算処理を行う際に、演算結果などを一時的に記憶するための記憶部である。また、RAM13には、揮発性記憶部に相当し、書換ツール200から受信した中継プログラムが一時的に記憶される。   The CPU 11 executes a master program and a master repro program stored in advance in the ROM 12 described later. The ROM 12 stores a master program, a master repro program, and a communication driver. The RAM 13 is a storage unit for temporarily storing calculation results and the like when the CPU 11 performs calculation processing. The RAM 13 corresponds to a volatile storage unit and temporarily stores the relay program received from the rewriting tool 200.

第1データ送受信部14は、第1通信バス31を介して、書換ツール200と通信を行うための通信部である。一方、第2データ送受信部15は、第2通信バス32を介して、スレーブノード20と通信を行うための通信部である。CPU11は、制御モード時に、ROM12に記憶された通信ドライバを実行することで、第1データ送受信部14及び第2データ送受信部15を介して通信を行うことができる。   The first data transmission / reception unit 14 is a communication unit for communicating with the rewriting tool 200 via the first communication bus 31. On the other hand, the second data transmission / reception unit 15 is a communication unit for communicating with the slave node 20 via the second communication bus 32. The CPU 11 can perform communication via the first data transmission / reception unit 14 and the second data transmission / reception unit 15 by executing the communication driver stored in the ROM 12 in the control mode.

また、CPU11は、リプロモード時に、RAM13に一時的に記憶された中継プログラムを実行することで、第1データ送受信部14及び第2データ送受信部15を介して通信を行う。言い換えると、CPU11は、リプロモード時に、RAM13に一時的に記憶された中継プログラムを実行することで、スレーブノード20と書換ツール200との間で中継を行う。   Further, the CPU 11 performs communication via the first data transmission / reception unit 14 and the second data transmission / reception unit 15 by executing the relay program temporarily stored in the RAM 13 in the repro mode. In other words, the CPU 11 relays between the slave node 20 and the rewriting tool 200 by executing the relay program temporarily stored in the RAM 13 in the repro mode.

さらに、マスタノード10は、プログラムカウンタを備えている。プログラムカウンタは、ROM12のアドレスと、RAM13のアドレスとを指定可能に構成されている。つまり、プログラムカウンタは、CPU11が実行する命令の読出し先をROM12からRAM13、及びRAM13からROM12に変更可能に構成されている。   Furthermore, the master node 10 includes a program counter. The program counter is configured such that the address of the ROM 12 and the address of the RAM 13 can be specified. In other words, the program counter is configured to be able to change the read destination of instructions executed by the CPU 11 from the ROM 12 to the RAM 13 and from the RAM 13 to the ROM 12.

スレーブノード20は、マスタノード10と同様の構成を有している。このため、スレーブノード20の構成に関する図示や詳細な説明は省略する。しかしながら、スレーブノード20は、マスタノード10と通信できればよい。このため、スレーブノード20は、マスタノード10と異なり、2つのデータ送受信部を備える必要がなく、データ送受信部を一つ備えていればよい。また、この他、スレーブノード20は、制御プログラムの内容、つまり制御内容がマスタノード10と異なる。   The slave node 20 has a configuration similar to that of the master node 10. For this reason, illustrations and detailed descriptions regarding the configuration of the slave node 20 are omitted. However, the slave node 20 only needs to be able to communicate with the master node 10. Therefore, unlike the master node 10, the slave node 20 does not need to include two data transmission / reception units, and only needs to include one data transmission / reception unit. In addition, the slave node 20 is different from the master node 10 in the contents of the control program, that is, the control contents.

ここで、図3、図4、図5を用いて、マスタノード10の処理動作に関して説明する。図3のフローチャートと図4のフローチャートは、マスタノード10の一連の処理動作を示している。つまり、マスタノード10は、図3のステップS21の処理を終了すると、図4のステップS22へと進む。マスタノード10は、例えば電源が供給されると図3のフローチャートに示す処理をスタートする。このとき、マスタノード10のプログラムカウンタはROM12となっている。よって、マスタノード10は、ROM12に記憶されている通信ドライバを実行することで、スレーブノード20や書換ツール200と通信を行うことになる。   Here, the processing operation of the master node 10 will be described with reference to FIGS. 3, 4, and 5. The flowchart of FIG. 3 and the flowchart of FIG. 4 show a series of processing operations of the master node 10. That is, when the master node 10 ends the process of step S21 in FIG. 3, the process proceeds to step S22 in FIG. For example, when power is supplied, the master node 10 starts the process shown in the flowchart of FIG. At this time, the program counter of the master node 10 is the ROM 12. Therefore, the master node 10 communicates with the slave node 20 and the rewriting tool 200 by executing the communication driver stored in the ROM 12.

なお、マスタノード10の処理動作は、書換ツール200の処理動作及びスレーブノード20の処理動作とも関連する。このため、以下においては、書換ツール200の処理動作及びスレーブノード20の処理動作と共に、マスタノード10の処理動作を説明する。図5は、マスタノード10、スレーブノード20、及び書換ツール200の処理動作を示すシーケンス図である。書換ツール200は、図5に示すように、ダウンロード要求コマンドを含む通信フレームなどをマスタノード10に対して送信する。図5のDLは、ダウンロードの略称である。   The processing operation of the master node 10 is also related to the processing operation of the rewrite tool 200 and the processing operation of the slave node 20. Therefore, in the following, the processing operation of the master node 10 will be described together with the processing operation of the rewriting tool 200 and the processing operation of the slave node 20. FIG. 5 is a sequence diagram showing processing operations of the master node 10, the slave node 20, and the rewriting tool 200. The rewrite tool 200 transmits a communication frame including a download request command to the master node 10 as shown in FIG. DL in FIG. 5 is an abbreviation for download.

ステップS10では、中継プログラムのダウンロード要求を受信したか否かを判定する。マスタノード10は、書換ツール200から受信した通信フレームを確認することで、ダウンロード要求を受信したか否かを判定する。そして、マスタノード10は、受信した通信フレームにダウンロード要求コマンドが含まれていた場合、ダウンロード要求を受信したとみなしてステップS11へ進む。また、マスタノード10は、受信した通信フレームにダウンロード要求コマンドが含まれていなかった場合、ダウンロード要求を受信したとみなさずステップS10を繰り返す。   In step S10, it is determined whether or not a relay program download request has been received. The master node 10 determines whether or not a download request has been received by checking the communication frame received from the rewriting tool 200. If the received communication frame includes a download request command, the master node 10 considers that the download request has been received, and proceeds to step S11. Further, if the download request command is not included in the received communication frame, the master node 10 does not consider that the download request has been received and repeats step S10.

マスタノード10は、所定時間、ダウンロード要求コマンドを受信できなかった場合、図3、図4の処理を終了してもよい。つまり、マスタノード10は、カウントアウト処理を行ってもよい。また、マスタノード10は、以下の判定においてもカウントアウト処理を行ってもよい。   When the master node 10 has not received the download request command for a predetermined time, the master node 10 may end the processes in FIGS. That is, the master node 10 may perform a count-out process. Further, the master node 10 may perform a count-out process in the following determination.

なお、以下のACKを受信したか否かの判定は、ステップS10と同様に、通信フレームを確認することで行う。よって、以下においては、重複する説明を省略する。   Note that whether or not the following ACK has been received is determined by confirming the communication frame, as in step S10. Therefore, the overlapping description is omitted below.

ステップS11では、ACK応答を行う。マスタノード10は、図5に示すように、ダウンロード要求コマンドを受信すると、書換ツール200に対してACKを含む通信フレームを返信する。つまり、マスタノード10は、ダウンロード要求コマンドを受信したことを書換ツール200に伝えるためにACKを返信する。なお、書換ツール200は、図5に示すように、ダウンロード要求コマンドに応答したACKを受信した場合、中継プログラムをマスタノード10に対して送信する。   In step S11, an ACK response is performed. As shown in FIG. 5, when receiving the download request command, the master node 10 returns a communication frame including ACK to the rewriting tool 200. That is, the master node 10 sends back an ACK to notify the rewriting tool 200 that the download request command has been received. As shown in FIG. 5, the rewriting tool 200 transmits a relay program to the master node 10 when receiving an ACK in response to the download request command.

ステップS12では、中継プログラムを受信したか否かを判定する。マスタノード10は、書換ツール200から中継プログラムを受信したと判定した場合にステップS13へ進み、受信したと判定してない場合にステップS12を繰り返す。つまり、マスタノード10は、図5のステップS121に示すように、書換ツール200から送信された中継プログラムを受信する(受信部)。そして、マスタノード10は、中継プログラムを受信した後に、ステップS13を実行する。   In step S12, it is determined whether a relay program has been received. When it is determined that the relay program has been received from the rewriting tool 200, the master node 10 proceeds to step S13, and when it is not determined that the relay program has been received, the master node 10 repeats step S12. That is, the master node 10 receives the relay program transmitted from the rewriting tool 200 (receiving unit) as shown in step S121 in FIG. Then, after receiving the relay program, the master node 10 executes step S13.

なお、マスタノード10は、制御モードでステップS10〜S12を実行して、中継プログラムを受信すると、マスタ側実行モードをリプロモードに決定してもよい。つまり、マスタノード10は、中継プログラムを受信した時点で、マスタ側実行モードを制御モードからリプロモードに遷移させてもよい。   Note that, when the master node 10 executes steps S10 to S12 in the control mode and receives the relay program, the master node execution mode may be determined to be the repro mode. That is, the master node 10 may transition the master side execution mode from the control mode to the repro mode when the relay program is received.

ステップS13では、中継プログラムを揮発性メモリに格納する(格納部)。マスタノード10は、図5に示すように、受信した中継プログラムを、揮発性メモリであるRAM13に格納する。中継プログラムは、RAM13に格納されるため、一時的にRAM13に記憶されるとも言える。なお、RAM13は、マスタノード10への電源供給が停止されると、記憶内容が消える。このため、中継プログラムは、マスタノード10への電源供給が停止されると消えてしまう。   In step S13, the relay program is stored in a volatile memory (storage unit). As illustrated in FIG. 5, the master node 10 stores the received relay program in the RAM 13 that is a volatile memory. Since the relay program is stored in the RAM 13, it can be said that the relay program is temporarily stored in the RAM 13. Note that the RAM 13 loses its stored contents when power supply to the master node 10 is stopped. For this reason, the relay program disappears when the power supply to the master node 10 is stopped.

ステップS14では、プログラムカウンタを中継プログラムの格納先へ変更する。マスタノード10は、プログラムカウンタをROM12から、中継プログラムの格納先であるRAM13へ変更する。これは、受信した通信フレームをスレーブノード20や書換ツール200で受信できるようにするためである。   In step S14, the program counter is changed to the storage location of the relay program. The master node 10 changes the program counter from the ROM 12 to the RAM 13 that is the storage destination of the relay program. This is because the received communication frame can be received by the slave node 20 or the rewrite tool 200.

つまり、マスタノード10は、図2の一点鎖線S1で示すように、通信ドライバを実行することで書換ツール200と通信を行い、中継プログラムを受信する。そして、マスタノード10は、一点鎖線S2で示すように、受信した中継プログラムをRAM13に格納する。その後、マスタノード10は、プログラムカウンタをRAM13へ変更する。   That is, the master node 10 communicates with the rewriting tool 200 by executing the communication driver and receives the relay program as indicated by a one-dot chain line S1 in FIG. Then, the master node 10 stores the received relay program in the RAM 13 as indicated by the alternate long and short dash line S2. Thereafter, the master node 10 changes the program counter to the RAM 13.

マスタノード10は、プログラムカウンタをRAM13へ変更すると、一点鎖線S3、S4で示すように、通信ドライバではなく中継プログラムを実行して、スレーブノード20や書換ツール200との通信を行うことになる。なお、図2では、スレーブノード20から書換ツール200への通信時の状況を示す一点鎖線を省略している。   When the master node 10 changes the program counter to the RAM 13, the master node 10 executes the relay program instead of the communication driver and communicates with the slave node 20 and the rewriting tool 200 as indicated by alternate long and short dash lines S3 and S4. In FIG. 2, the alternate long and short dash line that indicates the situation at the time of communication from the slave node 20 to the rewriting tool 200 is omitted.

ステップS15では、ACK応答を行う。マスタノード10は、中継プログラムを受信すると、書換ツール200に対してACKを含む通信フレームを返信する。つまり、マスタノード10は、中継プログラムを受信したことを書換ツール200に伝えるためにACKを返信する。   In step S15, an ACK response is performed. When receiving the relay program, the master node 10 returns a communication frame including ACK to the rewriting tool 200. In other words, the master node 10 returns an ACK to notify the rewriting tool 200 that the relay program has been received.

なお、本実施形態では、図5に示すように、中継プログラムをRAM13に格納した後に、ACKを返信する例を採用している。よって、マスタノード10は、受信した中継プログラムをRAM13に格納したことを、書換ツール200に伝えるためにACKを返信する、とも言える。そして、書換ツール400は、中継プログラムの送信に対するACKを受信した後、スレーブノード20のID情報と消去要求コマンドとを含む通信フレームを送信する。   In the present embodiment, as shown in FIG. 5, an example in which an ACK is returned after the relay program is stored in the RAM 13 is employed. Therefore, it can also be said that the master node 10 returns an ACK in order to notify the rewriting tool 200 that the received relay program is stored in the RAM 13. Then, after receiving the ACK for transmission of the relay program, the rewriting tool 400 transmits a communication frame including the ID information of the slave node 20 and the erasure request command.

この消去要求コマンドは、ROMに記憶されている制御プログラムの消去を要求するコマンドである。また、消去要求コマンドは、制御プログラムの書換えを行うために用いられるものであり、書換用データに相当する。つまり、消去要求コマンドは、書換用データの一つと言える。   This erase request command is a command for requesting to erase the control program stored in the ROM. The erase request command is used for rewriting the control program and corresponds to rewriting data. That is, it can be said that the erase request command is one of the rewrite data.

ステップS16では、消去要求コマンドを受信したか否かを判定する。マスタノード10は、スレーブノード20に対する消去要求コマンドを受信したか否かを判定する。マスタノード10は、受信した通信フレームに消去要求コマンドとスレーブノード20を示すID情報とが含まれているか否かに基づいて、スレーブノード20に対する消去要求コマンドを受信したか否かを判定する。   In step S16, it is determined whether an erase request command has been received. The master node 10 determines whether an erase request command for the slave node 20 has been received. The master node 10 determines whether or not an erase request command for the slave node 20 has been received based on whether or not the received communication frame includes an erase request command and ID information indicating the slave node 20.

そして、マスタノード10は、消去要求コマンドとスレーブノード20を示すID情報とが含まれている場合、スレーブノード20に対する消去要求コマンドを受信したと判定してステップS17へ進む。また、マスタノード10は、消去要求コマンド又はスレーブノード20を示すID情報が含まれていない場合、スレーブノード20に対する消去要求コマンドを受信したと判定せずにステップS16を繰り返す。つまり、マスタノード10は、図5のステップS161に示すように、書換ツール200から送信された消去要求コマンドを受信する(受信部)。そして、マスタノード10は、消去要求コマンドを受信した後に、ステップS17を実行する。   If the erase request command and the ID information indicating the slave node 20 are included, the master node 10 determines that the erase request command for the slave node 20 has been received, and proceeds to step S17. If the master node 10 does not include the erase request command or the ID information indicating the slave node 20, the master node 10 repeats step S16 without determining that the erase request command for the slave node 20 has been received. That is, the master node 10 receives the erasure request command transmitted from the rewriting tool 200 as shown in step S161 in FIG. 5 (receiving unit). Then, after receiving the erase request command, the master node 10 executes Step S17.

ステップS17では、スレーブノード20に対応した通信フォーマットに変換する(変換部)。マスタノード10は、図5に示すように、中継プログラムを実行することで、スレーブノード20に対する消去要求コマンドを含んでいる通信フレームの通信フォーマットを、スレーブノード20で受信可能な通信フォーマットに変換する。このように、マスタノード10は、書換ツール200から受信して、一時的にRAM13に格納している中継プログラムを用いて、通信フォーマットを変換する。   In step S17, the communication format corresponding to the slave node 20 is converted (converter). As illustrated in FIG. 5, the master node 10 executes the relay program to convert the communication format of the communication frame including the erase request command for the slave node 20 into a communication format that can be received by the slave node 20. . In this way, the master node 10 converts the communication format using the relay program received from the rewriting tool 200 and temporarily stored in the RAM 13.

ステップS18では、スレーブノードへ消去要求コマンドを中継する(送信部)。マスタノード10は、図5に示すように、中継プログラムを実行することで、ステップS17で変換した通信フレームをスレーブノード20へ送信する。当然ながら、この通信フレームには、書換ツール200から送信されたスレーブノード20に対する消去要求コマンドが含まれている。   In step S18, the erasure request command is relayed to the slave node (transmission unit). As illustrated in FIG. 5, the master node 10 transmits the communication frame converted in step S <b> 17 to the slave node 20 by executing the relay program. Of course, this communication frame includes an erase request command for the slave node 20 transmitted from the rewrite tool 200.

この消去要求コマンドを含む通信フレームは、スレーブノード20で受信可能な通信フォーマットに変換されている。このため、スレーブノード20は、通信フレームを受信することができる。よって、スレーブノード20は、書換ツール200から送信された消去要求コマンドを受信できる。なお、スレーブノード20は、以下で説明する他の要求コマンドや書込対象データに関しても、マスタノード10が通信フレームの通信フォーマットが変換するため受信できる。   The communication frame including the erasure request command is converted into a communication format that can be received by the slave node 20. Therefore, the slave node 20 can receive a communication frame. Therefore, the slave node 20 can receive the erase request command transmitted from the rewrite tool 200. The slave node 20 can also receive other request commands and write target data described below because the communication format of the communication frame is converted by the master node 10.

図5に示すように、スレーブノード20は、消去要求コマンドを受信すると、この消去要求コマンドを実行することで、自ノード20の制御プログラムを消去する(消去処理)。そして、スレーブノード20は、制御プログラムを消去したことを書換ツール200に伝えるためにACKを返信する。スレーブノード20が返信するACKは、応答データに相当する。   As shown in FIG. 5, when the slave node 20 receives the erase request command, the slave node 20 executes the erase request command to erase the control program of the node 20 (erase processing). Then, the slave node 20 returns an ACK to notify the rewriting tool 200 that the control program has been deleted. The ACK returned by the slave node 20 corresponds to response data.

ステップS19では、スレーブノードからACKを受信したか否かを判定する。マスタノード10は、スレーブノード20からACKを受信したと判定した場合にステップS20へ進み、スレーブノードからACKを受信したと判定してない場合にステップS19を繰り返す。   In step S19, it is determined whether or not an ACK has been received from the slave node. The master node 10 proceeds to step S20 when it is determined that ACK is received from the slave node 20, and repeats step S19 when it is not determined that ACK is received from the slave node.

ステップS20では、書換ツール200に対応した通信フォーマットに変換する(応答変換部)。マスタノード10は、図5に示すように、中継プログラムを実行することで、書換ツール200に対するACKを含んでいる通信フレームの通信フォーマットを、書換ツール200で受信可能な通信フォーマットに変換する。   In step S20, the communication format corresponding to the rewriting tool 200 is converted (response conversion unit). As illustrated in FIG. 5, the master node 10 executes the relay program to convert the communication format of the communication frame including the ACK for the rewriting tool 200 into a communication format that can be received by the rewriting tool 200.

ステップS21では、書換ツールへACKを中継する。マスタノード10は、図5に示すように、ステップS20で変換した通信フレームを書換ツール200へ送信する。当然ながら、この通信フレームには、書換ツール200に対するACKが含まれている。   In step S21, ACK is relayed to the rewriting tool. As illustrated in FIG. 5, the master node 10 transmits the communication frame converted in step S <b> 20 to the rewriting tool 200. Naturally, this communication frame includes an ACK for the rewriting tool 200.

このACKを含む通信フレームは、書換ツール200で受信可能な通信フォーマットに変換されている。このため、書換ツール200は、通信フレームを受信することができる。よって、書換ツール200は、スレーブノード20から送信されたACKを受信できる。なお、書換ツール200は、以下で説明する他のACKに関しても、マスタノード10が通信フレームの通信フォーマットが変換するため受信できる。   The communication frame including the ACK is converted into a communication format that can be received by the rewriting tool 200. For this reason, the rewriting tool 200 can receive a communication frame. Therefore, the rewriting tool 200 can receive the ACK transmitted from the slave node 20. Note that the rewriting tool 200 can receive other ACK described below because the communication format of the communication frame is converted by the master node 10.

そして、書換ツール200は、図5に示すように、消去要求コマンドに応答したACKを受信した場合、書込要求コマンドをマスタノード10に対して送信する。この書込要求コマンドは、制御プログラムが消去されたROMに、新たな制御プログラムである書込みデータの書込みを要求するコマンドである。また、書込要求コマンドは、制御プログラムの書換えを行うために用いられるものであり、書換用データに相当する。つまり、書込要求コマンドは、書換用データの一つと言える。   Then, as illustrated in FIG. 5, the rewrite tool 200 transmits a write request command to the master node 10 when receiving an ACK in response to the erase request command. This write request command is a command for requesting writing of write data as a new control program to the ROM from which the control program has been erased. The write request command is used for rewriting the control program and corresponds to rewrite data. That is, it can be said that the write request command is one of the rewrite data.

ステップS22では、書込要求コマンドを受信したか否かを判定する。マスタノード10は、スレーブノード20に対する書込要求コマンドを受信したか否かを判定する。マスタノード10は、受信した通信フレームに書込要求コマンドとスレーブノード20を示すID情報とが含まれているか否かに基づいて、スレーブノード20に対する書込要求コマンドを受信したか否かを判定する。   In step S22, it is determined whether a write request command has been received. The master node 10 determines whether a write request command for the slave node 20 has been received. The master node 10 determines whether or not a write request command for the slave node 20 has been received based on whether or not the received communication frame includes a write request command and ID information indicating the slave node 20. To do.

そして、マスタノード10は、書込要求コマンドとスレーブノード20を示すID情報とが含まれている場合、スレーブノード20に対する書込要求コマンドを受信したと判定してステップS23へ進む。また、マスタノード10は、書込要求コマンド又はスレーブノード20を示すID情報が含まれていない場合、スレーブノード20に対する書込要求コマンドを受信したと判定せずにステップS22を繰り返す。   If the write request command and the ID information indicating the slave node 20 are included, the master node 10 determines that the write request command for the slave node 20 has been received, and proceeds to step S23. Further, when the write request command or the ID information indicating the slave node 20 is not included, the master node 10 repeats step S22 without determining that the write request command for the slave node 20 has been received.

なお、書換ツール200は、書込要求コマンドに続いて、スレーブノード20に対する書込対象データと、スレーブノード20を示すID情報が含まれている通信フレームを送信する。よって、書換ツール200は、スレーブノード20に対する書込要求コマンドを送信し、スレーブノード20からのACKを含む通信フレームを受信すると、スレーブノード20に対する書込対象データを含む通信フレームを送信する。   The rewrite tool 200 transmits a communication frame including data to be written to the slave node 20 and ID information indicating the slave node 20 following the write request command. Therefore, when the rewrite tool 200 transmits a write request command to the slave node 20 and receives a communication frame including ACK from the slave node 20, the rewrite tool 200 transmits a communication frame including write target data to the slave node 20.

このため、マスタノード10は、図5のステップS221に示すように、書換ツール200から送信された書込要求コマンドと書込対象データを受信する(受信部)。そして、マスタノード10は、書込要求コマンドと書込対象データを受信した後に、ステップS23を実行する。   Therefore, the master node 10 receives the write request command and the write target data transmitted from the rewrite tool 200 as shown in step S221 in FIG. 5 (receiving unit). Then, after receiving the write request command and the write target data, the master node 10 executes Step S23.

なお、書込対象データは、消去処理したROMに書込むデータである。よって、書込対象データは、新しい制御プログラムに相当する。また、書込対象データは、制御プログラムの書換えを行うために用いられるものであり、書換用データに相当する。つまり、書込対象データは、書換用データの一つと言える。   The write target data is data to be written to the erased ROM. Therefore, the write target data corresponds to a new control program. The write target data is used to rewrite the control program and corresponds to rewrite data. That is, it can be said that the write target data is one of the data for rewriting.

ステップS23では、ステップS17と同様に、スレーブノード20に対応した通信フォーマットに変換する(変換部)。しかしながら、ステップS23では、書込要求コマンドを含んでいる通信フレームと、書込対象データを含んでいる通信フレームの通信フォーマットを変換する。   In step S23, as in step S17, the communication format corresponding to the slave node 20 is converted (converter). However, in step S23, the communication format of the communication frame including the write request command and the communication frame including the write target data is converted.

ステップS24では、スレーブノードへ書込要求コマンドを中継する(送信部)。マスタノード10は、図5に示すように、中継プログラムを実行することで、ステップS23で変換した通信フレームをスレーブノード20へ送信する。ここでは、書換ツール200から送信されたスレーブノード20に対する書込要求コマンドが含まれた通信フレームと、書換ツール200から送信されたスレーブノード20に対する書込対象データが含まれた通信フレームとを送信する。なお、図5のステップS24では、書込対象データを省略している。   In step S24, the write request command is relayed to the slave node (transmission unit). As illustrated in FIG. 5, the master node 10 transmits the communication frame converted in step S <b> 23 to the slave node 20 by executing the relay program. Here, the communication frame including the write request command for the slave node 20 transmitted from the rewrite tool 200 and the communication frame including the write target data for the slave node 20 transmitted from the rewrite tool 200 are transmitted. To do. Note that data to be written is omitted in step S24 of FIG.

このように、マスタノード10は、スレーブノード20に対して、書込対象データを送信することで、スレーブノード20の制御プログラムを新しい制御プログラムに書換える。言い換えると、スレーブノード20は、書込対象データを含む通信フレームを受信した場合、書込対象データをROMに書込む(書込み処理)。これによって、スレーブノード20は、制御プログラムを新しい制御プログラムに書換える。そして、スレーブノード20は、書込対象データをROMに書込んだことを書換ツール200に伝えるために、ACKを返信する。   In this way, the master node 10 rewrites the control program of the slave node 20 to a new control program by transmitting the write target data to the slave node 20. In other words, when the slave node 20 receives the communication frame including the write target data, the slave node 20 writes the write target data in the ROM (write process). As a result, the slave node 20 rewrites the control program with a new control program. Then, the slave node 20 returns an ACK in order to notify the rewriting tool 200 that the write target data has been written in the ROM.

ステップS25では、スレーブノードからACKを受信したか否かを判定する。マスタノード10は、スレーブノード20からACKを受信したと判定した場合にステップS26へ進み、スレーブノードからACKを受信したと判定してない場合にステップS25を繰り返す。   In step S25, it is determined whether or not an ACK has been received from the slave node. The master node 10 proceeds to step S26 when it is determined that ACK is received from the slave node 20, and repeats step S25 when it is not determined that ACK is received from the slave node.

ステップS26では、ステップS20と同様に、書換ツール200に対応した通信フォーマットに変換する(応答変換部)。ステップS27では、ステップS21と同様に、書換ツールへACKを中継する。   In step S26, as in step S20, the communication format corresponding to the rewriting tool 200 is converted (response conversion unit). In step S27, ACK is relayed to the rewriting tool, as in step S21.

そして、書換ツール200は、図5に示すように、書込要求コマンド又は書込対象データに応答したACKを受信した場合、ベリファイ要求コマンドをマスタノード10に対して送信する。このベリファイ要求コマンドは、新たな制御プログラムが正常に書込まれたか否かを検証することを要求するコマンドである。また、ベリファイ要求コマンドは、制御プログラムの書換えを行うために用いられるため、書換用データに相当するとみなすこともできる。つまり、ベリファイ要求コマンドは、書換用データの一つとみなすこともできる。   Then, as illustrated in FIG. 5, when the rewrite tool 200 receives the write request command or the ACK in response to the write target data, the rewrite tool 200 transmits a verify request command to the master node 10. This verify request command is a command for requesting to verify whether or not a new control program has been normally written. Further, since the verify request command is used for rewriting the control program, it can be regarded as corresponding to rewriting data. That is, the verify request command can be regarded as one of the rewrite data.

ステップS28では、ベリファイ要求コマンドを受信したか否かを判定する。マスタノード10は、スレーブノード20に対するベリファイ要求コマンドを受信したか否かを判定する。マスタノード10は、受信した通信フレームにベリファイ要求コマンドとスレーブノード20を示すID情報とが含まれているか否かに基づいて、スレーブノード20に対するベリファイ要求コマンドを受信したか否かを判定する。   In step S28, it is determined whether a verify request command has been received. The master node 10 determines whether a verify request command for the slave node 20 has been received. The master node 10 determines whether or not a verify request command for the slave node 20 has been received based on whether or not the received communication frame includes a verify request command and ID information indicating the slave node 20.

そして、マスタノード10は、ベリファイ要求コマンドとスレーブノード20を示すID情報とが含まれている場合、スレーブノード20に対するベリファイ要求コマンドを受信したと判定してステップS29へ進む。また、マスタノード10は、ベリファイ要求コマンド又はスレーブノード20を示すID情報が含まれていない場合、スレーブノード20に対するベリファイ要求コマンドを受信したと判定せずにステップS28を繰り返す。つまり、マスタノード10は、図5のステップS281に示すように、書換ツール200から送信されたベリファイ要求コマンドを受信した後に、ステップS29を実行する。   If the verify request command and the ID information indicating the slave node 20 are included, the master node 10 determines that the verify request command for the slave node 20 has been received, and proceeds to step S29. Further, when the verification request command or the ID information indicating the slave node 20 is not included, the master node 10 repeats Step S28 without determining that the verification request command for the slave node 20 has been received. That is, as shown in step S281 in FIG. 5, the master node 10 executes step S29 after receiving the verify request command transmitted from the rewriting tool 200.

ステップS29では、ステップS17と同様に、スレーブノード20に対応した通信フォーマットに変換する。しかしながら、ステップS29では、ベリファイ要求コマンドを含んでいる通信フレームの通信フォーマットを変換する。なお、ステップS29は、変換部に相当するとみなすこともできる。   In step S29, the communication format corresponding to the slave node 20 is converted as in step S17. However, in step S29, the communication format of the communication frame including the verify request command is converted. Note that step S29 can also be regarded as equivalent to a conversion unit.

ステップS30では、スレーブノードへベリファイ要求コマンドを中継する。マスタノード10は、図5に示すように、中継プログラムを実行することで、ステップS29で変換した通信フレームをスレーブノード20へ送信する。当然ながら、この通信フレームには、書換ツール200から送信されたスレーブノード20に対するベリファイ要求コマンドが含まれている。なお、ステップS30は、送信部に相当するとみなすこともできる。   In step S30, the verify request command is relayed to the slave node. As illustrated in FIG. 5, the master node 10 transmits the communication frame converted in step S <b> 29 to the slave node 20 by executing the relay program. Of course, this communication frame includes a verify request command for the slave node 20 transmitted from the rewriting tool 200. Note that step S30 can also be regarded as corresponding to a transmission unit.

図5に示すように、スレーブノード20は、ベリファイ要求コマンドを受信すると、このベリファイ要求コマンドを実行することで、自ノード20の書換えが正常に完了したか検証する(検証処理)。そして、スレーブノード20は、自ノード20の書換えが正常に完了したことを書換ツール200に伝えるために、ACKを返信する。   As shown in FIG. 5, when the slave node 20 receives the verify request command, the slave node 20 executes the verify request command to verify whether the rewriting of the node 20 has been normally completed (verification process). Then, the slave node 20 returns an ACK in order to notify the rewriting tool 200 that the rewriting of the own node 20 has been normally completed.

ステップS31では、スレーブノードからACKを受信したか否かを判定する。マスタノード10は、スレーブノード20からACKを受信したと判定した場合にステップS32へ進み、スレーブノードからACKを受信したと判定してない場合にステップS31を繰り返す。   In step S31, it is determined whether or not an ACK has been received from the slave node. The master node 10 proceeds to step S32 when it is determined that ACK is received from the slave node 20, and repeats step S31 when it is not determined that ACK is received from the slave node.

ステップS32では、ステップS20と同様に、書換ツール200に対応した通信フォーマットに変換する。ステップS33では、ステップS21と同様に、書換ツールへACKを中継する。   In step S32, the communication format corresponding to the rewriting tool 200 is converted as in step S20. In step S33, ACK is relayed to the rewriting tool as in step S21.

以上のように、マスタノード10は、書換ツール200から書換用データだけでなく、スレーブノード20が書換用データを受信可能となるように通信態様に変換するための中継プログラムを受信する。また、マスタノード10は、受信した中継プログラムを一時的にRAM13に保存しておく。   As described above, the master node 10 receives not only the rewriting data from the rewriting tool 200 but also the relay program for converting the communication mode so that the slave node 20 can receive the rewriting data. Further, the master node 10 temporarily stores the received relay program in the RAM 13.

そして、マスタノード10は、RAM13に保存している中継プログラムを用いて通信態様を変換して、変換された後の通信態様で、書換用データをスレーブノード20に送信することで、スレーブノード20のプログラムを書込対象データに書換える。このため、マスタノード10は、スレーブノード20の通信態様が変わったとしても、スレーブノード20が書換用データを受信可能となるように通信態様を変換できる。よって、マスタノード10は、書込対象データの誤書込みの発生を抑制できる。また、マスタノード10は、スレーブノード20の通信態様が変わるたびにマスタノード10の設計変更を行う場合よりも、開発工数を低減できる。   Then, the master node 10 converts the communication mode using the relay program stored in the RAM 13, and transmits the rewriting data to the slave node 20 in the communication mode after the conversion, whereby the slave node 20 Rewrite the program to the data to be written. For this reason, even if the communication mode of the slave node 20 changes, the master node 10 can change the communication mode so that the slave node 20 can receive the rewriting data. Therefore, the master node 10 can suppress the occurrence of erroneous writing of the write target data. Further, the master node 10 can reduce the development man-hours compared to the case where the design change of the master node 10 is performed every time the communication mode of the slave node 20 changes.

さらに、マスタノード10は、スレーブノード20の通信態様が変わったとしても、設計変更が不要である。このため、マスタノード10の品番数が増えることを抑えることができ、管が煩雑になることを抑制できる。   Furthermore, the master node 10 does not require a design change even if the communication mode of the slave node 20 changes. For this reason, it can suppress that the product number of the master node 10 increases, and can suppress that a pipe | tube becomes complicated.

なお、本実施形態では、一例として、マスタノード10が中継プログラムを実行することで通信プロトコル及び通信フォーマットを変換する例を採用した。しかしながら、本発明はこれに限定されない。上記のように、マスタノード10とスレーブノード20とは、リプロプログラムのバージョンや、プログラムの書換え仕様が異なる場合もある。この場合、マスタノード10は、中継プログラムを実行することで、書換え時の手順や、手続きや、データ量を変換することで、書換ツール200から送信された書換用データをスレーブノード20が受信できるようにする。同様に、マスタノード10は、中継プログラムを実行することで、書換え時の手順や、手続きや、データ量を変換することで、スレーブノード20から送信されたACKを書換ツール200が受信できるようにする。   In the present embodiment, as an example, the example in which the master node 10 converts the communication protocol and the communication format by executing the relay program is adopted. However, the present invention is not limited to this. As described above, the master node 10 and the slave node 20 may have different repro program versions and different program rewriting specifications. In this case, the master node 10 can receive the rewriting data transmitted from the rewriting tool 200 by executing the relay program to convert the rewriting procedure, procedure, and data amount. Like that. Similarly, the master node 10 executes the relay program so that the rewriting tool 200 can receive the ACK transmitted from the slave node 20 by converting the procedure, procedure, and data amount at the time of rewriting. To do.

また、マスタノード10とスレーブノード20とは、通信プロトコルは同じであるが、通信速度が異なる場合もある。この場合、マスタノード10は、中継プログラムを実行して、通信プロトコルの変換を行うことなく、通信フォーマットの変換を行うことで、書換ツール200から送信された書換用データをスレーブノード20が受信できるようにする。同様に、マスタノード10は、中継プログラムを実行して、通信プロトコルの変換を行うことなく、通信フォーマットの変換を行うことで、スレーブノード20から送信されたACKを書換ツール200が受信できるようにする。   The master node 10 and the slave node 20 have the same communication protocol but may have different communication speeds. In this case, the master node 10 can receive the rewriting data transmitted from the rewriting tool 200 by executing the relay program and converting the communication format without converting the communication protocol. Like that. Similarly, the master node 10 executes the relay program to convert the communication format without converting the communication protocol so that the rewriting tool 200 can receive the ACK transmitted from the slave node 20. To do.

つまり、中継プログラムは、スレーブノード20のプログラムを書換える際に、スレーブノード20が書換用データを受信可能となるように、スレーブノードとの通信態様を変換するものであれば採用できる。言い換えると、中継プログラムは、スレーブノード20のプログラムを書換える際に、書換用データをスレーブノード20が受信可能となるように変換する機能を有するものであれば採用できる。   That is, the relay program can be adopted as long as it converts the communication mode with the slave node so that the slave node 20 can receive the rewriting data when the program of the slave node 20 is rewritten. In other words, the relay program can be adopted as long as it has a function of converting the data for rewriting so that the slave node 20 can receive when rewriting the program of the slave node 20.

また、本実施形態では、一例として、スレーブノード20における書換えを行う際に、上記の各要求コマンドと書込対象データをスレーブノード20に送信し、これらに応答してスレーブノード20からACKを返す例を採用した。しかしながら、本発明は、これに限定されない。例えば、スレーブノード20における書換えでは、書換ツール200が認証要求コマンドなどを送信してもよい。この場合、スレーブノード20は、認証コマンドを受信すると、認証用データを書換ツール200に返信する。当然ながら、認証要求コマンドや認証用データは、上記のようにマスタノード10を介して書換ツール200やスレーブノード20に中継される。   In the present embodiment, as an example, when rewriting in the slave node 20 is performed, the above request commands and data to be written are transmitted to the slave node 20, and an ACK is returned from the slave node 20 in response thereto. An example was taken. However, the present invention is not limited to this. For example, in the rewriting in the slave node 20, the rewriting tool 200 may transmit an authentication request command or the like. In this case, when receiving the authentication command, the slave node 20 returns authentication data to the rewriting tool 200. Of course, the authentication request command and the authentication data are relayed to the rewrite tool 200 and the slave node 20 via the master node 10 as described above.

以上、本発明の好ましい実施形態について説明した。しかしながら、本発明は、上記実施形態に何ら制限されることはなく、本発明の趣旨を逸脱しない範囲において、種々の変形が可能である。以下に、本発明のその他の形態として、第2実施形態、第3実施形態に関して説明する。これらの実施形態は、夫々単独で実施することも可能であるが、適宜組み合わせて実施することも可能である。本発明は、実施形態において示された組み合わせに限定されることなく、種々の組み合わせによって実施可能である。   The preferred embodiments of the present invention have been described above. However, the present invention is not limited to the above embodiment, and various modifications can be made without departing from the spirit of the present invention. Below, 2nd Embodiment and 3rd Embodiment are demonstrated as another form of this invention. Each of these embodiments can be implemented independently, but can also be implemented in combination as appropriate. The present invention is not limited to the combinations shown in the embodiments, and can be implemented by various combinations.

(第2実施形態)
図6、図7を用いて、第2実施形態に関して説明する。なお、本実施形態では、車載制御装置としてマスタノード10aを採用する。また、本実施形態の車載制御システムは、マスタノード10aとスレーブノード20とを備えていると言える。
(Second Embodiment)
The second embodiment will be described with reference to FIGS. In the present embodiment, the master node 10a is employed as the in-vehicle control device. Moreover, it can be said that the vehicle-mounted control system of this embodiment is provided with the master node 10a and the slave node 20. FIG.

ここでは、マスタノード10aにおける、マスタノード10と異なる点を重点的に説明する。マスタノード10aは、書換え時にスレーブノード20や書換ツール200と通信する際に、中継プログラムを実行するのではなく、通信ドライバを実行する点がマスタノード10と異なる。つまり、中継プログラムは、上記実施形態の中継プログラムと異なり、通信を行うための機能を含んでいない。   Here, differences from the master node 10 in the master node 10a will be described mainly. The master node 10a is different from the master node 10 in that a communication driver is executed instead of executing a relay program when communicating with the slave node 20 or the rewriting tool 200 at the time of rewriting. That is, unlike the relay program of the above embodiment, the relay program does not include a function for performing communication.

車載制御システムは、上記のように、第1通信バス31を介して行われる通信と、第2通信バス32を介して行われる通信とで通信態様が異なる。詳述すると、マスタノード10aと書換ツール200との間での通信プロトコルは、マスタノード10aとスレーブノード20との間での通信プロトコルと同じである。しかしながら、マスタノード10aと書換ツール200との間での通信速度は、マスタノード10aとスレーブノード20との間での通信速度と異なる。   As described above, the vehicle-mounted control system differs in communication mode between communication performed via the first communication bus 31 and communication performed via the second communication bus 32. More specifically, the communication protocol between the master node 10a and the rewriting tool 200 is the same as the communication protocol between the master node 10a and the slave node 20. However, the communication speed between the master node 10a and the rewriting tool 200 is different from the communication speed between the master node 10a and the slave node 20.

このため、マスタノード10aは、書換え時に、書換ツール200からスレーブノード20への書換用データを中継する場合、及びスレーブノード20から書換ツール200へのACKを中継する場合、通信フレームの通信フォーマットを変える必要がある。言い換えると、マスタノード10aは、書換え時に、通信プロトコルを変換する必要はないが、通信フレームの通信フォーマットを変える必要がある。なお、マスタノード10aは、マスタノード10と同様の構成要素を備えている。よって、マスタノード10aの構成に関しては、説明を省略する。   Therefore, when the master node 10a relays the data for rewriting from the rewriting tool 200 to the slave node 20 at the time of rewriting, and when relaying the ACK from the slave node 20 to the rewriting tool 200, the master node 10a changes the communication format of the communication frame. Need to change. In other words, the master node 10a does not need to convert the communication protocol at the time of rewriting, but needs to change the communication format of the communication frame. Note that the master node 10 a includes the same components as the master node 10. Therefore, the description of the configuration of the master node 10a is omitted.

図6のフローチャートと図7のフローチャートは、上記図3、図4に対応しており、マスタノード10aの一連の処理動作を示している。つまり、マスタノード10aは、図6のステップS24aの処理を終了すると、図7のステップS25aへと進む。なお、図6、図7では、図3、図4と同じ処理に対して同じステップ番号を付与して詳しい説明を省略する。   The flowchart of FIG. 6 and the flowchart of FIG. 7 correspond to FIG. 3 and FIG. 4, and show a series of processing operations of the master node 10a. That is, when the master node 10a finishes the process of step S24a in FIG. 6, the process proceeds to step S25a in FIG. 6 and 7, the same step numbers are assigned to the same processes as those in FIGS. 3 and 4, and detailed description thereof is omitted.

マスタノード10aは、例えば電源が供給されると図6のフローチャートに示す処理をスタートする。よって、マスタノード10aは、例えば電源が供給されると、ステップS10、S11、S12の順に実行して、図6のステップS13を実行する。なお、ステップS10〜S13の間、マスタノード10aのプログラムカウンタは、上記実施形態と同様にROM12となっている。よって、マスタノード10aは、ROM12に記憶されている通信ドライバを実行することで、スレーブノード20や書換ツール200と通信できるようになっている。   For example, when power is supplied, the master node 10a starts the processing shown in the flowchart of FIG. Therefore, for example, when power is supplied, the master node 10a executes steps S10, S11, and S12 in this order, and executes step S13 in FIG. During steps S10 to S13, the program counter of the master node 10a is the ROM 12 as in the above embodiment. Therefore, the master node 10 a can communicate with the slave node 20 and the rewriting tool 200 by executing the communication driver stored in the ROM 12.

マスタノード10aは、ステップS13の後、プログクラムカウンタの変更を行うことなく、ステップS15へ進む。これは、マスタノード10aが、書換え時に、中継プログラムではなく通信ドライバを実行して、スレーブノード20や書換ツール200と通信するためである。   After step S13, the master node 10a proceeds to step S15 without changing the program counter. This is because the master node 10a communicates with the slave node 20 and the rewriting tool 200 by executing a communication driver instead of the relay program at the time of rewriting.

ステップS16aでは、ステップS16と同様に、消去要求コマンドを受信したか否かを判定する。しかしながら、マスタノード10aは、ステップS16aの判定を行う際、プログラムカウンタがROM12となっている。なお、マスタノード10aは、以下のステップS19a、S22a、S25a、S28a、S31aでも同様に、プログラムカウンタがROM12となっている。   In step S16a, as in step S16, it is determined whether an erase request command has been received. However, when the master node 10a makes the determination in step S16a, the program counter is the ROM 12. In the master node 10a, the program counter is the ROM 12 in the following steps S19a, S22a, S25a, S28a, and S31a as well.

そして、マスタノード10aは、ステップS16aでYES判定した場合、ステップS17を実行するまでの間に、プログラムカウンタをRAM13へ変更する。よって、ステップS17では、マスタノード10aは、上記実施形態と同様に、中継プログラムを実行することで、消去要求コマンドを含む通信フレームの通信フォーマットを変更する(変換部)。また、マスタノード10aは、通信フォーマットを変更した後、ステップS18aを実行するまでの間に、プログラムカウンタをROM12へ戻す。   If the determination is YES in step S16a, the master node 10a changes the program counter to the RAM 13 until step S17 is executed. Therefore, in step S17, the master node 10a changes the communication format of the communication frame including the erasure request command by executing the relay program as in the above embodiment (conversion unit). The master node 10a returns the program counter to the ROM 12 after changing the communication format and before executing step S18a.

つまり、マスタノード10aは、通信フォーマットを変更するときだけ、プログラムカウンタをRAM13に変更し、通信フォーマットの変更が完了すると、プログラムカウンタをROM12に戻す。よって、マスタノード10aは、ステップS20、S23、S26、S29、S32を実行するときだけプログラムカウンタをRAM13に変更し、これらの処理が完了すると、プログラムカウンタをROM12に戻す。なお、マスタノード10aは、変換部に相当するステップS17、S20、S23、S26、S29、S32で通信プロトコルの変換を行うことなく通信フォーマットを変換する。   That is, the master node 10a changes the program counter to the RAM 13 only when the communication format is changed, and returns the program counter to the ROM 12 when the change of the communication format is completed. Therefore, the master node 10a changes the program counter to the RAM 13 only when executing steps S20, S23, S26, S29, and S32, and returns the program counter to the ROM 12 when these processes are completed. The master node 10a converts the communication format without converting the communication protocol in steps S17, S20, S23, S26, S29, and S32 corresponding to the conversion unit.

ステップS18aでは、ステップS18と同様に、スレーブノード20へ消去要求コマンドを中継する。しかしながら、マスタノード10aは、ステップS18aを行う際、プログラムカウンタがROM12となっている。よって、マスタノード10aは、中継ドライバではなく通信ドライバを実行して、通信フォーマットが変換された通信フレームをスレーブノード20へ送信する。   In step S18a, the erasure request command is relayed to the slave node 20 as in step S18. However, when the master node 10a performs step S18a, the program counter is the ROM 12. Therefore, the master node 10a executes the communication driver instead of the relay driver, and transmits the communication frame whose communication format is converted to the slave node 20.

なお、マスタノード10aは、ステップS24a、S30aにおいても同様に、中継ドライバではなく通信ドライバを実行して、通信フォーマットが変換された通信フレームをスレーブノード20へ送信する。さらに、マスタノード10aは、ステップS21a、S27a、S33aにおいて、中継ドライバではなく通信ドライバを実行して、書換ツール200へ通信フレームを送信する。   Similarly, in steps S24a and S30a, the master node 10a executes the communication driver instead of the relay driver, and transmits the communication frame whose communication format has been converted to the slave node 20. Further, the master node 10a transmits a communication frame to the rewriting tool 200 by executing the communication driver instead of the relay driver in steps S21a, S27a, and S33a.

マスタノード10aは、マスタノード10と同様の効果を奏することができる。さらに、マスタノード10aが実行する中継プログラムは、通信機能を有していないため、マスタノード10が実行する中継プログラムよりも容量が小さい。このため、マスタノード10aは、中継プログラムを保存するためにRAM13に確保すべき容量を低減できる。   The master node 10a can achieve the same effects as the master node 10. Furthermore, since the relay program executed by the master node 10a does not have a communication function, the capacity is smaller than that of the relay program executed by the master node 10. For this reason, the master node 10a can reduce the capacity to be secured in the RAM 13 in order to store the relay program.

(第3実施形態)
図8、図9、図10を用いて、第3実施形態に関して説明する。なお、本実施形態では、車載制御装置としてマスタノード10bを採用する。また、本実施形態の車載制御システムは、マスタノード10bとスレーブノード20bとを備えていると言える。車載制御システムは、例えばECU(Electronic Control Unit)などである。よって、マスタノード10bとスレーブノード20bとは、同じECUに搭載されている。
(Third embodiment)
The third embodiment will be described with reference to FIGS. 8, 9, and 10. FIG. In the present embodiment, the master node 10b is employed as the in-vehicle control device. Moreover, it can be said that the vehicle-mounted control system of this embodiment is provided with the master node 10b and the slave node 20b. The in-vehicle control system is, for example, an ECU (Electronic Control Unit). Therefore, the master node 10b and the slave node 20b are mounted on the same ECU.

スレーブノード20bは、スレーブノード20と同様に、実行モードとして、制御モードとリプロモードとを有している。なお、スレーブノード20bの実行モードは、スレーブ側実行モードに相当する。   Similar to the slave node 20, the slave node 20b has a control mode and a repro mode as execution modes. The execution mode of the slave node 20b corresponds to the slave side execution mode.

一方、マスタノード10bは、マスタノード10と同様に、実行モードとして、制御モードとリプロモードとを有している。マスタノード10bは、所定の条件を満たすか否かによって、自ノード10bの実行モードを制御モードとリプロモードとのいずれかに決定する(モード決定部)。   On the other hand, like the master node 10, the master node 10b has a control mode and a repro mode as execution modes. The master node 10b determines the execution mode of the own node 10b to be either the control mode or the repro mode depending on whether or not a predetermined condition is satisfied (mode determination unit).

なお、マスタノード10bの実行モードは、マスタ側実行モードに相当する。また、マスタノード10bが実装する制御プログラムは、マスタ用プログラムに相当する。さらに、マスタノード10bが実装するリプロプログラムは、マスタ用リプロプログラムに相当する。   The execution mode of the master node 10b corresponds to the master side execution mode. Further, the control program implemented by the master node 10b corresponds to a master program. Furthermore, the repro program implemented by the master node 10b corresponds to a master repro program.

マスタノード10bとスレーブノード20bとは、実行モードが不一致の場合、適切な動作ができない。例えば、マスタノード10bが制御モードでスレーブノード20bがリプロモードの場合、スレーブノード20bは、制御モード時にマスタノード10bに送信する信号を送信しなくなる。よって、マスタノード10bは、本来であればスレーブノード20bから送信されてくる信号を取得できないため、制御モードでの適切な動作ができなくなる。なお、マスタノード10bは、例えば、スレーブノード20bが制御モード時に送信する信号を取得できたか否かで、スレーブノード20bがリプロモードであるか否かを判定できる。   When the execution mode does not match between the master node 10b and the slave node 20b, an appropriate operation cannot be performed. For example, when the master node 10b is in the control mode and the slave node 20b is in the repro mode, the slave node 20b does not transmit a signal to be transmitted to the master node 10b in the control mode. Therefore, the master node 10b cannot acquire a signal transmitted from the slave node 20b if it is originally, and thus cannot perform an appropriate operation in the control mode. The master node 10b can determine whether or not the slave node 20b is in the repro mode based on, for example, whether or not the signal transmitted by the slave node 20b in the control mode can be acquired.

ここで、図9に示すように、マスタノード10bの処理動作に関して説明する。マスタノード10bは、例えば電源が供給されると図9のフローチャートに示す処理をスタートする。なお、マスタノード10bは、図9のステップS21の処理を終了すると、図10のステップS22へと進む。また、図9、図10では、図3、図4と同じ処理に対して同じステップ番号を付与して詳しい説明を省略する。   Here, as shown in FIG. 9, the processing operation of the master node 10b will be described. For example, when power is supplied, the master node 10b starts the processing shown in the flowchart of FIG. When the master node 10b completes the process of step S21 in FIG. 9, the process proceeds to step S22 in FIG. 9 and 10, the same step numbers are assigned to the same processes as those in FIGS. 3 and 4, and detailed description thereof is omitted.

マスタノード10bは、上記実施形態と同様に、ステップS10を実行する。そして、マスタノード10bは、ステップS40で、マスタ側実行モードをリプロモードへ遷移する(モード決定部)。つまり、マスタノード10bは、中継プログラムを受信すると、マスタ側実行モードをリプロモードに決定する。言い換えると、マスタノード10bは、中継プログラムを受信すると、所定の条件を満たしたとみなして、実行モードをリプロモードに決定する。   The master node 10b executes step S10 as in the above embodiment. Then, in step S40, the master node 10b transitions the master side execution mode to the repro mode (mode determination unit). That is, when receiving the relay program, the master node 10b determines the master side execution mode to be the repro mode. In other words, when the master node 10b receives the relay program, the master node 10b considers that a predetermined condition is satisfied, and determines the execution mode to the repro mode.

なお、マスタノード10bは、ステップS40の後、上記実施形態と同様に、ステップS11以降の処理を実行する。そして、マスタノード10bは、リプロプログラムを実行することで、中継プログラムをRAM13に一時的に保存してもよい。   Note that, after step S40, the master node 10b executes the processing from step S11 onward as in the above embodiment. Then, the master node 10b may temporarily store the relay program in the RAM 13 by executing the repro program.

マスタノード10bは、上記実施形態と同様の効果を奏することができる。さらに、マスタノード10bは、スレーブノード20bとの間で相互監視を行う場合であっても上記実施形態と同様の効果を奏することができる。   The master node 10b can achieve the same effects as in the above embodiment. Furthermore, even if the master node 10b performs mutual monitoring with the slave node 20b, the same effects as in the above embodiment can be obtained.

また、車載制御装置100は、車載制御システムそのものであってもよく、車載制御システムに含まれていてもよい。   Moreover, the vehicle-mounted control apparatus 100 may be the vehicle-mounted control system itself, or may be included in the vehicle-mounted control system.

10,10a,10b…マスタノード、11……CPU、12…ROM、13…RAM、14…第1データ送受信部、15…第1データ送受信部、20,20b…スレーブノード、31…第1通信バス、32…第2通信バス、100…車載制御装置、200…書換ツール   DESCRIPTION OF SYMBOLS 10, 10a, 10b ... Master node, 11 ... CPU, 12 ... ROM, 13 ... RAM, 14 ... 1st data transmission / reception part, 15 ... 1st data transmission / reception part, 20, 20b ... Slave node, 31 ... 1st communication Bus 32, second communication bus 100, on-vehicle control device 200, rewriting tool

Claims (8)

車両の外部に設けられた外部装置(200)から送信された書込対象データを含む書換用データを、車載ネットワークにおけるスレーブノード(20)に送信して、スレーブノードのプログラムを書換える車載制御装置であって、
前記外部装置から前記書換用データと、前記スレーブノードのプログラムを書換える際に前記スレーブノードが前記書換用データを受信可能となるように、前記スレーブノードとの通信態様を変換するための中継プログラムを受信する受信部(S121、S161、S221、S281)と、
前記受信部で受信した前記中継プログラムを一時的に揮発性記憶部に保存する格納部(S13)と、
前記スレーブノードのプログラムを書換える際に、前記スレーブノードが前記書換用データを受信可能となるように、前記格納部に保存した前記中継プログラムを用いて前記通信態様を変換する変換部(S17、S23、S29)と、
前記スレーブノードのプログラムを書換える際に、前記変換部で変換された後の前記通信態様で、前記外部装置から受信した前記書換用データを前記スレーブノードに送信する送信部(S18、S18a、S24、S24a、S30、S30a)と、備えている車載制御装置。
A vehicle-mounted control device that rewrites data for rewriting including data to be written transmitted from an external device (200) provided outside the vehicle to the slave node (20) in the vehicle-mounted network and rewrites the program of the slave node. Because
Relay program for converting the communication mode with the slave node so that the slave node can receive the rewrite data when rewriting the rewrite data and the slave node program from the external device Receiving unit (S121, S161, S221, S281),
A storage unit (S13) that temporarily stores the relay program received by the reception unit in a volatile storage unit;
A conversion unit (S17, which converts the communication mode using the relay program stored in the storage unit so that the slave node can receive the rewriting data when the slave node program is rewritten. S23, S29),
Transmitters (S18, S18a, S24) that transmit the rewrite data received from the external device to the slave node in the communication mode after being converted by the converter when the slave node program is rewritten. , S24a, S30, S30a), and a vehicle-mounted control device provided.
前記中継プログラムは、前記通信態様を変換するための機能に加えて、前記スレーブノードとの通信を行うための機能を、さらに含んでおり、
前記送信部は、前記中継プログラムを用いて、前記書換用データを前記スレーブノードに送信する請求項1に記載の車載制御装置。
The relay program further includes a function for performing communication with the slave node, in addition to a function for converting the communication mode.
The in-vehicle control device according to claim 1, wherein the transmission unit transmits the rewriting data to the slave node using the relay program.
前記変換部は、前記通信態様として、前記書換用データの通信フォーマットを変換する請求項1又は2に記載の車載制御装置。   The in-vehicle control device according to claim 1, wherein the conversion unit converts a communication format of the rewrite data as the communication mode. 前記変換部は、前記通信態様として、前記書換用データを送信する際の通信プロトコルを変換する請求項1又は2に記載の車載制御装置。   The in-vehicle control device according to claim 1, wherein the conversion unit converts a communication protocol when transmitting the rewriting data as the communication mode. 前記スレーブノードとの通信を行うための通信ドライバを、さらに備えており、
前記変換部は、前記通信態様として、前記書換用データの通信フォーマットを変換し、
前記送信部は、前記通信ドライバを用いて、前記変換部で変換された後の前記通信フォーマットで前記書換用データを前記スレーブノードに送信する請求項1に記載の車載制御装置。
A communication driver for performing communication with the slave node;
The conversion unit converts the communication format of the rewrite data as the communication mode,
The in-vehicle control device according to claim 1, wherein the transmission unit transmits the rewriting data to the slave node in the communication format after being converted by the conversion unit using the communication driver.
前記スレーブノードが、スレーブ側実行モードとして、前記プログラムを実行して制御を行う制御モードと、前記プログラムに基づいた制御を行うことなくリプロプログラムを実行して前記プログラムの書き換えを行うリプロモードとを有しており、
前記車載制御装置は、
マスタ側実行モードとして、マスタ用プログラムを実行して制御を行う制御モードと、前記マスタ用プログラムに基づいた制御を行うことなくマスタ用リプロプログラムを実行して前記マスタ用プログラムの書き換えを行うリプロモードとのいずれかに決定するモード決定部とを、備えており、
前記モード決定部は、前記受信部で前記中継プログラムのダウンロード要求を受信すると、前記マスタ側実行モードを前記リプロモードに決定する請求項1乃至5のいずれか一項に記載の車載制御装置。
The slave node executes, as a slave side execution mode, a control mode in which the program is executed and controlled, and a repro mode in which the repro program is executed without performing control based on the program and the program is rewritten. Have
The in-vehicle control device is
As a master side execution mode, a control mode for executing and controlling the master program, and a repro mode for executing the master repro program without performing control based on the master program and rewriting the master program And a mode determination unit that determines any of
The in-vehicle control device according to any one of claims 1 to 5, wherein the mode determination unit determines the master side execution mode to the repro mode when the reception unit receives a download request for the relay program.
前記格納部は、前記受信部で前記中継プログラムを受信すると、前記マスタ用リプロプログラムを用いて、前記受信部で受信した前記中継プログラムを一時的に揮発性記憶部に保存する請求項6に記載の車載制御装置。   7. The storage unit according to claim 6, wherein when the receiving unit receives the relay program, the storage unit temporarily stores the relay program received by the receiving unit in a volatile storage unit using the master repro program. In-vehicle control device. 前記スレーブノードは、前記書換用データを受信すると、前記外部装置に対する応答データを返信するものであり、
前記中継プログラムは、前記スレーブノードのプログラムを書換える際に前記外部装置が前記応答データを受信可能となるように、前記外部装置との通信態様を変換する機能を、さらに含んでおり、
前記車載制御装置は、
前記スレーブノードのプログラムを書換える際に、前記応答データを受信して、前記外部装置が前記応答データを受信可能となるように、前記格納部に保存した前記中継プログラムを用いて前記通信態様を変換する応答変換部(S20、S26、S32)を、さらに備えた請求項1乃至6のいずれか一項に記載の車載制御装置。
When the slave node receives the rewrite data, it returns response data to the external device,
The relay program further includes a function of converting a communication mode with the external device so that the external device can receive the response data when rewriting the program of the slave node.
The in-vehicle control device is
When rewriting the program of the slave node, the communication mode is set using the relay program stored in the storage unit so that the response data is received and the external device can receive the response data. The vehicle-mounted control apparatus as described in any one of Claims 1 thru | or 6 further provided with the response conversion part (S20, S26, S32) to convert.
JP2017018667A 2016-02-26 2017-02-03 In-vehicle control device Active JP6696452B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
DE102017202280.9A DE102017202280A1 (en) 2016-02-26 2017-02-14 VEHICLE CONTROL DEVICE

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2016035987 2016-02-26
JP2016035987 2016-02-26

Publications (2)

Publication Number Publication Date
JP2017157202A true JP2017157202A (en) 2017-09-07
JP6696452B2 JP6696452B2 (en) 2020-05-20

Family

ID=59809926

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017018667A Active JP6696452B2 (en) 2016-02-26 2017-02-03 In-vehicle control device

Country Status (1)

Country Link
JP (1) JP6696452B2 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07311603A (en) * 1994-05-16 1995-11-28 Hitachi Ltd Controller for automobile
JPH1097419A (en) * 1996-09-20 1998-04-14 Denso Corp Memory write device for electronic device
JP2004186782A (en) * 2002-11-29 2004-07-02 Yazaki Corp Data write control method
JP2011044014A (en) * 2009-08-21 2011-03-03 Toyota Motor Corp Vehicle information update system, user terminal and in-vehicle device
JP2012093961A (en) * 2010-10-27 2012-05-17 Omron Automotive Electronics Co Ltd Control apparatus and method, and program write system
JP2014019280A (en) * 2012-07-18 2014-02-03 Honda Motor Co Ltd Vehicular electronic control system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07311603A (en) * 1994-05-16 1995-11-28 Hitachi Ltd Controller for automobile
JPH1097419A (en) * 1996-09-20 1998-04-14 Denso Corp Memory write device for electronic device
JP2004186782A (en) * 2002-11-29 2004-07-02 Yazaki Corp Data write control method
JP2011044014A (en) * 2009-08-21 2011-03-03 Toyota Motor Corp Vehicle information update system, user terminal and in-vehicle device
JP2012093961A (en) * 2010-10-27 2012-05-17 Omron Automotive Electronics Co Ltd Control apparatus and method, and program write system
JP2014019280A (en) * 2012-07-18 2014-02-03 Honda Motor Co Ltd Vehicular electronic control system

Also Published As

Publication number Publication date
JP6696452B2 (en) 2020-05-20

Similar Documents

Publication Publication Date Title
JP6665728B2 (en) In-vehicle update device, in-vehicle update system and communication device update method
US8095301B2 (en) On-vehicle system
WO2019216330A1 (en) In-vehicle update device, update process method, and update process program
WO2011055447A1 (en) Vehicle gateway device
JP5353545B2 (en) In-vehicle network device
JP4987760B2 (en) Relay device, communication system, and communication method
JP6060782B2 (en) Relay device
JP5979025B2 (en) Vehicle gateway device
JP2013137729A (en) Program rewriting system, control device, program distribution device, identification information storage device, and method for rewriting program
JP6524905B2 (en) Electronic control unit
JP6895373B2 (en) Electronic control device for automobiles
JP7087334B2 (en) Electronic control device
JP5630485B2 (en) In-vehicle communication system
WO2019221058A1 (en) Vehicle-mounted relay device, communication system, bus determination method, and computer program
JP6696452B2 (en) In-vehicle control device
JP2018093370A (en) On-vehicle electronic control device, on-vehicle electronic control system, and relay device
US20220244946A1 (en) Ota master, update control method, non-transitory storage medium, and vehicle
JP2009087107A (en) Control system for vehicle
WO2020195034A1 (en) Vehicle-mounted update device, update processing system, update processing method, and processing program
JP2013192092A (en) On-vehicle device
JP6528700B2 (en) In-vehicle control device and in-vehicle network including in-vehicle control device
JP2004040649A (en) On-vehicle communication equipment
JP6397763B2 (en) Control device, programming device and programming system for motor vehicle
US20220405081A1 (en) Center, ota master, method, non-transitory storage medium, and vehicle
JP7102704B2 (en) Electronic control device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190404

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200227

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20200324

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200406

R151 Written notification of patent or utility model registration

Ref document number: 6696452

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250