JP2014085770A - Information processing device - Google Patents

Information processing device Download PDF

Info

Publication number
JP2014085770A
JP2014085770A JP2012233148A JP2012233148A JP2014085770A JP 2014085770 A JP2014085770 A JP 2014085770A JP 2012233148 A JP2012233148 A JP 2012233148A JP 2012233148 A JP2012233148 A JP 2012233148A JP 2014085770 A JP2014085770 A JP 2014085770A
Authority
JP
Japan
Prior art keywords
program
variation
executed
switching
memory
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.)
Granted
Application number
JP2012233148A
Other languages
Japanese (ja)
Other versions
JP5942778B2 (en
Inventor
Kazumi Yamada
一美 山田
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.)
Toyota Motor Corp
Original Assignee
Toyota Motor Corp
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 Toyota Motor Corp filed Critical Toyota Motor Corp
Priority to JP2012233148A priority Critical patent/JP5942778B2/en
Publication of JP2014085770A publication Critical patent/JP2014085770A/en
Application granted granted Critical
Publication of JP5942778B2 publication Critical patent/JP5942778B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an information processing device that can perform switching to a program that normally should be executed when detecting that a program which normally should not be executed is being executed.SOLUTION: An information processing device is constituted so as to execute: initial setting processing in which setting is made for prohibiting the execution of a program other than a predetermined program; and program switching processing in which if the execution of a program other than the predetermined program is detected, an execution program is switched to the predetermined program.

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).

特開2007-115187号公報JP 2007-115187 A

ところで、車両等に実装される制御プログラムに関して、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.

上記目的を達成するため、本発明の一局面によれば、所定プログラム以外のプログラムの実行を禁止する設定を行う初期設定処理と、
前記所定プログラム以外のプログラムの実行を検出した場合に、実行するプログラムを前記所定プログラムに切り換えるプログラム切換処理と、を実行するように構成された情報処理装置が提供される。
In order to achieve the above object, according to one aspect of the present invention, an initial setting process for performing a setting for prohibiting execution of a program other than a predetermined program;
An information processing apparatus configured to execute a program switching process for switching a program to be executed to the predetermined program when execution of a program other than the predetermined program is detected 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.

車両制御装置100の一例を示す構成図である。1 is a configuration diagram illustrating an example of a vehicle control device 100. FIG. ECU10(マイコン20)におけるイニシャル処理の一例を示すフローチャートである。It is a flowchart which shows an example of the initial process in ECU10 (microcomputer 20). ECU10(マイコン20)におけるメイン処理の一例を示すフローチャートである。It is a flowchart which shows an example of the main process in ECU10 (microcomputer 20). ECU10(マイコン20)におけるメモリ保護違反割り込み処理(プログラム切換処理)の一例を示すフローチャートである。It is a flowchart which shows an example of the memory protection violation interruption process (program switching process) in ECU10 (microcomputer 20). ECU10(マイコン20)におけるメモリ保護違反割り込み処理(プログラム切換処理)の他の一例を示すフローチャートである。It is a flowchart which shows another example of the memory protection violation interruption process (program switching process) in ECU10 (microcomputer 20). ECU10(マイコン20)におけるメモリ保護違反割り込み処理(プログラム切換処理)の他の一例を示すフローチャートである。It is a flowchart which shows another example of the memory protection violation interruption process (program switching process) in ECU10 (microcomputer 20).

以下、図面を参照して、本発明を実施するための最良の形態の説明を行う。   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 vehicle control device 100. Vehicle control device 100 includes an ECU 10. The ECU 10 may be an ECU that performs arbitrary vehicle control. For example, the ECU 10 may be an ECU that performs driving force control (engine control or transmission control) of the vehicle.

ECU10は、例えばCAN(controller area network)などの適切なバス14を介して、車両内の各種の他のECU12に接続されてよい。他のECU12は、例えば車両のボデー系の電装品を制御するボデーECU等を含んでよい。   The ECU 10 may be connected to various other ECUs 12 in the vehicle via an appropriate bus 14 such as a CAN (controller area network). The other ECU 12 may include, for example, a body ECU that controls the electrical components of the vehicle body.

ECU10のハードウェア構成自体は、任意であり、例えば図1に示すように、例えばCANドライバ12を介して、バス14に接続されるマイコン20を備える。マイコン20は、CPU22と、メモリ保護部(保護機能)24と、フラッシュメモリ26と、RAM28とを含む。   The hardware configuration itself of the ECU 10 is arbitrary. For example, as shown in FIG. 1, the ECU 10 includes a microcomputer 20 connected to the bus 14 via, for example, a CAN driver 12. The microcomputer 20 includes a CPU 22, a memory protection unit (protection function) 24, a flash memory 26, and a RAM 28.

ここで、本実施例では、車両等に実装される制御プログラムに関して、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 CPU 22 accesses the flash memory 26 and the RAM 28 via the memory protection unit 24 and performs various processes based on the control programs (variation A program and variation B program) stored in the flash memory 26.

メモリ保護部24は、ある制御プログラムの実行に伴って、禁止領域として指定されたアドレス領域へのアクセス(例えばWrite/Readアクセス)が発生したこと(メモリ保護違反)を検出すると、その旨の情報(アクセス例外)を発生する。禁止領域は、例えばスーパーバイザーモード等のセキュリティ性を確保したアプリケーションにより設定(指定)されてよい。例えばバリエーションA用プログラムのみへのアクセスを許可し、バリエーションB用プログラムへのアクセスを禁止するとき、バリエーションB用プログラムが格納されたアドレス領域が禁止領域となる。このとき、バリエーションA用プログラムが格納されたアドレス領域が実行許可領域(実行許可アドレス)となる。   When the memory protection unit 24 detects that an access (for example, Write / Read access) to an address area designated as a prohibited area has occurred (execution of memory protection) in accordance with execution of a certain control program, information to that effect (Access exception) occurs. The prohibited area may be set (designated) by an application that ensures security, such as supervisor mode. For example, when the access to only the variation A program is permitted and the access to the variation B program is prohibited, the address area in which the variation B program is stored becomes the prohibited area. At this time, the address area in which the variation A program is stored becomes the execution permission area (execution permission address).

フラッシュメモリ26は、不揮発性メモリの一例であり、他の同様の類のメモリ(例えば他のEEPROM)が使用されてもよい。フラッシュメモリ26には、バリエーションA用プログラム及びバリエーションB用プログラムが格納される。   The flash memory 26 is an example of a nonvolatile memory, and other similar types of memory (for example, other EEPROMs) may be used. The flash memory 26 stores a variation A program and a variation B program.

RAM28は、SRAM(Static Random Access Memory)であってよい。RAM28には、フラッシュメモリ26から一時的に読み出した値等が格納される。RAM28には、例えば後述のバリエーション情報[VARI]が格納される。   The RAM 28 may be an SRAM (Static Random Access Memory). The RAM 28 stores values temporarily read from the flash memory 26. The RAM 28 stores, for example, later-described variation information [VARI].

図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 step 200, vehicle information [INF] is input. Vehicle information may be inputted from other ECU12 (for example, body ECU etc.) by in-vehicle ECU communication, such as CAN communication, for example. In this case, the vehicle information may be data that is periodically received while the ignition switch is on. The vehicle information may be received from a vehicle factory tool or the like. The vehicle information includes information on variations of the control program (that is, information indicating which variation program should be executed for the vehicle). Here, the vehicle information includes information indicating which of the variation A program and the variation B program should be executed. For example, the vehicle information may be information indicating destination or the like as information indirectly indicating which of the variation A program and the variation B program should be executed.

ステップ202では、上記ステップ200で入力された車両情報に基づいて、バリエーション情報[VARI]が確定される。即ち、上記ステップ200で入力された車両情報に応じたバリエーション情報[VARI]がRAM28(及びフラッシュメモリ26)に記憶される。例えば、上記ステップ200で入力された車両情報[INF]が、バリエーションA用プログラムを指示する情報を含む場合、バリエーション情報[VARI]が"A"として確定され、上記ステップ200で入力された車両情報[INF]が、バリエーションB用プログラムを指示する情報を含む場合、バリエーション情報[VARI]が"B"として確定される。   In step 202, the variation information [VARI] is determined based on the vehicle information input in step 200. That is, the variation information [VARI] corresponding to the vehicle information input in step 200 is stored in the RAM 28 (and the flash memory 26). For example, when the vehicle information [INF] input in step 200 includes information indicating the program for variation A, the variation information [VARI] is determined as “A”, and the vehicle information input in step 200 When [INF] includes information indicating the variation B program, the variation information [VARI] is determined as “B”.

ステップ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 step 202, that is, based on the variation information [VARI] stored in the RAM 28 (and the flash memory 26). It is determined whether or not A ″. If the variation information [VARI] is “A”, the process proceeds to step 206; otherwise, the process proceeds to step 208.

ステップ206では、バリエーションA用プログラム以外の実行を禁止する設定を行う。即ち、バリエーションB用プログラムの実行を禁止する設定を行う。この設定は、例えば、バリエーションA用プログラムのみアクセスを許可し、バリエーションB用プログラムへのアクセスを禁止するようにユーザアプリケーション(例えばスーパーバイザーモード等のセキュリティ性を確保したアプリケーション)からマイコン20のメモリ保護部24のレジスタへ設定値を書き込むことで実現されてよい。   In step 206, a setting for prohibiting execution of programs other than the variation A program is performed. That is, a setting for prohibiting the execution of the variation B program is performed. This setting can protect the memory of the microcomputer 20 from a user application (for example, an application that secures security such as supervisor mode) so that only the program for the variation A is allowed and access to the program for the variation B is prohibited. This may be realized by writing a set value to the register of the unit 24.

ステップ208では、上記ステップ202で確定されたバリエーション情報[VARI]に基づいて、バリエーション情報[VARI]が"B"であるか否かが判定される。バリエーション情報[VARI]が"B"であるときは、ステップ210に進み、それ以外の場合は、そのまま終了する。尚、バリエーションA用プログラム及びバリエーションB用プログラムの2種類のバリエーションしかない場合は、ステップ208を省略し、ステップ204で否定判定されたときにステップ210に進むこととしてもよい。   In step 208, based on the variation information [VARI] determined in step 202, it is determined whether or not the variation information [VARI] is “B”. When the variation information [VARI] is “B”, the process proceeds to step 210, and otherwise, the process ends. If there are only two types of variations, the program for variation A and the program for variation B, step 208 may be omitted, and if a negative determination is made in step 204, the process may proceed to step 210.

ステップ210では、上記ステップ206と同様、バリエーションB用プログラム以外の実行を禁止する設定を行う。即ち、バリエーションA用プログラムの実行を禁止する設定を行う。ステップ210の処理が終了すると、イニシャル処理が完了となる。   In step 210, as in step 206 above, a setting for prohibiting execution of programs other than the variation B program is performed. That is, the setting for prohibiting the execution of the variation A program is performed. When the process of step 210 is completed, the initial process is completed.

このように図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 step 300, based on the variation information [VARI] stored in the RAM 28 (or the flash memory 26), it is determined whether or not the variation information [VARI] is “A”. If the variation information [VARI] is “A”, the process proceeds to step 302; otherwise, the process proceeds to step 304.

ステップ302では、バリエーションA用の関数Func_A()が実行される。即ち、バリエーションA用プログラムが実行される。   In step 302, the function Func_A () for the variation A is executed. That is, the variation A program is executed.

ステップ304では、RAM28(又はフラッシュメモリ26)に格納されているバリエーション情報[VARI]に基づいて、バリエーション情報[VARI]が"B"であるか否かが判定される。バリエーション情報[VARI]が"B"であるときは、ステップ306に進み、それ以外の場合は、そのままステップ300に戻る。尚、バリエーションA用プログラム及びバリエーションB用プログラムの2種類のバリエーションしかない場合は、ステップ304を省略し、ステップ300で否定判定されたときにステップ306に進むこととしてもよい。   In step 304, based on the variation information [VARI] stored in the RAM 28 (or the flash memory 26), it is determined whether or not the variation information [VARI] is “B”. When the variation information [VARI] is “B”, the process proceeds to step 306. Otherwise, the process returns to step 300 as it is. If there are only two types of variations, the variation A program and the variation B program, step 304 may be omitted, and if a negative determination is made in step 300, the process may proceed to step 306.

ステップ306では、バリエーションB用の関数Func_B()が実行される。即ち、バリエーションB用プログラムが実行される。   In step 306, the function Func_B () for variation B is executed. That is, the variation B program is executed.

ここで、図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 CPU 22 tries to access the memory area (prohibited area) of the program that should not be executed based on the non-normal value. At this time, the memory protection unit 24 functions and prohibits the access. Therefore, information used for switching the control program (that is, switching between the program for variation A and the program for variation B) (or a copy of the information), that is, variation information stored in the RAM 28 (or flash memory 26). Even if it is rewritten to a value that is not a regular value for some reason during the operation, the operation of the processing that should not be executed can be surely prohibited by the setting of the memory protection unit 24.

図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 memory protection unit 24 generates an access exception during the main process shown in FIG. 3, for example.

ステップ400では、メモリ保護部24の設定情報(図2のステップ206及びステップ210参照)に基づいて、実行許可領域(実行許可アドレス)がバリエーションA用プログラムの処理(処理A)であるか否かを判定する。実行許可領域(実行許可アドレス)については、メモリ保護部24の設定情報を参照することで実現されてよい。実行許可領域が処理Aである場合は、ステップ402に進み、実行許可領域が処理Aでない場合は、ステップ404に進む。   In step 400, based on the setting information of the memory protection unit 24 (see step 206 and step 210 in FIG. 2), whether or not the execution permission area (execution permission address) is the process of the variation A program (process A). Determine. The execution permission area (execution permission address) may be realized by referring to the setting information of the memory protection unit 24. If the execution permission area is the process A, the process proceeds to step 402. If the execution permission area is not the process A, the process proceeds to step 404.

ステップ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 step 206 and step 210 in FIG. 2), whether or not the execution permission area (execution permission address) is the processing of the variation B program (processing B). Determine. If the execution permission area is process B, the process proceeds to step 406. If the execution permission area is not process B, the process ends. If there are only two types of variations, the variation A program and the variation B program, step 404 may be omitted, and if a negative determination is made in step 400, the process may proceed to step 406.

ステップ406では、バリエーションB用の関数Func_B()への復帰が実行される。即ち、バリエーションB用プログラムへの切換が実行される。これにより、制御プログラムの切換(即ちバリエーションA用プログラム及びバリエーションB用プログラム間の切換)に使用しているRAM28(又はフラッシュメモリ26)内のバリエーション情報が何らかの原因で正規の値"B"でない値"A"に動作中に書き換わってしまった場合でも、本来実行されるべきバリエーションB用プログラムへの復帰(切換)を実現することができる。尚、この際、RAM28(又はフラッシュメモリ26)内のバリエーション情報についても値"B"に書換えすることとしてもよい。   In step 406, the 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”.

図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 CPU 22 attempts to access a memory area (prohibited area) related to a program that should not be executed based on the non-normal value. At this time, the memory protection unit 24 functions to prohibit the processing that should not be executed as described above, and the processing shown in FIG. 4 is executed as the interrupt processing. Therefore, it should not be executed originally when the variation information used for switching the control program (that is, switching between the program for variation A and the program for variation B) is rewritten during operation to a value that is not a regular value for some reason. Even when the program can be executed, it is possible to return (correct) the program to be originally executed.

尚、図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 memory protection unit 24 generates an access exception during the main process shown in FIG. 3, for example.

ステップ500では、メモリ保護違反の違反発生箇所がバリエーションA用プログラムの処理(処理A)であるか否かを判定する。例えば、メモリ保護違反発生時のプログラムカウンタの値(アドレス)を参照し、そのプログラムカウンタの値に対応する処理(タスク)がバリエーションA用プログラムの処理(処理A)であるか否かを判定してもよい。尚、この場合も、メモリ保護違反は、メモリ保護部24の設定情報(図2のステップ206及びステップ210参照)に基づいて発生されるので、メモリ保護違反の違反発生箇所は、メモリ保護部24の設定情報に基づいて判断されていることになる。違反発生箇所が処理Aである場合は、ステップ502に進み、違反発生箇所が処理Aでない場合は、ステップ504に進む。   In step 500, it is determined whether or not the violation occurrence location of the memory protection violation is the processing of the variation A program (processing A). For example, referring to the value (address) of the program counter when a memory protection violation occurs, it is determined whether or not the process (task) corresponding to the value of the program counter is the process of the variation A program (process A). May be. In this case as well, the memory protection violation is generated based on the setting information of the memory protection unit 24 (see step 206 and step 210 in FIG. 2). It is determined based on the setting information. If the violation occurrence location is the process A, the process proceeds to step 502. If the violation occurrence location is not the process A, the process proceeds to step 504.

ステップ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 step 504, 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 506, and if the violation occurrence location is not process B, the process ends. If there are only two types of variations, the variation A program and the variation B program, step 504 may be omitted, and if a negative determination is made in step 500, the process may proceed to step 506.

ステップ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 CPU 22 attempts to access a memory area (prohibited area) related to a program that should not be executed based on the non-normal value. At this time, the memory protection unit 24 functions to prohibit the processing that should not be executed as described above, and the processing shown in FIG. 5 is executed as the interrupt processing. Thereby, the variation information used for switching the control program (that is, switching between the program for variation A and the program for variation B) should be originally executed by rewriting it to a value that is not a normal value for some reason during operation. Even when a program that is not ready can be executed, it is possible to return (correct) the program to be originally executed.

尚、図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 memory protection unit 24 generates an access exception during the main process shown in FIG. 3, for example.

ステップ600では、メモリ保護違反の違反発生箇所がバリエーションA用プログラムの処理(処理A)であるか否かを判定する。尚、メモリ保護違反の違反発生箇所は、メモリ保護部24の設定情報(図2のステップ206及びステップ210参照)に基づいて判断される。違反発生箇所が処理Aである場合は、ステップ602に進み、違反発生箇所が処理Aでない場合は、ステップ604に進む。   In step 600, it is determined whether or not the violation occurrence location of the memory protection violation is the processing of the variation A program (processing A). The location where the memory protection violation occurred is determined based on the setting information of the memory protection unit 24 (see step 206 and step 210 in FIG. 2). If the violation occurrence location is process A, the process proceeds to step 602, and if the violation occurrence location is not process A, the process proceeds to step 604.

ステップ602では、バリエーションB用の関数Func_B()への変更が実行される。即ち、バリエーションB用プログラムへの切換が実行される。これにより、制御プログラムの切換に使用しているRAM28(又はフラッシュメモリ26)内のバリエーション情報が何らかの原因で正規の値"B"でない値に動作中に書き換わってしまった場合でも、本来実行されるべきバリエーションB用プログラムへの復帰(切換)を実現することができる。尚、この際、RAM28(又はフラッシュメモリ26)内のバリエーション情報についても値"B"に書換えすることとしてもよい。ここで、正規の値が"B"でないときは(例えば正規の値が"D"のとき)、バリエーションB用の関数Func_B()への変更後、再び、メモリ保護部24からアクセス例外が発生し、図6のメモリ保護違反割り込み処理が再度実行されることになる。この場合、後述のステップ604で肯定判定されることになる。   In step 602, a change 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, 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 “B” for some reason, it is originally executed. Return to the program for variation B 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 “B”. Here, when the regular value is not “B” (for example, when the regular value is “D”), after the change to the function B for the variation B, Func_B (), an access exception occurs again from the memory protection unit 24. Then, the memory protection violation interrupt process of FIG. 6 is executed again. In this case, an affirmative determination is made in step 604 described later.

ステップ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 memory protection unit 24. Then, the memory protection violation interrupt process of FIG. 6 is executed again. In this case, an affirmative determination is made in step 608 described later.

ステップ608では、メモリ保護違反の違反発生箇所がバリエーションC用プログラムの処理(処理C)であるか否かを判定する。違反発生箇所が処理Cである場合は、ステップ610に進み、違反発生箇所が処理Cでない場合は、ステップ612に進む。   In step 608, it is determined whether the violation occurrence location of the memory protection violation is the processing of the variation C program (processing C). When the violation occurrence location is process C, the process proceeds to step 610, and when the violation occurrence location is not process C, the process proceeds to step 612.

ステップ610では、バリエーションD用の関数Func_D()への変更が実行される。即ち、バリエーションD用プログラムへの切換が実行される。これにより、制御プログラムの切換に使用しているRAM28(又はフラッシュメモリ26)内のバリエーション情報が何らかの原因で正規の値"D"でない値に動作中に書き換わってしまった場合でも、本来実行されるべきバリエーションD用プログラムへの復帰(切換)を実現することができる。尚、この際、RAM28(又はフラッシュメモリ26)内のバリエーション情報についても値"D"に書換えすることとしてもよい。ここで、正規の値が"D"でないときは(例えば正規の値が"A"のとき)、バリエーションD用の関数Func_D()への変更後、再び、メモリ保護部24からアクセス例外が発生し、図6のメモリ保護違反割り込み処理が再度実行されることになる。   In step 610, a change to the function Func_D () for variation D is performed. That is, switching to the variation D 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 “D” for some reason, it is originally executed. Return to the program for variation D 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 “D”. Here, when the regular value is not “D” (for example, when the regular value is “A”), an access exception occurs again from the memory protection unit 24 after the change to the function D for the variation D, Func_D (). Then, the memory protection violation interrupt process of FIG. 6 is executed again.

ステップ612では、バリエーションA用の関数Func_A()への変更が実行される。即ち、バリエーションA用プログラムへの切換が実行される。これにより、制御プログラムの切換に使用しているRAM28(又はフラッシュメモリ26)内のバリエーション情報が何らかの原因で正規の値"A"でない値に動作中に書き換わってしまった場合でも、本来実行されるべきバリエーションA用プログラムへの復帰(切換)を実現することができる。   In step 612, a change to the function Func_A () for variation A is performed. That is, switching to the variation A 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 “A” for some reason, it is originally executed. Return to the program for variation A to be performed (switching) can be realized.

このように図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 step 600, step 604, and step 608, respectively, and the function Func_A () for variation A is changed in step 612. That is, the return (correction) to the variation A program to be originally executed is realized.

また、例えば、本来実行すべきプログラムがバリエーション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 step 600, and in step 602, the function is changed to the function B for variation B Func_B (). In this case, after changing to the function B for the variation B, Func_B (), an access exception occurs again from the memory protection unit 24, and the memory protection violation interrupt process of FIG. 6 is executed again. Next, an affirmative determination is made at step 604, and the function Func_C () for variation C is changed at step 606. In this case, after the change to the function Func_C () for variation C, an access exception occurs again from the memory protection unit 24, and the memory protection violation interrupt process of FIG. 6 is executed again. Next, an affirmative determination is made at step 608, and the function Func_D () for variation D is changed at step 610. That is, the return (correction) to the variation D program to be originally executed is realized.

以上説明した本実施例によれば、とりわけ、以下のような優れた効果が奏される。   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 microcomputer 20 and an access violation occurs (when an access exception occurs). Can be forcibly changed to the program area to be used in the original variation. As a result, even if the variation information used for switching the control program is rewritten during operation to a value that is not a normal value for some reason, the program that should not be executed can be executed. It is possible to return (correct) the program to the execution state.

以上、本発明の好ましい実施例について詳説したが、本発明は、上述した実施例に制限されることはなく、本発明の範囲を逸脱することなく、上述した実施例に種々の変形及び置換を加えることができる。   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 memory protection unit 24 may manage (protect) access to the memory area for each domain (a group of functional units that perform specific processing).

また、上述した実施例において、バリエーション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 memory protection unit 24 may manage (protect) access to the respective memory areas for the second domain and the third domain, for example.

10 ECU
12 他のECU
20 マイコン
22 CPU
24 メモリ保護部
26 フラッシュメモリ
28 RAM
100 車両制御装置
10 ECU
12 Other ECUs
20 Microcomputer 22 CPU
24 Memory Protection Unit 26 Flash Memory 28 RAM
100 Vehicle control device

Claims (6)

所定プログラム以外のプログラムの実行を禁止する設定を行う初期設定処理と、
前記所定プログラム以外のプログラムの実行を検出した場合に、前記初期設定処理により設定された設定情報に基づいて、実行するプログラムを前記所定プログラムに切り換えるプログラム切換処理と、を実行するように構成された情報処理装置。
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. Information processing device.
メモリ保護部を備え、
前記所定プログラム以外のプログラムの実行は、前記所定プログラム以外のプログラムに係るメモリ領域へのアクセスに基づいて、前記メモリ保護部により検出する、請求項1に記載の情報処理装置。
With memory protection,
The information processing apparatus according to claim 1, wherein 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.
不揮発性メモリからなり、前記所定プログラムを含む複数のプログラムが格納された第1記憶装置と、
前記第1記憶装置と同じ不揮発性メモリ又は異なる揮発性メモリからなり、前記複数のプログラムのうちの実行すべき前記所定プログラムを決定するための情報が格納された第2記憶装置と、
メモリ保護部とを備え、
前記第2記憶装置に格納される情報に基づいて、実行するプログラムを決定し、前記決定したプログラムの実行に伴う前記第1記憶装置へのアクセス時に前記メモリ保護部においてメモリ保護違反が発生した場合に、前記決定した実行するプログラムを、前記所定プログラムに切り換える、請求項1又は2に記載の情報処理装置。
A first storage device comprising a non-volatile memory and storing a plurality of programs including the 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,
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 The information processing apparatus according to claim 1, wherein the determined program to be executed is switched to the predetermined program.
前記プログラム切換処理は、メモリ保護違反の発生時に割り込み処理として実行し、前記初期設定処理により前記メモリ保護部において設定された実行許可領域を参照することで、前記所定プログラムへの切換を実現する、請求項2又は3に記載の情報処理装置。   The program switching process is executed as an interrupt process when a memory protection violation occurs, and switching to the predetermined program is realized by referring to the execution permission area set in the memory protection unit by the initial setting process. The information processing apparatus according to claim 2 or 3. 前記プログラム切換処理は、メモリ保護違反の発生時に割り込み処理として実行し、メモリ保護違反の発生箇所を判断することで、前記所定プログラムへの切換を実現する、請求項2又は3に記載の情報処理装置。   4. The information processing according to claim 2, wherein the program switching process is executed as an interrupt process when a memory protection violation occurs, and the switching to the predetermined program is realized by determining a location where the memory protection violation occurs. apparatus. 前記プログラム切換処理は、メモリ保護違反の発生時に割り込み処理として実行し、メモリ保護違反が発生しなくなるまでプログラムを順次切り換えることで、前記所定プログラムへの切換を実現する、請求項2又は3に記載の情報処理装置。   4. The program switching process is executed as an interrupt process when a memory protection violation occurs, and switching to the predetermined program is realized by sequentially switching programs until no memory protection violation occurs. Information processing device.
JP2012233148A 2012-10-22 2012-10-22 Information processing device Expired - Fee Related JP5942778B2 (en)

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 true JP2014085770A (en) 2014-05-12
JP5942778B2 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016031659A (en) * 2014-07-29 2016-03-07 株式会社デンソー Electronic control unit
JP2018018274A (en) * 2016-07-27 2018-02-01 株式会社デンソー Electronic control device
JP2019053405A (en) * 2017-09-13 2019-04-04 株式会社デンソー Vehicle control device

Citations (6)

* Cited by examiner, † Cited by third party
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
JP2001256460A (en) * 2000-03-14 2001-09-21 Sharp Corp One-chip microcomputer and ic card using the same
JP2006079230A (en) * 2004-09-08 2006-03-23 Nec Electronics Corp Semiconductor circuit device and runaway detecting method

Patent Citations (6)

* Cited by examiner, † Cited by third party
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
JP2001256460A (en) * 2000-03-14 2001-09-21 Sharp Corp One-chip microcomputer and ic card using the same
JP2006079230A (en) * 2004-09-08 2006-03-23 Nec Electronics Corp Semiconductor circuit device and runaway detecting method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016031659A (en) * 2014-07-29 2016-03-07 株式会社デンソー Electronic control unit
JP2018018274A (en) * 2016-07-27 2018-02-01 株式会社デンソー Electronic control device
JP2019053405A (en) * 2017-09-13 2019-04-04 株式会社デンソー Vehicle control device

Also Published As

Publication number Publication date
JP5942778B2 (en) 2016-06-29

Similar Documents

Publication Publication Date Title
US10127161B2 (en) Method for the coexistence of software having different safety levels in a multicore processor system
US7444668B2 (en) Method and apparatus for determining access permission
US8234476B2 (en) Information processing apparatus and method of updating stack pointer
CN107949847B (en) Electronic control unit for vehicle
JP5942778B2 (en) Information processing device
JP2015531521A (en) Method and controller for controlling the separate execution of a plurality of linked program blocks
JP6323235B2 (en) Electronic control unit
CN107179980B (en) Method for monitoring a computing system and corresponding computing system
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
JP6471510B2 (en) Microcomputer
JP2017204083A (en) Memory protection system
CN114091008A (en) Method for securely updating a control device
JP2023510122A (en) Device with interface and method of operating device with interface
JP6349444B2 (en) Vehicle control device
WO2013057825A1 (en) Information processing device, data management method, data management program
JP2017107394A (en) Vehicle controller
CN107710162B (en) Electronic control device and stack using method
CN111079194A (en) Computing device and operating method for the same
JP2016084050A (en) On-vehicle control apparatus
JP2023009818A (en) Electronic control device for vehicle and control method by electronic control device for vehicle
JP7025200B2 (en) Program control device, program control system and program control method
JP2014137734A (en) Information processor and program
JP6762411B2 (en) Electronic control unit for automobiles
JP6699591B2 (en) Engine controller

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