JP5942778B2 - Information processing device - Google Patents
Information processing device Download PDFInfo
- Publication number
- JP5942778B2 JP5942778B2 JP2012233148A JP2012233148A JP5942778B2 JP 5942778 B2 JP5942778 B2 JP 5942778B2 JP 2012233148 A JP2012233148 A JP 2012233148A JP 2012233148 A JP2012233148 A JP 2012233148A JP 5942778 B2 JP5942778 B2 JP 5942778B2
- Authority
- JP
- Japan
- Prior art keywords
- program
- variation
- executed
- switching
- memory protection
- 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.)
- Expired - Fee Related
Links
- 230000010365 information processing Effects 0.000 title claims description 11
- 238000000034 method Methods 0.000 claims description 110
- 238000012545 processing Methods 0.000 claims description 31
- 230000001012 protector Effects 0.000 claims description 2
- 230000006870 function Effects 0.000 description 28
- 238000004891 communication Methods 0.000 description 3
- 238000012937 correction Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000007257 malfunction Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000006378 damage Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Landscapes
- Storage Device Security (AREA)
Description
本発明は、情報処理装置に関する。 The present invention relates to an information processing apparatus.
従来から、携帯可能電子装置の動作を制御するプログラムが複数のプログラムモジュールで構成されており、あるプログラムモジュールの実行を開始する前に、当該プログラムモジュールの実行可否を判断し、判断の結果、当該プログラムモジュールの実行が不可の場合は当該携帯可能電子装置の動作を停止させる技術が知られている(例えば、特許文献1参照)。 Conventionally, a program for controlling the operation of a portable electronic device has been configured by a plurality of program modules. Before starting execution of a certain program module, it is determined whether or not the program module can be executed. A technique for stopping the operation of the portable electronic device when the program module cannot be executed is known (see, for example, Patent Document 1).
ところで、車両等に実装される制御プログラムに関して、ECUのソフトウェアを例えば2WD、4WDなどの制御の異なる車両に対して共通化することがある。この場合、車両情報を他のECUや車両工場のツール等から受信し、不揮発性メモリに記憶し、その値を参照して動的に動作を切り換えるロジックが組み込まれる。 By the way, with respect to a control program installed in a vehicle or the like, the ECU software may be commonly used for vehicles with different controls such as 2WD and 4WD. In this case, vehicle information is received from another ECU, a vehicle factory tool, or the like, stored in a non-volatile memory, and a logic for dynamically switching the operation with reference to the value is incorporated.
また、一般的に、マイコンはメモリ保護機能を備え、同じマイコン上で実行される処理(タスク)毎に使用可能なメモリ領域を制限して、他の処理による予期しないメモリアクセスによる干渉を防止している。 In addition, microcomputers generally have a memory protection function that limits the memory area that can be used for each process (task) executed on the same microcomputer to prevent interference from unexpected memory access by other processes. ing.
しかしながら、ECU内に記憶した情報を使って動的にソフトウェアの動作を切り換えると、メモリの破壊やノイズ等に起因して、ECU内に記憶した情報が破壊された場合に、誤動作が発生する(例えば、本来実行されるべきでない処理が実行されうる)という問題がある。この点、動的に条件分岐等で処理を切り換えるプログラムの場合、元となる情報を書き込んだメモリ自体を多重化するなどの保護を行ったとしても、動作時に参照する際はレジスタ等の一時的なメモリを使用することになるため、ノイズ等で誤動作する可能性がある。この点、現状のメモリ保護機能は、実装されるべき処理(タスク)間の干渉を防止しているが、本来実行されるべきでない処理の実行までは防止することができない。 However, if the software operation is dynamically switched using the information stored in the ECU, a malfunction occurs when the information stored in the ECU is destroyed due to memory destruction, noise, or the like ( For example, there is a problem that processing that should not be executed can be executed. In this regard, in the case of a program that dynamically switches processing by conditional branching etc., even if protection such as multiplexing of the memory itself in which the original information is written is performed, a temporary register such as Since a large memory is used, there is a possibility of malfunction due to noise or the like. In this regard, the current memory protection function prevents interference between processes (tasks) to be implemented, but cannot prevent execution of processes that should not be executed.
そこで、本発明は、本来実行されるべきでないプログラムが実行されていることを検出した場合に、本来実行されるべきプログラムへ切り換えることができる情報処理装置の提供を目的とする。 Therefore, an object of the present invention is to provide an information processing apparatus capable of switching to a program that should be originally executed when it is detected that a program that should not be executed is being executed.
上記目的を達成するため、本発明の一局面によれば、不揮発性メモリからなり、所定プログラムを含む複数のプログラムが格納された第1記憶装置と、
前記第1記憶装置と同じ不揮発性メモリ又は異なる揮発性メモリからなり、前記複数のプログラムのうちの実行すべき前記所定プログラムを決定するための情報が格納された第2記憶装置と、
メモリ保護部とを備え、
前記メモリ保護部において前記所定プログラム以外のプログラムの実行を禁止する設定を行う初期設定処理と、
前記第2記憶装置に格納される情報に基づいて、実行するプログラムを決定し、前記決定したプログラムの実行に伴う前記第1記憶装置へのアクセス時に前記メモリ保護部においてメモリ保護違反が発生した場合に、前記初期設定処理により設定された設定情報に基づいて、実行するプログラムを前記所定プログラムに切り換えるプログラム切換処理と、を実行するように構成された情報処理装置が提供される。
In order to achieve the above object, according to one aspect of the present invention, a first storage device comprising a non-volatile memory and storing a plurality of programs including a predetermined program;
A second storage device comprising the same nonvolatile memory as the first storage device or a different volatile memory, and storing information for determining the predetermined program to be executed among the plurality of programs;
With a memory protector,
An initial setting process for performing a setting for prohibiting execution of a program other than the predetermined program in the memory protection unit ;
When a program to be executed is determined based on information stored in the second storage device, and a memory protection violation occurs in the memory protection unit when accessing the first storage device due to execution of the determined program Further, an information processing apparatus configured to execute a program switching process for switching a program to be executed to the predetermined program based on the setting information set by the initial setting process is provided.
本発明によれば、本来実行されるべきでないプログラムが実行されていることを検出した場合に、本来実行されるべきプログラムへ切り換えることができる情報処理装置が得られる。 According to the present invention, when it is detected that a program that should not be executed is executed, an information processing apparatus that can switch to a program that should be executed is obtained.
以下、図面を参照して、本発明を実施するための最良の形態の説明を行う。 The best mode for carrying out the present invention will be described below with reference to the drawings.
図1は、車両制御装置100の一例を示す構成図である。車両制御装置100は、ECU10を含む。ECU10は、任意の車両制御を行うECUであってよい。例えば、ECU10は、車両の駆動力制御(エンジン制御やトランスミッション制御)を行うECUであってよい。
FIG. 1 is a configuration diagram illustrating an example of the
ECU10は、例えばCAN(controller area network)などの適切なバス14を介して、車両内の各種の他のECU12に接続されてよい。他のECU12は、例えば車両のボデー系の電装品を制御するボデーECU等を含んでよい。
The ECU 10 may be connected to various
ECU10のハードウェア構成自体は、任意であり、例えば図1に示すように、例えばCANドライバ12を介して、バス14に接続されるマイコン20を備える。マイコン20は、CPU22と、メモリ保護部(保護機能)24と、フラッシュメモリ26と、RAM28とを含む。
The hardware configuration itself of the
ここで、本実施例では、車両等に実装される制御プログラムに関して、ECUのソフトウェアを例えば2WD、4WDなどの制御の異なる車両に対して共通化しているものとする。即ち、制御プログラムは、複数のバリエーションのプログラム(対象となる制御自体は同じであるが、制御内容が異なるプログラム)を含む。ここでは、制御プログラムは、例えば仕向け国「欧州」向けのバリエーションAのためのプログラム(バリエーションA用プログラム)と、例えば仕向け国「日本」向けのバリエーションBのためのプログラム(バリエーションB用プログラム)とを含む。尚、バリエーションA用プログラムと、バリエーションB用プログラムとは、対象となる制御自体は同じであるが、制御内容(要求値の算出ロジックなどの制御ロジック)が異なる。例えば、対象となる制御自体は、同じ駆動力制御であるが、バリエーションA用プログラムは、例えば2WD用に設計された駆動力制御プログラムであり、バリエーションB用プログラムは、例えば4WD用に設計された駆動力制御プログラムであるといった具合である。この際、2WD用に設計された駆動力制御プログラムと、4WD用に設計された駆動力制御プログラムとは、例えば、HV(ハイブリッド)制御において、各モータへの要求トルク(配分)の算出ロジックが異なる。 Here, in this embodiment, regarding the control program implemented in the vehicle or the like, it is assumed that the ECU software is common to vehicles with different controls such as 2WD and 4WD. That is, the control program includes a plurality of variations of programs (programs that have the same target control but different control contents). Here, the control program includes, for example, a program for variation A for the destination country “Europe” (program for variation A), and a program for variation B for the destination country “Japan” (program for variation B), for example. including. The program for variation A and the program for variation B have the same target control, but the control content (control logic such as required value calculation logic) is different. For example, the target control itself is the same driving force control, but the variation A program is a driving force control program designed for 2WD, for example, and the variation B program is designed for 4WD, for example. For example, it is a driving force control program. At this time, the driving force control program designed for 2WD and the driving force control program designed for 4WD are, for example, the calculation logic of required torque (distribution) to each motor in HV (hybrid) control. Different.
尚、車両に実装される制御プログラムは、多数存在し、それぞれが、複数のバリエーションのプログラムを含みうる。ここでは、複数のバリエーションのプログラムを含む、ある特定の1つの任意の制御プログラムを対象として説明を続ける。 There are many control programs installed in the vehicle, and each can include a plurality of variations. Here, the description will be continued with respect to a specific one arbitrary control program including a plurality of variations of programs.
CPU22は、メモリ保護部24を介してフラッシュメモリ26やRAM28にアクセスし、フラッシュメモリ26に格納された制御プログラム(バリエーションA用プログラム及びバリエーションB用プログラム)に基づく各種処理を行う。
The
メモリ保護部24は、ある制御プログラムの実行に伴って、禁止領域として指定されたアドレス領域へのアクセス(例えばWrite/Readアクセス)が発生したこと(メモリ保護違反)を検出すると、その旨の情報(アクセス例外)を発生する。禁止領域は、例えばスーパーバイザーモード等のセキュリティ性を確保したアプリケーションにより設定(指定)されてよい。例えばバリエーションA用プログラムのみへのアクセスを許可し、バリエーションB用プログラムへのアクセスを禁止するとき、バリエーションB用プログラムが格納されたアドレス領域が禁止領域となる。このとき、バリエーションA用プログラムが格納されたアドレス領域が実行許可領域(実行許可アドレス)となる。
When the
フラッシュメモリ26は、不揮発性メモリの一例であり、他の同様の類のメモリ(例えば他のEEPROM)が使用されてもよい。フラッシュメモリ26には、バリエーションA用プログラム及びバリエーションB用プログラムが格納される。
The
RAM28は、SRAM(Static Random Access Memory)であってよい。RAM28には、フラッシュメモリ26から一時的に読み出した値等が格納される。RAM28には、例えば後述のバリエーション情報[VARI]が格納される。
The
図2は、ECU10(マイコン20)におけるイニシャル処理の一例を示すフローチャートである。 FIG. 2 is a flowchart showing an example of initial processing in the ECU 10 (microcomputer 20).
ステップ200では、車両情報[INF]が入力される。車両情報は、例えばCAN通信等の車載ECU間通信にて他のECU12(例えばボデーECU等)から入力されてよい。この場合、車両情報は、イグニッションスイッチのオン中に定期的に受信されるデータであってよい。また、車両情報は、車両工場のツール等から受信されてもよい。車両情報は、制御プログラムのバリエーションに関する情報(即ち、当該車両に対してどのバリエーションのプログラムが実行されるべきかを示す情報)を含む。ここでは、車両情報は、バリエーションA用プログラム及びバリエーションB用プログラムのいずれが実行されるべきかを示す情報を含む。例えば、車両情報は、バリエーションA用プログラム及びバリエーションB用プログラムのいずれが実行されるべきかを間接的に示す情報として、仕向け等を示す情報であってもよい。
In
ステップ202では、上記ステップ200で入力された車両情報に基づいて、バリエーション情報[VARI]が確定される。即ち、上記ステップ200で入力された車両情報に応じたバリエーション情報[VARI]がRAM28(及びフラッシュメモリ26)に記憶される。例えば、上記ステップ200で入力された車両情報[INF]が、バリエーションA用プログラムを指示する情報を含む場合、バリエーション情報[VARI]が"A"として確定され、上記ステップ200で入力された車両情報[INF]が、バリエーションB用プログラムを指示する情報を含む場合、バリエーション情報[VARI]が"B"として確定される。
In
ステップ204では、上記ステップ202で確定されたバリエーション情報[VARI]に基づいて、即ち、RAM28(及びフラッシュメモリ26)内に記憶されたバリエーション情報[VARI]に基づいて、バリエーション情報[VARI]が"A"であるか否かが判定される。バリエーション情報[VARI]が"A"であるときは、ステップ206に進み、それ以外の場合は、ステップ208に進む。
In step 204, the variation information [VARI] is determined based on the variation information [VARI] determined in
ステップ206では、バリエーションA用プログラム以外の実行を禁止する設定を行う。即ち、バリエーションB用プログラムの実行を禁止する設定を行う。この設定は、例えば、バリエーションA用プログラムのみアクセスを許可し、バリエーションB用プログラムへのアクセスを禁止するようにユーザアプリケーション(例えばスーパーバイザーモード等のセキュリティ性を確保したアプリケーション)からマイコン20のメモリ保護部24のレジスタへ設定値を書き込むことで実現されてよい。
In
ステップ208では、上記ステップ202で確定されたバリエーション情報[VARI]に基づいて、バリエーション情報[VARI]が"B"であるか否かが判定される。バリエーション情報[VARI]が"B"であるときは、ステップ210に進み、それ以外の場合は、そのまま終了する。尚、バリエーションA用プログラム及びバリエーションB用プログラムの2種類のバリエーションしかない場合は、ステップ208を省略し、ステップ204で否定判定されたときにステップ210に進むこととしてもよい。
In
ステップ210では、上記ステップ206と同様、バリエーションB用プログラム以外の実行を禁止する設定を行う。即ち、バリエーションA用プログラムの実行を禁止する設定を行う。ステップ210の処理が終了すると、イニシャル処理が完了となる。
In
このように図2に示すイニシャル処理によれば、通信等で入力された車両情報を用いて、該当車両では実行すべきでないプログラム領域に対して実行を禁止する設定を行うことができる。 As described above, according to the initial process shown in FIG. 2, it is possible to perform the setting for prohibiting the execution of the program area that should not be executed in the corresponding vehicle, using the vehicle information input by communication or the like.
図3は、ECU10(マイコン20)におけるメイン処理の一例を示すフローチャートである。図3に示すメイン処理は、図2に示したイニシャル処理完了後、イグニッションスイッチがオンの間、所定周期毎に繰り返し実行されてよい。 FIG. 3 is a flowchart showing an example of main processing in the ECU 10 (microcomputer 20). The main process shown in FIG. 3 may be repeatedly executed at predetermined intervals while the ignition switch is on after completion of the initial process shown in FIG.
ステップ300では、RAM28(又はフラッシュメモリ26)に格納されているバリエーション情報[VARI]に基づいて、バリエーション情報[VARI]が"A"であるか否かが判定される。バリエーション情報[VARI]が"A"であるときは、ステップ302に進み、それ以外の場合は、ステップ304に進む。
In
ステップ302では、バリエーションA用の関数Func_A()が実行される。即ち、バリエーションA用プログラムが実行される。
In
ステップ304では、RAM28(又はフラッシュメモリ26)に格納されているバリエーション情報[VARI]に基づいて、バリエーション情報[VARI]が"B"であるか否かが判定される。バリエーション情報[VARI]が"B"であるときは、ステップ306に進み、それ以外の場合は、そのままステップ300に戻る。尚、バリエーションA用プログラム及びバリエーションB用プログラムの2種類のバリエーションしかない場合は、ステップ304を省略し、ステップ300で否定判定されたときにステップ306に進むこととしてもよい。
In
ステップ306では、バリエーションB用の関数Func_B()が実行される。即ち、バリエーションB用プログラムが実行される。
In
ここで、図3に示すメイン処理の間に、RAM28(又はフラッシュメモリ26)に格納されているバリエーション情報が何らかの原因(ノイズ等)で正規の値でない値に動作中に書き換わってしまった場合、CPU22は、その正規でない値に基づいて、本来実行すべきでない方のプログラムの係るメモリ領域(禁止領域)へアクセスを行おうとする。この際、メモリ保護部24が機能し、当該アクセスを禁止する。従って、制御プログラムの切換(即ちバリエーションA用プログラム及びバリエーションB用プログラム間の切換)に使用している情報(又はその情報の複製)、即ちRAM28(又はフラッシュメモリ26)に格納されているバリエーション情報が何らかの原因で正規の値でない値に動作中に書き換わってしまった場合でも、メモリ保護部24の設定により、本来実行すべきでない処理の動作を確実に禁止することができる。
If the variation information stored in the RAM 28 (or the flash memory 26) is rewritten during operation to a value that is not a normal value for some reason (such as noise) during the main processing shown in FIG. The
図4は、ECU10(マイコン20)におけるメモリ保護違反割り込み処理(プログラム切換処理)の一例を示すフローチャートである。図4に示す処理は、例えば、図3に示したメイン処理中に、メモリ保護部24がアクセス例外を発生したときに割り込み処理として実行されてよい。
FIG. 4 is a flowchart showing an example of a memory protection violation interrupt process (program switching process) in the ECU 10 (microcomputer 20). The process shown in FIG. 4 may be executed as an interrupt process when the
ステップ400では、メモリ保護部24の設定情報(図2のステップ206及びステップ210参照)に基づいて、実行許可領域(実行許可アドレス)がバリエーションA用プログラムの処理(処理A)であるか否かを判定する。実行許可領域(実行許可アドレス)については、メモリ保護部24の設定情報を参照することで実現されてよい。実行許可領域が処理Aである場合は、ステップ402に進み、実行許可領域が処理Aでない場合は、ステップ404に進む。
In
ステップ402では、バリエーションA用の関数Func_A()への復帰が実行される。即ち、バリエーションA用プログラムへの切換が実行される。これにより、制御プログラムの切換(即ちバリエーションA用プログラム及びバリエーションB用プログラム間の切換)に使用しているRAM28(又はフラッシュメモリ26)内のバリエーション情報が何らかの原因で正規の値"A"でない値"B"に動作中に書き換わってしまった場合でも、本来実行されるべきバリエーションA用プログラムへの復帰(切換)を実現することができる。尚、この際、RAM28(又はフラッシュメモリ26)内のバリエーション情報についても値"A"に書換えすることとしてもよい。 In step 402, the return to the function Func_A () for variation A is executed. That is, switching to the variation A program is executed. Thus, the variation information in the RAM 28 (or the flash memory 26) used for switching the control program (that is, switching between the variation A program and the variation B program) is a value that is not the normal value “A” for some reason. Even when the program is rewritten to “B” during the operation, it is possible to realize return (switching) to the variation A program that should be executed. At this time, the variation information in the RAM 28 (or the flash memory 26) may be rewritten to the value “A”.
ステップ404では、メモリ保護部24の設定情報(図2のステップ206及びステップ210参照)に基づいて、実行許可領域(実行許可アドレス)がバリエーションB用プログラムの処理(処理B)であるか否かを判定する。実行許可領域が処理Bである場合は、ステップ406に進み、実行許可領域が処理Bでない場合は、そのまま終了する。尚、バリエーションA用プログラム及びバリエーションB用プログラムの2種類のバリエーションしかない場合は、ステップ404を省略し、ステップ400で否定判定されたときにステップ406に進むこととしてもよい。
In step 404, based on the setting information of the memory protection unit 24 (see
ステップ406では、バリエーションB用の関数Func_B()への復帰が実行される。即ち、バリエーションB用プログラムへの切換が実行される。これにより、制御プログラムの切換(即ちバリエーションA用プログラム及びバリエーションB用プログラム間の切換)に使用しているRAM28(又はフラッシュメモリ26)内のバリエーション情報が何らかの原因で正規の値"B"でない値"A"に動作中に書き換わってしまった場合でも、本来実行されるべきバリエーションB用プログラムへの復帰(切換)を実現することができる。尚、この際、RAM28(又はフラッシュメモリ26)内のバリエーション情報についても値"B"に書換えすることとしてもよい。
In
図4に示す処理によれば、メモリ保護違反発生時の割り込み処理により、本来実行すべきプログラム領域を判別し、本来実行すべきプログラムの実行状態へと復帰させることができる。 According to the process shown in FIG. 4, it is possible to determine the program area to be originally executed by the interrupt process when the memory protection violation occurs, and to return to the execution state of the program to be originally executed.
具体的には、図3に示すメイン処理の間に、RAM28(又はフラッシュメモリ26)に格納されているバリエーション情報が何らかの原因(ノイズ等)で正規の値でない値に動作中に書き換わってしまった場合、CPU22は、その正規でない値に基づいて、本来実行すべきでないプログラムの係るメモリ領域(禁止領域)へアクセスを行おうとする。この際、メモリ保護部24が機能し、上述の如く本来実行すべきでない処理が禁止されると共に、割り込み処理として図4に示す処理が実行される。従って、制御プログラムの切換(即ちバリエーションA用プログラム及びバリエーションB用プログラム間の切換)に使用しているバリエーション情報が何らかの原因で正規の値でない値に動作中に書き換わることで本来実行すべきでないプログラムが実行されうる状態になった場合でも、本来実行すべきプログラムへの復帰(補正)が可能となる。
Specifically, during the main process shown in FIG. 3, the variation information stored in the RAM 28 (or the flash memory 26) is rewritten during operation to a value that is not a normal value for some reason (noise or the like). In this case, the
尚、図4に示す処理では、制御プログラムがバリエーションA用プログラム及びバリエーションB用プログラムの2種類であることを前提としているが、制御プログラムが3種類以上であっても同様である。例えば制御プログラムがバリエーションA用プログラム、バリエーションB用プログラム及びバリエーションC用プログラムの3種類である場合、ステップ404で否定判定されたときに、メモリ保護部24の設定情報(図2のステップ206及びステップ210参照)に基づいて、実行許可領域(実行許可アドレス)がバリエーションC用プログラムの処理(処理C)であるか否かを判定し、実行許可領域が処理Cであるときは、バリエーションC用の関数Func_C()への復帰が実行されればよい。 In the processing shown in FIG. 4, it is assumed that there are two types of control programs, a variation A program and a variation B program, but the same applies to three or more types of control programs. For example, when there are three types of control programs, a variation A program, a variation B program, and a variation C program, when a negative determination is made in step 404, the setting information (step 206 and step in FIG. 210)), it is determined whether or not the execution permission area (execution permission address) is the process (process C) of the variation C program. If the execution permission area is the process C, the variation C area It is only necessary to return to the function Func_C ().
図5は、ECU10(マイコン20)におけるメモリ保護違反割り込み処理(プログラム切換処理)の他の一例を示すフローチャートである。図5に示す処理は、例えば、図3に示したメイン処理中に、メモリ保護部24がアクセス例外を発生したときに割り込み処理として実行されてよい。
FIG. 5 is a flowchart showing another example of the memory protection violation interrupt process (program switching process) in the ECU 10 (microcomputer 20). The process shown in FIG. 5 may be executed as an interrupt process when the
ステップ500では、メモリ保護違反の違反発生箇所がバリエーションA用プログラムの処理(処理A)であるか否かを判定する。例えば、メモリ保護違反発生時のプログラムカウンタの値(アドレス)を参照し、そのプログラムカウンタの値に対応する処理(タスク)がバリエーションA用プログラムの処理(処理A)であるか否かを判定してもよい。尚、この場合も、メモリ保護違反は、メモリ保護部24の設定情報(図2のステップ206及びステップ210参照)に基づいて発生されるので、メモリ保護違反の違反発生箇所は、メモリ保護部24の設定情報に基づいて判断されていることになる。違反発生箇所が処理Aである場合は、ステップ502に進み、違反発生箇所が処理Aでない場合は、ステップ504に進む。
In
ステップ502では、バリエーションB用の関数Func_B()への復帰が実行される。即ち、バリエーションB用プログラムへの切換が実行される。これにより、制御プログラムの切換(即ちバリエーションA用プログラム及びバリエーションB用プログラム間の切換)に使用しているRAM28(又はフラッシュメモリ26)内のバリエーション情報が何らかの原因で正規の値"B"でない値"A"に動作中に書き換わってしまった場合でも、本来実行されるべきバリエーションB用プログラムへの復帰(切換)を実現することができる。尚、この際、RAM28(又はフラッシュメモリ26)内のバリエーション情報についても値"B"に書換えすることとしてもよい。 In step 502, a return to the function B for the variation B Func_B () is executed. That is, switching to the variation B program is executed. As a result, the variation information in the RAM 28 (or flash memory 26) used for switching the control program (that is, switching between the variation A program and the variation B program) is a value that is not the normal value “B” for some reason. Even when the program is rewritten to “A” during operation, it is possible to realize return (switching) to the variation B program that should be executed. At this time, the variation information in the RAM 28 (or the flash memory 26) may be rewritten to the value “B”.
ステップ504では、メモリ保護違反の違反発生箇所がバリエーションB用プログラムの処理(処理B)であるか否かを判定する。違反発生箇所が処理Bである場合は、ステップ506に進み、違反発生箇所が処理Bでない場合は、そのまま終了する。尚、バリエーションA用プログラム及びバリエーションB用プログラムの2種類のバリエーションしかない場合は、ステップ504を省略し、ステップ500で否定判定されたときにステップ506に進むこととしてもよい。
In
ステップ506では、バリエーションA用の関数Func_A()への復帰が実行される。即ち、バリエーションA用プログラムへの切換が実行される。これにより、制御プログラムの切換(即ちバリエーションA用プログラム及びバリエーションB用プログラム間の切換)に使用しているRAM28(又はフラッシュメモリ26)内のバリエーション情報が何らかの原因で正規の値"A"でない値"B"に動作中に書き換わってしまった場合でも、本来実行されるべきバリエーションA用プログラムへの復帰(切換)を実現することができる。尚、この際、RAM28(又はフラッシュメモリ26)内のバリエーション情報についても値"A"に書換えすることとしてもよい。 In step 506, return to the function Func_A () for variation A is executed. That is, switching to the variation A program is executed. Thus, the variation information in the RAM 28 (or the flash memory 26) used for switching the control program (that is, switching between the variation A program and the variation B program) is a value that is not the normal value “A” for some reason. Even when the program is rewritten to “B” during the operation, it is possible to realize return (switching) to the variation A program that should be executed. At this time, the variation information in the RAM 28 (or the flash memory 26) may be rewritten to the value “A”.
図5に示す処理によれば、同様に、メモリ保護違反発生時の割り込み処理により、メモリ保護違反が発生しないプログラムの実行状態、即ち本来実行すべきプログラムの実行状態へと復帰させることができる。 Similarly, according to the processing shown in FIG. 5, the interrupt processing when a memory protection violation occurs can return to the execution state of the program in which the memory protection violation does not occur, that is, the execution state of the program to be originally executed.
具体的には、図3に示すメイン処理の間に、RAM28(又はフラッシュメモリ26)に格納されているバリエーション情報が何らかの原因(ノイズ等)で正規の値でない値に動作中に書き換わってしまった場合、CPU22は、その正規でない値に基づいて、本来実行すべきでないプログラムの係るメモリ領域(禁止領域)へアクセスを行おうとする。この際、メモリ保護部24が機能し、上述の如く本来実行すべきでない処理が禁止されると共に、割り込み処理として図5に示す処理が実行される。これにより、制御プログラムの切換(即ちバリエーションA用プログラム及びバリエーションB用プログラム間の切換)に使用しているバリエーション情報が何らかの原因で正規の値でない値に動作中に書き換わることで本来実行すべきでないプログラムが実行されうる状態になった場合でも、本来実行すべきプログラムへの復帰(補正)が可能となる。
Specifically, during the main process shown in FIG. 3, the variation information stored in the RAM 28 (or the flash memory 26) is rewritten during operation to a value that is not a normal value for some reason (noise or the like). In this case, the
尚、図5に示す処理では、制御プログラムがバリエーションA用プログラム及びバリエーションB用プログラムの2種類であることを前提としているが、制御プログラムが3種類以上であっても同様である。例えば、制御プログラムがバリエーションA用プログラム、バリエーションB用プログラム、バリエーションC用プログラム及びバリエーションD用プログラムの4種類である場合、以下の図6に示すようなメモリ保護違反割り込み処理が実行されてもよい。 In the processing shown in FIG. 5, it is assumed that there are two types of control programs: a variation A program and a variation B program, but the same applies to three or more types of control programs. For example, when there are four types of control programs: a variation A program, a variation B program, a variation C program, and a variation D program, a memory protection violation interrupt process as shown in FIG. 6 below may be executed. .
図6は、ECU10(マイコン20)におけるメモリ保護違反割り込み処理(プログラム切換処理)の他の一例を示すフローチャートである。図6に示す処理は、例えば、図3に示したメイン処理中に、メモリ保護部24がアクセス例外を発生したときに割り込み処理として実行されてよい。
FIG. 6 is a flowchart showing another example of the memory protection violation interrupt process (program switching process) in the ECU 10 (microcomputer 20). The process shown in FIG. 6 may be executed as an interrupt process when the
ステップ600では、メモリ保護違反の違反発生箇所がバリエーションA用プログラムの処理(処理A)であるか否かを判定する。尚、メモリ保護違反の違反発生箇所は、メモリ保護部24の設定情報(図2のステップ206及びステップ210参照)に基づいて判断される。違反発生箇所が処理Aである場合は、ステップ602に進み、違反発生箇所が処理Aでない場合は、ステップ604に進む。
In
ステップ602では、バリエーションB用の関数Func_B()への変更が実行される。即ち、バリエーションB用プログラムへの切換が実行される。これにより、制御プログラムの切換に使用しているRAM28(又はフラッシュメモリ26)内のバリエーション情報が何らかの原因で正規の値"B"でない値に動作中に書き換わってしまった場合でも、本来実行されるべきバリエーションB用プログラムへの復帰(切換)を実現することができる。尚、この際、RAM28(又はフラッシュメモリ26)内のバリエーション情報についても値"B"に書換えすることとしてもよい。ここで、正規の値が"B"でないときは(例えば正規の値が"D"のとき)、バリエーションB用の関数Func_B()への変更後、再び、メモリ保護部24からアクセス例外が発生し、図6のメモリ保護違反割り込み処理が再度実行されることになる。この場合、後述のステップ604で肯定判定されることになる。
In
ステップ604では、メモリ保護違反の違反発生箇所がバリエーションB用プログラムの処理(処理B)であるか否かを判定する。違反発生箇所が処理Bである場合は、ステップ606に進み、違反発生箇所が処理Bでない場合は、ステップ608に進む。 In step 604, it is determined whether or not the violation occurrence location of the memory protection violation is the processing of the variation B program (processing B). If the violation occurrence location is process B, the process proceeds to step 606, and if the violation occurrence location is not process B, the process proceeds to step 608.
ステップ606では、バリエーションC用の関数Func_C()への変更が実行される。即ち、バリエーションC用プログラムへの切換が実行される。これにより、制御プログラムの切換に使用しているRAM28(又はフラッシュメモリ26)内のバリエーション情報が何らかの原因で正規の値"C"でない値に動作中に書き換わってしまった場合でも、本来実行されるべきバリエーションC用プログラムへの復帰(切換)を実現することができる。尚、この際、RAM28(又はフラッシュメモリ26)内のバリエーション情報についても値"C"に書換えすることとしてもよい。ここで、正規の値が"C"でないときは(例えば正規の値が"D"のとき)、バリエーションC用の関数Func_C()への変更後、再び、メモリ保護部24からアクセス例外が発生し、図6のメモリ保護違反割り込み処理が再度実行されることになる。この場合、後述のステップ608で肯定判定されることになる。
In step 606, a change to the function Func_C () for variation C is executed. That is, switching to the variation C program is executed. As a result, even if the variation information in the RAM 28 (or flash memory 26) used for switching the control program is rewritten during operation to a value other than the normal value “C” for some reason, it is originally executed. Return to the program for variation C to be performed (switching) can be realized. At this time, the variation information in the RAM 28 (or the flash memory 26) may be rewritten to the value “C”. Here, when the regular value is not “C” (for example, when the regular value is “D”), after the change to the function Func_C () for variation C, an access exception occurs again from the
ステップ608では、メモリ保護違反の違反発生箇所がバリエーションC用プログラムの処理(処理C)であるか否かを判定する。違反発生箇所が処理Cである場合は、ステップ610に進み、違反発生箇所が処理Cでない場合は、ステップ612に進む。
In
ステップ610では、バリエーションD用の関数Func_D()への変更が実行される。即ち、バリエーションD用プログラムへの切換が実行される。これにより、制御プログラムの切換に使用しているRAM28(又はフラッシュメモリ26)内のバリエーション情報が何らかの原因で正規の値"D"でない値に動作中に書き換わってしまった場合でも、本来実行されるべきバリエーションD用プログラムへの復帰(切換)を実現することができる。尚、この際、RAM28(又はフラッシュメモリ26)内のバリエーション情報についても値"D"に書換えすることとしてもよい。ここで、正規の値が"D"でないときは(例えば正規の値が"A"のとき)、バリエーションD用の関数Func_D()への変更後、再び、メモリ保護部24からアクセス例外が発生し、図6のメモリ保護違反割り込み処理が再度実行されることになる。
In
ステップ612では、バリエーションA用の関数Func_A()への変更が実行される。即ち、バリエーションA用プログラムへの切換が実行される。これにより、制御プログラムの切換に使用しているRAM28(又はフラッシュメモリ26)内のバリエーション情報が何らかの原因で正規の値"A"でない値に動作中に書き換わってしまった場合でも、本来実行されるべきバリエーションA用プログラムへの復帰(切換)を実現することができる。
In
このように図6に示す処理によれば、メモリ保護違反が発生する毎に、メモリ保護違反が発生しなくなるまで順次、制御プログラムが切り換えられる。これにより、制御プログラムの切換(即ちバリエーションA用プログラム、バリエーションB用プログラム、バリエーションC用プログラム、バリエーションD用プログラム間の切換)に使用しているバリエーション情報が何らかの原因で正規の値でない値に動作中に書き換わり、本来実行すべきでないプログラムが実行されうる状態になった場合でも、本来実行すべきプログラムへの復帰(補正)が可能となる。 As described above, according to the processing shown in FIG. 6, every time a memory protection violation occurs, the control program is sequentially switched until the memory protection violation does not occur. As a result, the variation information used for switching the control program (that is, switching between the program for variation A, the program for variation B, the program for variation C, and the program for variation D) operates to a value that is not a normal value for some reason. Even when a program that should not be executed can be executed, it can be restored (corrected) to the program that should be executed.
例えば、本来実行すべきプログラムがバリエーションA用プログラムであるが(即ちバリエーション情報の正規の値が"A"であるが)、何らかの原因でバリエーション情報の値が"D"に書き換わった場合を想定する。この場合、ステップ600、ステップ604、ステップ608でそれぞれ否定判定され、ステップ612でバリエーションA用の関数Func_A()へ変更されることになる。即ち、本来実行すべきバリエーションA用プログラムへの復帰(補正)が実現される。
For example, it is assumed that the program to be executed is the program for variation A (that is, the regular value of variation information is “A”), but the variation information value is rewritten to “D” for some reason. To do. In this case, a negative determination is made in
また、例えば、本来実行すべきプログラムがバリエーションD用プログラムであるが(即ちバリエーション情報の正規の値が"D"であるが)、何らかの原因でバリエーション情報の値が"A"に書き換わった場合を想定する。この場合、先ず、ステップ600で肯定判定され、ステップ602でバリエーションB用の関数Func_B()へ変更されることになる。この場合、バリエーションB用の関数Func_B()への変更後、再び、メモリ保護部24からアクセス例外が発生し、図6のメモリ保護違反割り込み処理が再度実行されることになる。次は、ステップ604で肯定判定され、ステップ606でバリエーションC用の関数Func_C()へ変更されることになる。この場合、バリエーションC用の関数Func_C()への変更後、再び、メモリ保護部24からアクセス例外が発生し、図6のメモリ保護違反割り込み処理が再度実行されることになる。次は、ステップ608で肯定判定され、ステップ610でバリエーションD用の関数Func_D()へ変更されることになる。即ち、本来実行すべきバリエーションD用プログラムへの復帰(補正)が実現される。
Also, for example, when the program to be executed originally is the program for variation D (that is, the regular value of variation information is “D”), but the value of variation information is rewritten to “A” for some reason. Is assumed. In this case, first, an affirmative determination is made in
以上説明した本実施例によれば、とりわけ、以下のような優れた効果が奏される。 According to the present embodiment described above, the following excellent effects can be obtained.
上述の如く、マイコン20のメモリ保護部(メモリ保護機能)24を利用して本来のバリエーションでは使用しないプログラム領域(メモリ領域)へのアクセスを禁止し、アクセス違反発生時(アクセス例外発生時)には本来のバリエーションで使用すべきプログラム領域へ強制的に変更させることができる。これにより、制御プログラムの切換に使用しているバリエーション情報が何らかの原因で正規の値でない値に動作中に書き換わり、本来実行すべきでないプログラムが実行されうる状態になった場合でも、本来実行すべきプログラムの実行状態への復帰(補正)が可能となる。
As described above, access to a program area (memory area) that is not used in the original variation is prohibited by using the memory protection unit (memory protection function) 24 of the
以上、本発明の好ましい実施例について詳説したが、本発明は、上述した実施例に制限されることはなく、本発明の範囲を逸脱することなく、上述した実施例に種々の変形及び置換を加えることができる。 The preferred embodiments of the present invention have been described in detail above. However, the present invention is not limited to the above-described embodiments, and various modifications and substitutions can be made to the above-described embodiments without departing from the scope of the present invention. Can be added.
例えば、上述した実施例において、メモリ保護部24は、ドメイン(特定の処理を行う機能単位のグループ)毎にメモリ領域へのアクセスを管理(保護)してよい。
For example, in the embodiment described above, the
また、上述した実施例において、バリエーションA用プログラムと、バリエーションB用プログラム(他のバリエーション用プログラムも同様)とは、完全に異なる別々のプログラムであってもよいし、一部に共通部分を有するプログラムであってもよい。後者の場合、例えば、バリエーションA用プログラムと、バリエーションB用プログラムとは、共通のタスク群(第1ドメイン)と、バリエーションA用プログラムに特有のタスク群(第2ドメイン)と、バリエーションB用プログラムに特有のタスク群(第3ドメイン)とを有してよい。この場合、メモリ保護部24は、例えば第2ドメイン及び第3ドメインに対してそれぞれのメモリ領域へのアクセスを管理(保護)してよい。
In the above-described embodiment, the variation A program and the variation B program (same for other variation programs) may be completely different separate programs or have some common parts. It may be a program. In the latter case, for example, the program for variation A and the program for variation B are a common task group (first domain), a task group specific to the program for variation A (second domain), and a program for variation B And a specific task group (third domain). In this case, the
10 ECU
12 他のECU
20 マイコン
22 CPU
24 メモリ保護部
26 フラッシュメモリ
28 RAM
100 車両制御装置
10 ECU
12 Other ECUs
20
24
100 Vehicle control device
Claims (4)
前記第1記憶装置と同じ不揮発性メモリ又は異なる揮発性メモリからなり、前記複数のプログラムのうちの実行すべき前記所定プログラムを決定するための情報が格納された第2記憶装置と、
メモリ保護部とを備え、
前記メモリ保護部において前記所定プログラム以外のプログラムの実行を禁止する設定を行う初期設定処理と、
前記第2記憶装置に格納される情報に基づいて、実行するプログラムを決定し、前記決定したプログラムの実行に伴う前記第1記憶装置へのアクセス時に前記メモリ保護部においてメモリ保護違反が発生した場合に、前記初期設定処理により設定された設定情報に基づいて、実行するプログラムを前記所定プログラムに切り換えるプログラム切換処理と、を実行するように構成された情報処理装置。 A first storage device comprising a non-volatile memory and storing a plurality of programs including a predetermined program;
A second storage device comprising the same nonvolatile memory as the first storage device or a different volatile memory, and storing information for determining the predetermined program to be executed among the plurality of programs;
With a memory protector,
An initial setting process for performing a setting for prohibiting execution of a program other than the predetermined program in the memory protection unit ;
When a program to be executed is determined based on information stored in the second storage device, and a memory protection violation occurs in the memory protection unit when accessing the first storage device due to execution of the determined program in the initial setting process based on the setting information set by, configured information processing apparatus to execute a program switching processing for switching the predetermined program a program to be executed.
前記所定プログラム以外のプログラムの実行を検出した場合に、前記初期設定処理により設定された設定情報に基づいて、実行するプログラムを前記所定プログラムに切り換えるプログラム切換処理と、を実行するように構成された情報処理装置であって、
メモリ保護部を備え、
前記所定プログラム以外のプログラムの実行は、前記所定プログラム以外のプログラムに係るメモリ領域へのアクセスに基づいて、前記メモリ保護部により検出し、
前記プログラム切換処理は、メモリ保護違反の発生時に割り込み処理として実行し、メモリ保護違反の発生箇所を判断することで、前記所定プログラムへの切換を実現する、情報処理装置。 An initial setting process for performing a setting for prohibiting execution of a program other than a predetermined program;
And a program switching process for switching a program to be executed to the predetermined program based on the setting information set by the initial setting process when execution of a program other than the predetermined program is detected. An information processing apparatus,
With memory protection,
Execution of a program other than the predetermined program is detected by the memory protection unit based on access to a memory area related to a program other than the predetermined program,
Wherein the program switching process is executed as an interrupt process in the event of a memory protection violation, by determining the occurrence location of the memory protection violation, we achieve the changeover to the predetermined program, information processing apparatus.
前記所定プログラム以外のプログラムの実行を検出した場合に、前記初期設定処理により設定された設定情報に基づいて、実行するプログラムを前記所定プログラムに切り換えるプログラム切換処理と、を実行するように構成された情報処理装置であって、
メモリ保護部を備え、
前記所定プログラム以外のプログラムの実行は、前記所定プログラム以外のプログラムに係るメモリ領域へのアクセスに基づいて、前記メモリ保護部により検出し、
前記プログラム切換処理は、メモリ保護違反の発生時に割り込み処理として実行し、メモリ保護違反が発生しなくなるまでプログラムを順次切り換えることで、前記所定プログラムへの切換を実現する、情報処理装置。 An initial setting process for performing a setting for prohibiting execution of a program other than a predetermined program;
And a program switching process for switching a program to be executed to the predetermined program based on the setting information set by the initial setting process when execution of a program other than the predetermined program is detected. An information processing apparatus,
With memory protection,
Execution of a program other than the predetermined program is detected by the memory protection unit based on access to a memory area related to a program other than the predetermined program,
Wherein the program switching process is executed as an interrupt process in the event of a memory protection violation, the program is sequentially switching it up memory protection violation no longer occurs, we achieve the switchover to the predetermined program, information processing apparatus.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012233148A JP5942778B2 (en) | 2012-10-22 | 2012-10-22 | Information processing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012233148A JP5942778B2 (en) | 2012-10-22 | 2012-10-22 | Information processing device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2014085770A JP2014085770A (en) | 2014-05-12 |
JP5942778B2 true JP5942778B2 (en) | 2016-06-29 |
Family
ID=50788790
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012233148A Expired - Fee Related JP5942778B2 (en) | 2012-10-22 | 2012-10-22 | Information processing device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5942778B2 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6323235B2 (en) * | 2014-07-29 | 2018-05-16 | 株式会社デンソー | Electronic control unit |
JP6589767B2 (en) * | 2016-07-27 | 2019-10-16 | 株式会社デンソー | Electronic control unit |
JP6972815B2 (en) * | 2017-09-13 | 2021-11-24 | 株式会社デンソー | Vehicle control device |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0492734A (en) * | 1990-08-07 | 1992-03-25 | Mazda Motor Corp | Device and method for controlling on-vehicle computer |
JPH06139084A (en) * | 1992-10-26 | 1994-05-20 | Mitsubishi Electric Corp | Information processor |
JPH07208258A (en) * | 1994-01-10 | 1995-08-08 | Nippondenso Co Ltd | Control device for vehicle |
JPH08319880A (en) * | 1995-05-25 | 1996-12-03 | Fuji Heavy Ind Ltd | Vehicle control method |
JP3710671B2 (en) * | 2000-03-14 | 2005-10-26 | シャープ株式会社 | One-chip microcomputer, IC card using the same, and access control method for one-chip microcomputer |
JP4522799B2 (en) * | 2004-09-08 | 2010-08-11 | ルネサスエレクトロニクス株式会社 | Semiconductor circuit device and runaway detection method |
-
2012
- 2012-10-22 JP JP2012233148A patent/JP5942778B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2014085770A (en) | 2014-05-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7444668B2 (en) | Method and apparatus for determining access permission | |
US8234476B2 (en) | Information processing apparatus and method of updating stack pointer | |
US20150212952A1 (en) | Method for the coexistence of software having different safety levels in a multicore processor system | |
CN107949847B (en) | Electronic control unit for vehicle | |
JP5942778B2 (en) | Information processing device | |
JP2015067107A (en) | Vehicle control device | |
JP4880105B2 (en) | Memory function protection method for control device and control device | |
JP6323235B2 (en) | Electronic control unit | |
CN107179980B (en) | Method for monitoring a computing system and corresponding computing system | |
WO2024056443A1 (en) | Method for checking data in a computer unit | |
US20140344916A1 (en) | Method for operating a communication module, and communication module | |
CN110574343B (en) | Method and semiconductor circuit for protecting an operating system of a vehicle safety system | |
US20150089175A1 (en) | Bus system and method of protected memory access | |
JP2017204083A (en) | Memory protection system | |
CN114091008A (en) | Method for securely updating a control device | |
JP5842833B2 (en) | Information processing apparatus and program | |
WO2013057825A1 (en) | Information processing device, data management method, data management program | |
JP2023510122A (en) | Device with interface and method of operating device with interface | |
JP2017107394A (en) | Vehicle controller | |
CN108369558B (en) | Method for operating a microcontroller | |
CN107710162B (en) | Electronic control device and stack using method | |
JP2023009818A (en) | Electronic control device for vehicle and control method by electronic control device for vehicle | |
CN111079194A (en) | Computing device and operating method for the same | |
JP6762411B2 (en) | Electronic control unit for automobiles | |
JP7025200B2 (en) | Program control device, program control system and program control method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20150115 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20150924 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20151027 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20151224 |
|
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: 20160426 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20160509 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 5942778 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
LAPS | Cancellation because of no payment of annual fees |