JP6408450B2 - Electronic control unit for automobile - Google Patents

Electronic control unit for automobile Download PDF

Info

Publication number
JP6408450B2
JP6408450B2 JP2015209879A JP2015209879A JP6408450B2 JP 6408450 B2 JP6408450 B2 JP 6408450B2 JP 2015209879 A JP2015209879 A JP 2015209879A JP 2015209879 A JP2015209879 A JP 2015209879A JP 6408450 B2 JP6408450 B2 JP 6408450B2
Authority
JP
Japan
Prior art keywords
program
ecu
boot loader
processor
rewriting
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
JP2015209879A
Other languages
Japanese (ja)
Other versions
JP2017084001A (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 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 JP2015209879A priority Critical patent/JP6408450B2/en
Publication of JP2017084001A publication Critical patent/JP2017084001A/en
Application granted granted Critical
Publication of JP6408450B2 publication Critical patent/JP6408450B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Description

本発明は、電気的にデータの書き換えが可能な不揮発性メモリを備えた自動車用電子制御装置に関する。   The present invention relates to an automotive electronic control device including a nonvolatile memory capable of electrically rewriting data.

自動車用電子制御装置は、電気的にデータの書き換えが可能な不揮発性メモリを搭載している。不揮発性メモリのデータを書き換える場合、特開2014−16890号公報(特許文献1)に記載されるように、更新データを転送する書込みツールを電子制御装置に接続する。そして、書込みツールが電子制御装置に更新データを転送し、電子制御装置が更新データを不揮発性メモリに書き込む。   The electronic control device for automobile is equipped with a nonvolatile memory capable of electrically rewriting data. When rewriting data in the nonvolatile memory, as described in Japanese Patent Application Laid-Open No. 2014-16890 (Patent Document 1), a writing tool for transferring update data is connected to the electronic control device. Then, the writing tool transfers the update data to the electronic control device, and the electronic control device writes the update data in the nonvolatile memory.

特開2014−16890号公報JP 2014-16890 A

ところで、電子制御装置の不揮発性メモリには、オペレーティングシステムをロードして起動するためのブートローダプログラムが書き込まれている。不揮発性メモリのデータを書き換える場合、不揮発性メモリの書換え領域を消去した後、そこに更新データを書き込むという手順を経る。ブートローダプログラムの書換え中、例えば、不揮発性メモリの消去後に電源障害又は通信障害によって電子制御装置がリセットされると、不揮発性メモリにブートローダプログラムが存在しなくなってしまう。このため、電源投入又はリセットしても、電子制御装置がオペレーティングシステムをロードすることができず、例えば、電子制御装置を分解して不揮発性メモリにブートローダプログラムを書き込まなければ、電子制御装置を使用できなくなってしまう。なお、ブートローダプログラムの書き換えは、例えば、その不具合解消、不揮発性メモリの全記憶領域の書き換えなどによって必要となる。   Incidentally, a boot loader program for loading and starting an operating system is written in the nonvolatile memory of the electronic control unit. When the data in the nonvolatile memory is rewritten, the update data is written in the nonvolatile memory after the erasure area is erased. During rewriting of the boot loader program, for example, if the electronic control device is reset due to a power failure or communication failure after erasing the nonvolatile memory, the boot loader program does not exist in the nonvolatile memory. For this reason, even if the power is turned on or reset, the electronic control unit cannot load the operating system. For example, the electronic control unit is used unless the electronic control unit is disassembled and the boot loader program is not written in the nonvolatile memory. It becomes impossible. Note that the boot loader program needs to be rewritten, for example, to eliminate the problem and rewrite the entire storage area of the nonvolatile memory.

そこで、本発明は、書込みツールでブートローダプログラムを書き込めるようにした、自動車用電子制御装置を提供することを目的とする。   SUMMARY OF THE INVENTION An object of the present invention is to provide an automotive electronic control device in which a boot loader program can be written with a writing tool.

自動車用電子制御装置は、電気的にデータを書換え可能な不揮発性メモリを備え、外部からの指示によって不揮発性メモリのデータを書き換える第1のモードと、不揮発性メモリに格納されたアプリケーションプログラムに従って制御対象機器を制御する第2のモードと、を切り替え可能である。そして、自動車用電子制御装置は、第1のモードで使用する書換えプログラムを、第2のモードにおいてオペレーティングシステムを起動させる起動プログラムが存在するときに動作する第1のプログラムと、起動プログラムが存在しないときにも動作する、オペレーティングシステムのサブセットを含んだ第2のプログラムと、を選択可能である。 An electronic control device for an automobile includes a nonvolatile memory that can electrically rewrite data, and performs control according to a first mode in which data in the nonvolatile memory is rewritten by an external instruction and an application program stored in the nonvolatile memory. It is possible to switch between the second mode for controlling the target device. The automotive electronic control device has no rewrite program used in the first mode, a first program that operates when a start program for starting the operating system in the second mode exists, and no start program. A second program that includes a subset of the operating system that sometimes runs can be selected.

本発明によれば、書込みツールでブートローダプログラムを書き込むことができる。   According to the present invention, a boot loader program can be written by a writing tool.

データ書換えシステムの一例を示す概要図である。It is a schematic diagram which shows an example of a data rewriting system. 電子制御装置の一例を示す内部構造図である。It is an internal structure figure which shows an example of an electronic controller. フラッシュROM(Read Only Memory)のメモリマップの一例を示す説明図である。It is explanatory drawing which shows an example of the memory map of flash ROM (Read Only Memory). 書換えツールの一例を示す内部構造図である。It is an internal structure figure which shows an example of the rewriting tool. 電子制御装置が実行する処理の一例を示すフローチャートである。It is a flowchart which shows an example of the process which an electronic controller performs. データ書換え処理の一例を示すサブルーチンである。It is a subroutine which shows an example of a data rewriting process. フラッシュROMにブートローダプログラムが存在しないときのメモリマップの一例を示す説明図である。It is explanatory drawing which shows an example of a memory map when a boot loader program does not exist in flash ROM.

以下、添付された図面を参照し、本発明を実施するための実施形態について詳述する。
図1は、自動車に搭載される電子制御装置(ECU:Electronic Control Unit)のデータを書き換える、データ書換えシステムの一例を示す。
Hereinafter, embodiments for carrying out the present invention will be described in detail with reference to the accompanying drawings.
FIG. 1 shows an example of a data rewriting system for rewriting data of an electronic control unit (ECU) mounted on an automobile.

データ書換え対象となるECU100は、CAN(Controller Area Network),シリアル通信,FlexRay(登録商標)などのネットワークケーブル200を介して、作業者がECU100のデータ書換え作業を行う、書換えツール300に着脱可能に接続される。なお、ECU100と書換えツール300とは、ネットワークケーブル200を使用した有線接続に限らず、無線送受信器を使用した無線接続によって接続されるようにしてもよい。   The ECU 100 to be rewritten can be attached to and detached from a rewriting tool 300 in which an operator performs data rewriting work on the ECU 100 via a network cable 200 such as CAN (Controller Area Network), serial communication, FlexRay (registered trademark), or the like. Connected. Note that the ECU 100 and the rewriting tool 300 are not limited to wired connection using the network cable 200 but may be connected by wireless connection using a wireless transceiver.

ECU100は、自動車に搭載された各種機器、例えば、燃料噴射弁,変速機,電動ブレーキシステム、ABS(Antilock Brake System),可変バルブタイミング機構,可変圧縮比機構などを制御する電子機器であって、マイクロコンピュータを内蔵している。具体的には、ECU100は、図2に示すように、CPU(Central Processing Unit)などのプロセッサ110と、ネットワークに接続するための通信回路120と、不揮発性メモリの一例として挙げられるフラッシュROM130と、揮発性メモリの一例として挙げられるRAM(Random Access Memory)140と、プロセッサ110,通信回路120,フラッシュROM130及びRAM140を相互に接続するバス150と、を有している。ここで、通信回路120は、ネットワークケーブル200を着脱可能に接続するコネクタ(図示せず)を含む。また、フラッシュROM130は、電気的にデータを消去及び書込むことで、データを書換え可能である。   The ECU 100 is an electronic device that controls various devices mounted on an automobile, for example, a fuel injection valve, a transmission, an electric brake system, an ABS (Antilock Brake System), a variable valve timing mechanism, a variable compression ratio mechanism, and the like. Built-in microcomputer. Specifically, as shown in FIG. 2, the ECU 100 includes a processor 110 such as a CPU (Central Processing Unit), a communication circuit 120 for connecting to a network, a flash ROM 130 as an example of a nonvolatile memory, A RAM (Random Access Memory) 140 that is an example of a volatile memory, and a bus 150 that connects the processor 110, the communication circuit 120, the flash ROM 130, and the RAM 140 to each other are included. Here, the communication circuit 120 includes a connector (not shown) that detachably connects the network cable 200. The flash ROM 130 can rewrite data by electrically erasing and writing data.

フラッシュROM130には、図3に示すように、ブートローダプログラム、書換えプログラム、フェイルセーフブートローダプログラム、オペレーティングシステム、各種機器を制御するためのアプリケーションプログラム1〜nなどが格納されている。ここで、ブートローダプログラム、書換えプログラム及びフェイルセーフブートローダプログラムが、夫々、起動プログラム、第1のプログラム及び第2のプログラムの一例として挙げられる。   As shown in FIG. 3, the flash ROM 130 stores a boot loader program, a rewrite program, a fail safe boot loader program, an operating system, application programs 1 to n for controlling various devices, and the like. Here, the boot loader program, the rewrite program, and the fail safe boot loader program are examples of the start program, the first program, and the second program, respectively.

ブートローダプログラムは、オペレーティングシステムをRAM140にロードして起動する。書換えプログラムは、オペレーティングシステムの動作下で、書換えツール300の指示に応答して、フェイルセーフブートローダプログラムが格納されている記憶領域を除く、フラッシュROM130のデータを書き換える。フェイルセーフブートローダプログラムは、オペレーティングシステムが動作していない状態、即ち、ブートローダプログラムが存在しない状態において、書換えツール300の指示に応答して、フェイルセーフブートローダプログラムが格納されている記憶領域を含む、フラッシュROM130のデータを書き換える。なお、ブートローダプログラム、書換えプログラム、フェイルセーフブートローダプログラム、オペレーティングシステム、アプリケーションプログラム1〜nは、例えば、データに埋め込まれた識別子、フラッシュROM130のメモリマップを管理するテーブルなどによって識別することができる。   The boot loader program loads the operating system into the RAM 140 and starts it. The rewriting program rewrites data in the flash ROM 130 except for the storage area in which the fail-safe boot loader program is stored in response to an instruction from the rewriting tool 300 under the operation of the operating system. The fail-safe boot loader program includes a storage area in which the fail-safe boot loader program is stored in response to an instruction from the rewriting tool 300 in a state where the operating system is not operating, that is, a state where the boot loader program does not exist. The data in the ROM 130 is rewritten. The boot loader program, the rewrite program, the fail safe boot loader program, the operating system, and the application programs 1 to n can be identified by, for example, an identifier embedded in data, a table that manages the memory map of the flash ROM 130, or the like.

ここで、フェイルセーフブートローダプログラムは、オペレーティングシステムが動作していなくとも、ECU100と書換えツール300との間の通信機能、フラッシュROM130のデータ書換え機能、フラッシュROM130のデータ検証機能を実現できるように構成されている。従って、フェイルセーフブートローダプログラムは、オペレーティングシステムのサブセットを含んでいる。   Here, the fail-safe boot loader program is configured to realize a communication function between the ECU 100 and the rewriting tool 300, a data rewriting function of the flash ROM 130, and a data verification function of the flash ROM 130 even when the operating system is not operating. ing. Thus, the failsafe boot loader program includes a subset of the operating system.

そして、ECU100は、電源投入又はリセットが行なわれたときに、フラッシュROM130のメモリマップ状態に応じて、ブートローダプログラム又はフェイルセーフブートローダプログラムを選択的に起動する。この選択的な起動は、例えば、ブートセクタを利用して実現することができる。   The ECU 100 selectively activates a boot loader program or a fail safe boot loader program according to the memory map state of the flash ROM 130 when power is turned on or reset. This selective activation can be realized, for example, using a boot sector.

書換えツール300は、作業者がECU100のデータ書換え作業を行う電子機器であって、例えば、パーソナルコンピュータなどのコンピュータから構成される。具体的には、書換えツール300は、図4に示すように、CPUなどのプロセッサ310と、ネットワークに接続するための通信回路320と、ハードディスク装置,SSD(Solid State Drive)などのストレージ330と、作業者へのインターフェースとなる入出力装置340と、を有している。ここで、通信回路320は、ネットワークケーブル200を着脱可能に接続するコネクタ(図示せず)を含む。また、入出力装置340は、LCD(Liquid Crystal Display)などのディスプレイと、キーボードと、マウスなどのポインティングデバイスと、を含む。ストレージ330は、例えば、図示しないネットワークに接続されたNAS(Network Attached Storage),サーバのストレージなどであってもよい。   The rewriting tool 300 is an electronic device in which an operator performs data rewriting work of the ECU 100, and is composed of a computer such as a personal computer, for example. Specifically, as shown in FIG. 4, the rewriting tool 300 includes a processor 310 such as a CPU, a communication circuit 320 for connecting to a network, a storage 330 such as a hard disk device and an SSD (Solid State Drive), And an input / output device 340 serving as an interface to the worker. Here, the communication circuit 320 includes a connector (not shown) that removably connects the network cable 200. The input / output device 340 includes a display such as an LCD (Liquid Crystal Display), a keyboard, and a pointing device such as a mouse. The storage 330 may be, for example, a NAS (Network Attached Storage) connected to a network (not shown), a server storage, or the like.

ストレージ330には、ECU100のフラッシュROM130を書き換えるための更新データが格納されている。更新データは、例えば、ブートローダプログラム、自動車に搭載された各種機器を制御するアプリケーションプログラム、そのアプリケーションプログラムで使用される定数,マップ(テーブル)などの制御パラメータなどを含む。なお、更新データは、更に、書換えプログラム、フェイルセーフブートローダプログラム、オペレーティングシステムを含むことができる。   The storage 330 stores update data for rewriting the flash ROM 130 of the ECU 100. The update data includes, for example, a boot loader program, an application program for controlling various devices mounted on the automobile, constants used in the application program, control parameters such as a map (table), and the like. The update data can further include a rewrite program, a fail safe boot loader program, and an operating system.

そして、ECU100は、書換えツール300からの指示によってフラッシュROM130のデータを書き換える第1のモードと、フラッシュROM130に格納されたアプリケーションプログラムに従って制御対象機器を制御する第2のモードと、を切り替え可能に構成されている。第1のモードで使用するデータ書換えプログラムとしては、第2のモードのブートローダプログラムが存在するときに動作する書換えプログラムと、ブートローダプログラムが存在しないときにも動作するフェイルセーフブートローダプログラムと、を選択可能である。また、ECU100は、電源投入又はリセットされてもブートローダプログラムが動作しない場合、フェイルセーフブートローダプログラムによる書換え処理に自動的に移行する。   The ECU 100 is configured to be able to switch between a first mode in which data in the flash ROM 130 is rewritten in accordance with an instruction from the rewriting tool 300 and a second mode in which the control target device is controlled in accordance with an application program stored in the flash ROM 130. Has been. As the data rewrite program used in the first mode, a rewrite program that operates when the boot loader program in the second mode exists and a fail safe boot loader program that operates even when the boot loader program does not exist can be selected. It is. Further, when the boot loader program does not operate even when the power is turned on or reset, the ECU 100 automatically shifts to a rewrite process by the fail safe boot loader program.

図5は、ECU100に電源が投入、又は、ECU100がリセットされたことを契機として、ECU100のプロセッサ110が実行する処理の一例を示す。なお、ECU100のフラッシュROM130のデータを書き換える場合には、作業者がECU100に書換えツール300を接続して、ECU100に電源を投入する。   FIG. 5 shows an example of processing executed by the processor 110 of the ECU 100 when the ECU 100 is powered on or reset. When rewriting the data in the flash ROM 130 of the ECU 100, the operator connects the rewriting tool 300 to the ECU 100 and turns on the power to the ECU 100.

ステップ1(図では「S1」と略記する。以下同様。)では、ECU100のプロセッサ110が、フラッシュROM130のブートセクタを検索し、例えば、そこにブートローダプログラムの識別子が格納されているか否かを介して、ブートローダプログラムがあるか否かを判定する。そして、ECU100のプロセッサ110は、フラッシュROM130にブートローダプログラムがあると判定すれば、処理をステップ2へと進める(Yes)。一方、ECU100のプロセッサ110は、フラッシュROM130にブートローダプログラムがないと判定すれば、処理をステップ8へと進める(No)。なお、フラッシュROM130にブートローダプログラムがあるか否かは、例えば、ECU100が備えている、指定した順序でブートセクタを検索して起動する機能を利用して判定することができる。   In step 1 (abbreviated as “S1” in the figure, the same applies hereinafter), the processor 110 of the ECU 100 searches for the boot sector of the flash ROM 130 and, for example, whether or not the identifier of the boot loader program is stored therein. To determine whether there is a boot loader program. If the processor 110 of the ECU 100 determines that there is a boot loader program in the flash ROM 130, the process proceeds to step 2 (Yes). On the other hand, if the processor 110 of the ECU 100 determines that there is no boot loader program in the flash ROM 130, the process proceeds to step 8 (No). Whether or not there is a boot loader program in the flash ROM 130 can be determined by using, for example, a function provided in the ECU 100 for searching and booting boot sectors in a specified order.

ステップ2では、ECU100のプロセッサ110が、フラッシュROM130のブートローダプログラムをRAM140にロードして起動する。そして、ブートローダプログラムが起動されると、ECU100のプロセッサ110は、フラッシュROM130のオペレーティングシステムをRAM140にロードして起動し、アプリケーションプログラムを起動する準備をすることができる。なお、ブートローダプログラムの起動は、例えば、ECU100が備えている、指定した順序でブートセクタを検索して起動する機能により実現することができる。   In step 2, the processor 110 of the ECU 100 loads the boot loader program in the flash ROM 130 into the RAM 140 and starts it. When the boot loader program is activated, the processor 110 of the ECU 100 can load the operating system of the flash ROM 130 into the RAM 140 and activate it to prepare for starting the application program. Note that the boot loader program can be activated by, for example, a function provided in the ECU 100 for searching and booting boot sectors in a specified order.

ステップ3では、ECU100のプロセッサ110が、フラッシュROM130の記憶領域を検索し、例えば、そこにアプリケーションプログラムの識別子が格納されているか否かを介して、アプリケーションプログラムがあるか否かを判定する。そして、ECU100のプロセッサ110は、フラッシュROM130にアプリケーションプログラムがあると判定すれば、処理をステップ4へと進める(Yes)。一方、ECU100のプロセッサ110は、フラッシュROM130にアプリケーションプログラムがないと判定すれば、処理をステップ7へと進める(No)。   In step 3, the processor 110 of the ECU 100 searches the storage area of the flash ROM 130 and determines whether there is an application program, for example, based on whether the identifier of the application program is stored there. If the processor 110 of the ECU 100 determines that there is an application program in the flash ROM 130, the process proceeds to step 4 (Yes). On the other hand, if the processor 110 of the ECU 100 determines that there is no application program in the flash ROM 130, the process proceeds to step 7 (No).

ステップ4では、ECU100のプロセッサ110が、フラッシュROM130のアプリケーションプログラムをRAM140にロードして起動する。なお、フラッシュROM130に複数のアプリケーションプログラムがある場合には、ECU100のプロセッサ110は、例えば、予め設定された起動順序で各アプリケーションプログラムを順次起動する。   In step 4, the processor 110 of the ECU 100 loads the application program of the flash ROM 130 into the RAM 140 and starts it. When there are a plurality of application programs in the flash ROM 130, the processor 110 of the ECU 100 sequentially activates each application program in, for example, a preset activation order.

ステップ5では、ECU100のプロセッサ110が、ステップ4で起動した各アプリケーションプログラムに従って、例えば、燃料噴射弁,変速機,電動ブレーキシステム、ABS,可変バルブタイミング機構,可変圧縮比機構などの各種機器を電子制御する。   In step 5, the processor 110 of the ECU 100 electronically converts various devices such as a fuel injection valve, a transmission, an electric brake system, an ABS, a variable valve timing mechanism, and a variable compression ratio mechanism in accordance with each application program started in step 4. Control.

ステップ6では、ECU100のプロセッサ110が、書換えツール300からデータ書換え要求があるか否かを判定する。そして、ECU100のプロセッサ110は、データ書換え要求があると判定すれば、処理をステップ7へと進める(Yes)。一方、ECU100のプロセッサ110は、データ書換え要求がないと判定すれば、処理をステップ5へと戻す(No)。なお、ECU100に書換えツール300が接続されていない場合には、書換えツール300からECU100にデータ書換え要求が送信されないので、各種機器を電子制御する通常処理が実行されることとなる。   In step 6, the processor 110 of the ECU 100 determines whether or not there is a data rewrite request from the rewrite tool 300. If the processor 110 of the ECU 100 determines that there is a data rewrite request, the process proceeds to step 7 (Yes). On the other hand, if the processor 110 of the ECU 100 determines that there is no data rewrite request, the process returns to step 5 (No). When the rewriting tool 300 is not connected to the ECU 100, a data rewriting request is not transmitted from the rewriting tool 300 to the ECU 100, and therefore normal processing for electronically controlling various devices is executed.

ステップ7では、ECU100のプロセッサ110が、フラッシュROM130の書換えプログラムをRAM140にロードして起動する。そして、ECU100のプロセッサ110は、処理をステップ9へと進める。   In step 7, the processor 110 of the ECU 100 loads the flash ROM 130 rewrite program into the RAM 140 and starts it. Then, the processor 110 of the ECU 100 advances the process to step 9.

ステップ8では、ECU100のプロセッサ110が、例えば、指定した順序でブートセクタを検索して起動する機能を利用して、フラッシュROM130のフェイルセーフブートローダプログラムをRAM140にロードして起動する。即ち、ECU100のプロセッサ110は、フラッシュROM130にブートローダプログラムが存在していないので、オペレーションシステムのサブセットを含むフェイルセーフブートローダプログラムを起動し、その機能を利用してブートローダプログラムを含む各種データをフラッシュROM130に書き込みできるようにする。そして、ECU100のプロセッサ110は、処理をステップ9へと進める。   In step 8, the processor 110 of the ECU 100 loads the fail safe boot loader program in the flash ROM 130 into the RAM 140 and activates it using, for example, a function to search and activate the boot sectors in the specified order. That is, since the boot loader program does not exist in the flash ROM 130, the processor 110 of the ECU 100 starts the fail safe boot loader program including a subset of the operation system, and uses the function to store various data including the boot loader program in the flash ROM 130. Make it writable. Then, the processor 110 of the ECU 100 advances the process to step 9.

ステップ9では、ECU100のプロセッサ110が、書換えツール300と協働して、ステップ7で起動した書換えプログラム、又は、ステップ8で起動したフェイルセーフブートローダプログラムによる、データ書換え処理のサブルーチンを実行する。なお、データ書換え処理の詳細は後述する。   In step 9, the processor 110 of the ECU 100 cooperates with the rewrite tool 300 to execute a data rewrite processing subroutine by the rewrite program activated in step 7 or the fail safe boot loader program activated in step 8. Details of the data rewriting process will be described later.

ステップ10では、ECU100のプロセッサ110が、以下に列挙する4つの条件の少なくとも1つが成立したか否かを介して、処理を終了させるか否かを判定する。そして、ECU100のプロセッサ110は、4つの条件の少なくとも1つが成立したと判定すれば、処理を終了させる(Yes)。一方、ECU100のプロセッサ110は、4つの条件の何れも成立していないと判定すれば、処理をステップ9へと戻す(No)。   In step 10, the processor 110 of the ECU 100 determines whether or not to end the process through whether or not at least one of the following four conditions is satisfied. If the processor 110 of the ECU 100 determines that at least one of the four conditions is satisfied, the process is terminated (Yes). On the other hand, if the processor 110 of the ECU 100 determines that none of the four conditions is satisfied, the process returns to step 9 (No).

第1の条件:フラッシュROM130へのデータ書込みが完了、又は、書換えツール300の署名改変
第2の条件:セッションタイムアウト(但し、フラッシュROM130の全記憶領域を書き換える場合にはタイムアウトさせない)
第3の条件:ECU100がリセット指令を受信(但し、フラッシュROM130の全記憶領域を書き換える場合のみ有効とし、通常は否定応答)
第4の条件:フラッシュROM130の消去若しくは書込み異常、通信遮断などの通信障害(但し、全記憶領域又はブートセクタを書き換える場合のみ有効)
First condition: data writing to the flash ROM 130 is completed, or signature modification of the rewrite tool 300 is second condition: session timeout (however, when rewriting the entire storage area of the flash ROM 130, timeout is not performed)
Third condition: ECU 100 receives a reset command (however, it is valid only when the entire storage area of flash ROM 130 is rewritten, and is normally a negative response)
Fourth condition: communication failure such as flash ROM 130 erasing or writing error, communication interruption (valid only when rewriting the entire storage area or boot sector)

図6は、ECU100のプロセッサ110と書換えツール300のプロセッサ310とが協働して実行する、データ書換え処理のサブルーチンの一例を示す。   FIG. 6 shows an example of a subroutine for data rewriting processing that is executed in cooperation by the processor 110 of the ECU 100 and the processor 310 of the rewriting tool 300.

ステップ21では、書換えツール300のプロセッサ310が、入出力装置340を利用して、ユーザに書換え対象を選択させる。即ち、書換えツール300のプロセッサ310は、例えば、入出力装置340に書換え対象を選択させる画面を表示し、その中から少なくとも1つの書換え対象を選択させる。   In step 21, the processor 310 of the rewriting tool 300 uses the input / output device 340 to cause the user to select a rewriting target. That is, the processor 310 of the rewriting tool 300 displays, for example, a screen for causing the input / output device 340 to select a rewriting target, and selects at least one rewriting target from the screen.

ステップ22では、書換えツール300のプロセッサ310が、ステップ21で選択された少なくとも1つの書換え対象から、1つの書換え対象を順次選定する。書換えツール300のプロセッサ310は、例えば、第1回目の処理では最初に選択された書換え対象を選定し、第2回目以降の処理では選択された順序に従って書換え対象を順次選定する。   In step 22, the processor 310 of the rewriting tool 300 sequentially selects one rewriting object from at least one rewriting object selected in step 21. For example, the processor 310 of the rewriting tool 300 selects the rewriting object selected first in the first process, and sequentially selects the rewriting object according to the selected order in the second and subsequent processes.

ステップ23では、書換えツール300のプロセッサ310が、例えば、ステップ22で選定された書換え対象のアドレスを指定することで、ECU100のフラッシュROM130における書換え対象が格納されている記憶領域の消去を、ECU100に要求する。   In step 23, the processor 310 of the rewrite tool 300 designates the rewrite target address selected in step 22, for example, to erase the storage area storing the rewrite target in the flash ROM 130 of the ECU 100 to the ECU 100. Request.

ステップ31では、ECU100のプロセッサ110が、書換えツール300からの消去要求に応答して、例えば、フラッシュROM130の指定アドレスに所定データを書き込むことで、その記憶領域を消去する。   In step 31, in response to the erasure request from the rewrite tool 300, the processor 110 of the ECU 100 erases the storage area, for example, by writing predetermined data to a designated address of the flash ROM 130.

ステップ32では、ECU100のプロセッサ110が、フラッシュROM130における指定アドレスの記憶領域の消去が終了したことを、書換えツール300に通知する。なお、このような通知は、ECU100と書換えツール300との間で同期をとるために行われる(以下同様)。   In step 32, the processor 110 of the ECU 100 notifies the rewriting tool 300 that the erasure of the storage area of the designated address in the flash ROM 130 has been completed. Note that such notification is performed in order to synchronize between the ECU 100 and the rewriting tool 300 (the same applies hereinafter).

ステップ24では、書換えツール300のプロセッサ310が、ECU100からの通知に応答して、ストレージ330から書換え対象の更新データを読み出し、これをECU100に送信する。なお、更新データは、所定サイズごとに分割して送信してもよい。   In step 24, the processor 310 of the rewriting tool 300 reads the update data to be rewritten from the storage 330 in response to the notification from the ECU 100 and transmits it to the ECU 100. The update data may be divided and transmitted for each predetermined size.

ステップ33では、ECU100のプロセッサ110が、書換えツール300から受信した更新データをフラッシュROM130に書き込む。
ステップ34では、ECU100のプロセッサ110が、フラッシュROM130へのデータ書込みが終了したことを、書換えツール300に通知する。
In step 33, the processor 110 of the ECU 100 writes the update data received from the rewriting tool 300 into the flash ROM 130.
In step 34, the processor 110 of the ECU 100 notifies the rewriting tool 300 that the data writing to the flash ROM 130 has been completed.

ステップ25では、書換えツール300のプロセッサ310が、全ての書換え対象を処理したか否かを判定する。そして、書換えツール300のプロセッサ310は、全ての書換え対象を処理したと判定すれば、処理を終了させる(Yes)。一方、書換えツール300のプロセッサ310は、全ての書換え対象を処理していないと判定すれば、処理をステップ22へと戻す(No)。   In step 25, the processor 310 of the rewriting tool 300 determines whether or not all rewriting objects have been processed. If the processor 310 of the rewriting tool 300 determines that all the rewriting objects have been processed, the processing ends (Yes). On the other hand, if the processor 310 of the rewriting tool 300 determines that not all rewriting objects have been processed, the process returns to step 22 (No).

かかる処理によれば、ECU100のフラッシュROM130にブートローダブログラムが書き込まれていれば、ECU100のプロセッサ110は、ブートローダプログラムをRAM140にロードして起動することで、オペレーティングシステムを動作させる。そして、フラッシュROM130にアプリケーションプログラムが書き込まれていれば、ECU100のプロセッサ110は、アプリケーションプログラムをRAM140にロードして起動することで、自動車に搭載された各種機器を電子制御する。   According to such processing, if the boot loader program is written in the flash ROM 130 of the ECU 100, the processor 110 of the ECU 100 loads the boot loader program into the RAM 140 and starts it, thereby operating the operating system. If an application program is written in the flash ROM 130, the processor 110 of the ECU 100 electronically controls various devices mounted on the automobile by loading the application program into the RAM 140 and starting the application program.

フラッシュROM130にアプリケーションプログラムが書き込まれていなければ、ECU100が各種機器を電子制御できないので、アプリケーションプログラムをフラッシュROM130に書き込み可能とすべく、ECU100のプロセッサ110は、書換えプログラムを起動する。また、ECU100のプロセッサ110が各種機器を電子制御しているとき、ECU100に接続された書換えツール300からデータ書換え要求があると、ECU100のプロセッサ110は、書換えツール300の要求に応答すべく、書換えプログラムを起動する。   If the application program is not written in the flash ROM 130, the ECU 100 cannot electronically control various devices. Therefore, the processor 110 of the ECU 100 starts the rewriting program so that the application program can be written in the flash ROM 130. In addition, when the processor 110 of the ECU 100 electronically controls various devices, if there is a data rewrite request from the rewrite tool 300 connected to the ECU 100, the processor 110 of the ECU 100 rewrites to respond to the request of the rewrite tool 300. Start the program.

そして、ECU100のプロセッサ110は、書換えツール300からの指示に応答して、フラッシュROM130のデータを書き換える。このとき、書換えプログラムは、フェイルセーフローダプログラムを書換え不能に構成されているため、例えば、フラッシュROM130の全データを書き換えているときに、電源障害又は通信障害が発生しても、フラッシュROM130からフェイルセーフブートローダプログラムが消失することを抑制できる。   Then, the processor 110 of the ECU 100 rewrites the data in the flash ROM 130 in response to an instruction from the rewriting tool 300. At this time, since the rewrite program is configured so that the fail safe loader program cannot be rewritten, for example, when all data in the flash ROM 130 is rewritten, even if a power failure or a communication failure occurs, the rewrite program fails from the flash ROM 130. The loss of the safe boot loader program can be suppressed.

一方、図7に示すように、フラッシュROM130にブートローダプログラムが書き込まれていない場合、ECU100のプロセッサ110は、オペレーティングシステムを動作させることができない。このため、ECU100のプロセッサ110は、オペレーティングシステムのサブセットを含んだフェイルセーフブートローダプログラムを起動し、その機能を利用して、少なくともブートローダプログラムをフラッシュROM130に書き込みできるようにする。   On the other hand, as shown in FIG. 7, when the boot loader program is not written in the flash ROM 130, the processor 110 of the ECU 100 cannot operate the operating system. For this reason, the processor 110 of the ECU 100 activates a fail-safe boot loader program including a subset of the operating system and uses the function to write at least the boot loader program into the flash ROM 130.

従って、ECU100において、フラッシュROM130のブートローダプログラムを書き換えているときに、例えば、電源障害又は通信障害によってリセットされ、ブートローダプログラムが消去されても、ECU100を分解せずに、書換えツール300の指示に応答して、フェイルセーフブートローダプログラムによってブートローダプログラムを書き込むことができる。   Therefore, when the boot loader program in the flash ROM 130 is rewritten in the ECU 100, for example, even if the boot loader program is deleted due to a power failure or a communication failure and the boot loader program is deleted, the ECU 100 does not disassemble the ECU 100 and responds to the instruction of the rewriting tool 300. Thus, the boot loader program can be written by the fail safe boot loader program.

ここで、フラッシュROM130のフェイルセーフブートローダプログラムは、例えば、バグなどを含んでいる可能性があるため、これも書換え対象となり得る。この場合、オペレーティングシステムの動作下において、書換えプログラムによってフェイルセーフブートローダプログラムを書き換えることができない。しかし、フェイルセーフブートローダプログラムは、フラッシュROM130の全記憶領域を書換え可能であるため、これによってフェイルセーフブートローダプログラムを書き換えることができる。ここで、フェイルセーフブートローダプログラムは、フラッシュROM130からRAM140へとロードされて起動されているので、フラッシュROM130のフェイルセーフブートローダプログラムを書き換えても、何ら問題が発生しない。   Here, since the fail-safe boot loader program of the flash ROM 130 may contain, for example, a bug, it can also be rewritten. In this case, the fail-safe boot loader program cannot be rewritten by the rewriting program under the operation of the operating system. However, since the fail safe boot loader program can rewrite the entire storage area of the flash ROM 130, the fail safe boot loader program can be rewritten. Here, since the fail safe boot loader program is loaded from the flash ROM 130 to the RAM 140 and started, no problem occurs even if the fail safe boot loader program in the flash ROM 130 is rewritten.

100 電子制御装置
110 プロセッサ
130 フラッシュROM(不揮発性メモリ)
100 Electronic control device 110 Processor 130 Flash ROM (nonvolatile memory)

Claims (3)

電気的にデータを書換え可能な不揮発性メモリを備え、外部からの指示によって前記不揮発性メモリのデータを書き換える第1のモードと、前記不揮発性メモリに格納されたアプリケーションプログラムに従って制御対象機器を制御する第2のモードと、を切り替え可能な自動車用電子制御装置において、
前記第1のモードで使用する書換えプログラムを、前記第2のモードにおいてオペレーティングシステムを起動させる起動プログラムが存在するときに動作する第1のプログラムと、前記起動プログラムが存在しないときにも動作する、前記オペレーティングシステムのサブセットを含んだ第2のプログラムと、を選択可能にした、
ことを特徴とする自動車用電子制御装置。
A non-volatile memory capable of electrically rewriting data is provided, and a control target device is controlled in accordance with a first mode in which data in the non-volatile memory is rewritten by an external instruction and an application program stored in the non-volatile memory In the automotive electronic control device capable of switching between the second mode,
The rewrite program used in the first mode operates when the start program for starting the operating system in the second mode exists and when the start program does not exist , A second program including a subset of the operating system is selectable;
An electronic control device for an automobile.
電源投入又はリセットしても前記第1のプログラムが動作しない場合、前記第2のプログラムによる書換え処理に移行する、
ことを特徴とする請求項1に記載の自動車用電子制御装置。
If the first program does not operate even when the power is turned on or reset, the process proceeds to a rewrite process by the second program.
The automotive electronic control device according to claim 1.
前記第1のプログラムは、前記第2のプログラムを書換え不能である、
ことを特徴とする請求項1又は請求項2に記載の自動車用電子制御装置。
The first program cannot rewrite the second program.
The automobile electronic control device according to claim 1 or 2, wherein
JP2015209879A 2015-10-26 2015-10-26 Electronic control unit for automobile Active JP6408450B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015209879A JP6408450B2 (en) 2015-10-26 2015-10-26 Electronic control unit for automobile

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015209879A JP6408450B2 (en) 2015-10-26 2015-10-26 Electronic control unit for automobile

Publications (2)

Publication Number Publication Date
JP2017084001A JP2017084001A (en) 2017-05-18
JP6408450B2 true JP6408450B2 (en) 2018-10-17

Family

ID=58711129

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015209879A Active JP6408450B2 (en) 2015-10-26 2015-10-26 Electronic control unit for automobile

Country Status (1)

Country Link
JP (1) JP6408450B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7128763B2 (en) * 2019-03-18 2022-08-31 日立Astemo株式会社 Electronic control unit and control data setting method
JP7082386B1 (en) 2021-11-30 2022-06-08 株式会社オーイーシー Software update method and its update system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004005152A (en) * 2002-05-31 2004-01-08 Hitachi Unisia Automotive Ltd Rewriting device for nonvolatile memory
JP2004192329A (en) * 2002-12-11 2004-07-08 Fuji Photo Film Co Ltd Program rewriting method and terminal device
KR100750132B1 (en) * 2005-09-27 2007-08-21 삼성전자주식회사 Method and system for booting, updating software automatically and recovering update error, and computer readable medium recording the method
JP5113700B2 (en) * 2008-09-24 2013-01-09 株式会社日立ソリューションズ Firmware update apparatus and method
JP2012093961A (en) * 2010-10-27 2012-05-17 Omron Automotive Electronics Co Ltd Control apparatus and method, and program write system

Also Published As

Publication number Publication date
JP2017084001A (en) 2017-05-18

Similar Documents

Publication Publication Date Title
US7490177B2 (en) System method for performing a direct memory access for automatically copying initialization boot code in a new memory architecture
TWI515660B (en) Firmware variable update method
US20180046447A1 (en) Data storage device and method for reducing firmware update time and data processing system including the device
TWI492867B (en) In-vehicle apparatus
JP6227794B2 (en) Vehicle control device, reprogramming system
JP6408450B2 (en) Electronic control unit for automobile
US10467018B2 (en) System and method for booting a host device from a mobile device
KR101601751B1 (en) Ecu of vehicle and boot software re-programming method thereof
JP6899719B2 (en) Electronic control device for automobiles
TWI438402B (en) Navigation device for vehicle
JP6575157B2 (en) Firmware download method and firmware embedded device
KR20170139730A (en) Data storage device and operating method thereof
JP6708596B2 (en) Electronic control device and control program verification method
US10817213B2 (en) Data storage device and operating method for data storage device
JP2002175193A (en) Device and method for rewriting program
JP2003271420A (en) Electronic control device
JP2007207089A (en) External storage device controller and program
TW200923782A (en) A bootloader self-update system and method thereof
TW201526005A (en) Method for programming flash memory and computer-readable medium
US20170344260A1 (en) Electronic device and operating method thereof
US7596717B2 (en) Microcomputer and debugging method
JP2011039825A (en) Firmware updating method and firmware updating device
JP2016081150A (en) Electronic controller for automatic vehicle
JP2015090512A (en) Information processing device having memory dump function
JP2020101841A (en) Vehicle control apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170920

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180425

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180515

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180619

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180920

R150 Certificate of patent or registration of utility model

Ref document number: 6408450

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250