JP6185371B2 - Sub-microcomputer program rewriting method - Google Patents
Sub-microcomputer program rewriting method Download PDFInfo
- Publication number
- JP6185371B2 JP6185371B2 JP2013239685A JP2013239685A JP6185371B2 JP 6185371 B2 JP6185371 B2 JP 6185371B2 JP 2013239685 A JP2013239685 A JP 2013239685A JP 2013239685 A JP2013239685 A JP 2013239685A JP 6185371 B2 JP6185371 B2 JP 6185371B2
- Authority
- JP
- Japan
- Prior art keywords
- microcomputer
- sub
- program
- protocol
- 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.)
- Active
Links
Images
Description
本発明は、サブマイコンのプログラム書き換え方法に関する。 The present invention relates to a program rewriting method for a sub-microcomputer.
特開2009−205569号公報(特許文献1)には、メインマイコンが、サブマイコンの制御プログラムの書き換えを検出すると、制御プログラムをサブマイコンに転送する技術が開示されている。 Japanese Patent Laying-Open No. 2009-205569 (Patent Document 1) discloses a technique for transferring a control program to a sub-microcomputer when the main microcomputer detects rewriting of the control program of the sub-microcomputer.
しかしながら、メインマイコンとサブマイコンとが所定のシリアル通信の所定のプロトコルで制御信号を送受信する場合において、同じ所定のプロトコルでサブマイコンのプログラムの書き換えデータを伝送すると、所定のプロトコルの通信パラメータの影響を受けて、サブマイコンのプログラムの書き換えができない場合がある。 However, when the main microcomputer and the sub microcomputer transmit and receive control signals using a predetermined protocol for a predetermined serial communication, if the rewrite data of the sub microcomputer program is transmitted using the same predetermined protocol, the influence of the communication parameters of the predetermined protocol In response, the sub-microcomputer program may not be rewritten.
それゆえに、本発明の目的は、メインマイコンとサブマイコンとがシリアル通信の所定のプロトコルで制御信号を送受信する場合において、所定のプロトコルの通信パラメータの影響を受けずに、サブマイコンのプログラムの書き換えができるサブマイコンのプログラム書き換え方法を提供する。 Therefore, an object of the present invention is to rewrite the program of the sub microcomputer without being affected by the communication parameters of the predetermined protocol when the main microcomputer and the sub microcomputer transmit and receive control signals by the predetermined protocol of serial communication. A sub-microcomputer program rewriting method is provided.
上記課題を解決するために、本発明は、メインマイコンとサブマイコンがシリアル通信線で接続されたシステムにおけるサブマイコンのプログラムの書き換え方法であって、メインマイコンとサブマイコンが、通信パラメータの変更が可能な第1のプロトコルに従って、制御信号を送受信するステップと、サブマイコンのプログラムの書き換え要求が発生した場合に、メインマイコンが、サブマイコンへ一定時間以上ロウレベルの信号を送信するステップと、サブマイコンが、一定時間ロウレベルの信号を受信することによって、プログラムの書き換え要求を識別するステップと、メインマイコンが、第1のプロトコル以外の第2のプロトコルに従って、プログラム書き換え用のデータを送信するステップと、サブマイコンが、第2のプロトコルに従って、プログラム書き換え用のデータを受信するステップとを備える。 In order to solve the above problems, the present invention is a method of rewriting a program of a sub microcomputer in a system in which a main microcomputer and a sub microcomputer are connected by a serial communication line, and the main microcomputer and the sub microcomputer can change communication parameters. A step of transmitting / receiving a control signal according to a first possible protocol, a step of transmitting a low level signal to the sub-microcomputer for a predetermined time or more when a sub-microcomputer program rewrite request is generated, and a sub-microcomputer Receiving a low level signal for a certain period of time to identify a program rewrite request, and the main microcomputer transmitting program rewrite data according to a second protocol other than the first protocol; Sub-microcomputer is the second prototype According Le, and a step of receiving data for program rewrite.
本発明によれば、メインマイコンとサブマイコンとが所定のプロトコルで制御信号をシリアル通信する場合において、所定のプロトコルの通信パラメータの影響を受けずに、サブマイコンのプログラムの書き換えができる。 According to the present invention, when the main microcomputer and the sub-microcomputer serially communicate control signals with a predetermined protocol, the sub-microcomputer program can be rewritten without being affected by the communication parameters of the predetermined protocol.
以下、本発明の実施の形態について、図面を用いて説明する。
図1は、本実施の形態のハイブリッド車両のECU(Electric Control Unit)の構成を説明するための図である。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 is a diagram for explaining a configuration of an ECU (Electric Control Unit) of the hybrid vehicle according to the present embodiment.
ECU1は、ハイブリッド車両における各機器の制御を行なう。ECU1は、メインマイコン2と、サブマイコン3とを備える。
The ECU 1 controls each device in the hybrid vehicle. The ECU 1 includes a
メインマイコン2と、サブマイコン3との間は、シリアル通信線6で接続される。
メインマイコン2とサブマイコン3は、シリアル通信線6を通じて、シリアル通信の一種であるUART(Universal Asynchronous Receiver Transmitter)プロトコルによって、図2に示すように、ハイブリッド車両の制御信号を含む制御メッセージを送受信する。
The
As shown in FIG. 2, the
メインマイコン2内のプログラムおよびサブマイコン3内のプログラムを書き換える(以下、リプログラムともいう)ために、書換えツール4からCAN(Controller Area Network)バス7を介してメインマイコン2のリプログラム用のデータおよびサブマイコン3のリプログラム用のデータが転送される。
Data for reprogramming the
メインマイコン2は、受信したメインマイコン2のリプログラム用のデータに基づいて、メインマイコン2内のプログラムを書き換える。また、メインマイコン2は、シリアル通信線6を通じて、サブマイコン3にサブマイコン3のリプログラム用のデータを転送する。
The
次に、サブマイコン3へのリプログラム用のデータの転送について説明する。
図3は、ハイブリッド車両の制御用の制御メッセージを用いたリプログラム用のデータの転送の例を表わす図である。
Next, transfer of reprogramming data to the
FIG. 3 is a diagram illustrating an example of reprogramming data transfer using a control message for controlling a hybrid vehicle.
図3に示すように、制御メッセージが、ヘッダ情報と、リプログラム要求と、リプログラム用のデータ(DATA1,DATA2,DATA3,・・・)と、誤り検出のためのCHECKSUMを含む。 As shown in FIG. 3, the control message includes header information, a reprogram request, reprogram data (DATA1, DATA2, DATA3,...), And CHECKSUM for error detection.
図3に示すように、制御メッセージを用いて、リプログラム要求と、リプログラム用のデータを送信した場合には、次のような問題が生じる。 As shown in FIG. 3, when a reprogram request and reprogram data are transmitted using a control message, the following problems occur.
メインマイコン2は、サブマイコン3へ、リプログラム要求とリプログラム用のデータを含む制御メッセージを送信し、サブマイコン3は、この制御メッセージを受信することによって、サブマイコン3内のプログラムを書き換える(リプログラム)。サブマイコン3は、リプログラム終了後に、メインマイコン2に、リプログラムが終了したことを表わす制御メッセージを送信する。メインマイコン2は、この制御メッセージを受信した後、メインマイコン2内のプログラムを書き換える(リプログラム)。
The
サブマイコン3のリプログラム終了後、メインマイコン2がリプログラムする前に、電源が遮断された場合に、サブマイコン3のプログラムと、メインマイコン2のプログラムの世代が相違する。リプログラム用のデータがUARTプロトコルの通信パラメータの変更(たとえば、通信速度A→B)を含んでいる場合に、メインマイコン2側では、通信速度がAであるが、サブマイコン3側の通信速度がBとなり、メインマイコン2とサブマイコン3との間の通信ができなくなってしまう。両者の通信速度が相違することによって、それ以降、リプログラムができなくなるだけでなく、制御信号の通信もできなくなる。このような事態を避けようとするなら、リプログラム要求とリプログラム用のデータとを制御メッセージによって送信する場合には、通信パラメータの変更を不可とする必要がある。
When the power is turned off after the reprogramming of the
このような問題が起こる原因は、サブマイコン3とメインマイコン2の間の制御信号を伝送するための制御メッセージを用いてリプログラム要求とリプログラム用のデータを送信したことである。このような問題を解決するために、リプログラム専用の通信線を新たに追加することが考えられるが、コストが増加するという問題がある。
The cause of such a problem is that a reprogram request and data for reprogramming are transmitted using a control message for transmitting a control signal between the
図4は、本実施の形態のリプログラム要求と、リプログラム用のデータの転送方法を説明するための図である。 FIG. 4 is a diagram for explaining a reprogram request and a data transfer method for reprogram according to the present embodiment.
メインマイコン2は、UARTプロトコルに従って、サブマイコン3との間で制御メッセージの交換をしているときに、サブマイコン3側のリプログラムの要求が発生した場合に、一定時間(たとえば、3秒間)ロウレベルの信号を送信する。一定時間ロウレベルの信号は、UARTプロトコルの通信パラメータの影響を受けないため、前述のように電源の突然の遮断によって、送信側であるメインマイコン2と、受信側であるサブマイコン3との間でUARTプロトコルの通信パラメータが相違していたとしても、リプログラム要求をサブマイコン3に伝達することができる。
When the
UARTプロトコルに従って信号を受信しているサブマイコン3は、一定時間(1秒以下)ロウレベルの信号を受信すると、エラーの発生を検出する。つまり、UARTプロトコルに従って信号を受信しているときに、リプログラム要求の可能性を検知することができる。ここで、送信側が一定時間ハイレベルの信号を送信した場合には、UARTプロトコルに従って信号を受信する受信側では、送信側からのメッセージがないと判断して待機状態となるので、エラーを検知することができないので、ロウレベル信号に代えてハイレベル信号は使用できない。サブマイコン3は、エラーの発生を検知してから、さらに一定時間(たとえば、2秒間)ロウレベル信号を受信すると、リプログラム要求を検知することができる。
The
その後、メインマイコン2が、リプログラム用のデータを送信する。リプログラム用のデータの中にUARTプロトコルの通信パラメータを含ませることによって、UARTプロトコルに従った制御メッセージの通信のための通信パラメータを変更することができる。
Thereafter, the
このリプログラム用のデータは、UARTプロトコルの通信パラメータの影響を受けないようにするために、リプログラム専用の通信プロトコルに従って、所定の通信パラメータ(通常は変更されない)によって送信される。 In order not to be affected by the communication parameters of the UART protocol, the reprogram data is transmitted by a predetermined communication parameter (usually not changed) in accordance with a reprogram-dedicated communication protocol.
図5は、メインマイコン2によるリプログラム要求と、リプログラム用のデータの送信手順を表わすフローチャートである。
FIG. 5 is a flowchart showing a reprogram request and reprogram data transmission procedure by the
まず、メインマイコン2は、書換えツール4からサブマイコン3のプログラムの書き換え(リプログラム)要求を受信する(ステップS101)。
First, the
次に、メインマイコン2は、一定時間(たとえば、3秒間)ロウレベルの信号を送信する(ステップS102)。
Next, the
次に、メインマイコン2は、リプログラム専用の通信プロトコルに従って、所定の通信パラメータでリプログラム用のデータを送信する(ステップS103)。
Next, the
図6は、サブマイコン3によるリプログラム要求およびリプログラム用のデータの受信手順を表わすフローチャートである。
FIG. 6 is a flowchart showing a procedure for receiving a reprogram request and data for reprogram by the
まず、サブマイコン3が、受信割り込みを受ける(ステップS201)。
メインマイコン2側が送信信号をロウレベル固定にすることによって、サブマイコン3が、受信エラーがあると判定したときには(ステップS202でYES)、リプログラム要求の判定処理を行なう(ステップS203)。
First, the
When the
図7は、図6のステップS203におけるリプログラム要求の判定処理の手順を表わすフローチャートである。 FIG. 7 is a flowchart showing the procedure of the reprogram request determination process in step S203 of FIG.
ステップS301において、受信信号のレベルがロウレベルのときには、処理がステップS302に進み、受信信号のレベルがハイレベルのときには、処理がステップS303に進む。 In step S301, when the level of the received signal is low, the process proceeds to step S302. When the level of the received signal is high, the process proceeds to step S303.
ステップS302において、サブマイコン3は、ロウ時間計測カウンタをインクリメントする。
In step S302, the
ステップS303において、サブマイコン3は、ロウ時間計測カウンタをクリアして、処理を終了する。
In step S303, the
ステップS303の後のステップS304において、ロウ時間計測カウンタのカウント値が所定値(たとえば2秒)を超えた場合には、処理がステップS305に進み、カウント値が所定値以下の場合には、処理がステップS301に戻る。 In step S304 after step S303, if the count value of the low time measurement counter exceeds a predetermined value (for example, 2 seconds), the process proceeds to step S305. If the count value is equal to or less than the predetermined value, the process is performed. Returns to step S301.
ステップS305において、サブマイコン3は、リプログラム要求があると判定する。
ステップS306において、サブマイコン3は、リプログラム専用の通信プロトコルに従って、所定の通信パラメータでリプログラム用のデータを受信する。
In step S305, the
In step S306, the
以上のように、本実施の形態によれば、メインマイコン2とサブマイコン3とがUARTプロトコルで制御信号をシリアル通信する場合において、メインマイコン2が一定時間ロウレベルの信号によってリプログラムの要求をサブマイコン3へ通知し、メインマイコン2がUARTプロトコルと相違する専用のプロトコルに従って、リプログラム用のデータをサブマイコン3に転送する。これによって、UARTプロトコルの通信パラメータの影響を受けずに、リプログラム用のデータが伝送されるので、ECUに供給される電源が突然遮断されることによって、メインマイコン2とサブマイコン3の間でUARTプロトコルの通信パラメータが不整合になったとしても、サブマイコン3のプログラムの書き換えができる。
As described above, according to the present embodiment, when the
メインマイコン2とサブマイコン3の間でUARTプロトコルの通信パラメータが整合しなくなった場合には、整合するように、メインマイコン2からサブマイコン3へUARTプロトコルの通信パラメータの変更を含むリプログラム用のデータを送信すればよい。これによって、UARTプロトコルを用いたメインマイコン2とサブマイコン3の制御信号の送受信も正常に回復する。
When the communication parameters of the UART protocol do not match between the
なお、本実施の形態では、通信パラメータとして通信速度について説明したが、これに限定するものではなく、たとえば、パリティビットのビット数、ストップビットのビット数を含む。 In this embodiment, the communication speed is described as the communication parameter. However, the communication speed is not limited to this, and includes, for example, the number of parity bits and the number of stop bits.
また、上述の実施の形態では、シリアル通信の一種としてクロック非同期型の通信であるUART通信を用いた場合について説明したが、これに限定するものではない。たとえば、SCI(Communication Interface)、I2C(Inter-Integrated Circuit)、CAN、LIN(Local Interconnect Network)などのシリアル通信や、クロック同期型のシリアル通信であってもよい。クロック同期型のシリアル通信の場合、メインマイコン2が、クロック信号を一定時間ハイレベルまたはロウレベルにすることによって、サブマイコン3へリプログラム要求を伝えることとしてもよい。
In the above-described embodiment, the case where UART communication that is clock asynchronous communication is used as a kind of serial communication has been described. However, the present invention is not limited to this. For example, serial communication such as SCI (Communication Interface), I2C (Inter-Integrated Circuit), CAN, LIN (Local Interconnect Network), or clock synchronous serial communication may be used. In the case of clock synchronous serial communication, the
今回開示された実施の形態は、すべての点で例示であって制限的なものではないと考え
られるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示さ
れ、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図さ
れる。
The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.
1 ECU、2 メインマイコン、3 サブアイコン、4 書換えツール、5 CANバス、6 シリアル通信線。 1 ECU, 2 main microcomputer, 3 sub icon, 4 rewriting tool, 5 CAN bus, 6 serial communication line.
Claims (1)
前記メインマイコンと前記サブマイコンが、通信パラメータの変更が可能な第1のプロトコルに従って、制御信号を送受信するステップと、
前記サブマイコンのプログラムの書き換え要求が発生した場合に、前記メインマイコンが、前記サブマイコンへ一定時間以上ロウレベルの信号を送信するステップと、
前記サブマイコンが、一定時間ロウレベルの信号を受信することによって、前記プログラムの書き換え要求を識別するステップと、
前記メインマイコンが、前記第1のプロトコル以外のリプログラム専用の第2のプロトコルに従って、所定の通信パラメータによって、前記プログラム書き換え用のデータを送信するステップと、
前記サブマイコンが、前記第2のプロトコルに従って、所定の通信パラメータによって、前記プログラム書き換え用のデータを受信するステップとを備え、前記プログラム書き換え用のデータは、前記第1のプロトコルの通信パラメータを含む、サブマイコンのプログラム書き換え方法。 A method of rewriting a program of the sub microcomputer in a system in which a main microcomputer and a sub microcomputer are connected by a serial communication line,
The main microcomputer and the sub-microcomputer send and receive control signals according to a first protocol capable of changing communication parameters;
When a rewrite request for the program of the sub-microcomputer occurs, the main microcomputer transmits a low level signal to the sub-microcomputer for a predetermined time or more;
The sub-microcomputer identifying a rewrite request of the program by receiving a low level signal for a predetermined time; and
The main microcomputer transmits the program rewriting data according to a predetermined communication parameter according to a second protocol dedicated to reprogramming other than the first protocol;
The sub-microcomputer, in accordance with the second protocol, the given communication parameters, e Bei and receiving data for the program rewriting, data for the program rewriting, the communication parameters of the first protocol Including sub-microcomputer program rewriting method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013239685A JP6185371B2 (en) | 2013-11-20 | 2013-11-20 | Sub-microcomputer program rewriting method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013239685A JP6185371B2 (en) | 2013-11-20 | 2013-11-20 | Sub-microcomputer program rewriting method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2015099528A JP2015099528A (en) | 2015-05-28 |
JP6185371B2 true JP6185371B2 (en) | 2017-08-23 |
Family
ID=53376092
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013239685A Active JP6185371B2 (en) | 2013-11-20 | 2013-11-20 | Sub-microcomputer program rewriting method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6185371B2 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3418887A1 (en) | 2017-06-19 | 2018-12-26 | Clarion Co., Ltd. | Electronic device and program updating method |
JP6898643B2 (en) * | 2017-08-10 | 2021-07-07 | 株式会社Subaru | Electronic control device for vehicles |
JP2023081445A (en) | 2021-12-01 | 2023-06-13 | 株式会社アイシン | Vehicular program rewriting system and shift device |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001176285A (en) * | 1999-12-16 | 2001-06-29 | Nitsuko Corp | Substrate provided with communication adapter |
JP2003140914A (en) * | 2001-10-31 | 2003-05-16 | Nissan Motor Co Ltd | Electronic control device |
JP2003196256A (en) * | 2001-12-26 | 2003-07-11 | Denso Corp | Electronic control unit |
JP2007004307A (en) * | 2005-06-21 | 2007-01-11 | Sony Corp | Information processor and method for rewriting program data |
JP2007092621A (en) * | 2005-09-28 | 2007-04-12 | Aisin Seiki Co Ltd | Electronic control unit |
-
2013
- 2013-11-20 JP JP2013239685A patent/JP6185371B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2015099528A (en) | 2015-05-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI730993B (en) | First communication device, communication method, and communication system | |
JP4407752B2 (en) | FAILURE LOCATION DETECTION DEVICE, COMMUNICATION DEVICE, AND FAILURE LOCATION DETECTION METHOD | |
KR101575547B1 (en) | The error variance detection method of can communication system and the can communication system | |
WO2013094072A1 (en) | Communication system and communication method | |
CN112637013B (en) | CAN bus message abnormity detection method and device, equipment and storage medium | |
US20090290485A1 (en) | Distributed communication system and corresponding communication method | |
KR101519719B1 (en) | Message process method of gateway | |
US10721022B2 (en) | Communication apparatus, communication method, program, and communication system | |
CN110447020B (en) | Communication device, communication method, program, and communication system | |
JP6185371B2 (en) | Sub-microcomputer program rewriting method | |
US8804750B2 (en) | Field device | |
JP6384332B2 (en) | Electronic control unit | |
KR101334017B1 (en) | Apparatus of checking a validity of message on network for a vehicle and method of thereof | |
US10055322B2 (en) | Interpreting signals received from redundant buses | |
JP2008293367A (en) | Serial communication device | |
EP2398190B1 (en) | Field communication system | |
JP6410914B1 (en) | Serial communication system | |
JP2009111911A (en) | Communication apparatus, communication system, and communication method | |
JP5018396B2 (en) | Communication apparatus and communication system | |
JP4968169B2 (en) | Communication system and communication method | |
US20150220471A1 (en) | Communication system | |
JP3777809B2 (en) | Method for detecting line abnormality in duplex communication system | |
JP5396812B2 (en) | Transmission control apparatus and transmission control method | |
JP6183281B2 (en) | Communication system and electronic control device | |
JP2018086950A (en) | Communication system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20160204 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20160809 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20160915 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20170110 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20170327 |
|
A911 | Transfer to examiner for re-examination before appeal (zenchi) |
Free format text: JAPANESE INTERMEDIATE CODE: A911 Effective date: 20170410 |
|
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: 20170704 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20170727 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6185371 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 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |