JP2018160208A - On-vehicle controller and program update software - Google Patents

On-vehicle controller and program update software Download PDF

Info

Publication number
JP2018160208A
JP2018160208A JP2017058398A JP2017058398A JP2018160208A JP 2018160208 A JP2018160208 A JP 2018160208A JP 2017058398 A JP2017058398 A JP 2017058398A JP 2017058398 A JP2017058398 A JP 2017058398A JP 2018160208 A JP2018160208 A JP 2018160208A
Authority
JP
Japan
Prior art keywords
block
program
nonvolatile memory
memory area
difference
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2017058398A
Other languages
Japanese (ja)
Inventor
黒澤 憲一
Kenichi Kurosawa
憲一 黒澤
中原 章晴
Akiharu Nakahara
章晴 中原
裕行 粕谷
Hiroyuki Kasuya
裕行 粕谷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Astemo Ltd
Original Assignee
Hitachi Automotive Systems Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Automotive Systems Ltd filed Critical Hitachi Automotive Systems Ltd
Priority to JP2017058398A priority Critical patent/JP2018160208A/en
Publication of JP2018160208A publication Critical patent/JP2018160208A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

PROBLEM TO BE SOLVED: To shorten a difference restoration time.SOLUTION: An on-vehicle controller includes fifth difference restoration means that transmits third block difference data between a new program to be written into an update object block in a first nonvolatile memory region, i.e. an update object, and the whole of an old program in a second nonvolatile memory region to the on-vehicle controller by the block, stores the block difference data in the nonvolatile memory, and uses the third block difference data and the whole of the old program stored in the second nonvolatile memory region to restore the new program in the update object block in the first nonvolatile memory region. The on-vehicle controller repetitively executes the fifth difference restoration means and writes the restored new program into the first nonvolatile memory region.SELECTED DRAWING: Figure 1

Description

本発明は、車載制御装置、及びプログラム更新ソフトウェアに関する。   The present invention relates to an in-vehicle control device and program update software.

車載制御装置のリプログラミングは、低速なCAN(Controller Area Network)を介して書込みツールとしてのPC(Personal Computer)または車載書込み装置と、車載制御装置(ECU:Electric Control Unit)を接続し、バイナリーデータ(新プログラム)全体を分割転送しながらECUのフラッシュメモリへ書込みを行っている。   Reprogramming the in-vehicle control device connects binary data by connecting a PC (Personal Computer) or in-vehicle writing device as a writing tool to the in-vehicle control device (ECU: Electric Control Unit) via a low-speed CAN (Controller Area Network). (New program) Writing to the flash memory of the ECU while dividing and transferring the entire program.

このため、旧プログラムに対する新プログラムの更新部分が小さい場合においても、新プログラム全体をCAN経由で転送し、新プログラム全体の書込みを行っている。   For this reason, even when the update part of the new program with respect to the old program is small, the whole new program is transferred via CAN and the whole new program is written.

従って、書込みに要する時間がかかるという問題があった。これに対し、従来から差分によるリプログラミングの考え方が提案されている(例えば、特許文献1参照)。すなわち、特許文献1の段落〔0019〕には、書き換え方式の1つとして「ブロック単位で新旧プログラムの差分データを作成する手段」が記載されている。さらに段落〔0064〕には、更新対象ブロックの旧プログラムをSDRAMへ転送して、差分データと旧プログラムを用いて新プログラムをSDRAMへ復元し、更新対象ブロックを消去してから、新プログラムを書込んでいる。   Therefore, there is a problem that it takes time to write. On the other hand, the concept of reprogramming based on differences has been proposed (for example, see Patent Document 1). That is, paragraph [0019] of Patent Document 1 describes “means for creating difference data of old and new programs in block units” as one of the rewriting methods. Further, in paragraph [0064], the old program of the update target block is transferred to the SDRAM, the new program is restored to the SDRAM using the difference data and the old program, the update target block is erased, and then the new program is written. It is crowded.

特許文献2では、移動端末装置の差分によるソフトウェア更新方法が記載されている。段落〔0015〕には、移動端末装置の不揮発性メモリ内に、各々、ソフトウェア更新のための更新エンジンを含む本体プログラムを格納する第1および第2のメモリ領域を設け、ソフトウェア更新時に、一方の本体プログラムのバージョンと新たな本体プログラムのバージョンとの差分データをダウンロードし、前記第1および第2のメモリ領域の一方の更新エンジンを作業用メモリ領域に展開し、前記作業用メモリ領域内更新エンジンを実行することによって前記差分データで当該本体プログラムを更新し、更新が成功したとき当該更新後の本体プログラムを現用の本体プログラムとして選択し、更新が失敗したとき前記作業用メモリ領域内の更新エンジン内に含めたダウンロード機能により他方の本体プログラムのバージョンと新たな本体プログラムのバージョンとの差分データをダウンロードし、前記作業用メモリ領域内の更新エンジンを実行することによって前記差分データで当該本体プログラムを更新し、更新が成功したとき当該更新後の本体プログラムを現用の本体プログラムとして選択する手段が記載されている。   Patent Document 2 describes a software update method based on differences between mobile terminal devices. In paragraph [0015], first and second memory areas for storing a main body program including an update engine for software update are provided in the nonvolatile memory of the mobile terminal device, respectively. The difference data between the version of the main body program and the version of the new main body program is downloaded, one update engine of the first and second memory areas is expanded in the work memory area, and the update engine in the work memory area To update the main body program with the difference data, and when the update is successful, select the updated main body program as the current main body program, and when the update fails, the update engine in the working memory area The download function included in the other version and new version of the main program Download the difference data with the version of the body program, execute the update engine in the working memory area, update the body program with the difference data, and when the update is successful, use the updated body program Means for selecting as the main body program is described.

しかし、差分データと一方の本体プログラムを用いて、どのような手段で新プログラムを復元するか明記されてはいない。   However, it is not specified how to restore the new program by using the difference data and one main body program.

特開2012−190075号公報JP 2012-190075 A 特開2007−189332号公報JP 2007-189332 A

車載制御装置は、数メガバイトの不揮発性メモリと1メガバイト以下の小さな揮発性メモリで構成した記憶装置で構成されることが多い。これはマイコンに内蔵されているメモリだけで制御を実現することで安価な車載制御装置を実現するためである。このため揮発性メモリへ新プログラム全体を復元することはできない。従って、新プログラムを複数のブロックに分割し、ブロック毎の新プログラムと不揮発性メモリに記憶されている旧プログラム全体とのブロック差分データを生成し、車載制御装置は前記ブロック差分データと不揮発性メモリの旧プログラム全体から当該ブロックの新プログラムを揮発性メモリへ復元し、その後に当該ブロックの新プログラムを不揮発性メモリへ書込む。このブロック単位の復元を繰返すことで新プログラム全体を不揮発性メモリへ書込むことが可能となり、かつ揮発性メモリの使用量をブロックサイズに限定することができる。   In-vehicle control devices are often composed of a storage device composed of a non-volatile memory of several megabytes and a small volatile memory of 1 megabyte or less. This is to realize an inexpensive in-vehicle control device by realizing the control only with the memory built in the microcomputer. For this reason, the entire new program cannot be restored to the volatile memory. Therefore, the new program is divided into a plurality of blocks, and block difference data between the new program for each block and the entire old program stored in the nonvolatile memory is generated. The new program of the block is restored from the entire old program to the volatile memory, and then the new program of the block is written to the nonvolatile memory. By repeating this restoration in units of blocks, the entire new program can be written into the nonvolatile memory, and the amount of volatile memory used can be limited to the block size.

しかしながら、ブロック単位に複数回ブロック差分復元処理を繰返すため、オーバヘッドが存在し、復元性能を低下させる要因になる。   However, since the block difference restoration process is repeated a plurality of times for each block, there is an overhead, which causes a reduction in restoration performance.

上記課題を解決するために、本発明の車載制御装置は一例として、書込み装置から提供される更新内容に基づいて、格納している旧プログラムを新プログラムヘ更新可能な車載制御装置であって、プログラムを格納する複数のブロックを備える第1の不揮発性メモリ領域と第2の不揮発性メモリ領域との2面構成の不揮発性メモリと、データを一時的に記憶する揮発性メモリと、を備え、前記書き込み装置は、更新対象である前記第1の不揮発性メモリ領域の更新対象ブロックへ書込む前記新プログラムと、前記第2の不揮発性メモリ領域の前記旧プログラム全体との第3のブロック差分データ、または更新対象である前記第2の不揮発性メモリ領域の更新対象ブロックへ書込む前記新プログラムと前記第1の不揮発性メモリ領域の前記旧プログラム全体との第4のブロック差分データを、ブロック毎に車載制御装置へ送信し、ブロック差分データを前記揮発性メモリに格納し、前記第3のブロック差分データと前記第2の不揮発性メモリ領域に格納されている前記旧プログラム全体とを用いて、前記第1の不揮発性メモリ領域の前記更新対象ブロックの前記新プログラムを復元する第5の差分復元手段と、前記第4のブロック差分データと前記第1の不揮発性メモリ領域に格納されている前記旧プログラム全体とを用いて、前記第2の不揮発性メモリ領域の前記更新対象ブロックの前記新プログラムを復元する第6の差分復元手段と、を備え、前記第5の差分復元手段または前記第6の差分復元手段を繰り返し実行することにより、復元された前記新プログラムを前記第1の不揮発性メモリ領域または前記第2の不揮発性メモリ領域に書き込む。   In order to solve the above-mentioned problem, the vehicle-mounted control device of the present invention is, as an example, a vehicle-mounted control device that can update the stored old program to the new program based on the update content provided from the writing device, A non-volatile memory having a two-surface configuration of a first non-volatile memory area and a second non-volatile memory area having a plurality of blocks for storing programs; and a volatile memory for temporarily storing data; The writing device includes third block difference data between the new program to be written to the update target block in the first nonvolatile memory area to be updated and the entire old program in the second nonvolatile memory area. Or the new program to be written to the update target block of the second nonvolatile memory area to be updated and the old program of the first nonvolatile memory area. 4th block difference data with the whole gram is transmitted to a vehicle-mounted control apparatus for every block, block difference data is stored in the volatile memory, the 3rd block difference data and the 2nd non-volatile memory area A fifth difference restoring means for restoring the new program of the block to be updated in the first nonvolatile memory area using the entire old program stored in the first non-volatile memory area; and the fourth block difference data; Sixth difference restoring means for restoring the new program of the block to be updated in the second nonvolatile memory area using the entire old program stored in the first nonvolatile memory area; And repetitively executing the fifth difference restoring means or the sixth difference restoring means to restore the restored new program to the first nonvolatile memory. Written sexual memory area or the second nonvolatile memory area.

本発明によれば、差分復元時間を短縮することができる。   According to the present invention, the difference restoration time can be shortened.

発明の実施形態による車両の全体構成を示す模式図である。1 is a schematic diagram showing an overall configuration of a vehicle according to an embodiment of the invention. 図1に示す車載制御装置のSRAMの内部の構成を示す模式図である。It is a schematic diagram which shows the structure inside SRAM of the vehicle-mounted control apparatus shown in FIG. 図1に示す車載制御装置のFLASHメモリの内部の構成を示す模式図である。It is a schematic diagram which shows the structure inside the FLASH memory of the vehicle-mounted control apparatus shown in FIG. (a)A面プログラム全体とB面ブロック毎の新プログラムからヘッダ付きブロック差分データの生成概要図と、(b)B面プログラム全体とA面ブロック毎の新プログラムからヘッダ付きブロック差分データの生成概要図である。(a) Overview of generation of block difference data with header from the entire A surface program and new program for each B surface block, and (b) Generation of block difference data with header from the entire B surface program and new program for each A surface block FIG. (a)A面プログラム全体とB#nのブロック差分データからブロックB#nの新プログラム復元概要図と、(b)B面プログラム全体とA#nのブロック差分データからブロックA#nの新プログラム復元概要図である。(a) Outline of new program restoration of block B # n from entire A-side program and block difference data of B # n, (b) New block A # n from entire B-side program and block difference data of A # n It is a program restoration schematic diagram. A面更新ソフト304AとB面更新ソフト307のフローチャートである。It is a flowchart of A side update software 304A and B side update software 307. ブロック差分データ通信ソフトが車載書き込み装置から受信する通信コマンドの種類を示す図である。It is a figure which shows the kind of communication command which block difference data communication software receives from a vehicle-mounted writing apparatus. 車載書込み装置100から送信される通信コマンドのシーケンス図である。It is a sequence diagram of a communication command transmitted from the in-vehicle writing device 100. ブロック差分データ通信ソフトのフローチャートである。It is a flowchart of block difference data communication software. ブロック差分復元ソフトのフローチャートである。It is a flowchart of block difference restoration software. 診断ソフトのフローチャートである。It is a flowchart of diagnostic software. 面切替えソフトのフローチャートである。It is a flowchart of surface switching software.

本実施例は、2面構成の不揮発性メモリのそれぞれにプログラムを配置した車載制御装置において、ブロック差分復元処理の性能を向上させる3つの手段を提供する。   The present embodiment provides three means for improving the performance of the block difference restoration process in the in-vehicle control device in which a program is arranged in each of the two-side configuration nonvolatile memories.

第1のブロック差分復元処理性能向上手段は、既に述べているように、旧プログラム全体を参照して、ブロックの新プログラムを復元する手段である。もちろん、ブロックの新プログラムと旧プログラム全体を参照して、当該ブロックの差分データを生成することが前提である。つまり、ブロックの差分データ生成は、新プログラムの部分命令列と類似した部分命令列を旧プログラムから検索して、短い符号に変換することが基本なので、参照できる範囲が広いほど、ブロック差分データサイズを小さくできる。これは、2面構成の不揮発性メモリゆえに可能なことである。2面構成であれば、差分更新中に片面の旧プログラムは全く変更されない。更新されるのは他方の面である。もし1面構成であれば、ブロックの新プログラムを揮発性メモリに復元した後に、どうしても旧プログラムの一部のブロックを更新せざるをえない。このため、旧プログラム全体を参照してブロックの新プログラムを復元する手段は、2面構成ゆえの手段である。   As described above, the first block difference restoration processing performance improving means is means for restoring the new program of the block with reference to the entire old program. Of course, it is assumed that difference data for the block is generated with reference to the new program and the entire old program. In other words, the difference data generation of a block is basically based on searching for a partial instruction sequence similar to the partial instruction sequence of the new program from the old program and converting it to a short code. Can be reduced. This is possible because of the two-sided non-volatile memory. With the two-sided configuration, the old program on one side is not changed at all during the difference update. It is the other side that is updated. If it is a one-plane configuration, after restoring the new program of the block to the volatile memory, it is unavoidable to update some blocks of the old program. For this reason, the means for restoring the new program of the block with reference to the entire old program is a means due to the two-surface configuration.

第2のブロック差分復元処理性能向上手段は、同一ブロック間のデータコピー手段である。もし第1不揮発性メモリのブロックの旧プログラムと第2不揮発性メモリの当該ブロックの新プログラムが同一内容であった場合、差分復元処理を省略して、第1不揮発性メモリの当該ブロックの旧プログラムを第2不揮発性メモリの当該ブロックへコピーすれば高速に処理することができる。逆に言えば、旧プログラム全体と新プログラム全体から1つに差分データを生成した場合、復元処理をした後に当該ブロックへ新プログラムを書込むことになり、効率が低下する。   The second block difference restoration processing performance improvement unit is a data copy unit between the same blocks. If the old program of the block of the first non-volatile memory and the new program of the block of the second non-volatile memory have the same content, the differential restoration process is omitted and the old program of the block of the first non-volatile memory Can be processed at high speed by copying to the corresponding block of the second nonvolatile memory. In other words, if difference data is generated from one of the entire old program and the entire new program, the new program is written into the block after the restoration process, resulting in a reduction in efficiency.

第3の手段は、ブロック差分データをブロック差分本体データと、ブロック差分本体データサイズを含むブロック差分ヘッダで構成し、ブロック差分データを受信すると、そのヘッダ内のブロック差分本体データサイズを参照して、サイズが0で無ければ第1の手段でブロック差分復元を行い、サイズが0であれば、第2の手段で同一ブロック間のデータコピーを行う。   The third means comprises block difference data including a block difference body data and a block difference header including the block difference body data size. When the block difference data is received, the block difference data is referred to by referring to the block difference body data size in the header. If the size is not 0, the first means performs block differential restoration, and if the size is 0, the second means performs data copy between the same blocks.

このように、第3の手段は、ブロック差分本体データにブロック差分ヘッダを付加することで、第1の手段と第2の手段を組み合わせてブロック毎の新プログラムを高速に復元する手段である。   As described above, the third means is a means for adding a block difference header to the block difference main body data to restore the new program for each block at high speed by combining the first means and the second means.

以下、図面を用いて本発明の実施形態による車載制御装置を含む車両の構成及び動作を説明する。   Hereinafter, the configuration and operation of a vehicle including an in-vehicle control device according to an embodiment of the present invention will be described with reference to the drawings.

車両は、車載書き込み装置100(ゲートウェイ)、複数の車載制御装置200(200〜200)を備える。車載書き込み装置100と車載制御装置200は、相互に車載ネットワークCANを介して通信する。 The vehicle includes an in-vehicle writing device 100 (gateway) and a plurality of in-vehicle control devices 200 (200 1 to 200 n ). The in-vehicle writing device 100 and the in-vehicle control device 200 communicate with each other via the in-vehicle network CAN.

車載制御装置200は、マイコン201、車載制御装置200毎の用途に応じた各種のIC(Integrated Circuit)204、CANトランシーバなどの通信装置205を備える。マイコン201は、SRAM202(揮発性メモリ)、FLASHメモリ203(不揮発性メモリ)を内蔵する。   The in-vehicle control device 200 includes a microcomputer 201, various ICs (Integrated Circuits) 204 corresponding to the use of each in-vehicle control device 200, and a communication device 205 such as a CAN transceiver. The microcomputer 201 incorporates an SRAM 202 (volatile memory) and a FLASH memory 203 (nonvolatile memory).

なお、車載書き込み装置100の構成も車載制御装置200の構成と基本的に同じであるが、車両の外部のネットワークのプロトコルに応じた通信装置をさらに備える。すなわち、車載書き込み装置100は、マイコン101、各種のIC104、CANトランシーバなどの通信装置105、車両の外部のネットワークのプロトコルに応じた通信装置106を備える。マイコン101は、SRAM102、FLASHメモリ103を内蔵する。   The configuration of the in-vehicle writing device 100 is basically the same as that of the in-vehicle control device 200, but further includes a communication device according to a network protocol outside the vehicle. That is, the in-vehicle writing device 100 includes a microcomputer 101, various ICs 104, a communication device 105 such as a CAN transceiver, and a communication device 106 according to a network protocol outside the vehicle. The microcomputer 101 includes an SRAM 102 and a FLASH memory 103.

次に、図2を用いて、車載制御装置200のSRAM202の構成を説明する。図2は、図1に示すSRAM202の内部の構成を示す模式図である。   Next, the configuration of the SRAM 202 of the in-vehicle control device 200 will be described with reference to FIG. FIG. 2 is a schematic diagram showing an internal configuration of the SRAM 202 shown in FIG.

SRAM202は、車載書込み装置100から送信された差分データを一時的に記憶するための受信エリア202a、差分データを用いて差分復元した復元プログラムを一時的に記憶するための復元エリア202bを備える。   The SRAM 202 includes a reception area 202a for temporarily storing difference data transmitted from the in-vehicle writing device 100, and a restoration area 202b for temporarily storing a restoration program restored using the difference data.

次に、図3を用いて、FLASHメモリ203の構成を説明する。図3は、図1に示すFLASHメモリ203の内部の構成を示す模式図である。FLASHメモリ203は、
第1不揮発性メモリ301(A面配置プログラム)と、第2不揮発性メモリ302(B面配置プログラム)と、第3不揮発性メモリ309(実行面を指示する変数selectareaを格納している)で構成されている。
Next, the configuration of the FLASH memory 203 will be described with reference to FIG. FIG. 3 is a schematic diagram showing an internal configuration of the FLASH memory 203 shown in FIG. The FLASH memory 203
Consists of a first non-volatile memory 301 (A-side arrangement program), a second non-volatile memory 302 (B-side arrangement program), and a third non-volatile memory 309 (which stores a variable selectarea that indicates an execution surface) Has been.

第1不揮発性メモリ301は、プリブート303とA面ブート304とA面更新ソフト304AとA面プログラム305で構成されている。一方、第2不揮発性メモリ302(B面配置プログラム)は、B面ブート306とB面更新ソフト307とB面プログラム308で構成されている。ここで、プリブート303は、車載制御装置がパワーオンまたはイグニッションオンした場合に、最初に実行される初期化プログラムが搭載されており、SRAM202などの初期化後に第3不揮発性メモリ309の変数selectareaを参照して、その値に従ってA面ブート304またはB面ブート306のいずれかに分岐する。すなわち、selectareaには、実行すべき面情報(A面またはB面情報)が格納されている。もしA面ブート304へ分岐した場合は、A面プログラム305のサム値チェックなどの診断を行った後、A面プログラム305内のOS立ち上げに必要な初期化や各種タイマ設定などの処理を行い、更新対象であるA面プログラム305を実行する。   The first non-volatile memory 301 includes a pre-boot 303, an A-side boot 304, an A-side update software 304A, and an A-side program 305. On the other hand, the second non-volatile memory 302 (B-side arrangement program) includes a B-side boot 306, a B-side update software 307, and a B-side program 308. Here, the pre-boot 303 is equipped with an initialization program that is executed first when the vehicle-mounted control device is powered on or ignition-on, and the variable selectarea of the third nonvolatile memory 309 is initialized after initialization of the SRAM 202 or the like. With reference to the value, it branches to either the A-side boot 304 or the B-side boot 306 according to the value. That is, the select area stores surface information to be executed (A surface or B surface information). If it branches to the A-side boot 304, it performs diagnostics such as checking the sum value of the A-side program 305, and then performs initialization and various timer settings necessary for OS startup in the A-side program 305. Then, the A-plane program 305 to be updated is executed.

これにより、車載制御装置200は正常に動作可能となる。A面更新ソフト304AはA面プログラム305実行中にソフトウェア更新指示が通知されると、実行されるプログラムである。A面更新ソフト304Aは、本発明の第1〜3手段を実現するブロック差分データ通信ソフト601とブロック差分復元ソフト602と診断ソフト604と面切換えソフト605で構成されており(図6参照)、B面プログラム308を差分更新するソフトウェアである。   Thereby, the vehicle-mounted control apparatus 200 can operate | move normally. The A-side update software 304A is a program that is executed when a software update instruction is notified during execution of the A-side program 305. The A-side update software 304A includes block difference data communication software 601, block difference restoration software 602, diagnosis software 604, and surface switching software 605 that realize the first to third means of the present invention (see FIG. 6). This is software for differentially updating the B-side program 308.

一方、第2不揮発性メモリ302のB面ブート306へ分岐した場合は、同様にB面プログラム308のサム値チェックなどの診断を行った後、B面プログラム308内のOS立ち上げに必要な初期化や各種タイマ設定などの処理を行い、更新対象であるB面プログラム308を実行する。   On the other hand, when branching to the B-side boot 306 of the second non-volatile memory 302, the initial value necessary for starting up the OS in the B-side program 308 is similarly performed after performing a diagnosis such as checking the sum value of the B-side program 308. The B surface program 308 to be updated is executed by performing processing such as conversion and various timer settings.

これにより、車載制御装置200は正常に動作可能となる。B面更新ソフト307はB面プログラム308実行中にソフトウェア更新指示が通知されると、実行されるプログラムである。B面更新ソフト307は、同様に本発明の第1〜3手段を実現するブロック差分データ通信ソフト601とブロック差分復元ソフト602と診断ソフト604と面切換えソフト605で構成されており(図6参照)、A面プログラム305を差分更新するソフトウェアである。   Thereby, the vehicle-mounted control apparatus 200 can operate | move normally. The B-side update software 307 is a program that is executed when a software update instruction is notified during execution of the B-side program 308. Similarly, the B-side update software 307 includes block difference data communication software 601, block difference restoration software 602, diagnosis software 604, and surface switching software 605 that implement the first to third means of the present invention (see FIG. 6). ), Software for differentially updating the A-side program 305.

本実施形態では、一例として、FLASHメモリ203のサイズは2MBとしている。ここで、ブロックA#n, B#n(n = 1〜7)とは、消去可能な最小サイズである。例えば、ブロックB#nにデータを書き込む場合、ブロックB#n全体を消去してからデータを書き込む必要がある。   In the present embodiment, as an example, the size of the FLASH memory 203 is 2 MB. Here, the blocks A # n and B # n (n = 1 to 7) are the minimum erasable sizes. For example, when data is written to the block B # n, it is necessary to erase the entire block B # n before writing the data.

次に図4を用いて、ヘッダ付きブロック差分データの生成概要を説明する。   Next, the outline of generation of header difference block difference data will be described with reference to FIG.

まず(a)A面プログラム全体とB面ブロック毎の新プログラムからヘッダ付きブロック差分データの生成を説明する。   First, (a) generation of header-added block difference data from the entire A-side program and a new program for each B-side block will be described.

A面プログラム305とB面ブロックB#n(n = 1〜7)毎の新プログラムからブロックB#n (n = 1〜7)毎のブロック差分データ410を生成する。生成の第1ステップは、ブロックA#nとブロックB#n (n = 1〜7)のデータ一致チェックである。例として、もしA#4とB#4のデータが一致すれば、B#4のブロック差分ヘッダ420内のブロック差分本体データサイズを0に設定したブロック差分データを生成する。もちろんブロック差分本体データは付属しない。   Block difference data 410 for each block B # n (n = 1 to 7) is generated from the A program 305 and the new program for each B block B # n (n = 1 to 7). The first step of generation is a data match check between the block A # n and the block B # n (n = 1 to 7). For example, if the data of A # 4 and B # 4 match, block difference data in which the block difference body data size in the block difference header 420 of B # 4 is set to 0 is generated. Of course, block difference body data is not attached.

もしA#4とB#4のデータが不一致であれば、A面プログラム305全体とブロックB#4の新プログラムからB#4のブロック差分本体データ430を生成し、次にB#4のブロック差分ヘッダ420内のブロック差分本体データサイズへそのサイズを設定する。   If the data of A # 4 and B # 4 do not match, B # 4 block difference body data 430 is generated from the entire A plane program 305 and the new program of block B # 4, and then the block of B # 4 The size is set to the block difference main body data size in the difference header 420.

以上でB#4のブロック差分データが生成できた。この生成処理をブロック毎に繰返すことで、B面新プログラム400のヘッダ付きブロック差分データを全て生成できる。   The B # 4 block difference data has been generated. By repeating this generation processing for each block, all the block difference data with header of the B-side new program 400 can be generated.

次に、(b)B面プログラム全体とA面ブロック毎の新プログラムからヘッダ付きブロック差分データの生成を説明する。   Next, (b) generation of block difference data with a header from the entire B surface program and a new program for each A surface block will be described.

B面プログラム308とA面ブロックA#n(n = 1〜7)毎の新プログラムからブロックA#n (n = 1〜7)毎のブロック差分データ450を生成する。生成の第1ステップは、同様に、ブロックA#nとブロックB#n (n = 1〜7)のデータ一致チェックである。例として、もしA#4とB#4のデータが一致すれば、A#4のブロック差分ヘッダ460内のブロック差分本体データサイズを0に設定し、A#4のブロック差分データを生成する。もちろんブロック差分本体データは付属しない。   Block difference data 450 for each block A # n (n = 1 to 7) is generated from the new program for each of the B surface program 308 and the A surface block A # n (n = 1 to 7). Similarly, the first step of generation is a data matching check between the block A # n and the block B # n (n = 1 to 7). As an example, if the data of A # 4 and B # 4 match, the block difference body data size in the block difference header 460 of A # 4 is set to 0, and the block difference data of A # 4 is generated. Of course, block difference body data is not attached.

もしA#4とB#4のデータが不一致であれば、B面プログラム308全体とブロックA#4の新プログラムからA#4のブロック差分本体データ470を生成し、次にA#4のブロック差分ヘッダ460にブロック差分本体データサイズを設定する。以上でA#4のブロック差分データが生成できた。この生成処理をブロック毎に繰返すことで、A面新プログラム440のヘッダ付きブロック差分データを全て生成できる。   If the data of A # 4 and B # 4 do not match, A # 4 block difference body data 470 is generated from the entire B surface program 308 and the new program of block A # 4, and then the block of A # 4 The block difference main body data size is set in the difference header 460. The A # 4 block difference data has been generated. By repeating this generation processing for each block, all the block difference data with header of the A-side new program 440 can be generated.

次に、図5を用いて車載制御装置が行う第1〜3手段の概要を説明する。   Next, the outline | summary of the 1st-3rd means which a vehicle-mounted control apparatus performs using FIG.

A面配置プログラム301は第1不揮発性メモリに配置されたプログラムである。前述したように、リセットやイグニッションON時に最初に実行するPREBOOTと、第3不揮発性メモリ内の変数selectareaの値が“A面”である時に実行されるBOOT#A、第1〜第3手段を実現する更新ソフト304Aが配置されているDIFF#A,A面プログラム305で構成されている。ブロックB#nのブロック差分データは、B#nのブロック差分ヘッダ500とB#nのブロック差分本体データ510で構成されている。   The A plane arrangement program 301 is a program arranged in the first nonvolatile memory. As described above, PREBOOT that is executed first when reset or ignition is turned on, BOOT # A that is executed when the value of the variable selectarea in the third non-volatile memory is “A plane”, and first to third means It consists of DIFF # A and A-side program 305 in which update software 304A to be realized is arranged. The block difference data of block B # n is composed of a block difference header 500 of B # n and block difference body data 510 of B # n.

更新ソフト304Aの処理概要530は、第3の手段によりB#nのブロック差分ヘッダ500内のブロック差分本体データサイズを参照し、もしブロック差分本体データサイズ=0ならば第1不揮発性メモリのブロックA#nを第2不揮発性メモリのブロックB#nヘコピーする(第2の手段)。一方、もしブロック差分本体データサイズ≠0ならば第1の手段により第1不揮発性メモリのA面プログラム305全体とB#nのブロック差分本体データ510からブロック差分復元手段を用いてブロックB#nの新プログラム520を復元する。この操作を各ブロック毎に繰返して第2不揮発性メモリへB面の新プログラムを書込むことができる。   The processing summary 530 of the update software 304A refers to the block difference body data size in the B # n block difference header 500 by the third means, and if the block difference body data size = 0, the block of the first nonvolatile memory A # n is copied to the block B # n of the second nonvolatile memory (second means). On the other hand, if the block difference main body data size ≠ 0, the first means uses the block difference restoring means from the entire A-side program 305 of the first nonvolatile memory and the block difference main body data 510 of B # n to use the block B # n. The new program 520 is restored. By repeating this operation for each block, the new program on the B side can be written to the second nonvolatile memory.

同様に、B面プログラムとA#nのブロック差分データを用いて第1不揮発性メモリへA面の新プログラムを書込む操作を説明する。   Similarly, an operation for writing a new program for the A side to the first nonvolatile memory using the B side program and the A # n block difference data will be described.

まず、B面配置プログラム308は第2不揮発性メモリに配置されたプログラムである。同様に、PREBOOTが第3不揮発性メモリ内の変数selectareaを参照し、その値が“B面”である時に実行されるBOOT#B、第1〜第3手段を実現する更新ソフト307が配置されているDIFF#B,B面プログラム308で構成されている。ブロックA#nのブロック差分データは、A#nのブロック差分ヘッダ540とA#nのブロック差分本体データ550で構成されている。   First, the B-side arrangement program 308 is a program arranged in the second nonvolatile memory. Similarly, BOOT # B executed when PREBOOT refers to the variable selectarea in the third non-volatile memory and the value is “B side”, and update software 307 for realizing the first to third means is arranged. DIFF # B, B-side program 308. The block difference data of the block A # n includes an A # n block difference header 540 and an A # n block difference body data 550.

更新ソフト307の処理概要570は、第3の手段によりA#nのブロック差分ヘッダ540内のブロック差分本体データサイズを参照し、もしブロック差分本体データサイズ=0ならば第2不揮発性メモリのブロックB#nを第1不揮発性メモリのブロックA#nヘコピーする(第2の手段)。一方、もしブロック差分本体データサイズ≠0ならば第1の手段により第2不揮発性メモリのB面プログラム308全体とA#nのブロック差分本体データ550からブロック差分復元手段を用いてブロックA#nの新プログラム560を復元する。この操作を各ブロック毎に繰返して第1不揮発性メモリへA面の新プログラムを書込むことができる。   The processing summary 570 of the update software 307 refers to the block difference body data size in the block difference header 540 of A # n by the third means, and if the block difference body data size = 0, the block of the second nonvolatile memory B # n is copied to the block A # n of the first nonvolatile memory (second means). On the other hand, if the block difference body data size ≠ 0, the first means uses the block A # n from the entire B-side program 308 of the second non-volatile memory and the block difference body data 550 of A # n using the block difference restoration means. The new program 560 is restored. By repeating this operation for each block, a new program for the A side can be written to the first nonvolatile memory.

以上、第1〜第3手段の概要を説明した。次に図6〜図11を用いてその動作を詳しく説明する。   The outline of the first to third means has been described above. Next, the operation will be described in detail with reference to FIGS.

図6は、A面更新ソフト304AとB面更新ソフト307のフローチャートである。ブロック差分データ通信ソフト601は、車載書込み装置100から送信されたブロック差分データを受信し、そのブロック差分ヘッダ内のブロック差分本体データサイズの値に応じてブロック間のデータコピー処理や、ブロック差分復元ソフト602を実行する。次に603で全てのブロック差分データを受信完了したか判定し、noならば601へ分岐して次のブロック差分データを受信する。一方、yesならば新プログラムが第1不揮発性メモリまたは第2不揮発性メモリへ復元完了したので、診断ソフト604を実行して正常に書込み完了したかチェックする。もし診断結果が正常ならば面切替えソフト605を実行して、第3不揮発性メモリ内の変数selectareaを変更する。以上により、車載制御装置200をリセットすれば、PREBOOTが起動し、変数selectareaを参照して新プログラムが起動できる。   FIG. 6 is a flowchart of the A-side update software 304A and the B-side update software 307. The block difference data communication software 601 receives the block difference data transmitted from the in-vehicle writing device 100, and performs data copy processing between blocks or block difference restoration according to the value of the block difference main body data size in the block difference header. The software 602 is executed. Next, in 603, it is determined whether or not reception of all the block difference data has been completed. If no, branch to 601 and receive the next block difference data. On the other hand, if yes, since the new program has been restored to the first nonvolatile memory or the second nonvolatile memory, the diagnostic software 604 is executed to check whether the writing has been completed normally. If the diagnosis result is normal, the surface switching software 605 is executed to change the variable selectarea in the third nonvolatile memory. As described above, if the in-vehicle control device 200 is reset, PREBOOT is started, and a new program can be started with reference to the variable selectarea.

次に、図7Aを用いて車載書込み装置100から送信され、ブロック差分データ通信ソフト601が受信する通信コマンドの種類を説明する。   Next, the types of communication commands transmitted from the in-vehicle writing device 100 and received by the block difference data communication software 601 will be described using FIG. 7A.

700の通信コマンド$00は、選択面と選択プログラムバージョンを要求するコマンドである。本通信コマンドの応答により、車載書き込み装置100は、現在実行しているプログラムがA面またはB面なのか知ることができる。またそのプログラムバージョンを確認した上で正しいブロック差分データを車載制御装置200へ送信することができる。   A communication command $ 00 700 is a command for requesting a selection plane and a selection program version. From the response of this communication command, the in-vehicle writing device 100 can know whether the currently executed program is the A side or the B side. In addition, the correct block difference data can be transmitted to the in-vehicle control device 200 after confirming the program version.

710の通信コマンド$10は、ブロック差分データ送信開始コマンドである。本通信コマンド以降に送信するデータがブロック差分データであることを車載制御装置200へ通知するために使用する。   A communication command $ 10 710 is a block difference data transmission start command. This is used to notify the in-vehicle control device 200 that data transmitted after this communication command is block difference data.

720の通信コマンド$20 MA MSは、差分復元対象エリアを車載制御装置200へ通知するコマンドである。MAはエリアの先頭アドレスであり、MSはエリアのサイズである。   The communication command $ 20 MA MS of 720 is a command for notifying the in-vehicle control device 200 of the difference restoration target area. MA is the start address of the area, and MS is the size of the area.

730の通信コマンド$30 DATAは、ブロック差分データ送信コマンドである。DATAは、ブロック差分ヘッダとブロック差分本体データである。   The communication command $ 30 DATA 730 is a block difference data transmission command. DATA is a block difference header and block difference body data.

740の通信コマンド$40は、ブロック差分データ送信終了コマンドである。
このように、1つのブロック差分データは、720、730、740の3つの通信コマンドで送信され、この3つの通信コマンドが繰返し送信することで全てのブロック差分データが車載制御装置200へ送信する。
A communication command $ 40 740 is a block difference data transmission end command.
Thus, one block difference data is transmitted with three communication commands 720, 730, and 740, and all the block difference data is transmitted to the in-vehicle control device 200 by repeatedly transmitting these three communication commands.

750の通信コマンド$50 MA MSは、診断開始コマンドである。MAは診断エリアの先頭アドレスであり、MSは診断エリアのサイズである。診断は、サム値チェックで行う。新プログラムの正しいサム値は、新プログラムの定められたアドレスに書き込まれており、車載制御装置200は、そのアドレスを知っているものとする。   The communication command $ 50 MAMS 750 is a diagnosis start command. MA is the start address of the diagnosis area, and MS is the size of the diagnosis area. Diagnosis is performed by checking the sum value. It is assumed that the correct sum value of the new program is written at an address determined by the new program, and the in-vehicle control device 200 knows the address.

760の通信コマンド$60は、面切替え指示コマンドである。本コマンドにより変数selectareaの値を反対の面へ切替える。   A communication command $ 60 760 is a surface switching instruction command. This command switches the value of variable selectarea to the opposite side.

図7Bを用いて、車載書込み装置100が送信する通信コマンドのシーケンスを説明する。   A sequence of communication commands transmitted by the in-vehicle writing device 100 will be described with reference to FIG. 7B.

770は、通信コマンド 選択面と選択プログラムバージョン要求 $00を送信する。
通信コマンド$00の応答として、車載制御装置200から選択面とそのプログラムのバージョン情報が返信される。
770 transmits a communication command selection surface and a selection program version request $ 00.
As a response to the communication command $ 00, the in-vehicle control device 200 returns the selected surface and version information of the program.

771は、通信コマンド ブロック差分データ送信開始 $10を送信する。   771 transmits a communication command block difference data transmission start $ 10.

772は、通信コマンド 差分復元対象エリア指定 $20を送信する。   772 transmits a communication command differential restoration target area designation $ 20.

773は、通信コマンド 差分復元対象エリアのブロック差分データ $30を送信する。   773 transmits the communication command differential restoration target area block differential data $ 30.

774は、通信コマンド ブロック差分データ送信終了 $40を送信する。   774 transmits a communication command block difference data transmission end $ 40.

775は、全てのブロックの差分データを送信したか判定し、もしyesならば776を実行し、もしnoならば772〜775を繰返し実行する。   In step 775, it is determined whether the difference data of all the blocks has been transmitted. If yes, 776 is executed, and if no, 772 to 775 are repeatedly executed.

776は、通信コマンド 診断開始 $50を送信する。   776 transmits a communication command diagnosis start $ 50.

777は、通信コマンド 面切替え指示 $60を送信する。   777 transmits a communication command plane switching instruction $ 60.

以上で、車載書込み装置100は、通信コマンドを車載制御装置200へ送信できた。   As described above, the in-vehicle writing device 100 can transmit the communication command to the in-vehicle control device 200.

以上の通信コマンドを受信してブロック差分データ通信ソフト601は動作する。   The block difference data communication software 601 operates upon receiving the above communication command.

図8は、ブロック差分データ通信ソフト601のフローチャートである。   FIG. 8 is a flowchart of the block difference data communication software 601.

800で、車載書込み装置100から通信コマンドCMDを受信する。   At 800, a communication command CMD is received from the in-vehicle writing device 100.

801では、通信コマンドCMDが$00であるか判定し、yesならば805を実行し、noならば810を実行する。805は、第3不揮発性メモリの変数selectareaの値と、selectarea指示面に配置されているプログラムのバージョンを読み出し、車載書込み装置100へ返信する。810では、通信コマンドCMDが$10であるか判定し、yesならば815を実行し、noならば820を実行する。   In 801, it is determined whether the communication command CMD is $ 00. If yes, 805 is executed, and if no, 810 is executed. 805 reads the value of the variable selectarea of the third nonvolatile memory and the version of the program arranged on the selectarea instruction surface, and returns it to the in-vehicle writing device 100. In 810, it is determined whether the communication command CMD is $ 10. If yes, 815 is executed, and if no, 820 is executed.

815ではブロック差分本体データを格納するための受信エリア202aと復元エリア202bを初期化する。   In 815, the reception area 202a and the restoration area 202b for storing the block difference main body data are initialized.

820では、通信コマンドCMDが$20であるか判定し、yesならば825を実行し、noならば830を実行する。   In 820, it is determined whether the communication command CMD is $ 20. If yes, 825 is executed, and if no, 830 is executed.

825では、差分復元対象エリアの先頭アドレスMAとサイズMSを記憶する。   In 825, the head address MA and the size MS of the difference restoration target area are stored.

830では、通信コマンドCMDが$30であるか判定し、yesならば835を実行し、noならば840を実行する。   In 830, it is determined whether the communication command CMD is $ 30. If yes, 835 is executed, and if no, 840 is executed.

835では、DATA内のブロック差分本体データを受信エリア202aヘ格納し、ブロック差分ヘッダ内のブロック差分本体データサイズを読み出して変数SIZEに記憶する。   In 835, the block difference body data in DATA is stored in the reception area 202a, and the block difference body data size in the block difference header is read and stored in the variable SIZE.

840では、通信コマンドCMDが$40であるか判定し、yesならば845を実行し、noならば850を実行する。   In 840, it is determined whether the communication command CMD is $ 40. If yes, 845 is executed, and if no, 850 is executed.

845は、第1〜第3手段を実現している処理である。まず、第3不揮発性メモリの変数selectareaと変数SIZEを参照して、4つの組合せに応じたケースの処理を行う。   Reference numeral 845 denotes processing that realizes the first to third means. First, referring to the variable selectarea and the variable SIZE of the third non-volatile memory, a case process corresponding to the four combinations is performed.

第1のケースは、selectarea=“A面”かつSIZE=0の場合である。このケースでは、第1不揮発性メモリのブロックA#nのデータを第2不揮発性メモリB#nヘコピーする。   The first case is a case where selectarea = “A surface” and SIZE = 0. In this case, the data of the block A # n of the first nonvolatile memory is copied to the second nonvolatile memory B # n.

第2のケースは、selectarea=“A面”かつSIZE≠0の場合である。このケースでは、ブロック差分復元ソフト602を実行して、その復元結果を復元エリア202bヘ格納する。さらに復元エリア202bの復元データを第2不揮発性メモリのブロックB#n(先頭アドレスMA, サイズMS)ヘ書込む。   The second case is a case where selectarea = “A surface” and SIZE ≠ 0. In this case, the block difference restoration software 602 is executed, and the restoration result is stored in the restoration area 202b. Further, the restoration data in the restoration area 202b is written into the block B # n (first address MA, size MS) of the second nonvolatile memory.

第3のケースは、selectarea=“B面”かつSIZE=0の場合である。このケースでは、第2不揮発性メモリのブロックB#nのデータを第1不揮発性メモリA#nヘコピーする。   The third case is a case where selectarea = “B surface” and SIZE = 0. In this case, the data of the block B # n of the second nonvolatile memory is copied to the first nonvolatile memory A # n.

第4のケースは、selectarea=“B面”かつSIZE≠0の場合である。このケースでは、ブロック差分復元ソフト602を実行して、その復元結果を復元エリア202bヘ格納する。さらに復元エリア202bの復元データを第1不揮発性メモリのブロックA#n(先頭アドレスMA, サイズMS)ヘ書込む。   The fourth case is a case where selectarea = “B surface” and SIZE ≠ 0. In this case, the block difference restoration software 602 is executed, and the restoration result is stored in the restoration area 202b. Further, the restoration data in the restoration area 202b is written into the block A # n (first address MA, size MS) of the first nonvolatile memory.

850では、通信コマンドCMDが$50であるか判定し、yesならば855を実行し、noならば860を実行する。   In 850, it is determined whether the communication command CMD is $ 50. If yes, 855 is executed, and if no, 860 is executed.

855では先頭アドレスMAとサイズMSで指示された診断エリアを診断ソフト604を実行してサム値による診断を行う。診断結果が正常ならば“正常”を記憶し、診断結果が異常ならば“異常”を記憶する。   In 855, the diagnosis area designated by the start address MA and the size MS is executed by the diagnosis software 604 to perform diagnosis using the sum value. If the diagnosis result is normal, “normal” is stored, and if the diagnosis result is abnormal, “abnormal” is stored.

860では通信コマンドCMDが$60であるか判定し、yesならば865を実行し、noならば1つのブロック差分データによる新プログラムは書込み完了したので、通信コマンド処理を終了する。しかし、図6の603から、全てのブロック差分データを受信完了するまでブロック差分データ通信ソフト601は実行されることがわかる。   In 860, it is determined whether or not the communication command CMD is $ 60. If yes, 865 is executed, and if no, the new program based on one block difference data has been written, so the communication command processing is terminated. However, it can be seen from 603 in FIG. 6 that the block difference data communication software 601 is executed until reception of all the block difference data is completed.

865は、第3不揮発性メモリの変数selectareaの値を変更するため、面切替えソフト605を実行する。   In step 865, the surface switching software 605 is executed to change the value of the variable selectarea of the third nonvolatile memory.

図9は、ブロック差分復元ソフト602のフローチャートである。   FIG. 9 is a flowchart of the block difference restoration software 602.

最初に、一般的な差分生成・差分復元ソフトの概要について説明する。差分生成ソフトは、差分抽出処理部において、新プログラムの部分命令列と類似の部分命令列を旧プログラムから検索して見つけ出し、その部分命令列を短い符号に置き換えてコピーコマンドに付属させる。一方、類似の部分命令列が見つからない場合には、追加コマンドにその部分命令列を付属させる。このコピーコマンドと追加コマンドの列が差分データである。このように、差分データとは、単に新プログラムから旧プログラムを減算した結果では無く、類似部分名列を短い符号に置き換えたコピーコマンドや追加コマンドなどの列で構成されている。   First, an outline of general difference generation / differential restoration software will be described. The difference generation software searches and finds a partial instruction sequence similar to the partial instruction sequence of the new program from the old program in the difference extraction processing unit, replaces the partial instruction sequence with a short code, and attaches it to the copy command. On the other hand, if a similar partial instruction sequence is not found, the partial instruction sequence is attached to the additional command. The sequence of this copy command and additional command is the difference data. Thus, the difference data is not simply a result of subtracting the old program from the new program, but is composed of columns such as a copy command and an additional command in which the similar part name sequence is replaced with a short code.

以上の準備を踏まえて、ブロック差分復元ソフト602の動作を説明する。   Based on the above preparation, the operation of the block difference restoration software 602 will be described.

900は、受信エリア202aのブロック差分本体データから差分コマンドを読み出す。   900 reads a difference command from the block difference body data in the reception area 202a.

910で差分コマンドを解析し、920で差分コマンドがコピーコマンドか判定し、yesならば925で付属する符号から変数selectareaで指示された面のプログラムの部分命令列を復元エリア202bへ書込む。もしnoならば、930を実行する。   In 910, the differential command is analyzed. In 920, it is determined whether the differential command is a copy command. If no, execute 930.

930では差分コマンドが追加コマンドか判定し、yesなら935の追加コマンドに付属するデータ(部分命令列)を復元エリア202bヘ追加書込みをする。もしnoならば、940を実行する。   In 930, it is determined whether the differential command is an additional command. If yes, data (partial instruction sequence) attached to the additional command in 935 is additionally written to the restoration area 202b. If no, execute 940.

940では、受信エリア202aの差分コマンドを全て読み出したか判定し、yesなら、差分復元処理は終了である。もしnoならば、900へ戻って処理を繰返す。   In 940, it is determined whether all the differential commands in the reception area 202a have been read. If yes, the differential restoration process is completed. If no, return to 900 and repeat the process.

以上で、差分復元した復元プログラムが復元リア202bに格納できたことになる。   As described above, the restored program that has been differentially restored can be stored in the restored rear 202b.

図10は、診断ソフト604のフローチャートである。   FIG. 10 is a flowchart of the diagnostic software 604.

1000では、新プログラム内の予め定められた特定アドレスに配置されている“新プログラムのサム値”を読み出し、変数SUMへ記憶する。   At 1000, the “sum value of the new program” arranged at a predetermined specific address in the new program is read and stored in the variable SUM.

1010では、先頭アドレスMA,サイズMSのエリアに書き込まれた新プログラムのデータを4バイト単位で加算し、その加算結果を変数Sへ記憶する。   In 1010, the data of the new program written in the area of the start address MA and the size MS is added in units of 4 bytes, and the addition result is stored in the variable S.

1020では、変数SUMと変数Sの一致チェックを行い、一致した場合1025を実行し、不一致の場合1030を実行する。1025では、診断結果が正常なので、診断結果として“正常”を記憶する。1030では、診断結果が異常なので、診断結果として“異常”を記憶して終了する。   In 1020, a match check between the variable SUM and the variable S is performed. If they match, 1025 is executed, and if they do not match, 1030 is executed. In 1025, since the diagnosis result is normal, “normal” is stored as the diagnosis result. In 1030, since the diagnosis result is abnormal, “abnormal” is stored as the diagnosis result, and the process ends.

図11は、面切替えソフト605のフローチャートである。   FIG. 11 is a flowchart of the surface switching software 605.

1100では、診断結果が“異常”か判定し、yesならば終了する。すなわち新プログラムへ切替えは行わずに、現時点のプログラムで車載制御装置200を実行することになる。   In 1100, it is determined whether the diagnosis result is “abnormal”. That is, the in-vehicle control device 200 is executed with the current program without switching to the new program.

一方、noであれば、1120を実行する。1120では、現時点の変数selectareaの値が“A面”か判定し、yesならば1130を実行し、noならば1140を実行する。1130では、変数selectareaを“B面”へ変更する。1140では変数selectareaを“A面”へ変更する。以上で、新プログラムを実行可能にできた。   On the other hand, if no, 1120 is executed. In 1120, it is determined whether the current value of the variable “selectarea” is “A plane”. If yes, 1130 is executed, and if no, 1140 is executed. In 1130, the variable selectarea is changed to “B-side”. In 1140, the variable selectarea is changed to "A surface". The new program can now be executed.

100…車載書込み装置(ゲートウェイ)
101…マイコン(演算装置)
102…SRAM(揮発性メモリ)
103…FLASHメモリ(不揮発性メモリ)
104…各種のIC
105…通信装置(CANプロトコル)
106…通信装置(車両の外部のネットワークのプロトコル)
200…車載制御装置(ECU)
201…マイコン(演算装置)
202…SRAM(揮発性メモリ)
203…FLASHメモリ(不揮発性メモリ)
204…各種のIC
205…通信装置(CANプロトコル)
202a…受信エリア
202b…復元エリア
301…第1不揮発性メモリ(A面配置プログラム)
302…第2不揮発性メモリ(B面配置プログラム)
303…プリブート(変数selectareaを参照してA面またはB面へ分岐するプログラム)
304…A面ブート(A面配置プログラムの初期化処理プログラム)
304A…A面更新ソフト(第1〜第3手段を実行するソフト)
305…A面プログラム(A面の更新対象プログラム)
306…B面ブート(B面配置プログラムの初期化処理プログラム)
307…B面更新ソフト(第1〜第3手段を実行するソフト)
308…B面プログラム(B面の更新対象プログラム)
309…第3不揮発性メモリ(実行面を指示する変数selectarea格納エリア)
400…B面の新プログラム
410…ブロック差分データ
420…ブロックB#nのブロック差分ヘッダ
430…ブロックB#nのブロック差分本体データ
440…A面の新プログラム
450…ブロック差分データ
460…ブロックA#nのブロック差分ヘッダ
470…ブロックA#nのブロック差分本体データ
500…ブロックB#nのブロック差分ヘッダ
510…ブロックB#nのブロック差分本体データ
520…ブロックB#nの新プログラム
530…A面更新ソフト304Aの処理概要図
540…ブロックA#nのブロック差分ヘッダ
550…ブロックA#nのブロック差分本体データ
560…ブロックA#nの新プログラム
570…B面更新ソフト307の処理概要図
601…ブロック差分データ通信ソフト
602…ブロック差分復元ソフト
604…診断ソフト
605…面切替えソフト
100: In-vehicle writing device (gateway)
101: Microcomputer (arithmetic unit)
102 ... SRAM (volatile memory)
103 ... FLASH memory (nonvolatile memory)
104 ... Various ICs
105 ... Communication device (CAN protocol)
106: Communication device (network protocol outside the vehicle)
200: On-vehicle control device (ECU)
201: Microcomputer (arithmetic unit)
202 ... SRAM (volatile memory)
203 ... FLASH memory (nonvolatile memory)
204 ... Various ICs
205 ... Communication device (CAN protocol)
202a ... Reception area 202b ... Restore area 301 ... First nonvolatile memory (A-side arrangement program)
302 ... 2nd non-volatile memory (B surface arrangement program)
303 ... Pre-boot (a program that branches to the A or B plane with reference to the variable selectarea)
304 ... A-side boot (A-side placement program initialization processing program)
304A ... A-side update software (software for executing the first to third means)
305 ... A-side program (A-plane update target program)
306 ... B-side boot (B-side placement program initialization processing program)
307 ... B-side update software (software for executing the first to third means)
308 ... B-side program (B-side update target program)
309 ... Third nonvolatile memory (variable selectarea storage area for instructing execution surface)
400 ... B-side new program 410 ... Block difference data 420 ... Block B # n block difference header 430 ... Block B # n block difference body data 440 ... A-side new program 450 ... Block difference data 460 ... Block A # Block difference header 470 of n ... Block difference body data 500 of block A # n ... Block difference header 510 of block B # n ... Block difference body data 520 of block B # n ... New program 530 of block B # n ... A surface Process update diagram 540 of update software 304A Block difference header 550 of block A # n Block difference main body data 560 of block A # n New program 570 of block A # n Process overview diagram B-side update software 307 601 Block difference data communication software 602... Block difference restoration software 604. Diagnosis software 605. For example soft

Claims (6)

書込み装置から提供される更新内容に基づいて、格納している旧プログラムを新プログラムヘ更新可能な車載制御装置であって、
プログラムを格納する複数のブロックを備える第1の不揮発性メモリ領域と第2の不揮発性メモリ領域との2面構成の不揮発性メモリと、データを一時的に記憶する揮発性メモリと、を備え、
前記書き込み装置は、更新対象である前記第1の不揮発性メモリ領域の更新対象ブロックへ書込む前記新プログラムと、前記第2の不揮発性メモリ領域の前記旧プログラム全体との第3のブロック差分データ、または更新対象である前記第2の不揮発性メモリ領域の更新対象ブロックへ書込む前記新プログラムと前記第1の不揮発性メモリ領域の前記旧プログラム全体との第4のブロック差分データを、ブロック毎に車載制御装置へ送信し、
ブロック差分データを前記揮発性メモリに格納し、前記第3のブロック差分データと前記第2の不揮発性メモリ領域に格納されている前記旧プログラム全体とを用いて、前記第1の不揮発性メモリ領域の前記更新対象ブロックの前記新プログラムを復元する第5の差分復元手段と、
前記第4のブロック差分データと前記第1の不揮発性メモリ領域に格納されている前記旧プログラム全体とを用いて、前記第2の不揮発性メモリ領域の前記更新対象ブロックの前記新プログラムを復元する第6の差分復元手段と、を備え、
前記第5の差分復元手段または前記第6の差分復元手段を繰り返し実行することにより、復元された前記新プログラムを前記第1の不揮発性メモリ領域または前記第2の不揮発性メモリ領域に書き込むことを特徴とする車載制御装置。
Based on the update content provided from the writing device, an in-vehicle control device capable of updating the stored old program to the new program,
A non-volatile memory having a two-surface configuration of a first non-volatile memory area and a second non-volatile memory area having a plurality of blocks for storing programs; and a volatile memory for temporarily storing data;
The writing device includes third block difference data between the new program to be written to the update target block in the first nonvolatile memory area to be updated and the entire old program in the second nonvolatile memory area. Or the fourth block difference data between the new program to be written to the update target block of the second nonvolatile memory area to be updated and the entire old program of the first nonvolatile memory area for each block. To the in-vehicle control device,
Block differential data is stored in the volatile memory, and the first nonvolatile memory area is obtained by using the third block differential data and the entire old program stored in the second nonvolatile memory area. A fifth difference restoring means for restoring the new program of the update target block;
The new program of the block to be updated in the second nonvolatile memory area is restored using the fourth block difference data and the entire old program stored in the first nonvolatile memory area. A sixth difference restoring means,
Writing the restored new program in the first nonvolatile memory area or the second nonvolatile memory area by repeatedly executing the fifth difference restoring means or the sixth difference restoring means. A vehicle-mounted control device.
更新対象である前記第1の不揮発性メモリ領域の前記前記更新対象ブロックの前記新プログラムと、前記第2の不揮発性メモリ領域の前記旧プログラムが同一である場合には、前記第2の不揮発性メモリ領域の前記旧プログラムを前記第1の不揮発性メモリ領域の前記更新対象ブロックへコピーする第7のコピー手段と、
更新対象である前記第2の不揮発性メモリ領域の前記更新対象ブロックの前記新プログラムと、前記第1の不揮発性メモリ領域の前記旧プログラムが同一である場合には、前記第1の不揮発性メモリ領域の前記旧プログラムを前記第2の不揮発性メモリ領域の前記更新対象ブロックへコピーする第8のコピー手段と、
を備えたことを特徴とする請求項1の車載制御装置。
When the new program in the block to be updated in the first nonvolatile memory area to be updated and the old program in the second nonvolatile memory area are the same, the second nonvolatile memory A seventh copy means for copying the old program in the memory area to the update target block in the first nonvolatile memory area;
When the new program in the block to be updated in the second nonvolatile memory area to be updated and the old program in the first nonvolatile memory area are the same, the first nonvolatile memory An eighth copy means for copying the old program in the area to the block to be updated in the second nonvolatile memory area;
The in-vehicle control device according to claim 1, comprising:
前記第3のブロック差分データと前記第4のブロック差分データは、少なくとも差分データの有無情報を含むブロック差分ヘッダ部と、差分データ本体のブロック差分本体部と、を含み、
前記差分データの有無情報が差分データ有りの場合、前記第5の差分復元手段及び前記第6の差分復元手段により前記更新対象ブロックへ前記新プログラムを復元し、
前記差分データの有無情報が差分データ無しの場合、前記第7の差分復元手段及び前記第8のコピー手段により前記旧プログラムを前記更新対象ブロックへコピーする
ことを特徴とする請求項2の車載制御装置
The third block difference data and the fourth block difference data include a block difference header part including at least presence / absence information of difference data, and a block difference body part of the difference data body,
When the difference data presence / absence information includes difference data, the fifth difference restoration unit and the sixth difference restoration unit restore the new program to the update target block,
3. The in-vehicle control according to claim 2, wherein when the difference data presence / absence information indicates that there is no difference data, the old program is copied to the update target block by the seventh difference restoring means and the eighth copying means. apparatus
書込み装置から提供される更新内容に基づいて、格納している旧プログラムを新プログラムヘ更新可能な車載制御装置であって、
前記プログラムを格納する複数のブロックを備える第1の不揮発性メモリ領域と第2の不揮発性メモリ領域との2面構成の不揮発性メモリと、データを一時的に記憶する揮発性メモリとを備え、
更新対象である前記第1の不揮発性メモリ領域の更新対象ブロックへ書込む前記新プログラムと、前記第2の不揮発性メモリ領域の前記旧プログラム全体との第3のブロック差分データ、または更新対象である前記第2の不揮発性メモリ領域の更新対象ブロックへ書込む前記新プログラムと前記第1の不揮発性メモリ領域の前記旧プログラム全体との第4のブロック差分データを、ブロック毎に車載制御装置へ送信し、
前記車載制御装置のプログラム更新ソフトウェアは、前記ブロック差分データを前記揮発性メモリに格納し、前記第3のブロック差分データと前記第2の不揮発性メモリに格納されている前記旧プログラム全体とを用いて前記第1の不揮発性メモリの前記更新対象ブロックの前記新プログラムを復元する第5の差分復元手段と、
前記第4のブロック差分データと前記第1の不揮発性メモリに格納されている前記旧プログラム全体とを用いて前記第2の不揮発性メモリの前記更新対象ブロックの前記新プログラムを復元する第6の差分復元手段と、を備え、
前記第5の差分復元手段または前記第6の差分復元手段を繰り返し実行することにより復元された前記新プログラムを前記第1の不揮発性メモリまたは前記第2の不揮発性メモリに書き込むことを特徴とする車載制御装置のプログラム更新ソフトウェア。
Based on the update content provided from the writing device, an in-vehicle control device capable of updating the stored old program to the new program,
A non-volatile memory having a two-surface configuration of a first non-volatile memory area and a second non-volatile memory area having a plurality of blocks for storing the program; and a volatile memory for temporarily storing data
Third block difference data between the new program to be written to the update target block in the first nonvolatile memory area to be updated and the entire old program in the second nonvolatile memory area, or an update target The fourth block difference data between the new program to be written to the update target block in the second non-volatile memory area and the entire old program in the first non-volatile memory area is transferred to the in-vehicle controller for each block. Send
The program update software of the in-vehicle controller stores the block difference data in the volatile memory, and uses the third block difference data and the entire old program stored in the second nonvolatile memory. A fifth difference restoring means for restoring the new program of the update target block of the first nonvolatile memory;
Using the fourth block difference data and the entire old program stored in the first nonvolatile memory, a sixth program for restoring the new program of the block to be updated in the second nonvolatile memory Differential restoration means,
The new program restored by repeatedly executing the fifth difference restoring means or the sixth difference restoring means is written into the first nonvolatile memory or the second nonvolatile memory. Program update software for in-vehicle control devices.
更新対象である前記第1の不揮発性メモリ領域の前記更新対象ブロックの前記新プログラムと前記第2の不揮発性メモリ領域の前記旧プログラムが同一である場合には、前記第2の不揮発性メモリ領域の前記旧プログラムを前記第1の不揮発性メモリ領域の前記更新対象ブロックへコピーする第7のコピー手段と、
更新対象である前記第2の不揮発性メモリ領域の前記更新対象ブロックの前記新プログラムと前記第1の不揮発性メモリ領域の前記旧プログラムが同一である場合には、前記第1の不揮発性メモリ領域の前記旧プログラムを前記第2の不揮発性メモリ領域の前記更新対象ブロックへコピーする第8のコピー手段と、
を備えたことを特徴とする請求項4の車載制御装置のプログラム更新ソフトウェア。
When the new program in the block to be updated in the first nonvolatile memory area to be updated and the old program in the second nonvolatile memory area are the same, the second nonvolatile memory area A seventh copy means for copying the old program of the first non-volatile memory area to the update target block;
When the new program in the block to be updated in the second nonvolatile memory area to be updated and the old program in the first nonvolatile memory area are the same, the first nonvolatile memory area An eighth copy means for copying the old program of the second nonvolatile memory area to the update target block;
The program update software for the in-vehicle control device according to claim 4.
前記第3のブロック差分データと第4のブロック差分データは、少なくとも差分データの有無情報を含むブロック差分ヘッダ部と、差分データ本体のブロック差分本体部と、を含み、
前記差分データの有無情報が差分データ有りの場合、前記第5の差分復元手段と前記第6の差分復元手段により更新対象ブロックへ新プログラムを復元し、
前記差分データの有無情報が差分データ無しの場合、前記第7のコピー手段と前記第8のコピー手段により前記旧プログラムを前記更新対象ブロックへコピーする
ことを特徴とする請求項5の車載制御装置のプログラム更新ソフトウェア。
The third block difference data and the fourth block difference data include at least a block difference header part including presence / absence information of difference data, and a block difference body part of the difference data body,
When the difference data presence / absence information includes difference data, the fifth difference restoring means and the sixth difference restoring means restore the new program to the update target block,
6. The in-vehicle control device according to claim 5, wherein when the difference data presence / absence information indicates that there is no difference data, the seventh copy unit and the eighth copy unit copy the old program to the update target block. Program update software.
JP2017058398A 2017-03-24 2017-03-24 On-vehicle controller and program update software Pending JP2018160208A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017058398A JP2018160208A (en) 2017-03-24 2017-03-24 On-vehicle controller and program update software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017058398A JP2018160208A (en) 2017-03-24 2017-03-24 On-vehicle controller and program update software

Publications (1)

Publication Number Publication Date
JP2018160208A true JP2018160208A (en) 2018-10-11

Family

ID=63796703

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017058398A Pending JP2018160208A (en) 2017-03-24 2017-03-24 On-vehicle controller and program update software

Country Status (1)

Country Link
JP (1) JP2018160208A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021131754A1 (en) * 2019-12-24 2021-07-01 京セラ株式会社 Communication apparatus and program
CN115208868A (en) * 2021-04-06 2022-10-18 丰田自动车株式会社 Center, distribution control method, and non-transitory storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004157767A (en) * 2002-11-06 2004-06-03 Mitsubishi Electric Corp Software update system
JP2004234511A (en) * 2003-01-31 2004-08-19 Nec Corp Software updating system, portable terminal, software updating method, and program
JP2010079382A (en) * 2008-09-24 2010-04-08 Hitachi Kokusai Electric Inc Software update method
JP2010211295A (en) * 2009-03-06 2010-09-24 Mitsubishi Electric Corp Data update device, data update method of the same, and data update program
JP2012008640A (en) * 2010-06-22 2012-01-12 Hitachi Solutions Ltd Firmware update method, information device, and firmware update system
JP2013205933A (en) * 2012-03-27 2013-10-07 Mitsubishi Electric Corp Firmware updating device and firmware updating method
JP2014106875A (en) * 2012-11-29 2014-06-09 Denso Corp On-vehicle program update device
JP2017059210A (en) * 2015-09-14 2017-03-23 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America GATEWAY DEVICE, Firmware Update Method, and Control Program

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004157767A (en) * 2002-11-06 2004-06-03 Mitsubishi Electric Corp Software update system
JP2004234511A (en) * 2003-01-31 2004-08-19 Nec Corp Software updating system, portable terminal, software updating method, and program
JP2010079382A (en) * 2008-09-24 2010-04-08 Hitachi Kokusai Electric Inc Software update method
JP2010211295A (en) * 2009-03-06 2010-09-24 Mitsubishi Electric Corp Data update device, data update method of the same, and data update program
JP2012008640A (en) * 2010-06-22 2012-01-12 Hitachi Solutions Ltd Firmware update method, information device, and firmware update system
JP2013205933A (en) * 2012-03-27 2013-10-07 Mitsubishi Electric Corp Firmware updating device and firmware updating method
JP2014106875A (en) * 2012-11-29 2014-06-09 Denso Corp On-vehicle program update device
JP2017059210A (en) * 2015-09-14 2017-03-23 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America GATEWAY DEVICE, Firmware Update Method, and Control Program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021131754A1 (en) * 2019-12-24 2021-07-01 京セラ株式会社 Communication apparatus and program
CN115208868A (en) * 2021-04-06 2022-10-18 丰田自动车株式会社 Center, distribution control method, and non-transitory storage medium

Similar Documents

Publication Publication Date Title
KR100584338B1 (en) Method and system for updating software
JP6568947B2 (en) In-vehicle control device, program update system, and program update software
US11914871B2 (en) Electronic control device and program-update method
JP2001195241A (en) Computer
JP2018160207A (en) On-vehicle controller and program update software
CN111796848A (en) Bootloader software updating method and device, embedded controller and storage medium
CN111026417A (en) Embedded equipment upgrading method and embedded equipment
JP2023168511A (en) Control device, method, program and vehicle
JP2018160208A (en) On-vehicle controller and program update software
JP6719020B2 (en) In-vehicle control device and program update software
US11449329B2 (en) Vehicle control device and program update system
JP6575157B2 (en) Firmware download method and firmware embedded device
US9223697B2 (en) Computer reprogramming method, data storage medium and motor vehicle computer
CN113613954A (en) Electronic control device and method for setting control data
JP6782654B2 (en) In-vehicle control device and program update software
CN110442074B (en) Processing device for programmable logic controller program
JP6838714B2 (en) In-vehicle control device
JP2010020416A (en) Data transfer method and data transfer unit
JP7266216B2 (en) Information processing device and information processing method
US20170031703A1 (en) Method and device for updating a virtual machine operated on a physical machine under a hypervisor
JP5016604B2 (en) Information processing apparatus and information processing method
JP2013004043A (en) Information processing device, image forming apparatus, and program
US20230252153A1 (en) Electronic control device and updating method for control software
JP2020004448A (en) Automotive electronic control device
JP2007004350A (en) Method for executing temporary use program, microprocessor system, information processor and program

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170327

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190118

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190121

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190910

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20191107

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200407

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20201104