JP6913621B2 - Electronic control device for automobiles - Google Patents
Electronic control device for automobiles Download PDFInfo
- Publication number
- JP6913621B2 JP6913621B2 JP2017242763A JP2017242763A JP6913621B2 JP 6913621 B2 JP6913621 B2 JP 6913621B2 JP 2017242763 A JP2017242763 A JP 2017242763A JP 2017242763 A JP2017242763 A JP 2017242763A JP 6913621 B2 JP6913621 B2 JP 6913621B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- rewriting
- control program
- block
- erase
- 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
Classifications
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B60—VEHICLES IN GENERAL
- B60R—VEHICLES, VEHICLE FITTINGS, OR VEHICLE PARTS, NOT OTHERWISE PROVIDED FOR
- B60R16/00—Electric or fluid circuits specially adapted for vehicles and not otherwise provided for; Arrangement of elements of electric or fluid circuits specially adapted for vehicles and not otherwise provided for
- B60R16/02—Electric or fluid circuits specially adapted for vehicles and not otherwise provided for; Arrangement of elements of electric or fluid circuits specially adapted for vehicles and not otherwise provided for electric constitutive elements
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
- G06F8/654—Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Mechanical Engineering (AREA)
- Stored Programmes (AREA)
Description
本発明は、自動車用電子制御装置に関し、更に詳しくは、自動車に搭載されたECU(Electric Control Unit)における制御ソフトウェアの更新技術に関する。 The present invention relates to an electronic control device for an automobile, and more particularly to an update technique of control software in an ECU (Electric Control Unit) mounted on an automobile.
従来、この種の電子制御装置において、フラッシュROM(Read Only Memory)などの不揮発性メモリに書込まれたプログラムやデータを書換えて更新する場合には、例えば特許文献1に記載されるような方法で行っていた。すなわち、電子制御装置に接続されたツール(メモリ書換機)からの指示に応答して、不揮発性メモリの対象領域を消去し、ツールから順次送信されるプログラムやデータを不揮発性メモリに書込んでいた。
Conventionally, in this type of electronic control device, when rewriting and updating a program or data written in a non-volatile memory such as a flash ROM (Read Only Memory), for example, a method as described in
ところで、近年、自動車用電子制御装置に搭載される制御ソフトウェアの規模は増大の一途を辿っており、これに伴ってプログラムやデータの更新のための書換え時間が長大化している。現状の通信技術では、例えば4Mbyteの記憶容量の書換えには25分程度の時間が必要になる。今後、更に不揮発性メモリの記憶容量や制御ソフトウェアの規模が増大することを考えると、更新にはより長時間を要することになる。 By the way, in recent years, the scale of control software installed in electronic control devices for automobiles has been steadily increasing, and along with this, the rewriting time for updating programs and data has become longer. With the current communication technology, for example, it takes about 25 minutes to rewrite the storage capacity of 4 Mbyte. Considering that the storage capacity of the non-volatile memory and the scale of the control software will increase in the future, the update will take a longer time.
本発明は上記のような事情に鑑みてなされたもので、その目的とするところは、不揮発性メモリに記憶されたソフトウェアの更新時間を短縮できる自動車用電子制御装置を提供することにある。 The present invention has been made in view of the above circumstances, and an object of the present invention is to provide an electronic control device for an automobile capable of shortening the update time of software stored in a non-volatile memory.
本発明の一態様に係る自動車用電子制御装置は、消去ブロック単位でデータを消去可能であると共に、前記消去ブロックと同一又は小さい書込ブロック単位でデータを書込み可能な不揮発性メモリを有し、該不揮発性メモリにおける消去ブロックの整数倍の単位で構成された記憶領域毎に制御プログラムが記憶された自動車用電子制御装置であって、前記各消去ブロックに共通の空き領域を設け、前記各消去ブロックの先頭アドレスに、前記空き領域を識別するための識別情報を付与し、外部からの書換え要求に応じて、前記不揮発性メモリの一部のデータを消去ブロック単位で消去し、前記不揮発性メモリに書込ブロック単位でデータを書込む際に、該書込ブロック毎に書換えの正誤を確認し、前記書込ブロックにおける制御プログラム領域が溢れる場合に、関数コール部を当該制御プログラム領域内に配置し、対応する関数本体を前記共通の空き領域に書き込む、ことを特徴とする。 The electronic control device for an automobile according to one aspect of the present invention has a non-volatile memory capable of erasing data in units of erase blocks and writing data in units of write blocks that are the same as or smaller than the erase blocks. An electronic control device for automobiles in which a control program is stored for each storage area configured in units of integral multiples of the erase blocks in the non-volatile memory. A common free area is provided in each erase block, and each erase block is provided. Identification information for identifying the free area is added to the start address of the block, and a part of the data in the non-volatile memory is erased in units of erase blocks in response to a rewrite request from the outside, and the non-volatile memory is erased. when writing data in the write block units, to confirm the correctness of the rewriting for each said write block, when the control program area in the write block is full, place the function call unit to the control program area However , the corresponding function body is written in the common free area.
また、本発明の別の一態様に係る自動車用電子制御装置は、消去ブロック単位でデータを消去可能であると共に、前記消去ブロックと同一又は小さい書込ブロック単位でデータを書込み可能な不揮発性メモリを有し、該不揮発性メモリにおける消去ブロックの整数倍の単位で構成された記憶領域毎に制御プログラムが記憶された自動車用電子制御装置であって、前記各消去ブロックに共通の空き領域を設け、前記各消去ブロックの先頭アドレスに、前記空き領域を識別するための識別情報を付与し、外部からの書換え要求に応じて、前記不揮発性メモリの一部のデータを消去ブロック単位で消去し、前記不揮発性メモリに書込ブロック単位でデータを書込む際に、該書込ブロック毎に書換えの正誤を確認し、誤りの場合は該当する書込ブロックを含む消去ブロックを消去し、書込ブロック単位で再書込みを行い、消去及び再書込み中は外部からの通信を途絶させない状態にし、前記書込ブロックにおける制御プログラム領域が溢れる場合に、関数コール部を当該制御プログラム領域内に配置し、対応する関数本体を前記共通の空き領域に書き込む、ことを特徴とする。 Further, the electronic control device for automobiles according to another aspect of the present invention is a non-volatile memory capable of erasing data in units of erase blocks and writing data in units of write blocks that are the same as or smaller than the erase blocks. An electronic control device for automobiles in which a control program is stored for each storage area configured in units of integral multiples of the erase block in the non-volatile memory, and a common free area is provided in each erase block. , Identification information for identifying the free area is added to the start address of each erase block, and a part of the data in the non-volatile memory is erased in units of erase blocks in response to a rewrite request from the outside. wherein the nonvolatile memory when writing data in the write block unit, check the correctness of the rewriting for each said write block, if an error erasing the erase block containing the appropriate write block, the write block Rewrite is performed in units, communication from the outside is not interrupted during erasure and rewrite, and when the control program area in the write block overflows, a function call unit is placed in the control program area to deal with it. It is characterized in that the function body to be used is written in the common free area.
本発明によれば、不揮発性メモリに、消去ブロックの整数倍の単位で構成された記憶領域毎に制御プログラムを記憶し、制御プログラムの割り付けと消去ブロックを対応させているので、書換え対象領域を制御プログラム毎にでき、データの転送量を削減してソフトウェアの更新時間を短縮できる。
また、外部からの書換え要求に応じて、不揮発性メモリの一部の記憶領域を消去し、この消去領域に書込ブロック単位で書込むことで、書換え対象領域のサイズの縮小を図れ、データの書込み時間を短縮してソフトウェアの更新時間を短縮できる。
更に、消去及び再書込み中は外部からの通信を途絶させないようにすれば、誤書込みを抑制できる。
According to the present invention, the control program is stored in the non-volatile memory for each storage area configured in units of integral multiples of the erase block, and the control program allocation and the erase block are associated with each other. This can be done for each control program, reducing the amount of data transferred and shortening the software update time.
In addition, by erasing a part of the storage area of the non-volatile memory in response to a rewrite request from the outside and writing to this erased area in units of write blocks, the size of the rewrite target area can be reduced and the data can be reduced. The writing time can be shortened and the software update time can be shortened.
Further, if communication from the outside is not interrupted during erasing and rewriting, erroneous writing can be suppressed.
以下、本発明の実施形態について図面を参照して説明する。
図1は、自動車に搭載される電子制御装置(ECU:Electronic Control Unit)のデータを書換える、データ書換えシステムの一例を示している。書換え対象となるECU10は、CAN(Controller Area Network)、シリアル通信、FlexRay(登録商標)及びEthernet(登録商標)などのネットワークケーブル20を介して、ツール30に着脱自在に接続される。そして、作業者がツール30を操作して、ECU10の書換え作業を行う。
なお、ECU10とツール30とは、ネットワークケーブル20を使用した有線に限らず、無線送受信機を使用した無線通信によって相互に接続されるようにしてもよい。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 shows an example of a data rewriting system that rewrites data of an electronic control unit (ECU) mounted on an automobile. The ECU 10 to be rewritten is detachably connected to the
The ECU 10 and the
ECU10は、自動車に搭載された各種の機器、例えば燃料噴射弁、変速機、電動ブレーキシステム、ABS(Antilock Brake System)、可変バルブタイミング機構、及びブラシレスモータなどを制御する電子機器であって、マイクロコンピュータを内蔵している。具体的には、ECU10は、図2に示すように、CPU(Central Processing Unit)などのプロセッサ11と、ネットワークに接続するための通信装置12と、不揮発性メモリの一例としてのフラッシュROM13と、揮発性メモリの一例としてのRAM(Random Access Memory)14と、バス15とを有する。ここで、バス15は、プロセッサ11、通信装置12、フラッシュROM13及びRAM14を相互に接続している。また、通信装置12は、ネットワークケーブル20を着脱可能に接続するコネクタ(図示せず)を備える。
The ECU 10 is an electronic device that controls various devices mounted on an automobile, such as a fuel injection valve, a transmission, an electric brake system, an ABS (Antilock Brake System), a variable valve timing mechanism, and a brushless motor. It has a built-in computer. Specifically, as shown in FIG. 2, the ECU 10 includes a
フラッシュROM13の記憶領域は、図3に示すように、所定サイズの複数の消去ブロックEB1〜EBqに分割されている。また、各々の消去ブロックEB1〜EBqは、所定サイズの複数の書込ブロックWB1,WB2,…,WBxに区画されている。ここで、消去ブロックは、データを消去する最小単位を規定し、書込ブロックはデータを書込む最小単位を規定しており、書込ブロックは消去ブロックと同一か、又は小さい容量になっている。そして、ある書込ブロックのデータを書換える場合、その書込ブロックが属する消去ブロックのデータを全て消去した後、データを消去した消去ブロックに属する全ての書込ブロックにデータを書込む、という手順を経るようになっている。なお、フラッシュROM13における消去ブロックのサイズが同一でない場合には、各消去ブロックに属する書込ブロックの数は異なっていてもよい。
As shown in FIG. 3, the storage area of the
フラッシュROM13の消去ブロックEB1〜EBmに対応する記憶領域には、例えばENG(エンジン)制御プログラムが記憶されており、余剰部分が空き領域となっている。消去ブロックEB1の先頭アドレスには、記憶されている制御プログラムと書換える制御プログラムとを識別(例えば新旧プログラムの識別)、または前記各消去ブロックを識別するための識別情報が付与されている。識別情報としては、本例ではハッシュ値(ハッシュ値1)を用いている。
For example, an ENG (engine) control program is stored in the storage area corresponding to the erasing blocks EB1 to EBm of the
このハッシュ値は、データの同一性を比較するための識別情報の一例であって、類似するデータでも大きく異なる値をとるものを採用するとよい。そして、プロセッサ31は、消去ブロックEB1のデータから算出したハッシュ値を、プロセッサ31内のRAMなどの記憶媒体に一時的に記憶させておく。
This hash value is an example of identification information for comparing the identity of data, and it is preferable to adopt a hash value that takes a significantly different value even for similar data. Then, the
消去ブロックEBm+1〜EBnに対応する記憶領域には、例えばTCU(Transmission Control Unit)制御プログラムが記憶されており、余剰部分が空き領域となっている。消去ブロックEBm+1の先頭アドレスには、記憶されている制御プログラムと書換える制御プログラムとを識別、または前記各消去ブロックを識別するための識別情報(例えばハッシュ値2)が付与されている。 For example, a TCU (Transmission Control Unit) control program is stored in the storage area corresponding to the erasure blocks EBm + 1 to EBn, and the surplus portion is a free area. Identification information (for example, hash value 2) for identifying the stored control program and the control program to be rewritten, or identifying each of the erased blocks is added to the start address of the erase block EBm + 1.
消去ブロックEBn+1〜EBoに対応する記憶領域には、例えばAPI(Application Programming Interface)が記憶されており、余剰部分が空き領域となっている。消去ブロックEBn+1の先頭アドレスには、記憶されている制御プログラムと書換える制御プログラムとを識別、または前記各消去ブロックを識別するための識別情報(例えばハッシュ値3)が付与されている。
消去ブロックEBo+1〜EBpに対応する記憶領域には、例えばBIOS(Basic Input Output System)が記憶されており、余剰部分が空き領域となっている。消去ブロックEBo+1の先頭アドレスには、記憶されている制御プログラムと書換える制御プログラムとを識別、または前記各消去ブロックを識別するための識別情報(例えばハッシュ値4)が付与されている。
For example, an API (Application Programming Interface) is stored in the storage area corresponding to the erasure blocks EBn + 1 to EBo, and the surplus portion is a free area. Identification information (for example, hash value 3) for identifying the stored control program and the control program to be rewritten, or identifying each of the erased blocks is added to the start address of the erased block EBn + 1.
For example, a BIOS (Basic Input Output System) is stored in the storage area corresponding to the erasure blocks EBo + 1 to EBp, and the surplus portion is a free area. Identification information (for example, hash value 4) for identifying the stored control program and the control program to be rewritten, or identifying each of the erased blocks is added to the start address of the erase block EBo + 1.
消去ブロックEBp+1〜EBqに対応する記憶領域は、共通の空き領域(共通領域)となっている。消去ブロックEBp+1の先頭アドレスには、空き領域を識別、または前記各消去ブロックを識別するための識別情報(例えばハッシュ値5)が付与されている。
このように、フラッシュROM13には、消去ブロックの整数倍の単位で構成された記憶領域毎に各種のプログラムが記憶されている。
The storage area corresponding to the erase blocks EBp + 1 to EBq is a common free area (common area). The start address of the erased block EBp + 1 is given identification information (for example, a hash value 5) for identifying a free area or identifying each erased block.
As described above, various programs are stored in the
ツール30は、作業者がECU10のデータ書換え作業を行う電子機器であって、例えば、パーソナルコンピュータなどから構成される。具体的には、ツール30は、図4に示すように、CPUなどのプロセッサ31と、ネットワークに接続するための通信装置32と、ハードディスク装置やSSD(Solid State Drive)などのストレージ33と、作業者へのインターフェースとなる入出力装置34と、これらの機器を相互に接続するバス35とを備えている。ここで、通信装置32は、ネットワークケーブル20を着脱可能に接続するコネクタ(図示せず)を備える。また、入出力装置34は、LCD(Liquid Crystal Display)などのディスプレイと、キーボードと、マウスなどのポインティングデバイスと、を含む。なお、ストレージ33は、例えば、図示しないネットワークに接続されたNAS(Network Attached Storage)やサーバのストレージなどであってもよい。
The
ストレージ33には、ECU10のフラッシュROM13を書換えるための書換えデータが格納されている。書換えデータは、例えば、自動車に搭載された各種機器を制御する制御プログラム、その制御プログラムで使用される定数やマップなどの制御パラメータなどを含む。ストレージ33に格納された書換えデータは、プロセッサ31の制御によりバス35を介して通信装置32に転送され、図示しないコネクタからネットワークケーブル20を介してECU10に送信される。
The
次に、上記のような構成において、データ書換え処理(リプログラミング)について図5乃至図7により説明する。図5は、ECU10のフラッシュROM13の制御プログラムの一部を更新する手順の一例と、ツール側のストレージのメモリ構成とECU側のフラッシュROMのメモリ構成を示している。また、図6は、書換え対象のENG制御プログラムにおける書換え前と書換え中のストレージ、フラッシュROM及びRAMの状態をそれぞれ示し、図7は、書換え対象のENG制御プログラムにおける書換え中と書換え後のフラッシュROM及びRAMの状態をそれぞれ示している。
Next, in the above configuration, the data rewriting process (reprogramming) will be described with reference to FIGS. 5 to 7. FIG. 5 shows an example of a procedure for updating a part of the control program of the
データ書換え処理は、作業者がツール30をネットワークケーブル20でECU10に接続した後、ツール30において、所定の操作を行ったときに実行される。ここでは、ECU10は、ネットワークケーブル20を介してツール30と接続されたときに、電力が供給されて起動することを前提とするが、別の電源ケーブルの接続により起動する形態もあり得る。
The data rewriting process is executed when the operator performs a predetermined operation on the
ツール30におけるストレージ33は、図3と同様にENG制御プログラム、TCU制御プログラム、API、BIOS及び空き領域が割り付けられたメモリ構成になっており、本例では各々の識別情報としてバージョン2(Ver:2)が付与されている。また、ECU10におけるフラッシュROM13に書込まれているソフトウェアは、図3と同様にENG制御プログラム、TCU制御プログラム、API、BIOS及び空き領域が割り付けられたメモリ構成になっている。そして、ENG制御プログラムの識別情報としてバージョン1(Ver:1)が付与され、TCU制御プログラム、API、BIOS及び空き領域には識別情報としてバージョン2(Ver:2)が付与されている。
The
このように、本データ書換えシステムは、新旧の制御プログラムを比較し、バージョンが異なるブロックのみを書換える。これによって、フラッシュROM13に書込まれている旧バージョン1のENG制御プログラムが、ストレージ33における新バージョン2のENG制御プログラムに書換えられることになる。
図6(a)は、ツール30側のストレージ33のENG制御プログラム(Ver:2)と、ECU10側の書換え前のフラッシュROM13のENG制御プログラム(Ver:1)を示しており、フラッシュROM13は余剰部分に空き領域を有している。
In this way, this data rewriting system compares the old and new control programs and rewrites only the blocks with different versions. As a result, the
FIG. 6A shows the ENG control program (Ver: 2) of the
まず、ツール30からECU10に識別情報照合要求が出され(ステップS1)、ツール30におけるストレージ33に記憶されている識別情報(ここではソフトVer:2)とECU10におけるフラッシュROM13に記憶されている識別情報(ここではソフトVer:1)とがECU10で比較される(ステップS2)。識別情報に差異があった場合は、ECU10側からツール30側に書換えデータの送付要求を行う(ステップS3)。これによって、ツール30から書換え対象(領域)の消去要求が出力される(ステップS4)。ECU10がツール30からの消去要求を受け取ると、書換え対象(領域)の消去が開始される(ステップS5)。そして、消去が終了すると、ECU10側からツール30側に消去終了を通知する(ステップS6)。
First, the
次に、ツール30からECU10に書込みデータ(ソフトVer:2のENG制御プログラム)が転送され(ステップS7)、この書込みデータがRAM14に格納される(ステップS8)。RAM14へのデータの書込みが終了すると(ステップS9)、ECU10により書込み異常の有無が判定される(ステップS10)。上記ステップS2で識別情報に差異がなかった場合、及びステップS10で「書込み異常なし」と判定された場合には、ECU10からツール30に書込み完了を通知し(ステップS13)、ツール30が書込み完了通知を受け取ると入出力装置34のディスプレイに書込み完了を表示して作業者に通知する(ステップS14)。複数の書換え対象がある場合には、次の書込み対象に対して識別情報照合要求を出して、次の書換え対象へ移動し(ステップS15)、上述したステップと同様な動作を繰り返す。
Next, the write data (ENG control program of software Ver: 2) is transferred from the
一方、ステップS10で「書込み異常あり」、すなわち、書込みデータに誤りがあると判定された場合には、該当する書込ブロック(異常部)を含む消去ブロックを消去し(ステップS11)、RAM14に保持されているデータを使って再書込みを行う(ステップS12)。この消去及び再書込み中には、外部からの通信を途絶させないようにする。
On the other hand, when it is determined in step S10 that there is a "write error", that is, there is an error in the write data, the erase block including the corresponding write block (abnormal part) is erased (step S11), and the
例えば、図6(b)に示すように、書換え後のフラッシュROM13において、消去ブロックEB3中の書込ブロックWBoに書込み失敗エリアが発生したと仮定する。この場合には、図7(a)に示すように、正常に書換えが完了した消去ブロックEB1,EB2のデータは保持し、消去ブロックEB3のみを消去し(このとき消去ブロックEB4は消去状態)、書込ブロックWBn+1〜WBo、WBo+1〜WBpに対して再書込みする。同様に、消去ブロックEB4中の書込ブロックに書込み失敗エリアが発生した場合には、消去ブロックEB4のみを消去し、書込ブロックWBo+1〜WBpに対して再書込みする。
For example, as shown in FIG. 6B, it is assumed that a write failure area occurs in the write block WBo in the erase block EB3 in the rewritten
この際、フラッシュROM13の書込ブロックWBn+1〜WBo−1に書込まれているデータをRAM14に退避することで、再書込みする場合にRAM14のデータを利用して短時間で書き込むことができる。すなわち、フラッシュROM13における消去ブロック単位での消去の際に、正常に書込まれている書込ブロックのデータをRAM14に退避(コピー)してから消去し、正常に書込まれなかった残りのデータをツール30から再受信して書換えを行う。
At this time, by saving the data written in the writing blocks WBn + 1 to WBo-1 of the
また、書込ブロックWBn+1〜WBo−1への書込データを、ツール30のストレージ33からRAM14に再転送してもう一度書込みするようにしてもよい。リトライによる書込みが完了すると、図7(b)に示すように、フラッシュROM13にはツール30側のストレージ33と同じバージョン2のENG制御プログラムが書込まれ、旧バージョンから新バージョンへの更新が終了する。
Further, the data written to the write blocks WBn + 1 to WBo-1 may be re-transferred from the
上記ステップS11,S12の期間には、ツール30側でECU10から出力されるビジィ(BUSY)信号を受信して監視し(ステップS16)、ツール30とECU10の通信タイムアウトを回避する。書込みが完了すると、ECU10からツール30に書込み完了を通知し(ステップS13)、ツール30側で書込み完了通知を受け取ると入出力装置34のディスプレイに表示して作業者に書込み完了を通知する(ステップS14)。そして、複数の書換え対象がある場合には、次の書込み対象に対して識別情報照合要求を出して、次の書換え対象へ移動し(ステップS15)、上述したステップと同様な動作を繰り返す。
During the period of steps S11 and S12, the
なお、上記実施形態では、書換え対象の識別情報を順次比較して書換えの要否を判定する例を示した。このようにしているのは、無線通信でリプログラムする場合を考慮したもので、無線通信では不特定多数の車両が対象となるため、相手側の車両がどのような状態になっているか把握できていないままリプログラムが行われることがあるからである。特に、過去何度かリプログラムされている状態から最新のプログラムに変更する場合には、どこがリプログラムされているのか分からない。
しかしながら、書換え対象が明確な場合には、ツール30からECU10に書換え対象の制御プログラム、消去ブロック、あるいは書込ブロックを指定して、ブロック単位で書換えるようにしても良い。すなわち、不揮発性メモリの書換えを実行する消去ブロックを予め設定し、当該消去ブロック内の書込ブロックを書換えるようにすることもできる。
In the above embodiment, an example of determining the necessity of rewriting by sequentially comparing the identification information of the rewriting target is shown. This is done in consideration of the case of reprogramming by wireless communication, and since wireless communication targets an unspecified number of vehicles, it is possible to grasp the state of the other vehicle. This is because the reprogram may be performed without it. In particular, if you change from a state that has been reprogrammed several times in the past to the latest program, you do not know where it has been reprogrammed.
However, when the rewriting target is clear, the
図8は、上述したデータ書換え処理において、書込むデータ量が書込まれているデータ量よりも多く、書換え領域の容量がオーバーした場合における、対策前と対策後のメモリ構成を対比して示している。ここでは、図8(a)に示すように、フラッシュROM13が図3に示したメモリ構成と同じであると仮定し、ENG制御プログラムを書換える場合を例に取って説明する。図8(b)に示すように、ENG制御プログラムには、「関数Aコール」と「関数A本体」が含まれており、このENG制御プログラムの空き領域に追加分のENG制御プログラムを書込むものとする。ここで、追加分のENG制御プログラムには「関数Bコール」、「関数B本体」、「関数Cコール」及び「関数C本体」が含まれている。追加分のENG制御プログラムが空き領域より容量が大きく、空き領域に収まらない場合には、書換える必要がない他の制御プログラム、例えばTCU制御プログラム、API及びBIOSもアドレスを順次ずらして書換えなければならない。
FIG. 8 shows a comparison of the memory configurations before and after the countermeasure when the amount of data to be written is larger than the amount of data to be written and the capacity of the rewrite area is exceeded in the above-mentioned data rewriting process. ing. Here, as shown in FIG. 8A, it is assumed that the
そこで、図8(c)に示すように、ENG制御プログラムには「関数Aコール」、及び追加分のENG制御プログラムにおける「関数Bコール」と「関数Cコール」を書き込む。そして、「関数A本体」と、追加分のENG制御プログラムにおける「関数B本体」及び「関数C本体」はそれぞれ共通の空き領域(共通領域)に書き込む。 Therefore, as shown in FIG. 8C, a "function A call" and an additional "function B call" and "function C call" in the ENG control program are written in the ENG control program. Then, the "function A main body" and the "function B main body" and the "function C main body" in the additional ENG control program are written in a common free area (common area).
上述したように、基本的には各制御プログラム領域の空き領域を使用して追加分のデータ容量を確保するが、特定の制御プログラム領域が溢れる場合には、図8(b),(c)に示すように、任意の関数コール部を制御プログラム領域内に配置し、関数本体は共通の空き領域に移動するとよい。 As described above, basically, the free area of each control program area is used to secure the additional data capacity, but when a specific control program area overflows, FIGS. 8 (b) and 8 (c) are shown. As shown in, it is preferable to arrange an arbitrary function call unit in the control program area and move the function body to a common free area.
このようなデータ書換えシステムによれば、複数の制御プログラムのうちの一部の制御プログラムを書換える際に、追加分が当該制御プログラムの空き領域より大きな容量であっても、アドレスを順次ずらして他の制御プログラムを書換える必要がなく、共通の空き領域を利用して最小限のデータ量で書換えが可能である。従って、書換えるメモリ領域を小さくしてソフトウェアの更新時間を短縮できる。
なお、複数の制御領域がオーバーする場合は、制御プログラム領域には空き領域を設けずに制御プログラムを敷き詰めるとよい。
According to such a data rewriting system, when rewriting a part of the control programs among a plurality of control programs, the addresses are sequentially shifted even if the additional capacity is larger than the free area of the control program. There is no need to rewrite other control programs, and it is possible to rewrite with the minimum amount of data using a common free area. Therefore, the memory area to be rewritten can be reduced and the software update time can be shortened.
When a plurality of control areas are exceeded, it is advisable to spread the control programs in the control program area without providing an empty area.
図9は、ECU10のフラッシュROM13の制御プログラムの一部を更新するデータ書換え処理の別の例を示しており、複数の制御プログラムを書換えるものである。ここでは、書換え前のフラッシュROM13(ECU10側)のENG制御プログラムが旧バージョンであり、且つ共通の空き領域に追加分のENG制御プログラムを書き込む場合を例に取って示している。
FIG. 9 shows another example of the data rewriting process for updating a part of the control program of the
まず、ツール30からECU10に識別情報照合要求が出され(ステップS21)、ツール30におけるストレージ33に記憶されている識別情報(ここではソフトVer:2)とECU10におけるフラッシュROM13に記憶されている識別情報(ここではソフトVer:1)とがECU10で比較される(ステップS22)。識別情報に差異があった場合は、ECU10側から書換えデータであるENG制御プログラムの送付要求をツール30側に行う(ステップS23)。これによって、ツール30側から書換え対象の消去要求が出力され(ステップS24)、ECU10側で書換え対象であるENG制御プログラムの消去が開始される(ステップS25)。そして、消去が終了すると、ECU10側からツール30側に消去終了を通知する(ステップS26)。
First, the
次に、ツール30からECU10に書込みデータ(ソフトVer:2のENG制御プログラム)が転送され(ステップS27)、このデータがRAM14に格納される(ステップS28)。RAM14へのデータの書込みが終了すると(ステップS29)、ECU10により書込み異常の有無が判定される(ステップS30)。上記ステップS22で識別情報に差異がなかった場合、及びステップS30で「書込み異常なし」と判定された場合には、ECU10からツール30に書込み完了を通知し(ステップS33)、ツール30が書込み完了通知を受け取ると、次の書込み対象に対して識別情報照合要求を出して、次の書換え対象である共通領域の書換え動作を開始する(ステップS35)。
Next, the write data (ENG control program of software Ver: 2) is transferred from the
一方、ステップS30で「書込み異常あり」と判定された場合には、書込み異常が発生した消去ブロック(異常部)を消去し(ステップS31)、異常が発生した消去ブロックからRAM14に退避したデータを使って再書込みする(ステップS32)。すなわち、フラッシュROM13における消去ブロック単位での消去の際に、正常に書込まれている書込ブロックのデータをRAM14に退避(コピー)してから消去し、正常に書込まれなかった残りのデータを再受信して書換える。上記ステップS31,S32の期間には、ツール30側でECU10から出力されるビジィ(BUSY)信号を受信して監視し(ステップS34)、ツール30とECU10の通信タイムアウトを回避する。書込みが完了すると、ECU10からツール30に書込み完了を通知する(ステップS33)。
On the other hand, when it is determined in step S30 that "there is a write abnormality", the erase block (abnormal part) in which the write abnormality has occurred is erased (step S31), and the data saved in the
ツール30側では、書込み完了通知を受け取ると共通の空き領域(共通領域)の書換え動作に移る。すなわち、ツール30からECU10に識別情報照合要求が出力され(ステップS35)、ツール30におけるストレージ33に記憶されている識別情報(ここではソフトVer:2)とECU10におけるフラッシュROM13に記憶されている識別情報(ここではソフトVer:1)とがECU10で比較される(ステップS36)。識別情報に差異があった場合は、ECU10側から共通領域に書換えデータの送付要求をツール30側に行う(ステップS37)。これによって、ツール30から書換え対象である共通領域の消去要求が出力される(ステップS38)。ECU10側で書換え対象である共通領域の消去が開始され(ステップS39)、消去が終了するとECU10側からツール30側に消去終了を通知する(ステップS40)。
When the
続いて、ツール30からECU10に書込みデータ(追加分のENG制御プログラム)が転送され(ステップS41)、このデータがRAM14に格納される(ステップS42)。RAM14へのデータの書込みが終了すると、RAM14からフラッシュROM13へのデータの書込みが行われる(ステップS43)。その後、上述したステップS30以降と同様に、書込み異常の有無を判定し、書込が終了すると、次の書込み対象に対して識別情報照合要求を出して、次の書換え対象へ移動し、同様な動作を繰り返して書込みを行う。そして、ECU10からツール30に全ての書込みが完了したことが通知されると、入出力装置34のディスプレイに書込み完了を表示して作業者に通知する。
Subsequently, the write data (additional ENG control program) is transferred from the
なお、上述したステップS30〜S32においては、書換えに失敗した場合には、次の書換え対象への処理には遷移しないようになっている。このようにしているのは、例えばツール30と複数のECU10とを無線通信により接続してデータ書換えを行うと、通信が切断される可能性があるためである。このような場合に、制御プログラムのブロックを同一グループ(同一制御)で分類し、同じグループは連続で書換えを行うようにすれば誤書込みを抑制できる。
また、フラッシュROM(不揮発性メモリ)の同一消去ブロックで複数回書換えが失敗した場合は、エラーと判定して書換えを中断するとよい。
In steps S30 to S32 described above, if the rewriting fails, the process does not transition to the next rewriting target. This is done because, for example, if the
Further, when the rewriting fails a plurality of times in the same erasing block of the flash ROM (nonvolatile memory), it may be determined as an error and the rewriting may be interrupted.
図10は、本発明の第2の実施形態に係る自動車用電子制御装置におけるデータ書換えシステムを示している。本例では、書換えツール40が、無線送受信機41を用いた無線通信により、自動車42に搭載された第1ECU43に搭載されている不揮発性メモリ(フラッシュROM)45、または第2ECU44に搭載されている不揮発性メモリ(フラッシュROM)46の書換え作業を行うように構成されている。
FIG. 10 shows a data rewriting system in an electronic control device for an automobile according to a second embodiment of the present invention. In this example, the
自動車42には、無線送受信機47及び不正アクセスを防止するためのセキュリティゲートウェイ48が搭載されており、無線送受信機47で受信したデータを、セキュリティゲートウェイ48からバス49を介して第1ECU43と第2ECU44に入力するように構成されている。ここでは、便宜上、第1ECU43と第2ECU44と呼ぶが、基本的には両者は同一構成であり、主従の関係や優先順位はなく、実質的に同じ不揮発性メモリ45,46、例えばフラッシュROMと、CPU50,51を備えている。
The
上記のような構成において、自動車42の走行中には第1ECU43で制御されているものとすると、書換えツール40からデータが送られてくると、第2ECU44の不揮発性メモリ46に受信したデータが供給されて制御プログラムの書換えが実行される。具体的な書換えの手順は上述した通りである。そして、自動車42の停車中に第1ECU43と第2ECU44の切換えが行われる。すなわち、自動車42の制御が第2ECU44で実行される。従って、リプログラムされた新しい制御プログラムにより、自動車42が制御される。
In the above configuration, assuming that the
他の基本的な書換え動作は第1の実施形態と同様であるので、詳細な説明は省略する。
無線によるデータの書換えにおいては、自動車42が動かされてしまう可能性があるので、ネットワークケーブル20で接続する場合に比べて書換え対象範囲を狭くして、書換え時間を短縮するのが好ましい。すなわち、不揮発性メモリに書込むデータを、書換え対象範囲を限定して無線通信で入力するとよい。
Since other basic rewriting operations are the same as those in the first embodiment, detailed description thereof will be omitted.
In wireless data rewriting, the
このような構成であっても、基本的には第1の実施形態と同様であり、不揮発性メモリに、消去ブロックの整数倍の単位で構成された記憶領域毎に制御プログラムを記憶し、制御プログラムの割り付けと消去ブロックを対応させているので、書換え対象領域を制御プログラム毎にでき、データの転送量を削減してソフトウェアの更新時間を短縮できる。また、外部からの書換え要求に応じて、不揮発性メモリの一部の記憶領域を消去し、この消去領域に書込ブロック単位で書込むことで、書換え対象領域のサイズの縮小を図れ、データの書込み時間を短縮してソフトウェアの更新時間を短縮できる。更に、消去及び再書込み中は外部からの通信を途絶させないようにすれば、誤書込みを抑制できる。 Even with such a configuration, the control program is basically the same as that of the first embodiment, and the control program is stored and controlled in the non-volatile memory for each storage area configured in units of integral multiples of the erase block. Since the program allocation and the erase block correspond to each other, the rewrite target area can be set for each control program, the data transfer amount can be reduced, and the software update time can be shortened. In addition, by erasing a part of the storage area of the non-volatile memory in response to a rewrite request from the outside and writing to this erased area in units of write blocks, the size of the rewrite target area can be reduced and the data can be reduced. The writing time can be shortened and the software update time can be shortened. Further, if communication from the outside is not interrupted during erasing and rewriting, erroneous writing can be suppressed.
なお、本第2の実施形態では、第1ECU43と第2ECU44を備える例について説明したが、1つのECUで2つのフラッシュROMを切換えて再書込みするような構成であってもよい。また、3つ以上のECUとフラッシュROMを切換えて用いる構成にも適用できるのは勿論である。
In the second embodiment, an example including the
更に、自動車42に予め設けられているカーナビゲーションシステムやオーディオシステムのハードディスクや半導体メモリなどの記憶装置を利用し、書換えツール40から転送された書換えデータを予め記憶装置に取り込んでおき、この記憶装置に格納したデータを使って不揮発性メモリを書換えるように構成することもできる。
Further, using a storage device such as a hard disk or a semiconductor memory of a car navigation system or an audio system provided in advance in the
10…ECU、11…プロセッサ、12…通信装置、13…フラッシュROM、14…RAM、15…バス、20…ネットワークケーブル、30…ツール、31…プロセッサ、32…通信装置、33…ストレージ、34…入出力装置、35…バス、40…書換えツール、41…無線送受信機、42…自動車、43…第1ECU、44…第2ECU、45,46…不揮発性メモリ(フラッシュROM)、47…無線送受信機、48…セキュリティゲートウェイ、49…バス、50,51…CPU、EB1〜EBq…消去ブロック、WB1,WB2,…,WBx…書込ブロック 10 ... ECU, 11 ... processor, 12 ... communication device, 13 ... flash ROM, 14 ... RAM, 15 ... bus, 20 ... network cable, 30 ... tool, 31 ... processor, 32 ... communication device, 33 ... storage, 34 ... Input / output device, 35 ... bus, 40 ... rewriting tool, 41 ... wireless transmitter / receiver, 42 ... automobile, 43 ... 1st ECU, 44 ... second ECU, 45, 46 ... non-volatile memory (flash ROM), 47 ... wireless transmitter / receiver , 48 ... Security gateway, 49 ... Bus, 50, 51 ... CPU, EB1 to EBq ... Erase block, WB1, WB2, ..., WBx ... Write block
Claims (11)
前記各消去ブロックに共通の空き領域を設け、
前記各消去ブロックの先頭アドレスに、前記空き領域を識別するための識別情報を付与し、
外部からの書換え要求に応じて、前記不揮発性メモリの一部のデータを消去ブロック単位で消去し、前記不揮発性メモリに書込ブロック単位でデータを書込む際に、該書込ブロック毎に書換えの正誤を確認し、
前記書込ブロックにおける制御プログラム領域が溢れる場合に、関数コール部を当該制御プログラム領域内に配置し、対応する関数本体を前記共通の空き領域に書き込む、
ことを特徴とする自動車用電子制御装置。 It has a non-volatile memory that can erase data in units of erase blocks and can write data in units of write blocks that are the same as or smaller than the erase blocks, and is configured in units that are integral multiples of the erase blocks in the non-volatile memory. An electronic control device for automobiles in which a control program is stored for each stored storage area.
A common free area is provided for each of the erase blocks.
Identification information for identifying the free area is added to the start address of each erased block.
Depending on the rewriting request from the outside, to erase a portion of data of said nonvolatile memory in units of erase blocks, when writing data in the write block in the nonvolatile memory, the rewriting for each said write block Check the correctness of
When the control program area in the write block overflows, the function call unit is arranged in the control program area, and the corresponding function body is written in the common free area.
An electronic control device for automobiles.
前記各消去ブロックに共通の空き領域を設け、
前記各消去ブロックの先頭アドレスに、前記空き領域を識別するための識別情報を付与し、
外部からの書換え要求に応じて、前記不揮発性メモリの一部のデータを消去ブロック単位で消去し、前記不揮発性メモリに書込ブロック単位でデータを書込む際に、該書込ブロック毎に書換えの正誤を確認し、
誤りの場合は該当する書込ブロックを含む消去ブロックを消去し、書込ブロック単位で再書込みを行い、消去及び再書込み中は外部からの通信を途絶させない状態にし、
前記書込ブロックにおける制御プログラム領域が溢れる場合に、関数コール部を当該制御プログラム領域内に配置し、対応する関数本体を前記共通の空き領域に書き込む、
ことを特徴とする自動車用電子制御装置。 It has a non-volatile memory that can erase data in units of erase blocks and can write data in units of write blocks that are the same as or smaller than the erase blocks, and is configured in units that are integral multiples of the erase blocks in the non-volatile memory. An electronic control device for automobiles in which a control program is stored for each stored storage area.
A common free area is provided for each of the erase blocks.
Identification information for identifying the free area is added to the start address of each erased block.
Depending on the rewriting request from the outside, to erase a portion of data of said nonvolatile memory in units of erase blocks, when writing data in the write block in the nonvolatile memory, the rewriting for each said write block Check the correctness of
In the case of an error, the erase block including the corresponding write block is erased, rewriting is performed in units of write blocks, and communication from the outside is not interrupted during the erase and rewrite.
When the control program area in the write block overflows, the function call unit is arranged in the control program area, and the corresponding function body is written in the common free area.
An electronic control device for automobiles.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017242763A JP6913621B2 (en) | 2017-12-19 | 2017-12-19 | Electronic control device for automobiles |
PCT/JP2018/034869 WO2019123747A1 (en) | 2017-12-19 | 2018-09-20 | Electronic control device for automobile and control method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017242763A JP6913621B2 (en) | 2017-12-19 | 2017-12-19 | Electronic control device for automobiles |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2019109745A JP2019109745A (en) | 2019-07-04 |
JP6913621B2 true JP6913621B2 (en) | 2021-08-04 |
Family
ID=66994571
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2017242763A Active JP6913621B2 (en) | 2017-12-19 | 2017-12-19 | Electronic control device for automobiles |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP6913621B2 (en) |
WO (1) | WO2019123747A1 (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20190098097A (en) * | 2019-08-01 | 2019-08-21 | 엘지전자 주식회사 | Electronic control system |
US20230252153A1 (en) | 2020-06-17 | 2023-08-10 | Hitachi Astemo, Ltd. | Electronic control device and updating method for control software |
CN111813076B (en) * | 2020-06-23 | 2021-09-07 | 深圳市元征科技股份有限公司 | Vehicle ECU (electronic control Unit) flashing method and device, vehicle ECU and storage medium |
CN112764374A (en) * | 2020-12-29 | 2021-05-07 | 江铃汽车股份有限公司 | Vehicle control unit configuration flashing method and system |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2290890B (en) * | 1994-06-29 | 1999-03-24 | Mitsubishi Electric Corp | Information processing system |
JP2001056787A (en) * | 1999-08-20 | 2001-02-27 | Fujitsu General Ltd | Device and method for write for memory |
JP4277396B2 (en) * | 1999-11-30 | 2009-06-10 | 株式会社デンソー | Electronic control unit |
JP2006079259A (en) * | 2004-09-08 | 2006-03-23 | Juki Corp | Controller |
JP5045584B2 (en) * | 2008-07-01 | 2012-10-10 | 株式会社デンソー | Program rewriting device |
JP6030485B2 (en) * | 2013-03-21 | 2016-11-24 | 日立オートモティブシステムズ株式会社 | Electronic control unit |
JP5702829B2 (en) * | 2013-05-23 | 2015-04-15 | 本田技研工業株式会社 | Relay device |
JP2015205555A (en) * | 2014-04-18 | 2015-11-19 | 日立オートモティブシステムズ株式会社 | embedded control system |
-
2017
- 2017-12-19 JP JP2017242763A patent/JP6913621B2/en active Active
-
2018
- 2018-09-20 WO PCT/JP2018/034869 patent/WO2019123747A1/en active Application Filing
Also Published As
Publication number | Publication date |
---|---|
WO2019123747A1 (en) | 2019-06-27 |
JP2019109745A (en) | 2019-07-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6913621B2 (en) | Electronic control device for automobiles | |
JP2021121963A (en) | Gateway device, on-vehicle network system and firmware update method | |
JP7224472B2 (en) | VEHICLE CONTROL DEVICE, UPDATE PROGRAM, PROGRAM UPDATE SYSTEM, AND WRITING DEVICE | |
CN114115929A (en) | Software update device, update control method, and non-temporary storage medium | |
WO2014148208A1 (en) | Electronic control device and method for rewriting data | |
US20220244946A1 (en) | Ota master, update control method, non-transitory storage medium, and vehicle | |
JP7087334B2 (en) | Electronic control device | |
US20220391192A1 (en) | Ota master, center, system, method, non-transitory storage medium, and vehicle | |
US20220391194A1 (en) | Ota master, system, method, non-transitory storage medium, and vehicle | |
JP2018180869A (en) | Rewrite system, rewrite device and computer | |
US20220035620A1 (en) | Software update device, update control method, non-transitory storage medium, and server | |
JP7230768B2 (en) | Electronic controller, session establishment program and control program | |
JP2009087107A (en) | Control system for vehicle | |
JP2001242917A (en) | Method and device for controlling drive sequence in vehicle and memory means | |
JP2022007618A (en) | Server, update management method, update management program and software update device | |
JP7349522B1 (en) | Computing equipment and programs | |
US11947824B2 (en) | Electronic control unit, method, and program | |
US20220391193A1 (en) | Ota master, system, method, non-transitory storage medium, and vehicle | |
US20220405083A1 (en) | Ota master, system, method, non-transitory storage medium, and vehicle | |
US20220342653A1 (en) | Ota master, center, system, update method, non-transitory storage medium, and vehicle | |
WO2023175752A1 (en) | Onboard program update system and onboard program update method | |
WO2020241473A1 (en) | Computation processing device, vehicle control device, and update method | |
JP2018181167A (en) | Electronic controller | |
WO2021166956A1 (en) | Data distribution device, data distribution system, and data distribution program | |
US20220342651A1 (en) | Center, ota master, system, distribution method, non-transitory storage medium, and vehicle |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20191121 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20201208 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210128 |
|
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: 20210615 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20210712 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6913621 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |