JP6838714B2 - In-vehicle control device - Google Patents

In-vehicle control device Download PDF

Info

Publication number
JP6838714B2
JP6838714B2 JP2018061090A JP2018061090A JP6838714B2 JP 6838714 B2 JP6838714 B2 JP 6838714B2 JP 2018061090 A JP2018061090 A JP 2018061090A JP 2018061090 A JP2018061090 A JP 2018061090A JP 6838714 B2 JP6838714 B2 JP 6838714B2
Authority
JP
Japan
Prior art keywords
program
difference data
difference
volatile memory
software
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
JP2018061090A
Other languages
Japanese (ja)
Other versions
JP2019175024A (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 JP2018061090A priority Critical patent/JP6838714B2/en
Publication of JP2019175024A publication Critical patent/JP2019175024A/en
Application granted granted Critical
Publication of JP6838714B2 publication Critical patent/JP6838714B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

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

従来から差分によるリプログラミングの考え方が提案されている。特許文献1の段落〔0019〕には、書き換え方式の1つとして、ブロック単位で新旧プログラムの差分データを作成することが記載されている。 Conventionally, the concept of reprogramming by difference has been proposed. In paragraph [0019] of Patent Document 1, it is described that the difference data of the old and new programs is created in block units as one of the rewriting methods.

特許文献2では、段落〔0006〕に、少ないRAM使用量で差分更新を実現することが記載されている。 In Patent Document 2, paragraph [0006] describes that differential update is realized with a small amount of RAM used.

特許文献3では、現バージョンのプログラムを圧縮して第2メモリに記憶してから、第1メモリのプログラム更新を行い、次に診断異常があった場合、第2メモリの圧縮データを解凍して現バージョンのプログラムを第1メモリへ書込むことでマイコンを動作可能にすることが記載されている。 In Patent Document 3, the current version of the program is compressed and stored in the second memory, then the program in the first memory is updated, and if there is a diagnostic abnormality next, the compressed data in the second memory is decompressed. It is described that the microcomputer can be operated by writing the current version of the program to the first memory.

特開2012−190075号公報Japanese Unexamined Patent Publication No. 2012-190075 特開2011−81561号公報Japanese Unexamined Patent Publication No. 2011-81561 特開2016−118879号公報Japanese Unexamined Patent Publication No. 2016-118879

差分更新は、一般的には新プログラムと1つ前のバージョンから差分データを生成する。しかしながら、数百万台のリコールのケースを考えると全ての車両が1つ前のバージョンのプログラムが搭載されているとは考えにくい。運転者は所有車に異常を感じていない場合、リコールによるプログラム更新をしないケースやディーラーへ行くのが面倒などの理由で更新しないことがある。このため、差分更新には、複数バージョンとの差分データを用意する必要がある。このためバージョン管理が複雑になる。 The difference update generally generates the difference data from the new program and the previous version. However, considering the case of recalling millions of vehicles, it is unlikely that all vehicles are equipped with the previous version of the program. If the driver does not feel any abnormality in his / her own vehicle, he / she may not update the program due to recall or because it is troublesome to go to the dealer. Therefore, it is necessary to prepare the difference data with a plurality of versions for the difference update. This complicates version control.

上記課題を解決するために本発明は、異なるバージョンの実行プログラムで動作している車載制御装置でも、同一の差分データで新たな実行プログラムへ更新することを目的とする。 In order to solve the above problems, it is an object of the present invention to update an in-vehicle control device operating with different versions of execution programs to a new execution program with the same difference data.

上記課題を解決するために、本発明は、書き換え可能な実行用プログラムと特定プログ
ラムを配置した不揮発性メモリを備え、新たな前記実行用プログラムと前記特定プログラ
ムとの差分データと、前記不揮発性メモリの前記特定プログラムから、新たな前記実行用
プログラムを復元して前記不揮発性メモリへ書き込むことにより前記実行用プログラムを
更新し、前記不揮発性メモリは、前記実行用プログラムを格納する第1不揮発性メモリと、前記特定プログラムと前記差分データを格納する第2不揮発性メモリと、を含み、前記第2不揮発性メモリは、新たな前記差分データを格納する第1差分データ格納エリアと、前の前記差分データを格納する第2差分データ格納エリアとを備え、新たな前記実行用プログラムへの更新が失敗した場合、前記第2差分データ格納エリアに格納された前記前の差分データと前記特定プログラムから、前の前記実行用プログラムを復元して、前記第1不揮発性メモリへ書き込む
In order to solve the above problems, the present invention includes a rewritable execution program and a non-volatile memory in which the specific program is arranged, new difference data between the execution program and the specific program, and the non-volatile memory. The execution program is updated by restoring a new execution program from the specific program and writing to the non-volatile memory, and the non-volatile memory is a first non-volatile memory for storing the execution program. The second non-volatile memory includes the specific program and the second non-volatile memory for storing the difference data, and the second non-volatile memory includes a first difference data storage area for storing the new difference data and the previous difference. It is provided with a second difference data storage area for storing data, and when a new update to the execution program fails, the previous difference data stored in the second difference data storage area and the specific program are used. The previous execution program is restored and written to the first non-volatile memory .

本発明によれば、異なるバージョンの実行プログラムで動作している車載制御装置でも、同一の差分データで新たな実行プログラムへ更新できる。 According to the present invention, even in-vehicle control devices operating with different versions of execution programs can be updated to a new execution program with the same difference data.

発明の実施形態による車両の全体構成を示す模式図Schematic diagram showing the overall configuration of the vehicle according to the embodiment of the invention 図1に示す車載制御装置のSRAMの内部の構成を示す模式図Schematic diagram showing the internal configuration of the SRAM of the in-vehicle control device shown in FIG. 本発明の実施形態の概念を説明するパソコンの圧縮ソフト、差分生成ソフトのフローチャートFlow chart of compression software and difference generation software of a personal computer for explaining the concept of the embodiment of the present invention. 本発明の実施形態の概念を説明する車載制御装置の解凍ソフト、差分復元ソフトのフローチャートFlow chart of decompression software and difference restoration software of in-vehicle control device explaining the concept of the embodiment of the present invention 図1に示す車載制御装置のFLASHメモリの内部の構成を示す模式図Schematic diagram showing the internal configuration of the FLASH memory of the in-vehicle control device shown in FIG. 図1に示す車載制御装置のFLASHメモリをマイコン内蔵FLASHメモリと外付けFLASHメモリで構成した構成の模式図Schematic diagram of a configuration in which the FLASH memory of the in-vehicle control device shown in FIG. 1 is composed of a FLASH memory with a built-in microcomputer and an external FLASH memory. 図4Bに示す外付けFLASHメモリの内部構成の模式図Schematic diagram of the internal configuration of the external FLASH memory shown in FIG. 4B. リプロソフト全体構成図Repro software overall configuration diagram 図1の車載書込み装置と車載制御装置の通信コマンドの種類を示す図The figure which shows the type of the communication command of the vehicle-mounted writing device and the vehicle-mounted control device of FIG. 図6の通信コマンドを用いてプログラム書込み装置が差分データを送信するフローチャートFlow chart in which the program writing device transmits the difference data using the communication command of FIG. 図6の通信コマンドを用いて車載制御装置が差分データを受信するフローチャートFlow chart in which the in-vehicle control device receives the difference data using the communication command of FIG. 図6の通信コマンドを用いてプログラム書込み装置が差分復元実行と診断実行コマンドを送信するフローチャートFlow chart in which the program writer sends the differential restoration execution and diagnostic execution commands using the communication command shown in FIG. 車載制御装置の差分復元ソフトのフローチャートFlowchart of difference restoration software for in-vehicle control device 車載制御装置の解凍ソフトが使用する解凍コマンドDecompression command used by the decompression software of the in-vehicle control device 車載制御装置の解凍ソフトの処理フローProcessing flow of decompression software for in-vehicle control device 車載制御装置の第1差分復元ソフトと第2差分復元ソフトが使用する差分コマンドDifference commands used by the first difference restoration software and the second difference restoration software of the in-vehicle control device 車載制御装置の第1差分復元ソフトのフローチャートFlowchart of the first difference restoration software of the in-vehicle control device 車載制御装置の診断ソフトのフローチャートFlowchart of diagnostic software for in-vehicle control device 車載制御装置の第2差分復元ソフトのフローチャートFlowchart of the second difference restoration software of the in-vehicle control device

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

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

従って、書込みに要する時間がかかるという問題があった。 Therefore, there is a problem that it takes time to write.

特許文献1から3のリプログラミングでは、いくつかの課題がある。 The reprogramming of Patent Documents 1 to 3 has some problems.

第1の課題として、差分更新は、一般的には新プログラムと1つ前のバージョンから差分データを生成する。しかしながら、数百万台のリコールのケースを考えると全ての車両が1つ前のバージョンのプログラムが搭載されているとは考えにくい。運転者は所有車に異常を感じていない場合、リコールによるプログラム更新をしないケースやディーラーへ行くのが面倒などの理由で更新しないことがある。このため、差分更新には、複数バージョンとの差分データを用意する必要がある。このためバージョン管理が複雑になる。このバージョン管理の複雑さを簡素化する手段を提供することが第1の課題である。 As the first problem, the difference update generally generates the difference data from the new program and the previous version. However, considering the case of recalling millions of vehicles, it is unlikely that all vehicles are equipped with the previous version of the program. If the driver does not feel any abnormality in his / her own vehicle, he / she may not update the program due to recall or because it is troublesome to go to the dealer. Therefore, it is necessary to prepare the difference data with a plurality of versions for the difference update. This complicates version control. The first challenge is to provide a means of simplifying the complexity of this version control.

第2の課題は、もし差分更新後の診断結果が異常であった場合、例えば不揮発性メモリFLASHには既に旧プログラムが存在しないので、差分によるリプログラミングが不可能になってしまうという点である。 The second problem is that if the diagnosis result after the difference update is abnormal, for example, since the old program does not already exist in the non-volatile memory FLASH, reprogramming by the difference becomes impossible. ..

車載制御装置は、数メガバイトの不揮発性メモリFLASHと1メガバイト以下の小さな揮発性メモリSRAMで構成した記憶装置で構成されることが多い。これはマイコンに内蔵されているメモリだけで制御を実現することで安価な車載制御装置を実現するためである。このため不揮発性メモリFLASHに記憶されている旧プログラムと差分データを入力として、差分復元ソフトにより新プログラムを差分復元し、新プログラムを不揮発性メモリFLASHへ書込むことでソフトウェア更新を実現する。しかしながら、復元した新プログラムが正しく復元できたか診断する必要がある。例えば、新プログラム全体のサム値やハッシュ値などを前記書込みツールや車載書込み装置から受信し、車載制御装置自身が復元した新プログラムのサム値やハッシュ値を計算して、受信した値と一致するかチェックすることで診断が可能となる。 The in-vehicle control device is often composed of a storage device composed of a non-volatile memory FLASH of several megabytes and a small volatile memory SRAM of 1 megabyte or less. This is to realize an inexpensive in-vehicle control device by realizing control only with the memory built in the microcomputer. Therefore, by inputting the difference data from the old program stored in the non-volatile memory FLASH, the new program is differentially restored by the difference restoration software, and the new program is written to the non-volatile memory FLASH to realize the software update. However, it is necessary to diagnose whether the restored new program was restored correctly. For example, the sum value and hash value of the entire new program are received from the writing tool and the in-vehicle writing device, and the sum value and hash value of the new program restored by the in-vehicle control device itself are calculated and match the received values. Diagnosis is possible by checking.

特許文献3では、現バージョンのプログラムを第2メモリに圧縮して格納する必要があるため、車載制御装置は圧縮手段を必要とすることが記載されている。しかし一般的に、圧縮処理は複雑で処理時間も長く、使用するメモリも非常に多い。このため車載制御装置への搭載は困難である。 Patent Document 3 describes that the in-vehicle control device requires a compression means because it is necessary to compress and store the current version of the program in the second memory. However, in general, the compression process is complicated, the processing time is long, and the memory used is very large. Therefore, it is difficult to mount it on an in-vehicle control device.

最初に、第1の課題を解決する構成の概念を図3A、図3B、図4A、図4B、図4Cを用いて説明する。 First, the concept of the configuration for solving the first problem will be described with reference to FIGS. 3A, 3B, 4A, 4B, and 4C.

図3Aは、パソコンに搭載されている圧縮ソフト310と差分生成ソフト340を用いて、新プログラムの差分データを生成する処理フローである。 FIG. 3A is a processing flow for generating the difference data of the new program by using the compression software 310 and the difference generation software 340 installed in the personal computer.

まず、(a)パソコンの圧縮ソフトで特定プログラムを圧縮するフローチャートで示すように、特定プログラム300を圧縮して圧縮データ320を生成する。ここで特定プログラムとは、特に限定する必要は無いが、理解しやすくするために、車載制御装置を工場から初出荷する時に搭載するプログラムと想定する。 First, (a) compressing the specific program with the compression software of the personal computer As shown in the flowchart, the specific program 300 is compressed to generate the compressed data 320. Here, the specific program is not particularly limited, but is assumed to be a program to be installed when the in-vehicle control device is first shipped from the factory for easy understanding.

次に(b)パソコンの差分生成ソフトで特定プログラムと新プログラムから差分データを生成するフローチャートに示すように、特定プログラム300と新プログラム330を差分生成ソフト340へ入力して差分データ350を生成する。 Next, (b) the difference data 350 is generated by inputting the specific program 300 and the new program 330 into the difference generation software 340 as shown in the flowchart for generating the difference data from the specific program and the new program with the difference generation software of the personal computer. ..

ここで、車載制御装置のプログラム更新の概念を図3Bを用いて説明する。 Here, the concept of updating the program of the in-vehicle control device will be described with reference to FIG. 3B.

前提として、全ての車載制御装置には、工場出荷時に圧縮データ320が不揮発性メモリへ書込んであるものとする。 As a premise, it is assumed that the compressed data 320 is written to the non-volatile memory at the time of shipment from the factory in all the in-vehicle control devices.

車載制御装置のプログラム更新を差分データ350を用いて実行する動作を説明する。まず、車載書込み装置は、車両走行中に、差分データ350を車載制御装置へ送信する。車載制御装置は、差分データ350を自装置内の不揮発性メモリへ保存する。 The operation of executing the program update of the in-vehicle control device using the difference data 350 will be described. First, the in-vehicle writing device transmits the difference data 350 to the in-vehicle control device while the vehicle is traveling. The in-vehicle control device stores the difference data 350 in the non-volatile memory in the own device.

次に、(c)車載制御装置の解凍ソフトで圧縮データから特定プログラムを復元するフローチャートと、(d)車載制御装置の差分復元ソフトで特定プログラムと差分データから新プログラムを復元するフローチャートを用いて説明する。 Next, using (c) a flowchart for restoring a specific program from compressed data with the decompression software of the in-vehicle control device, and (d) a flowchart for restoring a new program from the specific program and the difference data with the difference restoration software for the in-vehicle control device. explain.

まず、最初に解凍ソフト360が圧縮データ320から特定プログラム300を復元する。 First, the decompression software 360 restores the specific program 300 from the compressed data 320.

次に、差分復元ソフト370が特定プログラム300と差分データ350から新プログラム330を復元する。ここで差分データ350とは図3A(b)からわかるように、特定プログラム300と新プログラム330から生成されたものである。このため、車載制御装置は特定プログラム300さえあれば、差分データ350を用いて新プログラム330を復元できることがわかる。 Next, the difference restoration software 370 restores the new program 330 from the specific program 300 and the difference data 350. Here, the difference data 350 is generated from the specific program 300 and the new program 330, as can be seen from FIG. 3A (b). Therefore, it can be seen that the in-vehicle control device can restore the new program 330 using the difference data 350 as long as the specific program 300 is available.

このように本実施例は、車載制御装置の現バージョンのプログラムとの差分データを用いて差分更新するのではなく、全ての車載制御装置に搭載した特定のプログラムとの差分データを用いて差分更新する。 As described above, in this embodiment, the difference is not updated by using the difference data with the program of the current version of the in-vehicle control device, but by using the difference data with the specific program mounted on all the in-vehicle control devices. To do.

また、本実施例では車載制御装置に圧縮データの形態で特定プログラムを保持しているが、不揮発性メモリ容量が十分にあれば、特定プログラムそのままの形態で保持しても良い。 Further, in this embodiment, the in-vehicle control device holds the specific program in the form of compressed data, but if the non-volatile memory capacity is sufficient, the specific program may be held in the form as it is.

次に第2の課題を解決する構成を説明する。 Next, a configuration for solving the second problem will be described.

まず復元した新プログラム330を車載制御装置の不揮発性メモリへ書込み、現バージョンのプログラム(実行用プログラム331)を新プログラム330ヘ更新する。次に新プログラム330のサム値やハッシュ値などの計算を行い、新プログラム330の診断を行う。ここで診断結果に異常がなければ、車載制御装置は新プログラム330を用いて制御可能である。しかし、診断異常があった場合、前述したように差分更新によって現バージョンのプログラム(実行用プログラム331)へ戻すことはできない。そこで、本実施例では、差分データの格納エリアを最新の差分データ格納エリアと前回の差分データ格納エリアの2面用意し、差分データを格納しておく。この結果、診断異常があった場合は前回の差分データと特定のプログラムを用いて、現バージョンのプログラムを復元することができる。このように、特定プログラムとの差分データを最新版と前回版の2つを保持しておくことがポイントである。 First, the restored new program 330 is written to the non-volatile memory of the in-vehicle control device, and the current version of the program (execution program 331) is updated to the new program 330. Next, the sum value and hash value of the new program 330 are calculated, and the new program 330 is diagnosed. If there is no abnormality in the diagnosis result, the in-vehicle control device can be controlled by using the new program 330. However, if there is a diagnostic abnormality, it is not possible to return to the current version of the program (execution program 331) by the differential update as described above. Therefore, in this embodiment, the difference data storage area is prepared on two sides, the latest difference data storage area and the previous difference data storage area, and the difference data is stored. As a result, if there is a diagnostic abnormality, the current version of the program can be restored using the previous difference data and a specific program. In this way, the point is to keep the latest version and the previous version of the difference data with the specific program.

以上のように本実施例は、第1の課題を解決するために、車載制御装置内の現バージョンプログラムでは無く、特定のプログラム(例えば、初出荷時のプログラム)と新プログラムを用いて差分データを生成している。すなわち、異なるバージョンのプログラムで動作している車載制御装置であっても、本実施例の差分データだけで、全ての車載制御装置を差分更新できるようになる。このように本実施例により、複数のバージョンのプログラムとの差分データを管理しなくて済むので、プログラムのバージョン管理を簡素化できる。 As described above, in order to solve the first problem, the present embodiment uses a specific program (for example, a program at the time of initial shipment) and a new program instead of the current version program in the in-vehicle control device, and the difference data. Is being generated. That is, even if the in-vehicle control devices are operating with different versions of the program, all the in-vehicle control devices can be differentially updated only by the difference data of this embodiment. As described above, according to this embodiment, it is not necessary to manage the difference data between the programs of a plurality of versions, so that the version management of the program can be simplified.

第2の課題を解決するために、診断の結果、異常があった場合でも、前回版の差分データと特定のプログラムから現バージョンのプログラムを復元できる。この結果、車載制御装置を動作可能にできる。 In order to solve the second problem, even if there is an abnormality as a result of the diagnosis, the current version of the program can be restored from the difference data of the previous version and a specific program. As a result, the in-vehicle control device can be operated.

以下、図面を用いて実施例の詳細を説明する。まず、図1を用いて車載制御装置を含む車両の構成及び動作を説明する。 Hereinafter, the details of the examples will be described with reference to the drawings. First, the configuration and operation of the vehicle including the in-vehicle control device will be described with reference to FIG.

車両は、車載書き込み装置100(ゲートウェイ)、複数の車載制御装置200(200〜200)を備える。車載書き込み装置100と車載制御装置200は、相互に車載ネットワークCANを介して通信する。 Vehicle includes a vehicle writing device 100 (gateway), a plurality of vehicle-mounted control unit 200 (200 1 ~200 n). The vehicle-mounted writing device 100 and the vehicle-mounted control device 200 communicate with each other via the vehicle-mounted 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 according to the application of each in-vehicle control device 200, and a communication device 205 such as a CAN transceiver. The microcomputer 201 has a 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 vehicle-mounted writing device 100 is basically the same as the configuration of the vehicle-mounted control device 200, but a communication device corresponding to the protocol of the network outside the vehicle is further provided. 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 the protocol of the network outside the vehicle. The microcomputer 101 has a built-in SRAM 102 (volatile memory) and a FLASH memory 103 (nonvolatile memory).

次に、図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 view showing the internal configuration of the SRAM 202 shown in FIG.

SRAM202は、車載書込み装置100から送信された差分データを一時的に記憶するための受信エリア202a、車載制御装置200のFLASHメモリ203に予め内蔵された圧縮データを解凍して復元した特定のプログラムを一時的に記憶するための解凍エリア202c、差分データと特定のプログラムを用いて差分復元した新プログラムを一時的に記憶するための復元エリア202bを備える。 The SRAM 202 is a reception area 202a for temporarily storing the difference data transmitted from the vehicle-mounted writing device 100, and a specific program that is restored by decompressing the compressed data previously built in the FLASH memory 203 of the vehicle-mounted control device 200. A decompression area 202c for temporarily storing the decompression area 202c and a restoration area 202b for temporarily storing the difference data and the new program differentially restored using a specific program are provided.

次に、図4Aを用いて、FLASHメモリ203の構成を説明する。図4Aは、図1に示すFLASHメモリ203の内部の構成を示す模式図である。FLASHメモリ203は、複数のサイズのブロックB#n (n=1〜B)とリプロソフト400から構成される。ここで現バージョンのプログラムのバイナリーデータ(旧プログラムのバイナリーデータ)を格納する第1不揮発性メモリ410は、ブロックB#n (n=1〜7)のエリアである。また、本実施例の特定プログラムの圧縮データを格納する第2不揮発性メモリ420は、ブロックB#n (n=8〜B)のエリアである。さらに車載書込み装置100から受信した差分データを格納するための差分データ格納エリア430は、B#n (n=C, D)のエリアである。 Next, the configuration of the FLASH memory 203 will be described with reference to FIG. 4A. FIG. 4A is a schematic view showing the internal configuration of the FLASH memory 203 shown in FIG. The FLASH memory 203 is composed of blocks B # n (n = 1 to B) of a plurality of sizes and repro software 400. Here, the first non-volatile memory 410 for storing the binary data of the current version of the program (binary data of the old program) is an area of block B # n (n = 1 to 7). The second non-volatile memory 420 that stores the compressed data of the specific program of this embodiment is an area of block B # n (n = 8 to B). Further, the difference data storage area 430 for storing the difference data received from the vehicle-mounted writing device 100 is an area of B # n (n = C, D).

ここで、ブロックB#nとは、消去可能な最小サイズである。例えば、ブロックB#nにデータを書き込む場合、ブロックB#n全体を消去してからデータを書き込む必要がある。
さらにFLASHメモリ203の先頭のブロックには、差分更新を実行するリプロソフト400が搭載されている。また、FLASHメモリ203を複数のサイズのブロックB#n (n=1〜B)で構成しているが、ブロック数は本発明を制約するものではない。
Here, block B # n is the minimum size that can be erased. For example, when writing data to block B # n, it is necessary to erase the entire block B # n before writing the data.
Further, the repro software 400 that executes the differential update is mounted on the first block of the FLASH memory 203. Further, although the FLASH memory 203 is composed of blocks B # n (n = 1 to B) having a plurality of sizes, the number of blocks does not limit the present invention.

図4Bは、FLASH203をマイコン内蔵FLASH 203aと外付けFLASH 203bに分割した構成例である。内蔵FLASH 203aはリプロソフト400と第1不揮発性メモリ410で構成し、外付けFLASH 203bは第2不揮発性メモリ420(特定プログラムの圧縮データ)と差分データ格納エリア430で構成している。差分更新に必要なデータを外付けFLASH 203bに配置した構成である。 FIG. 4B is a configuration example in which the FLASH 203 is divided into a FLASH 203a with a built-in microcomputer and an external FLASH 203b. The built-in FLASH 203a is composed of the repro software 400 and the first non-volatile memory 410, and the external FLASH 203b is composed of the second non-volatile memory 420 (compressed data of a specific program) and the difference data storage area 430. This is a configuration in which the data required for differential update is placed on the external FLASH 203b.

図4Cは、図4Bの外付けFLASH 203bの差分データ格納エリア430を第1差分データ格納エリア430a (最新の差分データ)と第2差分データ格納エリア403b (前回の差分データ)の2つのエリアで構成した構成図である。前回の差分データは、診断異常時に使用する。 In FIG. 4C, the difference data storage area 430 of the external FLASH 203b of FIG. 4B is divided into two areas, the first difference data storage area 430a (latest difference data) and the second difference data storage area 403b (previous difference data). It is a constructed block diagram. The previous difference data is used when the diagnosis is abnormal.

次に実施例の全体構成を示す図5を用いて、リプロソフト400の動作を説明する。 Next, the operation of the repro software 400 will be described with reference to FIG. 5, which shows the overall configuration of the embodiment.

リプロソフト400には、一定周期で動作する通信ソフト500がある。差分データ受信ソフト510は、通信ソフト500から起動される。差分データ受信ソフト510は車載書込み装置100から受信した差分データをSRAM202の受信エリア202aに一時的に記憶し、さらに受信エリア202aの内容を第1差分データ格納エリア430aへ格納する手段である。次に通信ソフト500は差分復元ソフト520を起動する。差分復元ソフト520は、解凍ソフト540と第1差分復元ソフト550を起動する。解凍ソフト540は第2不揮発性メモリ420の圧縮データを解凍して特定プログラムを解凍エリア202cへ格納する。第1差分復元ソフト550は第1差分データ格納エリア430aの最新の差分データと解凍エリア202cの特定プログラムを入力として、差分更新を実行し、復元した新プログラムを復元エリア202bへ格納する。 The repro software 400 includes communication software 500 that operates at regular intervals. The difference data receiving software 510 is started from the communication software 500. The difference data receiving software 510 is a means for temporarily storing the difference data received from the in-vehicle writing device 100 in the receiving area 202a of the SRAM 202, and further storing the contents of the receiving area 202a in the first difference data storage area 430a. Next, the communication software 500 starts the difference restoration software 520. The difference restoration software 520 starts the decompression software 540 and the first difference restoration software 550. The decompression software 540 decompresses the compressed data of the second non-volatile memory 420 and stores the specific program in the decompression area 202c. The first difference restoration software 550 receives the latest difference data in the first difference data storage area 430a and a specific program in the decompression area 202c as inputs, executes a difference update, and stores the restored new program in the restoration area 202b.

次に第1不揮発性メモリ410のブロックB#n (n=1〜7)を消去して現バージョンのプログラム(旧プログラム、実行用プログラム331)を削除し、復元エリア202bの新プログラムを第1不揮発性メモリ410へ書込む。これで新プログラムが第1不揮発性メモリ410へ格納できたことになる。次に通信ソフト500は診断ソフトを起動させて、新プログラムが正しく復元され、かつ正しく書き込めたか診断を行う。もし診断結果が正常であれば、リプロソフト400によるソフトウェア更新は終了となる。一方、診断結果が異常であれば、解凍ソフト540を起動して、第2不揮発性メモリ420の圧縮データを解凍して特定プログラムをSRAM202の解凍エリア202cへ格納する。 Next, the block B # n (n = 1 to 7) of the first non-volatile memory 410 is erased, the current version of the program (old program, execution program 331) is deleted, and the new program in the restore area 202b is first. Write to the non-volatile memory 410. This means that the new program can be stored in the first non-volatile memory 410. Next, the communication software 500 starts the diagnostic software and diagnoses whether the new program is correctly restored and correctly written. If the diagnosis result is normal, the software update by the repro software 400 is completed. On the other hand, if the diagnosis result is abnormal, the decompression software 540 is started to decompress the compressed data of the second non-volatile memory 420, and the specific program is stored in the decompression area 202c of the SRAM 202.

次に第2差分復元ソフト560は第2差分データ格納エリア430bの前回の差分データと解凍エリア202cの特定プログラムを入力として、差分更新を実行し、復元した旧プログラム(現バージョンのプログラム、実行用プログラム331)を復元エリア202bへ格納する。 Next, the second difference restoration software 560 inputs the previous difference data in the second difference data storage area 430b and the specific program in the decompression area 202c, executes the difference update, and restores the old program (current version program, for execution). The program 331) is stored in the restoration area 202b.

次に第1不揮発性メモリ302のブロックB#n (n=1〜7)を消去することにより不正な新プログラムを削除し、復元エリア202bの旧プログラムを第1不揮発性メモリ302へ書込む。これで旧プログラムが第1不揮発性メモリ302へ格納できたことになる。 Next, the invalid new program is deleted by erasing the blocks B # n (n = 1 to 7) of the first non-volatile memory 302, and the old program in the restore area 202b is written to the first non-volatile memory 302. This means that the old program can be stored in the first non-volatile memory 302.

このように、差分復元に失敗した場合でも、特定プログラムの圧縮データと前回の差分データを用いて、解凍ソフト540と第2差分復元ソフト560を組み合わせて動作させることにより、旧プログラムを車載制御装置へ書込むことができた。 In this way, even if the difference restoration fails, the old program can be operated by combining the decompression software 540 and the second difference restoration software 560 using the compressed data of the specific program and the previous difference data. I was able to write to.

以下、具体的な通信コマンドの種類、プログラム書込み装置100が通信コマンドを使って車載制御装置へ差分データを送信する送信処理、車載制御装置の差分データ受信処理、プログラム書込み装置100の差分復元実行通信コマンドと診断実行通信コマンド送信処理、車載制御装置の差分復元実行通信コマンドと診断実行通信コマンド受信処理のフローチャートを図6〜図10Bを用いて説明し、次に解凍処理のコマンド、解凍ソフトの処理、差分処理のコマンド、第1差分復元ソフトの処理、診断ソフトの処理、第2差分復元ソフトの処理の詳細な説明を図10A〜図15を用いて説明する。 Hereinafter, specific types of communication commands, transmission processing in which the program writing device 100 transmits difference data to the in-vehicle control device using communication commands, difference data reception processing in the in-vehicle control device, and difference restoration execution communication in the program writing device 100 The flowcharts of the command and diagnosis execution communication command transmission processing, the differential restoration execution communication command of the in-vehicle controller and the diagnosis execution communication command reception processing are described with reference to FIGS. 6 to 10B, and then the decompression processing command and decompression software processing are described. , The command of the difference processing, the processing of the first difference restoration software, the processing of the diagnostic software, and the processing of the second difference restoration software will be described in detail with reference to FIGS. 10A to 15.

図6は、車載書込み装置100から車載制御装置200へ送信される通信コマンドである。この通信コマンドを用いて差分データを車載制御装置200へ送信する。 FIG. 6 is a communication command transmitted from the vehicle-mounted writing device 100 to the vehicle-mounted control device 200. The difference data is transmitted to the vehicle-mounted control device 200 using this communication command.

通信コマンド$10 600は車載制御装置200へ差分データの送信開始を通知するコマンドである。車載制御装置200はこのコマンドを受信することで、受信エリア202aへ差分データを格納することができる。 The communication command $ 10 600 is a command for notifying the in-vehicle controller 200 of the start of transmission of the difference data. By receiving this command, the in-vehicle control device 200 can store the difference data in the reception area 202a.

通信コマンド$20 610は、第1差分データ格納エリア430aを指定するコマンドである。付属するMAは第1差分データ格納エリア430aの先頭アドレス、MSは第1差分データ格納エリア430aのサイズである。 The communication command $ 20 610 is a command for designating the first difference data storage area 430a. The attached MA is the start address of the first difference data storage area 430a, and the MS is the size of the first difference data storage area 430a.

通信コマンド$30 620は、差分データDATAを付属したコマンドである。 The communication command $ 30 620 is a command with the difference data DATA attached.

通信コマンド$40 630は、差分データ送信終了を示すコマンドである。 The communication command $ 40 630 is a command indicating the end of differential data transmission.

以上の通信コマンドを用いて、プログラム書込み装置100から車載制御装置200へ差分データを送信し、車載制御装置200は差分データを第1差分格納エリア430aへ格納する。 Using the above communication command, the difference data is transmitted from the program writing device 100 to the vehicle-mounted control device 200, and the vehicle-mounted control device 200 stores the difference data in the first difference storage area 430a.

通信コマンド$50 640は、差分復元実行コマンドである。差分データを第1差分格納エリア430aへ格納した後に、プログラム書込み装置100から車載制御装置200へ送信される通信コマンドである。車載制御装置200は本通信コマンドを受信すると解凍ソフトと第1差分復元ソフトを起動して第1不揮発性メモリ410へ新プログラムを生成する。 The communication command $ 50 640 is a differential restoration execution command. This is a communication command transmitted from the program writing device 100 to the vehicle-mounted control device 200 after the difference data is stored in the first difference storage area 430a. Upon receiving this communication command, the in-vehicle control device 200 activates the decompression software and the first difference restoration software to generate a new program in the first non-volatile memory 410.

通信コマンド$60 650は、診断コマンドである。付属するMAは第1不揮発性メモリ410の先頭アドレス、MSはそのサイズである。車載制御装置200は、指定された先頭アドレスMAから、サイズMSのエリアのサム値を計算し、第1不揮発性メモリ410内新プログラムの所定のアドレスに格納されているサム値と一致することを診断する。もし一致すれば診断正常と判断してリプロ正常終了となる。一方、不一致の場合は診断異常と判断して解凍ソフトと第2差分復元ソフトを起動し、特定のプログラムと第2差分データ格納エリア430bの前回の差分データを用いて旧プログラムを復元し、第1不揮発性メモリ410へ書込むことで車載制御装置200を動作可能にする。 The communication command $ 60 650 is a diagnostic command. The attached MA is the start address of the first non-volatile memory 410, and the MS is its size. The in-vehicle control device 200 calculates the sum value of the area of size MS from the designated start address MA, and makes sure that the sum value matches the sum value stored in the predetermined address of the new program in the first non-volatile memory 410. Diagnose. If they match, the diagnosis is judged to be normal and the repro ends normally. On the other hand, if there is a discrepancy, it is judged that the diagnosis is abnormal, the decompression software and the second difference restoration software are started, and the old program is restored using the specific program and the previous difference data of the second difference data storage area 430b. 1 By writing to the non-volatile memory 410, the in-vehicle control device 200 can be operated.

図7は、プログラム書込み装置100が、車載制御装置200へ通信コマンドを用いて差分データをブロック単位に送信するフローチャートである。 FIG. 7 is a flowchart in which the program writing device 100 transmits the difference data to the in-vehicle control device 200 in block units by using a communication command.

700で通信コマンド 差分データ送信開始$10を送信する。 At 700, the communication command difference data transmission start $ 10 is transmitted.

710で通信コマンド 第1差分データ格納エリア430aを指定し、$20を送信する。 The communication command 1st difference data storage area 430a is specified by 710, and $ 20 is transmitted.

720で通信コマンド 差分データDATA $30を送信する。 At 720, the communication command difference data DATA $ 30 is transmitted.

730で通信コマンド 差分データ送信終了 $40を送信する。 Communication command difference data transmission end at 730 $ 40 is transmitted.

740は、全てのブロックの差分データを送信完了したか判定する。もし判定結果がnoならば710へ戻って次のブロックの差分データを710〜740を繰返すことで送信する。 740 determines whether the transmission of the difference data of all the blocks is completed. If the determination result is no, the process returns to 710 and the difference data of the next block is transmitted by repeating 710 to 740.

一方、もし判定結果がyesならば差分データ送信終了である。 On the other hand, if the determination result is yes, the difference data transmission is completed.

以上で、プログラム書込み装置100は全てのブロックの差分データを車載制御装置200へ送信したことになる。 As described above, the program writing device 100 has transmitted the difference data of all the blocks to the in-vehicle control device 200.

図8は、車載制御装置200の差分データ受信ソフト510の動作を示している。 FIG. 8 shows the operation of the difference data receiving software 510 of the in-vehicle control device 200.

800は、車載書込み装置100から通信コマンドAを受信する処理である。 The 800 is a process of receiving the communication command A from the in-vehicle writing device 100.

810は、受信した通信コマンドAが$10か判定し、もしyesなら815を実行して受信エリア202aを初期化する。一方、もしnoならば820を実行する。 810 determines whether the received communication command A is $ 10, and if yes, executes 815 to initialize the reception area 202a. On the other hand, if no, then 820 is executed.

815は、受信エリア202aと、復元エリア202bを初期化して差分更新の準備をする。 815 initializes the reception area 202a and the restoration area 202b to prepare for the difference update.

820は、コマンドAが$20か判定し、もしyesなら825を実行して第1差分データ格納エリア430aの先頭アドレスMAと、そのサイズMSを記憶する。一方、もしnoならば830を実行する。 820 determines whether the command A is $ 20, and if yes, executes 825 to store the start address MA of the first difference data storage area 430a and its size MS. On the other hand, if no, then 830 is executed.

830は、コマンドAが$30か判定し、もしyesなら835を実行してコマンドに付属する差分データDATAをMAで指示された第1差分データ格納エリア430aへ追加格納する。一方、もしnoならば840を実行する。 The 830 determines whether the command A is $ 30, and if yes, executes 835 to additionally store the difference data DATA attached to the command in the first difference data storage area 430a instructed by the MA. On the other hand, if no, then 840 is executed.

840は、コマンドAが$40か判定し、もしyesなら845を実行してブロックの差分データの受信完了であり、一方、もしnoならば850を実行する。 840 determines whether the command A is $ 40, and if yes, executes 845 to complete the reception of the block difference data, while if no, executes 850.

850は、全てのブロックの差分データを受信したか判定し、もしyesならば終了である。一方、もしnoならば820へ戻り、次のブロックの差分データを受信する処理を繰り返す。 850 determines whether the difference data of all the blocks has been received, and if yes, the process ends. On the other hand, if no, the process returns to 820 and the process of receiving the difference data of the next block is repeated.

以上で、差分データを第1差分データ格納エリア430aに格納できる。 With the above, the difference data can be stored in the first difference data storage area 430a.

図9は、プログラム書込み装置100から車載制御装置200へ通信コマンドを用いて差分復元実行と診断を指示するフローチャートである。
900は、通信コマンド$10による通信コマンド送信開始通知である。
910は、通信コマンド$50による差分復元実行通知である。
920は、通信コマンド$60による診断実行通知である。
FIG. 9 is a flowchart for instructing the differential restoration execution and the diagnosis from the program writing device 100 to the in-vehicle control device 200 by using a communication command.
Reference numeral 900 denotes a communication command transmission start notification by the communication command $ 10.
910 is a differential restoration execution notification by the communication command $ 50.
920 is a diagnosis execution notification by the communication command $ 60.

図10Aは、図9の910の差分復元実行コマンド受信によって起動される差分復元ソフト520のフローである。 FIG. 10A is a flow of the difference restoration software 520 activated by receiving the difference restoration execution command of FIG. 9 910.

1000は、解凍ソフト540を実行して第2不揮発性メモリ420の圧縮データを解凍して特定のプログラムを解凍エリア202cへ復元する処理である。 1000 is a process of executing the decompression software 540 to decompress the compressed data of the second non-volatile memory 420 and restore a specific program to the decompression area 202c.

1100は、第1差分復元ソフト550を実行して第1差分データ格納エリア430aの差分データと解凍エリア202cの特定のプログラムから新プログラムを生成して復元エリア202bへ格納する。さらに復元エリア202bの新プログラムを第1不揮発性メモリ410へ書込む処理である。 The 1100 executes the first difference restoration software 550 to generate a new program from the difference data in the first difference data storage area 430a and a specific program in the decompression area 202c, and stores the new program in the restoration area 202b. Further, it is a process of writing the new program of the restoration area 202b to the first non-volatile memory 410.

以上で、旧プログラムを新プログラムへ更新できる。 With the above, the old program can be updated to the new program.

図10Bは、解凍ソフト540が用いる解凍コマンドである。 FIG. 10B is a decompression command used by the decompression software 540.

解凍ソフトを説明する前に、まず圧縮ソフトの概要について説明する。圧縮ソフトは、圧縮処理において、プログラム中の部分命令列と同一の部分命令列をプログラムの他の部分に存在するか検索して見つけ出し、その部分命令列を短い符号に置き換える。同一の部分命令列が数多く存在すれば、短い符号に数多く置き換えられるので、より圧縮できることになる。このため圧縮ソフトは、プログラムを検索して同一の部分命令列が見つからない場合には、1000Aの解凍追加コマンドnewにその部分命令列DATAを付属させる。一方、同一の部分命令列が見つかった場合は、1010Aの解凍コピーコマンドcopyのように符号化する。プログラムのアドレスMAとサイズMSのペアで部分命令列を表現する。圧縮データとは、このように、解凍追加コマンドnewと解凍コピーコマンドcopyの列で構成されている。 Before explaining the decompression software, the outline of the compression software will be explained first. In the compression process, the compression software searches and finds out whether the same sub-instruction sequence as the sub-instruction sequence in the program exists in other parts of the program, and replaces the sub-instruction sequence with a short code. If there are many identical subinstruction sequences, they can be replaced with many short codes, so that they can be compressed more. Therefore, when the compression software searches the program and cannot find the same sub-instruction sequence, the compression software attaches the sub-instruction sequence DATA to the decompression additional command new of 1000A. On the other hand, when the same sub-instruction sequence is found, it is encoded by the decompression copy command copy of 1010A. A subinstruction sequence is represented by a pair of program address MA and size MS. In this way, the compressed data is composed of columns of the decompression addition command new and the decompression copy command copy.

以上の準備を踏まえて、解凍ソフト540の動作を説明する。 Based on the above preparation, the operation of the decompression software 540 will be described.

図11は、解凍ソフト540の動作を示すフローチャートである。 FIG. 11 is a flowchart showing the operation of the decompression software 540.

1100は第2不揮発性メモリ420の圧縮データを読み出す。 The 1100 reads the compressed data of the second non-volatile memory 420.

1110は読み出した圧縮コマンドを解析する。 1110 analyzes the read compression command.

1120はコマンドが解凍追加コマンドnewか判定し、もしyesならば1125を実行して解凍追加コマンドnewに付属するデータDATAを解凍エリア202cへ追記する。一方、noならば1130を実行する。 1120 determines whether the command is the decompression addition command new, and if yes, executes 1125 to add the data DATA attached to the decompression addition command new to the decompression area 202c. On the other hand, if no, 1130 is executed.

1130はコマンドが解凍コピーコマンドcopyか判定し、もしyesならば1135を実行して解凍コピーコマンドcopyに付属するMAとMSを用いて解凍エリア202c内のアドレスMAからサイズMSの部分命令列を解凍エリア202cへ追記する。一方、noならば1140を実行する。 The 1130 determines whether the command is a decompression copy command copy, and if yes, executes 1135 and decompresses the partial instruction sequence of size MS from the address MA in the decompression area 202c using the MA and MS attached to the decompression copy command copy. Add to area 202c. On the other hand, if no, 1140 is executed.

1140は全ての差分データを第2不揮発性メモリ420から読み出し終えたか判定し、もしyesならば終了である。すなわち特定のプログラムが解凍エリア202cに復元できたことになる。一方、noならば1100へ戻り、第2不揮発性メモリ420から圧縮データを読み出し、処理を繰り返し実行する。 1140 determines whether all the difference data has been read from the second non-volatile memory 420, and if yes, the process ends. That is, the specific program can be restored to the decompression area 202c. On the other hand, if no, the process returns to 1100, the compressed data is read from the second non-volatile memory 420, and the process is repeatedly executed.

次に、図12を用いて、第1差分復元ソフト550と第2差分復元ソフト560が用いる差分コマンドを説明する。 Next, the difference command used by the first difference restoration software 550 and the second difference restoration software 560 will be described with reference to FIG.

差分復元ソフトを説明する前に、まず差分生成ソフトの概要について説明する。差分生成ソフトは、差分生成処理において、新プログラム330の部分命令列が旧プログラム331に存在するか検索して見つけ出し、その部分命令列を短い符号に置き換える。新プログラムと旧プログラム331が類似していれば同一の部分命令列が数多く存在することになり、短い符号に数多く置き換えることができる。このため差分生成ソフトは、旧プログラム331を検索して同一の部分命令列が見つからない場合には、1200の差分追加コマンドnewにその部分命令列DATAを付属させる。一方、同一の部分命令列が旧プログラム331中に見つかった場合は、1210の差分コピーコマンドcopyのように符号化する。旧プログラムのアドレスMAとサイズMSのペアで部分命令列を表現する。差分データとは、このように、差分追加コマンドnewと差分コピーコマンドcopyの列で構成されている。 Before explaining the difference restoration software, the outline of the difference generation software will be explained first. In the difference generation process, the difference generation software searches for and finds out whether the partial instruction sequence of the new program 330 exists in the old program 331, and replaces the partial instruction sequence with a short code. If the new program and the old program 331 are similar, there will be many identical subinstruction sequences, and many can be replaced with short codes. Therefore, the difference generation software searches the old program 331 and when the same sub-instruction sequence is not found, attaches the sub-instruction sequence DATA to the 1200 difference addition command new. On the other hand, when the same sub-instruction sequence is found in the old program 331, it is encoded by the differential copy command copy of 1210. The sub-instruction sequence is represented by the pair of the address MA and the size MS of the old program. In this way, the difference data is composed of columns of the difference addition command new and the difference copy command copy.

以上の準備を踏まえて、第1差分復元ソフト550の動作を説明する。 Based on the above preparations, the operation of the first difference restoration software 550 will be described.

1300は、第1差分データ格納エリア430aの差分データから差分コマンドを読み出す。 The 1300 reads a difference command from the difference data in the first difference data storage area 430a.

1310は、差分コマンドを解析し、1320で差分コマンドが差分追加コマンドnewか判定し、もしyesなら1325を実行し、一方、もしnoならば1330を実行する。 1310 analyzes the difference command, determines in 1320 whether the difference command is the difference addition command new, executes 1325 if yes, and executes 1330 if no.

1325は、差分追加コマンドnewに付属する部分命令列DATAを復元エリア202bへ書込む。 1325 writes the partial instruction sequence DATA attached to the difference addition command new to the restoration area 202b.

1330は、差分コマンドが差分コピーコマンドcopyか判定し、もしyesなら1335を実行し、一方、もしnoならば1340を実行する。 The 1330 determines if the diff command is a diff copy command copy and executes the 1335 if yes, while executing the 1340 if no.

1335は、差分コピーコマンドcopyに付属するMAとMSを用いて、旧プログラムのアドレスMAからサイズMSの部分命令列を復元エリア202bへ追加書き込む。 The 1335 additionally writes a partial instruction sequence of size MS from the address MA of the old program to the restore area 202b using the MA and MS attached to the differential copy command copy.

1340は、第1差分データ格納エリア430aから差分データを全て読み出したか判定し、もしyesならば1350を実行する。一方、もしnoならば1300へ戻って処理を繰返す。 The 1340 determines whether all the difference data has been read from the first difference data storage area 430a, and if yes, executes 1350. On the other hand, if no, the process returns to 1300 and the process is repeated.

1350は、復元エリア202bに生成された新プログラムを第1不揮発性メモリ410へ書込む。 The 1350 writes the new program generated in the restoration area 202b to the first non-volatile memory 410.

以上で、差分復元した新プログラムを第1不揮発性メモリ410に格納できたことになる。 With the above, the new program that has been differentially restored can be stored in the first non-volatile memory 410.

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

前提として、新プログラムの定められたアドレスに新プログラム自身のサム値4バイトが存在しているものとする。診断は、このサム値を利用して行う。 As a premise, it is assumed that the sum value of the new program itself is 4 bytes at the specified address of the new program. Diagnosis is performed using this sum value.

1400は、第1不揮発性メモリ410の新プログラム中に存在するサム値を読み出して変数SUMへ設定している。 The 1400 reads the sum value existing in the new program of the first non-volatile memory 410 and sets it in the variable SUM.

1410は、第1不揮発性メモリ410の先頭アドレスMAからサイズMSまでのエリアのデータ(第1不揮発性メモリ410の新プログラム)を4バイト単位に加算した値を変数Sへ設定する。 In 1410, the value obtained by adding the data in the area from the start address MA of the first non-volatile memory 410 to the size MS (new program of the first non-volatile memory 410) in 4-byte units is set in the variable S.

1420は、変数SUMと変数Sの一致判定を行い、もしyesなら1425を実行し、一方、もしnoならば1430を実行する。 The 1420 determines that the variable SUM and the variable S match, and if yes, executes 1425, while if no, executes 1430.

1425は、診断結果が正常なのでプログラム更新は、正常終了となる。 Since the diagnosis result of 1425 is normal, the program update ends normally.

1430は、診断結果が異常なので、旧プログラムを復元することを目的に、まず解凍ソフト540を実行して特定のプログラムを解凍エリア202cへ生成する。 Since the diagnosis result of 1430 is abnormal, first, the decompression software 540 is executed to generate a specific program in the decompression area 202c for the purpose of restoring the old program.

1440は、第2差分復元ソフト560を起動して、第2差分データ格納エリア430bの前回の差分データと解凍エリア202cの特定のプログラムから旧プログラムを復元する。 1440 starts the second difference restoration software 560 to restore the old program from the previous difference data in the second difference data storage area 430b and the specific program in the decompression area 202c.

ここで、第1差分データ格納エリア430aと第2差分データ格納エリア430bの関係は、常に最新の差分データ格納エリアを第1差分データ格納エリアと呼び、前回の差分データを格納しているエリアを第2差分データ格納エリアと呼んでいる。また、前回の差分データと特定のプログラムから生成したプログラムは、明らかに、旧プログラムである。 Here, regarding the relationship between the first difference data storage area 430a and the second difference data storage area 430b, the latest difference data storage area is always called the first difference data storage area, and the area where the previous difference data is stored is called the first difference data storage area. It is called the second difference data storage area. Also, the program generated from the previous difference data and the specific program is clearly an old program.

解凍ソフト540の処理内容は、既に図11のフローチャートで詳しく説明したので、省略する。 Since the processing contents of the decompression software 540 have already been described in detail in the flowchart of FIG. 11, they will be omitted.

最後に、図15を用いて第2差分復元ソフト560のフローチャートを説明する。 Finally, the flowchart of the second difference restoration software 560 will be described with reference to FIG.

1500は、第2差分データ格納エリア430bの差分データから差分コマンドを読み出す。 The 1500 reads a difference command from the difference data in the second difference data storage area 430b.

1510は、差分コマンドを解析し、1520で差分コマンドが差分追加コマンドnewか判定し、もしyesなら1525を実行し、一方、もしnoならば1530を実行する。 1510 analyzes the difference command, determines whether the difference command is the difference addition command new at 1520, and executes 1525 if yes, while executing 1530 if no.

1525は、差分追加コマンドnewに付属する部分命令列DATAを復元エリア202bへ書込む。 The 1525 writes the partial instruction sequence DATA attached to the difference addition command new to the restore area 202b.

1530は、差分コマンドが差分コピーコマンドcopyか判定し、もしyesなら1535を実行し、一方、もしnoならば1540を実行する。 The 1530 determines if the diff command is a diff copy command copy, and if yes it executes 1535, while if no it executes 1540.

1535は、差分コピーコマンドcopyに付属するMAとMSを用いて、解凍エリア202cの特定のプログラムのアドレスMAからサイズMSの部分命令列を復元エリア202bへ追加書き込む。 The 1535 additionally writes a partial instruction sequence of size MS from the address MA of a specific program in the decompression area 202c to the restoration area 202b by using the MA and MS attached to the differential copy command copy.

1540は、第2差分データ格納エリア430bから差分データを全て読み出したか判定し、もしyesならば1550を実行する。一方、もしnoならば1500へ戻って処理を繰返す。 The 1540 determines whether all the difference data has been read from the second difference data storage area 430b, and if yes, executes 1550. On the other hand, if no, the process returns to 1500 and the process is repeated.

1550は、復元エリア202bに生成された旧プログラムを第1不揮発性メモリ410へ書込む。 The 1550 writes the old program generated in the restoration area 202b to the first non-volatile memory 410.

以上で、差分復元した旧プログラムを第1不揮発性メモリ410に格納できたことになる。 With the above, the old program that has been differentially restored can be stored in the first non-volatile memory 410.

本実施例では、特定のプログラムを圧縮して、その圧縮データを第2不揮発性メモリ420へ格納していた。しかし当然ながら、不揮発性メモリ203や外付けFLASH203bの容量が大きければ、圧縮データの形態では無く、特定のプログラム自身を第2不揮発性メモリ420へ保存しておいても良い。この形態が可能であれば、図5のリプロソフト400は、解凍ソフト540の代わりに、第2不揮発性メモリ420の特定のプログラムを解凍エリア202cへ転送する転送ソフトへ置き換えれば良い。この結果、差分復元ソフト520は、転送ソフトを実行して次に第1差分復元ソフト550を実行する。診断ソフト530も同様に、転送ソフトを実行して次に第2差分復元ソフト560を実行することで実現できる。 In this embodiment, a specific program is compressed and the compressed data is stored in the second non-volatile memory 420. However, as a matter of course, if the capacity of the non-volatile memory 203 or the external FLASH 203b is large, the specific program itself may be stored in the second non-volatile memory 420 instead of in the form of compressed data. If this form is possible, the repro software 400 of FIG. 5 may be replaced with transfer software that transfers a specific program of the second non-volatile memory 420 to the decompression area 202c instead of the decompression software 540. As a result, the difference restoration software 520 executes the transfer software, and then executes the first difference restoration software 550. Similarly, the diagnostic software 530 can be realized by executing the transfer software and then executing the second difference restoration software 560.

100…車載書込み装置(ゲートウェイ)
101…マイコン(演算装置)
102…SRAM(揮発性メモリ)
103…FLASHメモリ(不揮発性メモリ)
104…各種のIC
105…通信装置(CANプロトコル)
106…通信装置(車両の外部のネットワークのプロトコル)
200…車載制御装置(ECU)
201…マイコン(演算装置)
202…SRAM(揮発性メモリ)
203…FLASHメモリ(不揮発性メモリ)
203a…マイコン内蔵FLASHメモリ
203b…外付けFLASHメモリ
204…各種のIC
205…通信装置(CANプロトコル)
202a…受信エリア
202b…復元エリア
202c…解凍エリア
300…特定プログラム
310…圧縮ソフト
320…特定プログラムの圧縮データ
330…新プログラム(新たな実行用プログラム)
331…旧プログラム(実行用プログラム)
340…差分生成ソフト
350…特定プログラムと新プログラムの差分データ
360…解凍ソフト
370…差分復元ソフト
400…リプロソフト
410…第1不揮発性メモリ(実行可能なプログラムの格納エリア)
420…第2不揮発性メモリ(特定プログラムの圧縮データ格納エリア)
430…差分データ格納エリア
430a…第1差分データ格納エリア(最新の差分データ格納エリア)
430b…第2差分データ格納エリア(前回の差分データ格納エリア)
500…通信ソフト
510…差分データ受信ソフト
520…差分復元ソフト
530…診断ソフト
540…解凍ソフト
550…第1差分復元ソフト
560…第2差分復元ソフト
600…差分データ送信開始通信コマンド
610…差分データ格納エリア指定通信コマンド
620…差分データ通信コマンド
630…差分データ送信終了通信コマンド
640…復元実行通信コマンド
650…診断実行通信コマンド
1000A…解凍追加コマンド
1010A…解凍コピーコマンド
1200…差分追加コマンド
1210…差分コピーコマンド
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 (protocol of network outside the vehicle)
200 ... In-vehicle control device (ECU)
201 ... Microcomputer (arithmetic unit)
202 ... SRAM (volatile memory)
203 ... FLASH memory (nonvolatile memory)
203a ... FLASH memory with built-in microcomputer 203b ... External FLASH memory 204 ... Various ICs
205 ... Communication device (CAN protocol)
202a ... Reception area 202b ... Restoration area 202c ... Decompression area 300 ... Specific program 310 ... Compression software 320 ... Compression data of specific program 330 ... New program (new execution program)
331 ... Old program (execution program)
340 ... Difference generation software 350 ... Difference data between a specific program and a new program 360 ... Decompression software 370 ... Difference restoration software 400 ... Repro software 410 ... First non-volatile memory (executable program storage area)
420 ... Second non-volatile memory (compressed data storage area for a specific program)
430 ... Difference data storage area 430a ... First difference data storage area (latest difference data storage area)
430b ... Second difference data storage area (previous difference data storage area)
500 ... Communication software 510 ... Difference data reception software 520 ... Difference restoration software 530 ... Diagnostic software 540 ... Decompression software 550 ... First difference restoration software 560 ... Second difference restoration software 600 ... Difference data transmission start Communication command 610 ... Difference data storage Area designation communication command 620 ... Difference data communication command 630 ... Difference data transmission end communication command 640 ... Restoration execution communication command 650 ... Diagnosis execution communication command 1000A ... Decompression addition command 1010A ... Decompression copy command 1200 ... Difference addition command 1210 ... Difference copy command

Claims (3)

書き換え可能な実行用プログラムと特定プログラムを配置した不揮発性メモリを備え、新たな前記実行用プログラムと前記特定プログラムとの差分データと、前記不揮発性メモリの前記特定プログラムから、新たな前記実行用プログラムを復元して前記不揮発性メモリへ書き込むことにより前記実行用プログラムを更新し、
前記不揮発性メモリは、前記実行用プログラムを格納する第1不揮発性メモリと、前記特定プログラムと前記差分データを格納する第2不揮発性メモリと、を含み、
前記第2不揮発性メモリは、新たな前記差分データを格納する第1差分データ格納エリアと、前の前記差分データを格納する第2差分データ格納エリアとを備え、
新たな前記実行用プログラムへの更新が失敗した場合、前記第2差分データ格納エリアに格納された前記前の差分データと前記特定プログラムから、前の前記実行用プログラムを復元して、前記第1不揮発性メモリへ書き込むことを特徴とする車載制御装置。
A new execution program is provided from a rewritable execution program and a non-volatile memory in which a specific program is arranged, new difference data between the execution program and the specific program, and the specific program in the non-volatile memory. The execution program is updated by restoring and writing to the non-volatile memory.
The non-volatile memory includes a first non-volatile memory for storing the execution program and a second non-volatile memory for storing the specific program and the difference data.
The second non-volatile memory includes a first difference data storage area for storing the new difference data and a second difference data storage area for storing the previous difference data.
When the update to the new execution program fails, the previous execution program is restored from the previous difference data and the specific program stored in the second difference data storage area, and the first execution program is restored. An in-vehicle control device characterized by writing to a non-volatile memory.
前記第1不揮発性メモリは、マイコン内蔵であり、前記第2不揮発性メモリは、前記マイコンの外付けであることを特徴とする請求項記載の車載制御装置。 It said first non-volatile memory is a built-in microcomputer, the second non-volatile memory, the onboard control device according to claim 1, characterized in that the external of said microcomputer. 前記第2不揮発性メモリは、前記特定プログラムを圧縮データの形態で配置され、前記圧縮データを解凍して前記特定プログラムを生成してから、新たな前記実行用プログラムを復元して前記不揮発性メモリへ書き込むことを特徴とする請求項1または2に記載の車載制御装置。 In the second non-volatile memory, the specific program is arranged in the form of compressed data, the compressed data is decompressed to generate the specific program, and then a new execution program is restored to obtain the non-volatile memory. The vehicle-mounted control device according to claim 1 or 2, wherein the data is written to.
JP2018061090A 2018-03-28 2018-03-28 In-vehicle control device Active JP6838714B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018061090A JP6838714B2 (en) 2018-03-28 2018-03-28 In-vehicle control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018061090A JP6838714B2 (en) 2018-03-28 2018-03-28 In-vehicle control device

Publications (2)

Publication Number Publication Date
JP2019175024A JP2019175024A (en) 2019-10-10
JP6838714B2 true JP6838714B2 (en) 2021-03-03

Family

ID=68168897

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018061090A Active JP6838714B2 (en) 2018-03-28 2018-03-28 In-vehicle control device

Country Status (1)

Country Link
JP (1) JP6838714B2 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007080034A (en) * 2005-09-15 2007-03-29 Sony Corp Information processing system and method, receiver and receiving method, data generator and generating method, program, and information processor
JP4944686B2 (en) * 2007-06-28 2012-06-06 ソニーモバイルコミュニケーションズ株式会社 Software update method and portable terminal device
JP5212143B2 (en) * 2009-01-29 2013-06-19 株式会社デンソー Vehicle instrument
JP2010198155A (en) * 2009-02-24 2010-09-09 Fujitsu Ten Ltd Device and method for updating program, and information processing apparatus
CN102880495A (en) * 2012-10-15 2013-01-16 华为终端有限公司 Mobile terminal and software upgrading method for same

Also Published As

Publication number Publication date
JP2019175024A (en) 2019-10-10

Similar Documents

Publication Publication Date Title
CN108027753B (en) In-vehicle control device, program update system, and storage medium storing program update software
JP7071574B2 (en) Gateway device, in-vehicle network system and firmware update method
CN107077396B (en) In-vehicle control device, program writing device, program generating device, and method
US7774382B2 (en) Method and apparatus for configuring a control device, and corresponding control device
CN110809755B (en) electronic control system
CN101930387A (en) Improved fault tolerance method and device used for updating compressed read-only file system
JP2023090981A (en) Gateway device, on-vehicle network system and firmware update method
JP6719020B2 (en) In-vehicle control device and program update software
CN112424747A (en) Incremental files with reverse data
JP7298427B2 (en) Program update system and program update method
CN111240722A (en) Method for upgrading firmware over the air, and terminal, server and system applied by same
EP3920020A1 (en) Electronic control device and program update method
JP7044859B2 (en) Vehicle control device and program update system
JP2018160207A (en) On-vehicle controller and program update software
CN110764486B (en) Method and device for operating vehicle-mounted controller, vehicle-mounted controller and storage medium
JP2023168511A (en) Control device, method, program and vehicle
JP6838714B2 (en) In-vehicle control device
JP2018160208A (en) On-vehicle controller and program update software
JP6782654B2 (en) In-vehicle control device and program update software
WO2023175752A1 (en) Onboard program update system and onboard program update method
JP6988636B2 (en) Reprogramming method
KR100432313B1 (en) Method for checking errors of data downloaded to flash memory of subsystem from host system
JP2001125790A (en) Program reloading method for on-vehicle electronics
CN117178254A (en) Method for efficiently storing data
JP2023119314A (en) Electronic control device

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180330

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200228

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200302

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200825

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200911

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: 20201228

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210126

R150 Certificate of patent or registration of utility model

Ref document number: 6838714

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250