JP6913621B2 - Electronic control device for automobiles - Google Patents

Electronic control device for automobiles Download PDF

Info

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
Application number
JP2017242763A
Other languages
Japanese (ja)
Other versions
JP2019109745A (en
Inventor
俊史 三宅
俊史 三宅
新井 敏央
敏央 新井
香世 南雲
香世 南雲
康司 湯浅
康司 湯浅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Astemo Ltd
Original Assignee
Hitachi Astemo Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Astemo Ltd filed Critical Hitachi Astemo Ltd
Priority to JP2017242763A priority Critical patent/JP6913621B2/en
Priority to PCT/JP2018/034869 priority patent/WO2019123747A1/en
Publication of JP2019109745A publication Critical patent/JP2019109745A/en
Application granted granted Critical
Publication of JP6913621B2 publication Critical patent/JP6913621B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B60VEHICLES IN GENERAL
    • B60RVEHICLES, VEHICLE FITTINGS, OR VEHICLE PARTS, NOT OTHERWISE PROVIDED FOR
    • B60R16/00Electric 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/02Electric 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates 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 Patent Document 1. I went there. That is, in response to an instruction from the tool (memory rewriting machine) connected to the electronic control device, the target area of the non-volatile memory is erased, and the programs and data sequentially transmitted from the tool are written to the non-volatile memory. board.

特開平9−128229号公報Japanese Unexamined Patent Publication No. 9-128229

ところで、近年、自動車用電子制御装置に搭載される制御ソフトウェアの規模は増大の一途を辿っており、これに伴ってプログラムやデータの更新のための書換え時間が長大化している。現状の通信技術では、例えば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の実施形態に係る自動車用電子制御装置のデータ書換えシステムを示す概要図である。It is a schematic diagram which shows the data rewriting system of the electronic control device for automobiles which concerns on 1st Embodiment of this invention. 図1に示したシステムにおける自動車用電子制御装置の構成例を示すブロック図である。It is a block diagram which shows the structural example of the electronic control device for automobiles in the system shown in FIG. 図2におけるフラッシュROMのメモリ構成の一例を示す図である。It is a figure which shows an example of the memory structure of the flash ROM in FIG. 図1に示したシステムにおけるツールの構成例を示すブロック図である。It is a block diagram which shows the configuration example of the tool in the system shown in FIG. データ書換え処理の一例を説明するためのフローチャート、及びツール側のストレージのメモリ構成とECU側のフラッシュROMのメモリ構成を示す図である。It is a flowchart for demonstrating an example of a data rewriting process, and is the figure which shows the memory composition of the storage on the tool side, and the memory composition of the flash ROM on the ECU side. 書換え対象のENG制御プログラムにおける書換え前と書換え中のストレージ、フラッシュROM及びRAMの状態を示す図である。It is a figure which shows the state of the storage, the flash ROM, and RAM before and during rewriting in the ENG control program to be rewritten. 書換え対象のENG制御プログラムにおける書換え中と書換え後のフラッシュROM及びRAMの状態を示す図である。It is a figure which shows the state of the flash ROM and RAM during and after rewriting in the ENG control program to be rewritten. 書換え領域の容量がオーバーした場合における、対策前と対策後のメモリ構成を対比して示す説明図である。It is explanatory drawing which shows the memory configuration before and after the measure by comparison when the capacity of a rewrite area is exceeded. データ書換え処理の別の例を説明するためのフローチャート、及びツール側のストレージのメモリ構成とECU側のフラッシュROMのメモリ構成を示す図である。It is a flowchart for demonstrating another example of a data rewriting process, and the figure which shows the memory composition of the storage on the tool side, and the memory composition of the flash ROM on the ECU side. 本発明の第2の実施形態に係る自動車用電子制御装置におけるデータ書換えシステムを示す概要図である。It is a schematic diagram which shows the data rewriting system in the electronic control device for automobiles which concerns on 2nd Embodiment of this invention.

以下、本発明の実施形態について図面を参照して説明する。
図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 tool 30 via a network cable 20 such as CAN (Controller Area Network), serial communication, FlexRay (registered trademark) and Ethernet (registered trademark). Then, the operator operates the tool 30 to perform the rewriting work of the ECU 10.
The ECU 10 and the tool 30 are not limited to the wired connection using the network cable 20, but may be connected to each other by wireless communication using a wireless transceiver.

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 processor 11 such as a CPU (Central Processing Unit), a communication device 12 for connecting to a network, a flash ROM 13 as an example of a non-volatile memory, and volatilization. It has a RAM (Random Access Memory) 14 and a bus 15 as an example of the sex memory. Here, the bus 15 connects the processor 11, the communication device 12, the flash ROM 13 and the RAM 14 to each other. Further, the communication device 12 includes a connector (not shown) for detachably connecting the network cable 20.

フラッシュROM13の記憶領域は、図3に示すように、所定サイズの複数の消去ブロックEB1〜EBqに分割されている。また、各々の消去ブロックEB1〜EBqは、所定サイズの複数の書込ブロックWB1,WB2,…,WBxに区画されている。ここで、消去ブロックは、データを消去する最小単位を規定し、書込ブロックはデータを書込む最小単位を規定しており、書込ブロックは消去ブロックと同一か、又は小さい容量になっている。そして、ある書込ブロックのデータを書換える場合、その書込ブロックが属する消去ブロックのデータを全て消去した後、データを消去した消去ブロックに属する全ての書込ブロックにデータを書込む、という手順を経るようになっている。なお、フラッシュROM13における消去ブロックのサイズが同一でない場合には、各消去ブロックに属する書込ブロックの数は異なっていてもよい。 As shown in FIG. 3, the storage area of the flash ROM 13 is divided into a plurality of erasing blocks EB1 to EBq having a predetermined size. Further, each of the erase blocks EB1 to EBq is partitioned into a plurality of write blocks WB1, WB2, ..., WBx having a predetermined size. Here, the erase block defines the minimum unit for erasing data, the write block defines the minimum unit for writing data, and the write block has the same or smaller capacity as the erase block. .. Then, when rewriting the data of a certain write block, after erasing all the data of the erase block to which the write block belongs, the procedure of writing the data to all the write blocks belonging to the erase block in which the data is erased is written. It has come to go through. If the size of the erase blocks in the flash ROM 13 is not the same, the number of write blocks belonging to each erase block may be different.

フラッシュ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 flash ROM 13, and the surplus portion is a free area. The start address of the erase block EB1 is given identification information for identifying the stored control program and the control program to be rewritten (for example, identification of the old and new programs) or for identifying each erase block. As the identification information, a hash value (hash value 1) is used in this example.

このハッシュ値は、データの同一性を比較するための識別情報の一例であって、類似するデータでも大きく異なる値をとるものを採用するとよい。そして、プロセッサ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 processor 31 temporarily stores the hash value calculated from the data of the erase block EB1 in a storage medium such as a RAM in the processor 31.

消去ブロック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 flash ROM 13 for each storage area configured in units of integral multiples of the erase block.

ツール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 tool 30 is an electronic device in which an operator performs data rewriting work of the ECU 10, and is composed of, for example, a personal computer. Specifically, as shown in FIG. 4, the tool 30 works with a processor 31 such as a CPU, a communication device 32 for connecting to a network, and a storage 33 such as a hard disk device or an SSD (Solid State Drive). It includes an input / output device 34 that serves as an interface to a person, and a bus 35 that connects these devices to each other. Here, the communication device 32 includes a connector (not shown) for detachably connecting the network cable 20. Further, the input / output device 34 includes a display such as an LCD (Liquid Crystal Display), a keyboard, and a pointing device such as a mouse. The storage 33 may be, for example, NAS (Network Attached Storage) connected to a network (not shown), storage of a server, or the like.

ストレージ33には、ECU10のフラッシュROM13を書換えるための書換えデータが格納されている。書換えデータは、例えば、自動車に搭載された各種機器を制御する制御プログラム、その制御プログラムで使用される定数やマップなどの制御パラメータなどを含む。ストレージ33に格納された書換えデータは、プロセッサ31の制御によりバス35を介して通信装置32に転送され、図示しないコネクタからネットワークケーブル20を介してECU10に送信される。 The storage 33 stores rewriting data for rewriting the flash ROM 13 of the ECU 10. The rewriting data includes, for example, a control program for controlling various devices mounted on an automobile, control parameters such as constants and maps used in the control program, and the like. The rewrite data stored in the storage 33 is transferred to the communication device 32 via the bus 35 under the control of the processor 31, and is transmitted to the ECU 10 from a connector (not shown) via the network cable 20.

次に、上記のような構成において、データ書換え処理(リプログラミング)について図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 flash ROM 13 of the ECU 10, a memory configuration of the storage on the tool side, and a memory configuration of the flash ROM on the ECU side. Further, FIG. 6 shows the states of the storage, the flash ROM, and the RAM before and during the rewriting in the ENG control program to be rewritten, and FIG. 7 shows the flash ROM during and after the rewriting in the ENG control program to be rewritten. And the state of RAM are shown respectively.

データ書換え処理は、作業者がツール30をネットワークケーブル20でECU10に接続した後、ツール30において、所定の操作を行ったときに実行される。ここでは、ECU10は、ネットワークケーブル20を介してツール30と接続されたときに、電力が供給されて起動することを前提とするが、別の電源ケーブルの接続により起動する形態もあり得る。 The data rewriting process is executed when the operator performs a predetermined operation on the tool 30 after connecting the tool 30 to the ECU 10 with the network cable 20. Here, it is assumed that the ECU 10 is started by being supplied with electric power when it is connected to the tool 30 via the network cable 20, but there may be a form in which the ECU 10 is started by connecting another power cable.

ツール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 storage 33 in the tool 30 has a memory configuration in which the ENG control program, the TCU control program, the API, the BIOS, and the free area are allocated as in FIG. 3, and in this example, version 2 (Ver: Ver: 2) is given. Further, the software written in the flash ROM 13 in the ECU 10 has a memory configuration in which the ENG control program, the TCU control program, the API, the BIOS, and the free area are allocated as in FIG. Then, version 1 (Ver: 1) is given as the identification information of the ENG control program, and version 2 (Ver: 2) is given as the identification information to the TCU control program, API, BIOS and the free area.

このように、本データ書換えシステムは、新旧の制御プログラムを比較し、バージョンが異なるブロックのみを書換える。これによって、フラッシュ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 old version 1 ENG control program written in the flash ROM 13 is rewritten to the new version 2 ENG control program in the storage 33.
FIG. 6A shows the ENG control program (Ver: 2) of the storage 33 on the tool 30 side and the ENG control program (Ver: 1) of the flash ROM 13 before rewriting on the ECU 10 side, and the flash ROM 13 is surplus. It has a free area in the part.

まず、ツール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 tool 30 issues an identification information collation request to the ECU 10 (step S1), and the identification information (here, software Ver: 2) stored in the storage 33 of the tool 30 and the identification stored in the flash ROM 13 of the ECU 10 The information (here, software Ver: 1) is compared with the ECU 10 (step S2). If there is a difference in the identification information, the ECU 10 side requests the tool 30 side to send the rewrite data (step S3). As a result, the tool 30 outputs a request for erasing the rewrite target (area) (step S4). When the ECU 10 receives the erasure request from the tool 30, the erasure of the rewrite target (area) is started (step S5). Then, when the erasing is completed, the ECU 10 side notifies the tool 30 side of the erasing completion (step S6).

次に、ツール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 tool 30 to the ECU 10 (step S7), and the write data is stored in the RAM 14 (step S8). When the writing of data to the RAM 14 is completed (step S9), the ECU 10 determines whether or not there is a writing abnormality (step S10). If there is no difference in the identification information in step S2, or if it is determined in step S10 that there is no writing abnormality, the ECU 10 notifies the tool 30 of the completion of writing (step S13), and the tool 30 completes writing. When the notification is received, the completion of writing is displayed on the display of the input / output device 34 to notify the operator (step S14). When there are a plurality of rewriting targets, an identification information collation request is issued to the next writing target, the process moves to the next rewriting target (step S15), and the same operation as in the above-described step is repeated.

一方、ステップ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 RAM 14 is set. Rewriting is performed using the retained data (step S12). During this erasure and rewriting, communication from the outside is not interrupted.

例えば、図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 flash ROM 13. In this case, as shown in FIG. 7A, the data of the erase blocks EB1 and EB2 that have been normally rewritten are retained, and only the erase block EB3 is erased (at this time, the erase block EB4 is in the erased state). Rewrite to the write blocks WBn + 1 to WBo and WBo + 1 to WBp. Similarly, when a write failure area occurs in the write block in the erase block EB4, only the erase block EB4 is erased and rewritten to the write blocks WBo + 1 to WBp.

この際、フラッシュ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 flash ROM 13 to the RAM 14, the data in the RAM 14 can be used for rewriting in a short time. That is, when erasing in units of erase blocks in the flash ROM 13, the data of the write block normally written is saved (copied) in the RAM 14 and then erased, and the remaining data that is not normally written is saved. Is re-received from the tool 30 and rewritten.

また、書込ブロック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 storage 33 of the tool 30 to the RAM 14 and written again. When the writing by the retry is completed, as shown in FIG. 7B, the ENG control program of the same version 2 as the storage 33 on the tool 30 side is written in the flash ROM 13, and the update from the old version to the new version is completed. do.

上記ステップS11,S12の期間には、ツール30側でECU10から出力されるビジィ(BUSY)信号を受信して監視し(ステップS16)、ツール30とECU10の通信タイムアウトを回避する。書込みが完了すると、ECU10からツール30に書込み完了を通知し(ステップS13)、ツール30側で書込み完了通知を受け取ると入出力装置34のディスプレイに表示して作業者に書込み完了を通知する(ステップS14)。そして、複数の書換え対象がある場合には、次の書込み対象に対して識別情報照合要求を出して、次の書換え対象へ移動し(ステップS15)、上述したステップと同様な動作を繰り返す。 During the period of steps S11 and S12, the tool 30 receives and monitors the busy (BUSY) signal output from the ECU 10 (step S16) to avoid a communication timeout between the tool 30 and the ECU 10. When the writing is completed, the ECU 10 notifies the tool 30 of the completion of writing (step S13), and when the tool 30 receives the writing completion notification, it is displayed on the display of the input / output device 34 to notify the operator of the completion of writing (step S13). S14). Then, when there are a plurality of rewriting targets, an identification information collation request is issued to the next writing target, the process moves to the next rewriting target (step S15), and the same operation as in the above-described step is repeated.

なお、上記実施形態では、書換え対象の識別情報を順次比較して書換えの要否を判定する例を示した。このようにしているのは、無線通信でリプログラムする場合を考慮したもので、無線通信では不特定多数の車両が対象となるため、相手側の車両がどのような状態になっているか把握できていないままリプログラムが行われることがあるからである。特に、過去何度かリプログラムされている状態から最新のプログラムに変更する場合には、どこがリプログラムされているのか分からない。
しかしながら、書換え対象が明確な場合には、ツール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 tool 30 may specify the control program, the erasing block, or the writing block to be rewritten to the ECU 10 and rewrite in block units. That is, it is also possible to set an erase block for rewriting the non-volatile memory in advance and rewrite the write block in the erase block.

図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 flash ROM 13 has the same memory configuration as that shown in FIG. 3, and a case where the ENG control program is rewritten will be described as an example. As shown in FIG. 8B, the ENG control program includes a "function A call" and a "function A main body", and an additional ENG control program is written in the free area of the ENG control program. It shall be a program. Here, the additional ENG control program includes a "function B call", a "function B body", a "function C call", and a "function C body". If the additional ENG control program has a larger capacity than the free area and does not fit in the free area, other control programs that do not need to be rewritten, such as the TCU control program, API, and BIOS, must be rewritten by shifting the addresses in sequence. It doesn't become.

そこで、図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 flash ROM 13 of the ECU 10, and rewrites a plurality of control programs. Here, an example is shown in which the ENG control program of the flash ROM 13 (ECU 10 side) before rewriting is an old version and an additional ENG control program is written in a common free area.

まず、ツール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 tool 30 issues an identification information collation request to the ECU 10 (step S21), and the identification information (here, software Ver: 2) stored in the storage 33 of the tool 30 and the identification stored in the flash ROM 13 of the ECU 10 The information (here, software Ver: 1) is compared with the ECU 10 (step S22). If there is a difference in the identification information, the ECU 10 side requests the tool 30 side to send the ENG control program which is the rewriting data (step S23). As a result, the tool 30 side outputs a request for erasing the rewrite target (step S24), and the ECU 10 side starts erasing the ENG control program to be rewritten (step S25). Then, when the erasing is completed, the ECU 10 side notifies the tool 30 side of the erasing completion (step S26).

次に、ツール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 tool 30 to the ECU 10 (step S27), and this data is stored in the RAM 14 (step S28). When the writing of data to the RAM 14 is completed (step S29), the ECU 10 determines whether or not there is a writing abnormality (step S30). If there is no difference in the identification information in step S22, or if it is determined in step S30 that there is no writing abnormality, the ECU 10 notifies the tool 30 of the completion of writing (step S33), and the tool 30 completes writing. Upon receiving the notification, an identification information collation request is issued to the next write target, and the rewrite operation of the common area, which is the next rewrite target, is started (step S35).

一方、ステップ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 RAM 14 from the erase block in which the abnormality has occurred is saved. Rewrite using (step S32). That is, when erasing in units of erase blocks in the flash ROM 13, the data of the write block normally written is saved (copied) in the RAM 14 and then erased, and the remaining data that is not normally written is saved. Is re-received and rewritten. During the period of steps S31 and S32, the tool 30 receives and monitors the busy (BUSY) signal output from the ECU 10 (step S34) to avoid a communication timeout between the tool 30 and the ECU 10. When the writing is completed, the ECU 10 notifies the tool 30 of the completion of writing (step S33).

ツール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 tool 30 receives the writing completion notification, it shifts to the rewriting operation of the common free area (common area). That is, the identification information collation request is output from the tool 30 to the ECU 10 (step S35), and the identification information (here, software Ver: 2) stored in the storage 33 of the tool 30 and the identification stored in the flash ROM 13 of the ECU 10 The information (here, software Ver: 1) is compared with the ECU 10 (step S36). If there is a difference in the identification information, the tool 30 side is requested to send the rewrite data from the ECU 10 side to the common area (step S37). As a result, the tool 30 outputs a request for erasing the common area to be rewritten (step S38). Erasing of the common area to be rewritten is started on the ECU 10 side (step S39), and when the erasing is completed, the ECU 10 side notifies the tool 30 side of the completion of erasing (step S40).

続いて、ツール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 tool 30 to the ECU 10 (step S41), and this data is stored in the RAM 14 (step S42). When the writing of the data to the RAM 14 is completed, the data is written from the RAM 14 to the flash ROM 13 (step S43). After that, as in step S30 and subsequent steps described above, the presence or absence of a write abnormality is determined, and when the writing is completed, an identification information collation request is issued to the next write target, the process moves to the next rewrite target, and the same is true. The operation is repeated to write. Then, when the ECU 10 notifies the tool 30 that all the writing is completed, the display of the input / output device 34 displays the writing completion and notifies the operator.

なお、上述したステップ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 tool 30 and the plurality of ECUs 10 are connected by wireless communication to rewrite the data, the communication may be disconnected. In such a case, erroneous writing can be suppressed by classifying the blocks of the control program into the same group (same control) and rewriting the same group continuously.
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 rewriting tool 40 is mounted on the non-volatile memory (flash ROM) 45 mounted on the first ECU 43 mounted on the automobile 42 or the second ECU 44 by wireless communication using the wireless transceiver 41. It is configured to perform rewriting work of the non-volatile memory (flash ROM) 46.

自動車42には、無線送受信機47及び不正アクセスを防止するためのセキュリティゲートウェイ48が搭載されており、無線送受信機47で受信したデータを、セキュリティゲートウェイ48からバス49を介して第1ECU43と第2ECU44に入力するように構成されている。ここでは、便宜上、第1ECU43と第2ECU44と呼ぶが、基本的には両者は同一構成であり、主従の関係や優先順位はなく、実質的に同じ不揮発性メモリ45,46、例えばフラッシュROMと、CPU50,51を備えている。 The automobile 42 is equipped with a wireless transceiver 47 and a security gateway 48 for preventing unauthorized access, and data received by the wireless transceiver 47 is transmitted from the security gateway 48 via the bus 49 to the first ECU 43 and the second ECU 44. It is configured to enter in. Here, for convenience, they are referred to as the first ECU 43 and the second ECU 44, but basically they have the same configuration, there is no master-slave relationship or priority, and substantially the same non-volatile memories 45, 46, for example, a flash ROM. It includes CPUs 50 and 51.

上記のような構成において、自動車42の走行中には第1ECU43で制御されているものとすると、書換えツール40からデータが送られてくると、第2ECU44の不揮発性メモリ46に受信したデータが供給されて制御プログラムの書換えが実行される。具体的な書換えの手順は上述した通りである。そして、自動車42の停車中に第1ECU43と第2ECU44の切換えが行われる。すなわち、自動車42の制御が第2ECU44で実行される。従って、リプログラムされた新しい制御プログラムにより、自動車42が制御される。 In the above configuration, assuming that the automobile 42 is controlled by the first ECU 43 while the automobile 42 is running, when the data is sent from the rewriting tool 40, the received data is supplied to the non-volatile memory 46 of the second ECU 44. Then, the control program is rewritten. The specific rewriting procedure is as described above. Then, the first ECU 43 and the second ECU 44 are switched while the automobile 42 is stopped. That is, the control of the automobile 42 is executed by the second ECU 44. Therefore, the vehicle 42 is controlled by the new reprogrammed control program.

他の基本的な書換え動作は第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 automobile 42 may be moved. Therefore, it is preferable to narrow the rewriting target range and shorten the rewriting time as compared with the case of connecting with the network cable 20. That is, the data to be written in the non-volatile memory may be input by wireless communication with a limited rewriting target range.

このような構成であっても、基本的には第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 first ECU 43 and the second ECU 44 has been described, but one ECU may switch and rewrite the two flash ROMs. Of course, it can also be applied to a configuration in which three or more ECUs and a flash ROM are switched and used.

更に、自動車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 automobile 42, the rewrite data transferred from the rewrite tool 40 is previously taken into the storage device, and this storage device is used. It can also be configured to rewrite the non-volatile memory using the data stored in.

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.
前記不揮発性メモリに記憶される各々の制御プログラムは、制御対象毎に消去ブロック単位で割り付ける、ことを特徴とする請求項1又は2に記載の自動車用電子制御装置。 The electronic control device for an automobile according to claim 1 or 2, wherein each control program stored in the non-volatile memory is assigned to each control target in units of erase blocks. 前記不揮発性メモリの書換えを実行する消去ブロックを予め設定し、当該消去ブロック内の書込ブロックを書換える、ことを特徴とする請求項1乃至3いずれか1つの項に記載の自動車用電子制御装置。 The electronic control for an automobile according to any one of claims 1 to 3, wherein an erasing block for executing the rewriting of the non-volatile memory is set in advance, and the writing block in the erasing block is rewritten. Device. 前記不揮発性メモリの書換えを実行する消去ブロックを制御グループに応じて分類し、同一グループに対して連続的に書換えを実行する、ことを特徴とする請求項1乃至3いずれか1つの項に記載の自動車用電子制御装置。 The item according to any one of claims 1 to 3, wherein the erase blocks for executing the rewriting of the non-volatile memory are classified according to the control group, and the rewriting is continuously executed for the same group. Electronic control device for automobiles. 前記不揮発性メモリに記憶されている制御プログラムと、書換える制御プログラムとを比較し、差異のある部分を含む消去ブロックのみを書換える、ことを特徴とする請求項1乃至5いずれか1つの項に記載の自動車用電子制御装置。 One of claims 1 to 5, wherein the control program stored in the non-volatile memory is compared with the control program to be rewritten, and only the erase block including the difference portion is rewritten. The electronic control device for automobiles described in. 前記不揮発性メモリの同一消去ブロックで複数回書換えが失敗した場合は、エラーと判定して書換えを中断する、ことを特徴とする請求項1乃至6いずれか1つの項に記載の自動車用電子制御装置。 The electronic control for automobiles according to any one of claims 1 to 6, wherein if the rewriting fails a plurality of times in the same erasing block of the non-volatile memory, it is determined as an error and the rewriting is interrupted. Device. 前記不揮発性メモリにおける消去ブロック単位での消去の際に、正常に書込まれている書込ブロックのデータを退避してから消去し、正常に書込まれなかった残りのデータを再受信し、退避したデータと再受信したデータを用いて書換える、ことを特徴とする請求項1乃至7いずれか1つの項に記載の自動車用電子制御装置。 When erasing in units of erase blocks in the non-volatile memory, the data in the write block that was normally written is saved and then erased, and the remaining data that was not normally written is re-received. The electronic control device for an automobile according to any one of claims 1 to 7, wherein the saved data and the re-received data are used for rewriting. 前記不揮発性メモリには、記憶されている制御プログラムと書換える制御プログラムとを識別、または前記各消去ブロックを識別するための識別情報が更に記憶される、ことを特徴とする請求項1乃至8いずれか1つの項に記載の自動車用電子制御装置。 Claims 1 to 8 are characterized in that the non-volatile memory further stores identification information for identifying a stored control program and a control program to be rewritten, or for identifying each erased block. The electronic control device for an automobile according to any one of the items. 前記識別情報はハッシュ値である、ことを特徴とする請求項9に記載の自動車用電子制御装置。 The electronic control device for an automobile according to claim 9, wherein the identification information is a hash value. 前記不揮発性メモリに書込むデータを、書換え対象範囲を限定した無線通信により入力する、ことを特徴とする請求項1乃至10いずれか1つの項に記載の自動車用電子制御装置。 The electronic control device for an automobile according to any one of claims 1 to 10, wherein the data to be written in the non-volatile memory is input by wireless communication in which the rewriting target range is limited.
JP2017242763A 2017-12-19 2017-12-19 Electronic control device for automobiles Active JP6913621B2 (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

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