JP6463445B1 - In-vehicle control device - Google Patents
In-vehicle control device Download PDFInfo
- Publication number
- JP6463445B1 JP6463445B1 JP2017216162A JP2017216162A JP6463445B1 JP 6463445 B1 JP6463445 B1 JP 6463445B1 JP 2017216162 A JP2017216162 A JP 2017216162A JP 2017216162 A JP2017216162 A JP 2017216162A JP 6463445 B1 JP6463445 B1 JP 6463445B1
- Authority
- JP
- Japan
- Prior art keywords
- cpu
- program
- interrupt
- execution
- address
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 claims abstract description 262
- 238000012545 processing Methods 0.000 claims abstract description 72
- 230000000737 periodic effect Effects 0.000 claims abstract description 11
- 230000006870 function Effects 0.000 claims description 94
- 238000001514 detection method Methods 0.000 claims description 26
- 230000004044 response Effects 0.000 claims description 13
- 230000007257 malfunction Effects 0.000 abstract description 24
- 238000012937 correction Methods 0.000 abstract description 22
- 230000008030 elimination Effects 0.000 abstract description 4
- 238000003379 elimination reaction Methods 0.000 abstract description 4
- 238000004891 communication Methods 0.000 description 34
- 230000007547 defect Effects 0.000 description 12
- 238000011161 development Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 8
- 238000013461 design Methods 0.000 description 7
- 238000012360 testing method Methods 0.000 description 6
- 238000003491 array Methods 0.000 description 4
- 230000010354 integration Effects 0.000 description 4
- 238000005259 measurement Methods 0.000 description 4
- 238000011835 investigation Methods 0.000 description 3
- 230000006399 behavior Effects 0.000 description 2
- 125000004122 cyclic group Chemical group 0.000 description 2
- 238000005286 illumination Methods 0.000 description 2
- PWPJGUXAGUPAHP-UHFFFAOYSA-N lufenuron Chemical compound C1=C(Cl)C(OC(F)(F)C(C(F)(F)F)F)=CC(Cl)=C1NC(=O)NC(=O)C1=C(F)C=CC=C1F PWPJGUXAGUPAHP-UHFFFAOYSA-N 0.000 description 2
- 101100183160 Caenorhabditis elegans mcd-1 gene Proteins 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000004904 shortening Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Abstract
【課題】デバッガを使用しなくても制御プログラムの不具合の原因を特定できるとともに、フック関数を用意しなくても制御プログラムの不具合の解消を確認できる車載制御装置を提供する。【解決手段】車載制御装置1は、ROM7とRAM6とCPU5とを備える。ROMは、周期制御処理と、周期制御処理を構成する一連の処理の中で複数の予め決められる特定処理が個別に実行されるたびに実行される割り込み処理とを含む、制御プログラムを記憶する。RAMは、拡張プログラムとして、周期制御処理において不具合を発見し、その不具合の原因を特定できる、第1拡張プログラム、および、処理部分の不具合を修正する前の制御プログラムに対して、不具合を修正した後の処理部分が追加され、修正前の処理部分の代わりに実行され、制御プログラムの不具合の解消を確認できる、第2拡張プログラムを記憶する。CPUは、制御プログラムおよび拡張プログラムを実行する。【選択図】図1An in-vehicle control device that can identify the cause of a malfunction of a control program without using a debugger and can confirm the elimination of the malfunction of the control program without preparing a hook function. An in-vehicle control device includes a ROM, a RAM, and a CPU. The ROM stores a control program including a cycle control process and an interrupt process that is executed each time a plurality of predetermined specific processes are individually executed in a series of processes constituting the cycle control process. RAM, as an extended program, has discovered a problem in the periodic control process, and has corrected the problem with respect to the first extended program that can identify the cause of the problem and the control program prior to correcting the problem in the processing part A later processing part is added and stored in the second extension program, which is executed in place of the processing part before correction, and which can confirm that the control program has been solved. The CPU executes a control program and an extension program. [Selection] Figure 1
Description
本発明は、制御プログラムの実行結果に関する情報をRAMから取得することができるように工夫された車載制御装置に関するものである。 The present invention relates to an in-vehicle control device devised so that information related to the execution result of a control program can be acquired from a RAM.
モータ駆動用インバータ、照明駆動用コンバータ等の制御を行う車載制御装置(Electronic Contol Unit;以下、「ECU」と記す)は、モータ、照明機器等の制御対象のハウジング内に組み込まれ、機能部品として製品化される。 An in-vehicle control unit (Electronic Control Unit; hereinafter referred to as “ECU”) that controls an inverter for driving a motor, a converter for driving an illumination, and the like is incorporated in a housing to be controlled such as a motor and an illumination device as a functional component. It is commercialized.
ECUは、各種制御処理を行ったり、他のECUと情報交換、協調動作等を行ったりするために、以下のように構成される。すなわち、ECUは、CAN、FlexRay、Ethernet(登録商標)等の通信線に接続される他のECU、各種ツール等との通信(以下、「外部通信」と記す)を行う機能を有するマイクロコンピュータ(以下、「マイコン」と記す)を備えて構成される。 The ECU is configured as follows in order to perform various control processes, exchange information with other ECUs, perform cooperative operations, and the like. That is, the ECU has a function of performing communication (hereinafter referred to as “external communication”) with other ECUs and various tools connected to communication lines such as CAN, FlexRay, and Ethernet (registered trademark) ( (Hereinafter referred to as “microcomputer”).
ここで、マイコンが実行する制御プログラムの開発では、製品に課せられた要求を満たすように、処理を追加したり変更したり削除したりして、その結果が妥当であるか否かを確認するための試験が行われる。また、この開発では、要求を満足しない処理、意図しない振る舞い、誤り等(以下、「不具合」と記す)を繰り返し修正することが行われる。 Here, in the development of the control program executed by the microcomputer, processing is added, changed, or deleted to meet the requirements imposed on the product, and whether the result is valid is confirmed. Tests are conducted for In this development, processing that does not satisfy the requirements, unintended behavior, errors, etc. (hereinafter referred to as “defects”) are repeatedly corrected.
制御プログラムの開発初期において、制御プログラムの実用性が十分確認できない段階では、ECUを制御対象と組み合わせることなく、ECU単体で開発が行われる。ECU単体で開発が行われる場合、ECUのマイコンにデバッガを常に接続した状態で、その開発を進めることができる。制御プログラムに不具合が発見された場合、その不具合の原因の調査は、以下のように進められる。すなわち、その調査は、デバッガによって提供されるソースレベルデバッグ機能を利用することによって、制御プログラムのソースコードの各行において意図通りの実行結果となっているか否かを確認しながら進められる。 In the initial stage of development of the control program, at the stage where the practicality of the control program cannot be sufficiently confirmed, development is performed by the ECU alone without combining the ECU with the control target. When development is performed by the ECU alone, the development can proceed with the debugger always connected to the microcomputer of the ECU. When a defect is found in the control program, the investigation of the cause of the defect proceeds as follows. That is, the investigation proceeds while confirming whether or not the execution result is as intended in each line of the source code of the control program by using the source level debugging function provided by the debugger.
制御プログラムは、その実用性が十分確認できたところで、制御対象と組み合わされて統合試験が行われる。この段階では、ECUは、制御対象のハウジング内に組み込まれることが多く、ECUのマイコンにデバッガを接続することが困難な場合が多い。そこで、ECUが通常備える外部通信機能に対して、制御プログラムの処理データ、状態を示す変数等の実行時データの送信機能を追加する。この送信機能によって送信される実行時データを受信して観測することで、制御プログラムが正常に動作しているか否かを確認する。 When the practicality of the control program is sufficiently confirmed, an integrated test is performed in combination with the control target. At this stage, the ECU is often incorporated in the housing to be controlled, and it is often difficult to connect a debugger to the microcomputer of the ECU. Therefore, a function for transmitting processing data of the control program, execution time data such as a variable indicating the state is added to the external communication function normally provided in the ECU. By receiving and observing the runtime data transmitted by this transmission function, it is confirmed whether or not the control program is operating normally.
上述の制御プログラムの実行時データは、例えば、ASAM(Association for Standardisation of Automation and Measuring Systems)が規格化しているCAN Calibration Protocol、またはUniversal Measurement and Calibration Protocol(以下、「XCP」と記す)に基づいたプロトコルを適用して送信される(例えば、非特許文献1参照)。 The execution data of the above-described control program is, for example, CAN Calibration Protocol (hereinafter referred to as Universal Measurement and Calibration), which is standardized by Association for Standardization of Automation and Measurement Systems (ASAM), or Universal Measurement and Calibration. It is transmitted by applying a protocol (see, for example, Non-Patent Document 1).
非特許文献1によれば、XCPを適用するECUは、制御プログラムを実行するCPU(central processing unit)がアクセス可能な各アドレスが保持する値の読み出しが可能であり、さらに、アドレスがRAM(random access memory)または周辺機能レジスタである場合、そのアドレスに指定の値を書き込むことができる。この場合、単位時間あたりに取得可能な制御プログラムの実行時データの数および量は、ECUの外部通信機能の通信速度、データ処理速度等の性能によって制限される。
According to
XCPの主な用途として、例えば、制御プログラムが算出する制御目標値が制御対象にとって最適でない場合、その算出に使用する各種制御パラメータを繰り返し調整する工程(以下、「キャリブレーション」と記す)に使用される。 As a main application of XCP, for example, when the control target value calculated by the control program is not optimal for the control target, it is used for the process of repeatedly adjusting various control parameters used for the calculation (hereinafter referred to as “calibration”). Is done.
また、XCPを適用するECUは、上述のRAMだけでなく、制御プログラム、データ等を記憶するフラッシュメモリを書き変えるPROGRAMコマンドに対応することができる。このコマンドを利用すれば、ECUの外部通信機能を介してフラッシュメモリに記憶された制御プログラムまたはデータの一部または全部を書き換えることができる。さらに、XCPに定義されていないコマンドをユーザーが追加定義して使用することも可能である。 Further, the ECU to which XCP is applied can correspond to a PROGRAM command for rewriting a flash memory storing a control program, data, and the like as well as the above-described RAM. By using this command, part or all of the control program or data stored in the flash memory can be rewritten via the external communication function of the ECU. Further, it is possible for the user to additionally define and use a command not defined in XCP.
上述の統合試験において、制御プログラムに不具合が発見された場合、制御プログラムの開発者は、上述の実行時データを取得して解析し、制御プログラムの不具合の原因を特定しなければならない場合がある。この場合、制御プログラム開発者は、制御プログラムの実行時データの一部しか取得することができず、マイコンにデバッガを接続した場合に提供される制御プログラムのソースレベルデバッグ機能を利用することができない。そのため、制御プログラムの不具合の原因の調査が困難であるという問題がある。 When a defect is found in the control program in the integration test described above, the developer of the control program may need to acquire and analyze the above-mentioned runtime data to identify the cause of the defect in the control program. . In this case, the control program developer can obtain only a part of the control program runtime data, and cannot use the source level debugging function of the control program provided when the debugger is connected to the microcomputer. . Therefore, there is a problem that it is difficult to investigate the cause of the malfunction of the control program.
したがって、制御プログラム開発者は、制御プログラムの実行時データの一部に基づき、制御プログラムの不具合の原因を推定し、修正した制御プログラムをXCP等の手段を用いてECUに書き込み、再度の統合試験を行うことになる。 Therefore, the control program developer estimates the cause of the malfunction of the control program based on a part of the execution data of the control program, writes the corrected control program to the ECU using means such as XCP, and performs the integration test again. Will do.
ただし、制御プログラムの不具合の原因の推定が正しくない場合、その不具合が完全に解消できないことがある。その場合、制御プログラムの不具合の真の原因が特定されるまで、上述の制御プログラムの実行時データを取得する工程から、統合試験を行う工程までの開発サイクルを繰り返すことになる。その結果、制御プログラムの開発に時間がかかるという問題がある。 However, when the cause of the malfunction of the control program is not correctly estimated, the malfunction may not be completely eliminated. In that case, the development cycle from the process of acquiring the above-mentioned control program execution data to the process of performing the integration test is repeated until the true cause of the malfunction of the control program is identified. As a result, there is a problem that it takes time to develop a control program.
上述したXCPのPROGRAMコマンドを利用すれば、ECUのフラッシュメモリを書き換えて、不具合を修正した後の制御プログラムに更新することができる。しかしながら、上述したように、制御プログラムの不具合の原因の推定が正しくない場合、不具合の原因を正しく推定するために、不具合が発生する制御プログラムの実行時データを取得する工程に戻る必要がある。そのため、修正後の制御プログラムを修正前の状態に戻す必要があることが多い。このようなことから、修正後の制御プログラムを修正前の状態に戻すことなく、不具合の原因を特定し、修正の効果を確認できることが望ましい。 If the XCP PROGRAM command described above is used, the flash memory of the ECU can be rewritten to update the control program after correcting the problem. However, as described above, when the cause of the malfunction of the control program is not correctly estimated, it is necessary to return to the step of acquiring the execution data of the control program in which the malfunction occurs in order to correctly estimate the cause of the malfunction. Therefore, it is often necessary to return the control program after correction to the state before correction. For this reason, it is desirable to be able to identify the cause of the defect and confirm the effect of the correction without returning the corrected control program to the state before the correction.
上述の開発サイクル、特に制御プログラムのアルゴリズムを修正する工程の繰り返しに要する時間を短縮するための手段として、例えば、Bypassingが従来から知られている(例えば、非特許文献1、2参照)。
As a means for shortening the time required for repeating the above-described development cycle, particularly the process of correcting the algorithm of the control program, for example, Bypassing has been conventionally known (for example, refer to Non-Patent
非特許文献2によれば、元のプログラム処理を実行する直前に、フック関数と呼ばれる分岐処理関数を設け、このフック関数内で元の処理、または後で作成した制御パラメータを変更した処理を選択して実行する。これにより、ECUのROM(read only memory)に記憶される制御プログラム全体を書き変えることなく、変更が必要な処理だけを変更後の処理に切り替えてプログラムを実行させることが可能である。
According to
なお、上述のBypassingの実装方法としては、以下の2通りの方法が知られている(例えば、非特許文献2参照)。すなわち、第1方法として、フック関数がXCPおよび外部通信を介して、処理に使用するパラメータ、すなわち関数の引数を、例えばパーソナルコンピュータ等の外部に送信し、外部で処理を実行した結果をECUに返信するExternal Bypassingが挙げられる。第2方法として、予めECUのRAMに記憶した変更後のプログラム部分にフック関数内から分岐して実行するOn−target Bypassingが挙げられる。特に、ECUでは、制御処理の周期が数十μ秒と短い場合があり、External Bypassingでは、外部通信が時間的なボトルネックとなり、その周期以内に外部通信から処理結果を受信することが困難である。したがって、ECUでは、ECU内で処理を実行できるOn−target Bypassingが必要になることがある。 Note that the following two methods are known as mounting methods of the above-mentioned bypassing (for example, see Non-Patent Document 2). That is, as a first method, a hook function transmits parameters used for processing, that is, an argument of the function to the outside of, for example, a personal computer or the like via XCP and external communication, and the result of executing processing outside is sent to the ECU. There is an example of External Bypassing. As a second method, there is On-target Bypassing that is executed by branching from the hook function to the changed program portion stored in advance in the RAM of the ECU. In particular, in ECUs, the cycle of control processing may be as short as several tens of microseconds. With External Bypassing, external communication becomes a time bottleneck, and it is difficult to receive processing results from external communication within that cycle. is there. Therefore, the ECU may require on-target bypassing that can execute processing in the ECU.
制御パラメータのキャリブレーションを行う場合、制御パラメータの調整が必要な処理の箇所が分かっているので、予め必要な処理箇所だけにフック関数を追加することができる。 When calibrating the control parameter, the processing function that requires adjustment of the control parameter is known, so that the hook function can be added only to the necessary processing part.
しかしながら、制御プログラムのアルゴリズムに不具合が発生する場合、その発生箇所を予め予測してフック関数を用意しておくことが困難である。したがって、任意の箇所で発生する制御プログラムの不具合に対して予め対応可能とするためには、例えば、全ての関数にフック関数を用意する必要がある。この場合、制御プログラムの一部で発生する不具合に対応するために、制御プログラム全域にわたってフック関数を作成するのは非効率であるという問題がある。 However, when a problem occurs in the algorithm of the control program, it is difficult to predict the occurrence location in advance and prepare a hook function. Therefore, in order to be able to cope with a malfunction of a control program that occurs at an arbitrary location in advance, for example, it is necessary to prepare hook functions for all functions. In this case, there is a problem that it is inefficient to create a hook function over the entire control program in order to cope with a problem occurring in a part of the control program.
本発明は、上述のような課題を解決するためになされたものであり、デバッガを使用しなくても制御プログラムの不具合の原因を特定することができるとともに、フック関数を用意しなくても制御プログラムの不具合の解消を確認することができる車載制御装置を得ることを目的とする。 The present invention has been made to solve the above-described problems, and can determine the cause of a malfunction of a control program without using a debugger, and can control without preparing a hook function. An object of the present invention is to obtain an in-vehicle control device capable of confirming the elimination of a program defect.
本発明における車載制御装置は、制御対象を周期的に制御するための周期制御処理と、周期制御処理を構成する一連の処理の中で複数の予め決められる特定処理が個別に実行されるたびに実行される割り込み処理とを含む制御プログラムを記憶するROMと、拡張プログラムとして第1拡張プログラムおよび第2拡張プログラムを記憶するRAMと、制御プログラムおよび拡張プログラムを実行するCPUと、を備え、CPUは、特定処理を実行する際にアクセスする実行アドレスにアクセスしたことを検知して、割り込みを発生させるアクセス検知機能を備え、アクセス検知機能によって発生した割り込みに応答して割り込み処理を実行させることで、周期制御処理で特定処理の実行後以降の処理を中断し、第1拡張プログラムまたは第2拡張プログラムを実行し、当該実行後に、周期制御処理で特定処理の実行後以降の処理を再開し、第1拡張プログラムを実行させることで、特定処理の処理結果をRAMに記憶させるとともに、周期制御処理で特定処理の次に実行される次の特定処理の実行アドレスにCPUがアクセスしたことをアクセス検知機能が検知するように、アクセス検知機能を設定し、第2拡張プログラムを実行させることで、周期制御処理で不具合が発生する原因である処理の結果を修正するものである。 The vehicle-mounted control device according to the present invention each time a plurality of predetermined specific processes are individually executed in a cycle control process for periodically controlling a control target and a series of processes constituting the cycle control process. A ROM for storing a control program including interrupt processing to be executed, a RAM for storing a first extension program and a second extension program as an extension program, and a CPU for executing the control program and the extension program. , Equipped with an access detection function that detects an access to an execution address that is accessed when executing a specific process and generates an interrupt, and by executing an interrupt process in response to an interrupt generated by the access detection function, The process after the execution of the specific process is interrupted in the cycle control process, and the first extension program or second After executing the program, the process after the execution of the specific process is resumed in the cyclic control process, and the first extension program is executed, so that the processing result of the specific process is stored in the RAM and the cyclic control is performed. By setting the access detection function and executing the second extension program so that the access detection function detects that the CPU has accessed the execution address of the next specific process executed next to the specific process in the process, it is intended to correct the result of the cause of the defect in processing at a cycle control process.
本発明によれば、デバッガを使用しなくても制御プログラムの不具合の原因を特定することができるとともに、フック関数を用意しなくても制御プログラムの不具合の解消を確認することができる車載制御装置を得ることができる。 According to the present invention, an in-vehicle control apparatus that can identify the cause of a malfunction of a control program without using a debugger and can confirm the elimination of the malfunction of the control program without preparing a hook function. Can be obtained.
以下、本発明による車載制御装置を、好適な実施の形態にしたがって図面を用いて説明する。なお、図面の説明においては、同一部分または相当部分には同一符号を付し、重複する説明を省略する。 Hereinafter, a vehicle-mounted control device according to the present invention will be described with reference to the drawings according to a preferred embodiment. In the description of the drawings, the same portions or corresponding portions are denoted by the same reference numerals, and redundant description is omitted.
実施の形態1.
図1は、本発明の実施の形態1におけるECU1の構成を示すブロック図である。図1では、ECU1は、制御対象の一例であるモータ11の制御を実行するとともに、外部通信線12によって外部と通信するように構成される場合を例示している。
FIG. 1 is a block diagram showing a configuration of
ここで、後述するECU1の構成によって、ECU1によって制御プログラム内の周期制御処理において不具合を発見し、その不具合の原因を特定することができる。周期制御処理は、例えば50μ秒といった短い周期で実行される。また、ECU1の構成によって、処理部分の不具合を修正する前の制御プログラムに対して、その不具合を修正した後の処理部分が追加され、修正前の処理部分の代わりに、追加した処理部分が実行される。その結果、制御プログラムの不具合の解消を確認することができる。
Here, with the configuration of the
図1において、ECU1は、入力回路2、マイコン3および駆動回路10を備え、モータ11を制御するとともに、外部通信線12と接続される。マイコン3は、入出力機能(以下、I/Oと記す)4と、CPU5と、RAM6と、ROM7と、タイマ8と、外部通信機能9とを備える。
In FIG. 1, an
ここで、本実施の形態1のECU1の構成では、マイコン3の外部通信機能9に対して例えばXCPに基づいたプロトコルを追加する。これにより、外部通信から指定のメモリアドレスのアクセスを検知するための設定が行われ、後述する図9および図10に示す指定のコマンドとその引数がRAM6に記憶される。
Here, in the configuration of the
入力回路2は、外部からの信号、および制御対象であるモータ11に設けられる各種センサからの信号を電圧として読み取る。I/O4は、デジタル信号の入出力を行い、入力回路2によって読み取られた電圧のマイコン3内への取り込みを行い、駆動回路10への制御信号の出力を行う。
The
CPU5は、周知のアーキテクチャを用いたマイクロプロセッサであり、ROM7に記憶される後述する制御プログラム70を実行可能に構成される。また、CPU5は、制御プログラム70の実行中に割り込みが発生した場合、その割り込みに応じた処理を実行する。なお、CPU5として適用されるマイクロプロセッサによっては、割り込みを例外と呼ぶことがあるが、本実施の形態1では、両者を特に区別せず、単に割り込みと呼ぶこととする。
The
続いて、CPU5に具備される機能について、図2を参照しながら説明する。図2は、本発明の実施の形態1におけるCPU5に具備される機能を示すブロック図である。
Next, functions provided in the
図2に示すように、CPU5は、ブレイクポイント機能(以下、「BP」と記す)51と、2つのメモリ保護機能(以下、「MPU」と記す)、すなわち、第1MPU52および第2MPU53によって構成されるメモリ保護機能組とを備える。
As shown in FIG. 2, the
なお、CPU5に具備されるBP51の数は1つ以上必要であり、CPU5に具備されるメモリ保護機能組の組数は1組以上必要である。
Note that the number of
BP51は、CPU5のレジスタまたはCPU5がアクセス可能なメモリ空間に配置されている。CPU5は、ROM7に記憶されるプログラムを実行することで、BP51を、特定のメモリアドレスに設定可能である。BP51は、CPU5がアクセスするメモリアドレスを監視し、設定されたアドレスにCPU5がアクセスすれば、設定されたアドレスにCPU5がアクセスしたことをCPU5に通知する割り込み(以下、「BP割り込み」と記す)を発生させる。つまり、BP51は、CPU5が特定のアドレスにアクセスしたことを検知することができる。
The
CPU5がBP51を操作できない場合、すなわち、BP51を使用できない場合、BP51の代わりに、第1MPU52および第2MPU53が使用される。CPU5は、I/O4、RAM6、ROM7、タイマ8および外部通信機能9にアクセスすることができれば、単一コアでもあっても、複数コアであってもよい。
When the
第1MPU52および第2MPU53は、CPU5がアクセスするメモリアドレスが、第1MPU52および第2MPU53が設定されるアドレス範囲内か否かを監視する。CPU5は、第1MPU52および第2MPU53を、それぞれ、アドレス範囲の下限値と上限値に設定可能である。第1MPU52および第2MPU53は、CPU5がアクセスするメモリアドレスが、設定されたアドレス範囲外であれば、設定されたアドレス範囲外のアドレスにCPU5がアクセスしたことをCPU5に通知する割り込み(以下、「MPU割り込み」と記す)を発生させる。
The
本実施の形態1では、BP51を使用できない場合、第1MPU52および第2MPU53の上述の機能を利用して、CPU5が特定のメモリアドレスにアクセスしたことを検知する。例えば、CPU5が或るアドレスAにアクセスしたことを検知する場合、CPU5は、CPU5がアクセス可能なメモリ空間の先頭からアドレスA−1までの範囲に第1MPU52を設定し、アドレスA+1からCPU5がアクセス可能なメモリ空間の末尾までの範囲に第2MPU53を設定する。その後、CPU5は、第1MPU52と第2MPU53の機能を有効化する。
In the first embodiment, when the
このように、CPU5は、第1MPU52および第2MPU53を上述のアドレス範囲に設定し、第1MPU52と第2MPU53の機能を有効化する。その後、CPU5がアドレスAをアクセスすれば、アドレスAが、第1MPU52および第2MPU53が設定されたアドレス範囲外のアドレスであるので、MPU割り込みが発生する。つまり、第1MPU52および第2MPU53は、CPU5がアドレスA、すなわち特定のアドレスにアクセスしたことを検知することができる。
As described above, the
図1の説明に戻り、駆動回路10は、マイコン3から入力される制御量に従って、モータ11を駆動する。外部通信機能9は、外部通信線12に接続される。外部通信線12は、CAN、CAN FD、FlexRay、Ethernet(登録商標)等の、ECUで使用される一般的な通信線である。なお、本実施の形態1では、モータ11を制御するECU1に対して本発明を適用する場合を例示しているが、これに限定されず、モータ11以外の別の制御対象を制御するECUに対しても本発明が適用可能である。例えば、駆動回路10としてコンバータを用いて、制御対象をモータ11からLEDに代えた場合、LEDの照度制御についても、モータ11の駆動制御と同様に、短い周期で制御処理が行われる。また、外部通信機能9の構成について、特に限定されず、例えば、上述した通信方式を組み合わせて使用される構成、または、同一の通信方式を複数使用される構成が考えられる。さらに、ECU1に対して配線を追加することが可能な場合、マイコン3に具備される例えばUART、SPI等の各種シリアル通信、汎用デジタル入出力(GPIO)等を、外部通信機能9として適用することができる。
Returning to the description of FIG. 1, the
続いて、RAM6に設けられる制御プログラム拡張部60について、図3を参照しながら説明する。図3は、本発明の実施の形態1におけるRAM6に設けられる制御プログラム拡張部60を示すブロック図である。
Next, the control
CPU5は、RAM6にアクセス可能である。図3に示すように、RAM6に設けられる制御プログラム拡張部60は、サブルーチン開始アドレス記憶変数611を有する拡張プログラム開始アドレス記憶部61と、識別番号記憶配列621、第1引数記憶配列622、第2引数記憶配列623およびコマンド実行結果記憶領域624を有するコマンド記憶部62と、プログラム記憶領域631を有する拡張プログラム記憶部63とを備える。
The
拡張プログラム開始アドレス記憶部61において、サブルーチン開始アドレス記憶変数611には、後述するサブルーチンの開始アドレスが記憶される。ここで、サブルーチンは、制御プログラム70を拡張するプログラムの処理単位であり、呼び出し側に処理を返すリターン命令で処理を終えるものであり、例として、C言語では関数と呼ばれる処理単位を意味するものである。
In the extended program start
サブルーチン開始アドレス記憶変数611に記憶される有効なアドレスは、例えばプログラム記憶領域631に記憶されるサブルーチンの開始アドレス、ROM7に記憶されるサブルーチンの開始アドレス等である。
Valid addresses stored in the subroutine start
コマンド記憶部62において、識別番号記憶配列621には、コマンドを識別するための識別番号が記憶される。第1引数記憶配列622には、識別番号に対応するコマンドを実行するために必要な1つ目の引数情報が第1引数として記憶される。第2引数記憶配列623には、識別番号に対応するコマンドを実行するために必要な2つ目の引数情報が第2引数として記憶される。コマンド実行結果記憶領域624には、識別番号に対応するコマンドを実行した結果が記憶される。
In the
ここで、上述のコマンドの一例について、図4を参照しながら説明する。図4は、本発明の実施の形態1におけるCPU5が実行する拡張プログラムのコマンドの定義の一例を示す表である。
Here, an example of the above-described command will be described with reference to FIG. FIG. 4 is a table showing an example of the definition of the extended program command executed by the
図4では、識別番号記憶配列621に記憶される識別番号が示され、さらに、サブルーチンの振る舞いが、識別番号に対応するコマンドの定義として示されている。また、第1引数記憶配列622に記憶される第1引数の用途と、第2引数記憶配列623に記憶される第2引数の用途は、図4に示すコマンドの定義から分かる。
In FIG. 4, the identification numbers stored in the identification
識別番号記憶配列621、第1引数記憶配列622および第2引数記憶配列623を一組の記憶配列として、複数組の記憶配列をコマンド記憶部62に記憶することで、複数のコマンドをコマンド記憶部62に記憶することができる。なお、図3では、前記一組の記憶配列を個々の配列を用いて例示しているが、プログラムの実装の形態としては、例えばC言語で定義可能な構造体、C++言語で定義可能なクラス等に識別番号記憶配列621、第1引数記憶配列622および第2引数記憶配列623の各要素を定義し、その構造体、クラス等の配列を用いてもよい。
By storing the identification
続いて、ROM7に記憶される制御プログラム70について、図5を参照しながら説明する。図5は、本発明の実施の形態1におけるROM7に記憶される制御プログラム70を示すブロック図である。
Next, the
ROM7には、制御プログラム70が記憶されており、CPU5は、ROM7に記憶される制御プログラム70を読み出して実行する。図5に示すように、ROM7に記憶される制御プログラム70は、初期化処理71と、制御対象の一例であるモータ11を周期的に制御するための周期制御処理72と、外部通信機能9とXCPを利用して外部通信を行うためのXCP処理73と、BP割り込み処理74と、MPU割り込み処理75とを有する。
The
次に、制御プログラム70の周期制御処理72について、図6を参照しながら説明する。図6は、本発明の実施の形態1におけるCPU5が実行する制御プログラム70の周期制御処理72を示すフローチャートである。
Next, the
ステップS101において、CPU5は、I/O4から入力されるセンサ電圧値を読み出して取得し、処理がステップS102へと進む。CPU5がセンサ電圧値を読み出す手段としては、例えば、マイコン3に具備されるA/D変換機能、あるいは、センサと通信するためのSENTまたはPSI5のプロトコルを利用する手段が考えられる。
In step S101, the
ステップS102において、CPU5は、ステップS101で取得したセンサ電圧値を補正し、処理がステップS105へと進む。
In step S102, the
ステップS105において、CPU5は、周期制御処理72の仕様に対しての対応の要否を示す対応要否情報を読み出し、その対応要否情報を判定する。なお、周期制御処理72は、2種類以上の仕様を有し、2種類以上の仕様のうちの特定の仕様に対しての対応として、後述するステップS106の処理を実行する必要がある。
In step S <b> 105, the
また、ステップS105の判定処理では、対応要否情報が「0」である場合には、対応が不要であると判定され、対応要否情報が、「0」でない、すなわち「1」である場合には、対応が必要であると判定されるように構成されている。 Further, in the determination process of step S105, if the correspondence necessity information is “0”, it is determined that no correspondence is necessary, and the correspondence necessity information is not “0”, that is, “1”. Is configured so that it is determined that a response is necessary.
ステップS105において、CPU5は、対応要否情報が、対応が不要であることを示す「0」であるか否かを判定する。CPU5は、対応要否情報が「0」であると判定した場合には、処理がステップS103へと進む。一方、CPU5は、対応要否情報が「0」でないと判定した場合には、処理がステップS106へと進む。
In step S105, the
CPU5が、対応要否情報が「0」であるか否かを判定する手段としては、例えば、以下の手段が考えられる。すなわち、CPU5は、周期制御処理72の処理開始時にI/O4から入力されるデジタル入力値を読み出して取得し、その値がHighレベルであるかLowレベルであるかによって、対応要否情報が「0」であるか否かを判定する。
For example, the following means can be considered as means for the
ステップS106において、CPU5は、ステップS102で補正されたセンサ電圧値に対してさらに補正、すなわち、センサ電圧値を追加補正し、処理がステップS103へと進む。
In step S106, the
ステップS103において、CPU5は、ステップS102での補正後のセンサ電圧値、またはステップS106での追加補正後のセンサ電圧値から、制御量を算出し、処理がステップS104へと進む。
In step S103, the
ステップS104において、CPU5は、ステップS104で算出された制御量をI/O4に出力し、処理が終了となる。CPU5は、例えば、PWM(Pulse Width Modulation)制御に対応した制御量をI/O4に出力する。駆動回路10は、I/O4から入力される制御量に従って、モータ11を駆動する。
In step S104, the
次に、図6に示す制御プログラム70の周期制御処理72の不具合が発生した際のその不具合の原因を特定する手順について説明する。ここでは、図6に示す周期制御処理72の不具合の一例として、ステップS105において、CPU5が、周期制御処理72の仕様に対しての対応が必要であると判定し、ステップS106を実行すべきところを、逆の判定が行われて、ステップS106が実行されない場合を考える。この場合、ステップS106でセンサ電圧値が追加補正されることなく、ステップS103で制御量が算出されるので、結果として、制御プログラム70について統合試験を実施した際に、要求性能を満足しない結果となる。
Next, a procedure for specifying the cause of the malfunction when the malfunction of the
なお、ここでは説明のために、上述のとおり不具合の原因を予め示しているが、実際の不具合の原因の調査の開始段階では、要求性能を満足しないこと以外、不具合の原因が不明の状態である。 For the sake of explanation, the cause of the failure is shown in advance as described above. However, at the start of the investigation of the cause of the actual failure, the cause of the failure is unknown unless it satisfies the required performance. is there.
本実施の形態1では、不具合の原因を特定するために、図6に示す周期制御処理72において、I/O4から入力されるセンサ電圧値に対して、次の3つの項目(1)〜(3)を確認する。
In the first embodiment, in order to identify the cause of the malfunction, the following three items (1) to (1) are applied to the sensor voltage value input from the I /
・項目(1):ステップS104でI/O4に出力された制御量が設計範囲内であること
・項目(2):ステップS103で算出された制御量が設計範囲内であること
・項目(3):ステップS102で補正されたセンサ電圧値が設計範囲内であること
Item (1): The control amount output to the I /
上述の項目(1)〜(3)の確認を効率良く行うために、RAM6の拡張プログラム記憶部63のプログラム記憶領域631には、後述する図8に示す拡張プログラム、すなわち、第1拡張プログラムが記憶される。また、その拡張プログラムの開始アドレスは、外部通信機能9とXCPを利用するなどして記憶される。
In order to efficiently check the above items (1) to (3), the
コマンド記憶部62の識別番号記憶配列621と、第1引数記憶配列622と、第2引数記憶配列623のそれぞれには、後述する図9に示す識別番号と、第1引数と、第2引数とが対応付けられて記憶される。
Each of the identification
図8および図9に示されるNは、制御プログラム拡張部60をRAM6に記憶する際に0に設定される。制御プログラム拡張部60をRAM6に記憶する際に、コマンド実行結果記憶領域624には、図9に示すコマンドの実行結果が未だ記憶されていないことを示す、例えば0または255等の初期値が記憶される。
N shown in FIGS. 8 and 9 is set to 0 when the control
なお、図9では、BP割り込みが発生する場合に実行されるコマンドが示されているが、BP割り込みの代わりにMPU割り込みが発生するようにした場合であっても、図9と同様のコマンドが実行される。以下では、説明の簡単化のため、BP割り込みが発生する場合について説明する。 Note that FIG. 9 shows a command that is executed when a BP interrupt occurs, but even if an MPU interrupt is generated instead of a BP interrupt, a command similar to FIG. Executed. Hereinafter, a case where a BP interrupt occurs will be described for the sake of simplicity.
CPU5が図6に示すステップS101を実行した後にBP割り込みを発生させるために、CPU5は、ステップS101を実行する際にアクセスする実行アドレス、すなわちステップS101の実行アドレスにBP51を設定する。CPU5がアクセス可能なアドレスにBP51が配置されている場合、この設定は、外部通信機能9とXCPを利用して実施される。CPU5がアクセス可能なアドレスにBP51が配置されておらず、CPU5の専用命令等を使用してこの設定を実施する必要がある場合、XCPにユーザー定義のコマンドを追加することで、この設定を実施することができる。
In order to generate a BP interrupt after the
このように、アクセス検知機能としてのBP51は、CPU5が、周期制御処理72を構成する一連の処理であるステップS101〜S106の中で複数の予め決められる特定処理を実行する際にアクセスする実行アドレスに、CPU5がアクセスしたことを検知して、割り込みを発生させる。
As described above, the
本実施の形態1では、上述したとおり、アクセス検知機能がBP51によって構成されている場合を例示している。この場合、CPU5は、BP51を特定処理の実行アドレスに設定する。このようにアクセス検知機能としてのBP51を設定することで、BP51は、この実行アドレスにCPUがアクセスしたことを検知して、割り込みを発生させる。
In the first embodiment, as described above, the case where the access detection function is configured by the
なお、アクセス検知機能が第1MPU52および第2MPU53によって構成される場合、CPU5は、第1MPU52および第2MPU53を、特定処理の実行アドレスに基づいたアドレス範囲に設定する。具体的なアドレス範囲の設定方法は、上述したMPU割り込みを発生させるための方法と同様である。このようにアクセス検知機能としての第1MPU52および第2MPU53を設定することで、第1MPU52および第2MPU53は、CPU5がアクセスした実行アドレスがアドレス範囲外であることをもって、実行アドレスにCPUがアクセスしたことを検知して、割り込みを発生させる。
When the access detection function is configured by the
なお、BP51が設定されるステップS101〜ステップS104のそれぞれの実行アドレスは、例えば、制御プログラム70をPC上のデバッガで読み込み、処理とアドレスとの対応を表示することで取得可能である。
In addition, each execution address of step S101-step S104 in which BP51 is set can be acquired by, for example, reading the
次に、図6に示す周期制御処理72のステップS101〜ステップS104のそれぞれが実行されるたびにBP割り込みが発生する場合のCPU5の動作について説明する。
Next, the operation of the
上述のとおり、制御プログラム拡張部60がRAM6に記憶され、BP51の機能が有効化された後、CPU5がステップS101を実行すれば、第1BP割り込みが発生する。
As described above, after the control
第1BP割り込みが発生すると、CPU5は、図7に示す割り込み処理を実行する。ここで、BP割り込みが発生する場合に実行される割り込み処理について、図7を参照しながら説明する。図7は、本発明の実施の形態1におけるCPU5が実行する制御プログラム70のBP割り込み処理74を示すフローチャートである。割り込み処理は、後述するように、周期制御処理72を構成する一連の処理であるステップS101〜S106の中で、複数の予め決められる特定処理が個別に実行されるたびに実行される。
When the first BP interrupt occurs, the
図7に示す割り込み処理は、発生した割り込みに応答して、周期制御処理72で特定処理の実行後以降の処理を中断し、第1拡張プログラムまたは第2拡張プログラムを実行し、当該実行後に、周期制御処理72で特定処理の実行後以降の処理を再開するように、CPU5に対して動作させる。
In response to the generated interrupt, the interrupt process shown in FIG. 7 interrupts the process after the execution of the specific process in the
なお、図7に示す割り込み処理は、制御プログラム70のBP割り込み処理74と、MPU割り込み処理75に適用可能な処理である。つまり、図7に示す割り込み処理は、BP割り込み処理74およびMPU割り込み処理75のいずれにも適用可能である。図7に示す割り込み処理は、BP割り込み処理74およびMPU割り込み処理75のいずれかに適用してもよいし、両方に適用してもよい。
The interrupt process shown in FIG. 7 is a process applicable to the BP interrupt
図7に示すように、第1BP割り込みが発生して割り込み処理の実行が開始されると、ステップS201において、CPU5は、サブルーチン開始アドレス記憶変数611に記憶されるサブルーチンの開始アドレスを読み出し、処理がステップS202へと進む。
As shown in FIG. 7, when the first BP interrupt occurs and the execution of the interrupt process is started, in step S201, the
ステップS202において、CPU5は、ステップS201で読み出したサブルーチンの開始アドレスが有効であるか否かを判定する。開始アドレスが有効であると判定された場合には、処理がステップS203へと進み、開始アドレスが有効でない、すなわち無効であると判定された場合には、処理が終了となる。
In step S202, the
CPU5がサブルーチン開始アドレス記憶変数611に記憶されるサブルーチンの開始アドレスが有効であるか無効であるかを判定する手段としては、例えば、以下の手段が考えられる。すなわち、CPU5は、開始アドレスがゼロであれば無効であると判定し、開始アドレスがゼロ以外であれば有効であると判定する。
For example, the following means can be considered as means for the
ステップS203において、CPU5は、ステップS201で読み出した開始アドレスに対応するサブルーチンを実行し、処理が終了となる。
In step S203, the
なお、サブルーチン開始アドレス記憶変数611は、制御プログラム70の実行開始時に、初期化処理71によって初期化されて、無効なアドレスを記憶する。
Note that the subroutine start
図6に戻り、CPU5は、ステップS101を実行した後、第1BP割り込みが発生すると、図7に示す割り込み処理を実行する。第1BP割り込みが発生する場合、上述したように、サブルーチン開始アドレス記憶変数611には、有効な開始アドレスが設定されている。
Returning to FIG. 6, the
したがって、CPU5は、割り込み処理において、ステップS201を実行した後、ステップS202において、ステップS201で読み出した開始アドレスが有効であると判定し、処理がステップS203へと進む。
Therefore, after executing step S201 in the interrupt process, the
ステップS203において、CPU5は、ステップS201で読み出した開始アドレスに対応するサブルーチンを呼び出し、そのサブルーチンの実行を開始する。
In step S203, the
ここで、割り込み処理で呼び出されるサブルーチンについて、図8を参照しながら説明する。図8は、本発明の実施の形態1におけるCPU5が実行する制御プログラム70の割り込み処理で呼び出されるサブルーチンを示すフローチャートである。
Here, a subroutine called in the interrupt process will be described with reference to FIG. FIG. 8 is a flowchart showing a subroutine called in the interrupt process of the
図8に示す拡張プログラム、すなわち第1拡張プログラムは、特定処理の処理結果をRAM6に記憶するとともに、周期制御処理72で特定処理の次に実行される次の特定処理の実行アドレスにCPU5がアクセスしたことをアクセス検知機能が検知するように、アクセス検知機能を設定するよう、CPU5に対して動作させる。
The extension program shown in FIG. 8, that is, the first extension program, stores the processing result of the specific process in the
割り込み処理でサブルーチンが呼び出されると、拡張プログラム記憶部63のプログラム記憶領域631に記憶される拡張プログラム、すなわち図8に示すサブルーチンが実行される。ステップS301において、CPU5は、コマンド記憶部62の識別番号記憶配列621に記憶される要素Nを読み出し、処理がステップS302へと進む。
When the subroutine is called in the interrupt process, the extension program stored in the
ステップS302において、CPU5は、ステップS301で読み出した要素Nに対して1を加算し、その加算後の要素Nを識別番号記憶配列621に記憶し、処理がステップS303へと進む。
In step S302, the
ステップS303において、CPU5は、ステップS301で読み出した要素Nに対応するコマンドが終了コマンドであるか否かを判定する。コマンドが終了コマンドであると判定された場合には、処理が終了となり、コマンドが終了コマンドでないと判定された場合には、処理がステップS304へと進む。
In step S303, the
ステップS304において、ステップS301で読み出した要素Nに対応するコマンドを実行し、処理がステップS301へと戻り、ステップS301以降の処理を再び実行する。 In step S304, the command corresponding to the element N read in step S301 is executed, the process returns to step S301, and the processes after step S301 are executed again.
ここで、図8に示すサブルーチンで実行されるコマンドについて、図9を参照しながら説明する。図9は、本発明の実施の形態1におけるCPU5が実行する制御プログラム70の割り込み処理で呼び出されるサブルーチンのコマンドの定義の一例を示す表である。
Here, the commands executed in the subroutine shown in FIG. 8 will be described with reference to FIG. FIG. 9 is a table showing an example of the definition of a subroutine command called in the interrupt process of the
図9に示すように、要素Nおよび識別番号と、第1引数と、第2引数とが対応付けられて、識別番号記憶配列621と、第1引数記憶配列622と、第2引数記憶配列623とにそれぞれ記憶されている。また、図9では、要素Nに対応するコマンドの意味も併せて示している。
As shown in FIG. 9, the element N, the identification number, the first argument, and the second argument are associated with each other, and the identification
図7に戻り、割り込み処理でサブルーチンが呼び出されると、はじめは、N=0であるので、図8に示すサブルーチンでは、ステップS302において、N=1となり、ステップS304において、N=0に対応するコマンドが実行される。この場合、図9から分かるように、CPU5は、ステップS101で取得したセンサ電圧値を読み出して第1データとしてコマンド実行結果記憶領域624に記憶する。
Returning to FIG. 7, when the subroutine is called in the interrupt process, N = 0 at first. Therefore, in the subroutine shown in FIG. 8, N = 1 in step S <b> 302, and N = 0 in step S <b> 304. The command is executed. In this case, as can be seen from FIG. 9, the
N=0に対応するコマンドは、処理の終了を指示する終了コマンドではないので、サブルーチンでは、引き続き、ステップS301以降の処理が実行される。サブルーチンでは、ステップS302において、N=2となり、ステップS304において、N=1に対応するコマンドが実行される。この場合、CPU5が図6に示すステップS102を実行した後にBP割り込みを発生させるために、CPU5は、ステップS102を実行する際にアクセスする実行アドレス、すなわちステップS102の実行アドレスにBP51を設定する。
Since the command corresponding to N = 0 is not an end command for instructing the end of the process, the processes in and after step S301 are continuously executed in the subroutine. In the subroutine, N = 2 in step S302, and a command corresponding to N = 1 is executed in step S304. In this case, in order for the
N=1に対応するコマンドは、終了コマンドではないので、サブルーチンでは、引き続き、ステップS301以降の処理が実行される。サブルーチンでは、ステップS302において、N=3となり、ステップS303において、N=2に対応するコマンドが終了コマンドであると判定され、処理が終了となる。 Since the command corresponding to N = 1 is not an end command, the processing subsequent to step S301 is subsequently executed in the subroutine. In the subroutine, in step S302, N = 3, and in step S303, it is determined that the command corresponding to N = 2 is an end command, and the process ends.
この場合、サブルーチンが終了となり、処理が図7に示す割り込み処理に返され、さらに割り込み処理が終了となり、処理が図6に示す周期制御処理72のステップS101の実行の完了地点に戻る。なお、サブルーチンの終了時において、識別番号記憶配列621に記憶される要素Nの値そのものは、上述したとおり、N=3になっている。
In this case, the subroutine is finished, the process is returned to the interrupt process shown in FIG. 7, the interrupt process is further finished, and the process returns to the completion point of execution of step S101 of the
このように、CPU5は、アクセス検知機能としてのBP51によって発生した割り込みに応答して、周期制御処理72でステップS101の実行後以降の処理を中断する。また、CPU5は、割り込み処理を実行させることで、拡張プログラムに従って、ステップS101の処理結果をコマンド実行結果記憶領域624に記憶する。
As described above, the
続いて、CPU5は、周期制御処理72でステップS101の次に実行される次の特定処理であるステップS102の実行アドレスにCPU5がアクセスしたことをBP51が検知するように、BP51を設定する。また、CPU5は、割り込み処理を終了し、周期制御処理72でステップS101実行後以降の処理を再開する。
Subsequently, the
図6に戻り、CPU5は、ステップS102を実行した後、第2BP割り込みが発生すると、図7に示す割り込み処理を再度実行する。この場合、ステップS203でサブルーチンが呼び出され、そのサブルーチンが再度実行される。
Returning to FIG. 6, after executing step S <b> 102, when the second BP interrupt occurs, the
割り込み処理でサブルーチンが呼び出されると、前回のサブルーチンの終了時では、N=3になっているので、今回のサブルーチンでは、ステップS302において、N=4となり、ステップS304において、N=3に対応するコマンドが実行される。この場合、CPU5は、ステップS102で補正したセンサ電圧値を読み出して第2データとしてコマンド実行結果記憶領域624に記憶する。
When a subroutine is called by interrupt processing, N = 3 at the end of the previous subroutine, so in this subroutine, N = 4 in step S302 and N = 3 in step S304. The command is executed. In this case, the
N=3に対応するコマンドは、終了コマンドではないので、サブルーチンでは、引き続き、ステップS301以降の処理が実行される。サブルーチンでは、ステップS302において、N=5となり、ステップS304において、N=4に対応するコマンドが実行される。この場合、CPU5が図6に示すステップS103を実行した後にBP割り込みを発生させるために、CPU5は、ステップS103を実行する際にアクセスする実行アドレス、すなわちステップS103の実行アドレスにBP51を設定する。
Since the command corresponding to N = 3 is not an end command, processing in step S301 and subsequent steps is continued in the subroutine. In the subroutine, N = 5 in step S302, and a command corresponding to N = 4 is executed in step S304. In this case, in order for the
N=4に対応するコマンドは、終了コマンドではないので、サブルーチンでは、引き続き、ステップS301以降の処理が実行される。サブルーチンでは、ステップS302において、N=6となり、ステップS303において、N=5に対応するコマンドが終了コマンドであると判定され、処理が終了となる。 Since the command corresponding to N = 4 is not an end command, processing in step S301 and subsequent steps is continued in the subroutine. In the subroutine, in step S302, N = 6, and in step S303, it is determined that the command corresponding to N = 5 is an end command, and the process ends.
この場合、サブルーチンが終了となり、処理が図7に示す割り込み処理に返され、さらに割り込み処理が終了となり、処理が図6に示す周期制御処理72のステップS102の実行の完了地点に戻る。なお、サブルーチンの終了時において、識別番号記憶配列621に記憶される要素Nの値そのものは、上述したとおり、N=6になっている。
In this case, the subroutine is finished, the process is returned to the interrupt process shown in FIG. 7, the interrupt process is finished, and the process returns to the completion point of execution of step S102 of the
このように、CPU5は、アクセス検知機能としてのBP51によって発生した割り込みに応答して、周期制御処理72でステップS102の実行後以降の処理を中断する。また、CPU5は、割り込み処理を実行させることで、拡張プログラムに従って、ステップS102の処理結果をコマンド実行結果記憶領域624に記憶する。
As described above, the
続いて、CPU5は、周期制御処理72でステップS102の次に実行される次の特定処理であるステップS103の実行アドレスにCPU5がアクセスしたことをBP51が検知するように、BP51を設定する。また、CPU5は、割り込み処理を終了し、周期制御処理72でステップS102実行後以降の処理を再開する。
Subsequently, the
図6に戻り、CPU5は、ステップS103を実行した後、第3BP割り込みが発生すると、図7に示す割り込み処理を再度実行する。この場合、ステップS203でサブルーチンが呼び出され、そのサブルーチンが再度実行される。
Returning to FIG. 6, after executing step S <b> 103, when the third BP interrupt occurs, the
割り込み処理でサブルーチンが呼び出されると、前回のサブルーチンの終了時では、N=6になっているので、今回のサブルーチンでは、ステップS302において、N=7となり、ステップS304において、N=6に対応するコマンドが実行される。この場合、CPU5は、ステップS103で算出した制御量を読み出して第3データとしてコマンド実行結果記憶領域624に記憶する。
When a subroutine is called in the interrupt process, N = 6 at the end of the previous subroutine, so in this subroutine, N = 7 in step S302 and N = 6 in step S304. The command is executed. In this case, the
N=6に対応するコマンドは、終了コマンドではないので、サブルーチンでは、引き続き、ステップS301以降の処理が実行される。サブルーチンでは、ステップS302において、N=8となり、ステップS304において、N=7に対応するコマンドが実行される。この場合、CPU5が図6に示すステップS104を実行した後にBP割り込みを発生させるために、CPU5は、ステップS104を実行する際にアクセスする実行アドレス、すなわちステップS104の実行アドレスにBP51を設定する。
Since the command corresponding to N = 6 is not an end command, the processing subsequent to step S301 is subsequently executed in the subroutine. In the subroutine, N = 8 in step S302, and a command corresponding to N = 7 is executed in step S304. In this case, in order for the
N=7に対応するコマンドは、終了コマンドではないので、サブルーチンでは、引き続き、ステップS301以降の処理が実行される。サブルーチンでは、ステップS302において、N=9となり、ステップS303において、N=8に対応するコマンドが終了コマンドであると判定され、処理が終了となる。 Since the command corresponding to N = 7 is not an end command, the processing subsequent to step S301 is subsequently executed in the subroutine. In the subroutine, in step S302, N = 9, and in step S303, it is determined that the command corresponding to N = 8 is an end command, and the process ends.
この場合、サブルーチンが終了となり、処理が図7に示す割り込み処理に返され、さらに割り込み処理が終了となり、処理が図6に示す周期制御処理72のステップS103の実行の完了地点に戻る。なお、サブルーチンの終了時において、識別番号記憶配列621に記憶される要素Nの値そのものは、上述したとおり、N=9になっている。
In this case, the subroutine is ended, the process is returned to the interrupt process shown in FIG. 7, the interrupt process is further ended, and the process returns to the completion point of execution of step S103 of the
このように、CPU5は、アクセス検知機能としてのBP51によって発生した割り込みに応答して、周期制御処理72でステップS103の実行後以降の処理を中断する。また、CPU5は、割り込み処理を実行させることで、拡張プログラムに従って、ステップS103の処理結果をコマンド実行結果記憶領域624に記憶する。
As described above, the
続いて、CPU5は、周期制御処理72でステップS103の次に実行される次の特定処理であるステップS104の実行アドレスにCPU5がアクセスしたことをBP51が検知するように、BP51を設定する。また、CPU5は、割り込み処理を終了し、周期制御処理72でステップS103実行後以降の処理を再開する。
Subsequently, the
図6に戻り、CPU5は、ステップS104を実行した後、第4BP割り込みが発生すると、図7に示す割り込み処理を再度実行する。この場合、ステップS203でサブルーチンが呼び出され、そのサブルーチンが再度実行される。
Returning to FIG. 6, when the fourth BP interrupt occurs after executing step S104, the
割り込み処理でサブルーチンが呼び出されると、前回のサブルーチンの終了時では、N=9になっているので、今回のサブルーチンでは、ステップS302において、N=10となり、ステップS304において、N=9に対応するコマンドが実行される。この場合、CPU5は、ステップS104で出力した制御量を読み出して第4データとしてコマンド実行結果記憶領域624に記憶する。
When a subroutine is called in the interrupt process, N = 9 at the end of the previous subroutine, so in this subroutine, N = 10 in step S302 and N = 9 in step S304. The command is executed. In this case, the
N=9に対応するコマンドは、終了コマンドではないので、サブルーチンでは、引き続き、ステップS301以降の処理が実行される。サブルーチンでは、ステップS302において、N=11となり、ステップS304において、N=10に対応するコマンドが実行される。この場合、CPU5は、BP51を0に設定することで実質的にBP割り込みを無効化する。
Since the command corresponding to N = 9 is not an end command, processing in step S301 and subsequent steps is continuously executed in the subroutine. In the subroutine, N = 11 in step S302, and a command corresponding to N = 10 is executed in step S304. In this case, the
N=10に対応するコマンドは、終了コマンドではないので、サブルーチンでは、引き続き、ステップS301以降の処理が実行される。サブルーチンでは、ステップS302において、N=12となり、ステップS303において、N=11に対応するコマンドが終了コマンドであると判定され、処理が終了となる。 Since the command corresponding to N = 10 is not an end command, the processing subsequent to step S301 is subsequently executed in the subroutine. In the subroutine, in step S302, N = 12, and in step S303, it is determined that the command corresponding to N = 11 is an end command, and the process ends.
この場合、サブルーチンが終了となり、処理が図7に示す割り込み処理に返され、さらに割り込み処理が終了となり、処理が図6に示す周期制御処理72のステップS104の実行の完了地点に戻り、処理が終了となる。
In this case, the subroutine ends, the process returns to the interrupt process shown in FIG. 7, the interrupt process ends, the process returns to the completion point of execution of step S104 of the
このように、CPU5は、アクセス検知機能としてのBP51によって発生した割り込みに応答して、周期制御処理72でステップS104の実行後以降の処理を中断する。また、CPU5は、割り込み処理を実行させることで、拡張プログラムに従って、ステップS104の処理結果をコマンド実行結果記憶領域624に記憶する。
As described above, the
CPU5は、周期制御処理72を構成する一連の処理の中での特定処理であるステップS101〜S104をすべて実行し、さらに、周期制御処理72の最後の処理であるステップS104を実行したので、周期制御処理72が終了となる。
Since the
このように、第4BP割り込みが発生した後については、新たなBP割り込みが発生しないので、割り込み処理が実行されることなく、図6に示す周期制御処理72が終了となる。したがって、コマンド実行結果記憶領域624には、上述のN=0〜11に対応する一連のコマンド実行後のデータとして、第1データ、第2データ、第3データおよび第4データが記憶される。コマンド実行結果記憶領域624に記憶されるデータを、外部通信機能9とXCPを利用して読み出すことで、ステップS101、S102、S103およびS104のそれぞれを実行した結果を、制御プログラム70の周期制御処理72を変更することなく、取得することができる。
As described above, after the fourth BP interrupt occurs, no new BP interrupt occurs, so the interrupt process is not executed, and the
これに対して、本実施の形態1におけるECU1の構成を適用せずに、XCPのみを利用する場合、XCPではアドレスが既知の静的変数に記憶されるデータのみを取得可能なため、自動変数、およびCPUレジスタに一時的に保持されるデータを取得することができない。しかしながら、本実施の形態1におけるECU1の構成によれば、CPU5が実行するコマンドおよびスタックフレームを取得するコマンドを定義することで、制御プログラム70の周期制御処理72内で一時的に使用される自動変数および一時的にCPUレジスタに保持されるデータを取得することが可能である。
On the other hand, when only the XCP is used without applying the configuration of the
上述のN=0〜11に対応する一連のコマンド実行後のデータをコマンド実行結果記憶領域624から取得することで、上述の項目(1)〜(3)を確認することができる。その結果、ステップS104でI/O4に出力された制御量、ステップS103で算出された制御量およびステップS102で補正されたセンサ電圧値が、それぞれ設計範囲内ではないことが分かる。つまり、ステップS101で取得されたセンサ電圧値が設計どおりに補正されていないことを推定することができる。
By acquiring data after executing a series of commands corresponding to the above-described N = 0 to 11 from the command execution
本実施の形態1では、センサ電圧値が設計どおりに補正されていないという推定を確認するために、図6に示す周期制御処理72において、次の3つの項目(4)〜(6)をさらに確認する。
In the first embodiment, in order to confirm the estimation that the sensor voltage value is not corrected as designed, the following three items (4) to (6) are further added in the
・項目(4):対応要否情報を正しく読み出していること
・項目(5):ステップS106で追加補正が実行されていること
・項目(6):ステップS106で追加補正されたセンサ電圧値が設計範囲内であること
Item (4): The information on necessity of correspondence is correctly read. Item (5): Additional correction is performed in step S106. Item (6): The sensor voltage value additionally corrected in step S106 is obtained. Within the design range
上述の項目(4)〜(6)の確認を効率良く行うために、RAM6の拡張プログラム記憶部63のプログラム記憶領域631には、上述の図8に示す拡張プログラムが記憶される。また、その拡張プログラムの開始アドレスは、外部通信機能9とXCPを利用するなどして記憶される。
In order to check the above items (4) to (6) efficiently, the extension program shown in FIG. 8 is stored in the
コマンド記憶部62の識別番号記憶配列621と、第1引数記憶配列622と、第2引数記憶配列623のそれぞれには、後述する図10に示す識別番号と、第1引数と、第2引数とが対応付けられて記憶される。また、CPU5が図6に示すステップS102を実行した後にBP割り込みを発生させるために、CPU5は、ステップS102の実行アドレスにBP51を設定する。
Each of the identification
上述したとおり、制御プログラム拡張部60がRAM6に記憶され、BP51の機能が有効化された後、CPU5がステップS102を実行すれば、第1BP割り込みが発生する。
As described above, after the control
第1BP割り込みが発生すると、CPU5は、上述の項目(1)〜(3)を確認する場合と同様に、図7に示す割り込み処理を実行する。CPU5は、割り込み処理において、サブルーチン開始アドレス記憶変数611に記憶される開始アドレスに対応するサブルーチンを呼び出し、そのサブルーチンの実行を開始する。
When the first BP interrupt occurs, the
ステップS203でのサブルーチンの呼び出しによって、図8に示すサブルーチンが実行される。このサブルーチンでは、図10に示すコマンドが実行される。図10は、本発明の実施の形態1におけるCPU5が実行する制御プログラム70の割り込み処理で呼び出されるサブルーチンのコマンドの定義の一例を示す表である。
The subroutine shown in FIG. 8 is executed by calling the subroutine in step S203. In this subroutine, the command shown in FIG. 10 is executed. FIG. 10 is a table showing an example of the definition of a subroutine command called in the interrupt process of the
図10に示すように、要素Nおよび識別番号と、第1引数と、第2引数とが対応付けられて、識別番号記憶配列621と、第1引数記憶配列622と、第2引数記憶配列623とにそれぞれ記憶されている。また、図10では、要素Nに対応するコマンドの意味も併せて示している。
As shown in FIG. 10, the element N, the identification number, the first argument, and the second argument are associated with each other, and the identification
サブルーチンにおいて、図10に示すN=0〜2に対応するコマンドが実行された後、呼び出し側の割り込み処理に処理が返される。この時点で、CPU5は、ステップS102の実行の完了地点、すなわち、ステップS105の実行の開始直前において、上述の読み出された対応要否情報を、第1データとして、コマンド実行結果記憶領域624に記憶する。
In the subroutine, after the command corresponding to N = 0 to 2 shown in FIG. 10 is executed, the process is returned to the caller interrupt process. At this time, the
上述したとおり、図8に示すサブルーチンの終了によって、図7に示す割り込み処理に処理が返され、さらに、割り込み処理が終了となり、CPU5は、ステップS102の実行の完了地点に復帰する。その後、CPU5は、ステップS105を実行する。
As described above, upon completion of the subroutine shown in FIG. 8, the process is returned to the interrupt process shown in FIG. 7, and the interrupt process is finished, and the
本実施の形態1では、上述したとおり、不具合の一例として、ステップS105において、CPU5が、周期制御処理72の仕様に対しての対応が必要であると判定し、ステップS106を実行すべきところを、逆の判定が行われて、ステップS106が実行されない場合を考えている。したがって、ステップS105において、CPU5は、対応要否情報が、対応が不要であることを示す「0」であると判定し、ステップS106を実行せずに、ステップS103を実行する。
In the first embodiment, as described above, as an example of the problem, in step S105, the
そのため、CPU5は、図10に示すN=1に対応するコマンドを実行することでBP51を、ステップS106の実行アドレスに設定したものの、ステップS106を実行していないので、第2BP割り込みが発生しない。その結果、コマンド実行結果記憶領域624に第2データとして記憶される追加補正後のセンサ電圧値が初期値のままとなり、さらに、要素Nの値が3に保持されたままとなる。
Therefore, the
上述のN=0〜5に対応する一連のコマンド実行後のデータをコマンド実行結果記憶領域624から取得することで、上述の項目(4)〜(6)を確認することができる。その結果、対応要否情報が正しく読み出されており、追加補正が実行されておらず、追加補正後のセンサ電圧値がステップS106の未実行のため初期値であることが分かる。
By acquiring data after executing a series of commands corresponding to N = 0 to 5 described above from the command execution
上述の項目(1)〜(6)の確認結果から、不具合の原因は、センサ電圧値の追加補正が未実施であることによる可能性があることが分かる。 From the confirmation results of the items (1) to (6) described above, it can be understood that the cause of the problem may be due to the fact that additional correction of the sensor voltage value has not been performed.
これに対して、本実施の形態1におけるECU1の構成を適用せずに、XCPのみを利用する場合、項目(4)および(5)を直接確認することができない。そのため、ステップS103の実行前における補正後のセンサ電圧値が設計範囲外であることを確認できたとしても、その理由がステップS106の未実行によるものであるという直接の証拠を得ることができない。
On the other hand, when only the XCP is used without applying the configuration of the
しかしながら、本実施の形態1におけるECU1の構成によれば、項目(4)および(5)を確認することができる。そのため、ステップS103の実行前における補正後のセンサ電圧値が設計範囲外である理由が、対応要否情報が正しく読み出されているものの、ステップS105での判定が誤り、ステップS106が未実行であったためであると推定することができる。
However, according to the configuration of
なお、一般的なBPの機能では、特定のアドレスの実行を検知するのみでなく、特定のアドレスのデータ読み出しまたはデータ書き込みも検知可能である場合が多い。そこで、BP51における特定のアドレスのデータ読み出しの検知機能を使用して、CPU5が上述の対応要否情報を読み出した際にBP割り込みを発生させてもよい。この場合、CPU5は、そのBP割り込みの発生に応答して、割り込み処理内で、対応要否情報をコマンド実行結果記憶領域624に記憶することができる。
Note that in general BP functions, it is often possible not only to detect the execution of a specific address, but also to detect data reading or data writing at a specific address. Therefore, a detection function of data reading at a specific address in the
上述の不具合の原因の推定確度が高ければ、ステップS105の判定の内容を確認し、判定論理が逆であることを見つけることが容易になる。つまり、本実施の形態1におけるECU1の構成によって、上述の項目(1)〜(6)を確認すれば、デバッガを使用することなく、XCPのメモリアクセス機能のみを用いた場合よりも高い確度で不具合の原因を特定することができる。
If the estimation accuracy of the cause of the above-described defect is high, it is easy to confirm the content of the determination in step S105 and find that the determination logic is reversed. In other words, if the above items (1) to (6) are confirmed by the configuration of the
このようにCPU5は、BP51によって発生した割り込みに応答して、割り込み処理を実行させることで、周期制御処理72で特定処理の実行後以降の処理を中断し、図8に示す拡張プログラムを実行する。CPU5は、図8に示す拡張プログラムを実行させることで、特定処理、すなわちデータを取得することを所望する処理の処理結果をRAM6のコマンド実行結果記憶領域624に記憶させる。
As described above, the
また、CPU5は、図8に示す拡張プログラムを実行させることで、周期制御処理72で特定処理の次に実行される次の特定処理の実行アドレスにCPU5がアクセスしたことをBP51が検知するように、BP51を設定する。その後、CPU5は、拡張プログラムの実行後に、周期制御処理72で特定処理の実行後以降の処理を再開する。
Further, the
本実施の形態1では、制御プログラム70の周期制御処理72の不具合の原因を推定した後、その不具合を修正し、その修正後の周期制御処理72の結果を確認する。
In this
上述の修正の確認を効率良く実施するために、RAM6の拡張プログラム記憶部63のプログラム記憶領域631には、後述する図11に示す拡張プログラム、すなわち、第2拡張プログラムが記憶される。また、その拡張プログラムの開始アドレスは、外部通信機能9とXCPを利用するなどして記憶される。
In order to efficiently perform the above-described correction check, an extension program shown in FIG. 11, which will be described later, that is, a second extension program, is stored in the
CPU5が図6に示すステップS102を実行した後にBP割り込みを発生させるために、CPU5は、ステップS102の実行アドレスにBP51を設定する。
In order to generate a BP interrupt after the
上述したとおり、制御プログラム拡張部60がRAM6に記憶され、BP51の機能が有効化された後、CPU5がステップS102を実行すれば、CPU5がステップS105を実行する直前で、BP割り込みが発生する。
As described above, after the control
BP割り込みが発生すると、CPU5は、図7に示す割り込み処理を実行する。CPU5は、割り込み処理において、サブルーチン開始アドレス記憶変数611に記憶される開始アドレスに対応する図11に示すサブルーチンを呼び出し、そのサブルーチンの実行を開始する。
When the BP interrupt occurs, the
ここで、割り込み処理で呼び出されるサブルーチンについて、図11を参照しながら説明する。図11は、本発明の実施の形態1におけるCPU5が実行する制御プログラム70の割り込み処理で呼び出されるサブルーチンを示すフローチャートである。
Here, a subroutine called in the interrupt process will be described with reference to FIG. FIG. 11 is a flowchart showing a subroutine called in the interrupt process of the
図11に示す拡張プログラム、すなわち、第2拡張プログラムは、周期制御処理72で発生する不具合の原因である処理を修正した後の修正後処理を実行するように、CPU5に対して動作させる。修正後処理は、図11に示すステップS105NおよびS106に対応する。
The extension program shown in FIG. 11, that is, the second extension program, causes the
割り込み処理でサブルーチンが呼び出されると、CPU5は、拡張プログラム記憶部63のプログラム記憶領域631に記憶される図11に示す拡張プログラムを実行する。この場合、ステップS105Nにおいて、CPU5は、対応要否情報が、対応が不要であることを示す「1」であるか否かを判定する。
When the subroutine is called in the interrupt process, the
ここで、ステップS105Nの判定処理では、対応要否情報が「1」である場合には、対応が不要であると判定され、対応要否情報が、「1」でない、すなわち「0」である場合には、対応が必要であると判定されるように構成されている。つまり、ステップS105Nは、周期制御処理72で発生する不具合の原因である図6に示すステップS105を修正している。具体的には、ステップS105Nの判定論理は、ステップS105の判定論理の逆となるように修正されている。
Here, in the determination process in step S105N, if the correspondence necessity information is “1”, it is determined that no correspondence is necessary, and the correspondence necessity information is not “1”, that is, “0”. In such a case, it is determined that a response is necessary. That is, step S105N corrects step S105 shown in FIG. 6 which is the cause of the problem that occurs in the
ステップS105Nにおいて、CPU5は、対応要否情報が「1」であると判定した場合には、処理が終了となる。一方、CPU5は、対応要否情報が「1」でないと判定した場合には、処理がステップS106へと進む。
In step S105N, when the
図11に示すステップS106を実行後、サブルーチンが終了する。図11に示すサブルーチンの終了によって、図7に示す割り込み処理に処理が返され、さらに割り込み処理が終了となり、処理が図6に示すステップS102の実行の完了地点に戻る。その後、CPU5は、ステップS105の判定を実行するものの、この判定は、上述した不具合によって正しく行われない。そのため、CPU5は、ステップS106を実行せずに、ステップS103を実行する。その後、CPU5は、ステップS104を実行し、周期制御処理72が終了となる。
After executing step S106 shown in FIG. 11, the subroutine ends. By the end of the subroutine shown in FIG. 11, the process is returned to the interrupt process shown in FIG. 7, and the interrupt process is further ended, and the process returns to the completion point of the execution of step S102 shown in FIG. Thereafter, the
このように、CPU5は、図11に示す拡張プログラムを実行させることで、周期制御処理72で不具合が発生する原因である処理を修正した後の修正後処理を実行する。CPU5は、その後、CPU5は、拡張プログラムの実行後に、周期制御処理72で特定処理の実行後以降の処理を再開する。すなわち、図11に示すサブルーチンによって、CPU5は、ステップS105NおよびステップS106を実行することでセンサ電圧値の追加補正を行う。その後、CPU5は、図6に示す周期制御処理72によって、ステップS105およびS103を順に実行し、最後にステップS104を実行する。したがって、図11に示す拡張プログラムをRAM6に記憶した上で、制御プログラム70について統合試験を実施すれば、制御プログラム70の周期制御処理72を変更することなく、要求性能を満足しない不具合が解消することを確認できる。つまり、制御プログラム70の不具合修正の結果を確認する際に、On−target Bypassingに必要なフック関数を使用する必要がなくなる。
As described above, the
以上、本実施の形態1の車載制御装置によれば、周期制御処理と、周期制御処理を構成する一連の処理の中で複数の予め決められる特定処理が個別に実行されるたびに実行される割り込み処理とを含む制御プログラムを記憶するROMと、拡張プログラムとして第1拡張プログラムおよび第2拡張プログラムを記憶するRAMと、制御プログラムおよび拡張プログラムを実行するCPUとを備えて構成されている。
As mentioned above, according to the vehicle-mounted control apparatus of this
また、上記の構成において、CPUは、以下のように構成されている。すなわち、CPUは、特定処理を実行する際にアクセスする実行アドレスにアクセスしたことを検知して、割り込みを発生させるアクセス検知機能を備えて構成されている。 In the above configuration, the CPU is configured as follows. That is, the CPU is configured to include an access detection function that detects an access to an execution address that is accessed when executing a specific process and generates an interrupt.
CPUは、アクセス検知機能によって発生した割り込みに応答して割り込み処理を実行させることで、周期制御処理で特定処理の実行後以降の処理を中断し、第1拡張プログラムまたは第2拡張プログラムを実行し、当該実行後に、周期制御処理で特定処理の実行後以降の処理を再開するように構成されている。CPUは、第1拡張プログラムを実行させることで、特定処理の処理結果をRAMに記憶させるとともに、周期制御処理で特定処理の次に実行される次の特定処理の実行アドレスにCPUがアクセスしたことをアクセス検知機能が検知するように、アクセス検知機能を設定するように構成されている。CPUは、第2拡張プログラムを実行させることで、周期制御処理で不具合が発生する原因である処理を修正した後の修正後処理を実行するように構成されている。 The CPU executes the interrupt process in response to the interrupt generated by the access detection function, thereby interrupting the process after the execution of the specific process in the cycle control process and executing the first extension program or the second extension program. After the execution, the process after the execution of the specific process is resumed in the periodic control process. The CPU stores the processing result of the specific process in the RAM by executing the first extension program, and the CPU has accessed the execution address of the next specific process executed after the specific process in the cycle control process Is configured to set the access detection function so that the access detection function detects. The CPU is configured to execute a post-correction process after correcting a process that causes a problem in the periodic control process by executing the second extension program.
上述の車載制御装置を構成することで、デバッガを使用しなくても制御プログラムの不具合の原因を特定することができるとともに、フック関数を用意しなくても制御プログラムの不具合の解消を確認することができる。 By configuring the above-mentioned in-vehicle control device, it is possible to identify the cause of the malfunction of the control program without using a debugger, and confirm the elimination of the malfunction of the control program without preparing a hook function. Can do.
1 車載制御装置(ECU)、2 入力回路、3 マイコン、4 I/O、5 CPU、6 RAM、7 ROM、8 タイマ、9 外部通信機能、10 駆動回路、11 モータ、12 外部通信線、51 ブレイクポイント機能、52 第1メモリ保護機能、53 第2メモリ保護機能、60 制御プログラム拡張部、61 拡張プログラム開始アドレス記憶部、611 サブルーチン開始アドレス記憶変数、62 コマンド記憶部、621 識別番号記憶配列、622 第1引数記憶配列、623 第2引数記憶配列、624 コマンド実行結果記憶領域、63 拡張プログラム記憶部、631 プログラム記憶領域、70 制御プログラム、71 初期化処理、72 周期制御処理、73 XCP処理、74 BP割り込み処理、75 MPU割り込み処理。
DESCRIPTION OF
Claims (3)
拡張プログラムとして第1拡張プログラムおよび第2拡張プログラムを記憶するRAMと、
前記制御プログラムおよび前記拡張プログラムを実行するCPUと、
を備え、
前記CPUは、
前記特定処理を実行する際にアクセスする実行アドレスにアクセスしたことを検知して、割り込みを発生させるアクセス検知機能を備え、
前記アクセス検知機能によって発生した前記割り込みに応答して前記割り込み処理を実行させることで、前記周期制御処理で前記特定処理の実行後以降の処理を中断し、前記第1拡張プログラムまたは前記第2拡張プログラムを実行し、当該実行後に、前記周期制御処理で前記特定処理の実行後以降の処理を再開し、
前記第1拡張プログラムを実行させることで、前記特定処理の処理結果を前記RAMに記憶させるとともに、前記周期制御処理で前記特定処理の次に実行される次の特定処理の実行アドレスに前記CPUがアクセスしたことを前記アクセス検知機能が検知するように、前記アクセス検知機能を設定し、
前記第2拡張プログラムを実行させることで、前記周期制御処理で不具合が発生する原因である処理の結果を修正する
車載制御装置。 A cycle control process for periodically controlling the control target, and an interrupt process executed each time a plurality of predetermined specific processes are individually executed in a series of processes constituting the cycle control process. A ROM for storing a control program including:
A RAM for storing a first extension program and a second extension program as an extension program;
A CPU for executing the control program and the extension program;
With
The CPU
An access detection function for detecting an access to an execution address to be accessed when executing the specific process, and generating an interrupt;
By executing the interrupt process in response to the interrupt generated by the access detection function, the process after the execution of the specific process is interrupted in the cycle control process, and the first extension program or the second extension Execute the program, and after the execution, resume the process after the execution of the specific process in the periodic control process,
By executing the first extension program, the processing result of the specific process is stored in the RAM, and the CPU is assigned to the execution address of the next specific process executed next to the specific process in the cycle control process. Set the access detection function so that the access detection function detects access,
An in- vehicle control device that corrects a result of a process that causes a failure in the periodic control process by executing the second extension program.
前記CPUは、前記ブレイクポイント機能を、前記実行アドレスに設定し、
前記ブレイクポイント機能は、前記実行アドレスに前記CPUがアクセスしたことを検知して、前記割り込みを発生させる
請求項1に記載の車載制御装置。 The access detection function is configured by a breakpoint function,
The CPU sets the breakpoint function to the execution address,
The in-vehicle control device according to claim 1, wherein the breakpoint function detects that the CPU has accessed the execution address and generates the interrupt.
適用するアドレス範囲の下限値と上限値が設定される第1メモリ保護機能、および適用するアドレス範囲の下限値と上限値が設定され、前記第1メモリ保護機能とは、適用するアドレス範囲が異なる第2メモリ保護機能によって構成され、
前記CPUは、前記第1メモリ保護機能および前記第2メモリ保護機能を適用するアドレス範囲を、前記実行アドレスに基づいて設定し、
前記第1メモリ保護機能および前記第2メモリ保護機能は、前記CPUがアクセスした前記実行アドレスが前記アドレス範囲外であることをもって、前記実行アドレスに前記CPUがアクセスしたことを検知して、前記割り込みを発生させる
請求項1に記載の車載制御装置。 The access detection function
A first memory protection function in which a lower limit value and an upper limit value of an applied address range are set, and a lower limit value and an upper limit value of an applied address range are set, and the applied address range is different from the first memory protection function. A second memory protection function,
Wherein the CPU, the address range to apply the first protected memory and the second memory protection function, and set based on the execution address,
The first memory protection function and the second memory protection function detect that the CPU has accessed the execution address when the execution address accessed by the CPU is out of the address range, and the interrupt The in-vehicle control device according to claim 1.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017216162A JP6463445B1 (en) | 2017-11-09 | 2017-11-09 | In-vehicle control device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017216162A JP6463445B1 (en) | 2017-11-09 | 2017-11-09 | In-vehicle control device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP6463445B1 true JP6463445B1 (en) | 2019-02-06 |
JP2019087118A JP2019087118A (en) | 2019-06-06 |
Family
ID=65270578
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2017216162A Active JP6463445B1 (en) | 2017-11-09 | 2017-11-09 | In-vehicle control device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6463445B1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP4224054A1 (en) | 2020-09-29 | 2023-08-09 | Nitto Denko Corporation | Optical member, manufacturing method therefor, and light distribution element |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006079180A (en) * | 2004-09-07 | 2006-03-23 | Nec Electronics Corp | Microcomputer |
JP2009116815A (en) * | 2007-11-09 | 2009-05-28 | Denso Corp | Test system and program |
WO2013073009A1 (en) * | 2011-11-15 | 2013-05-23 | トヨタ自動車株式会社 | Microcomputer system and monitoring microcomputer |
-
2017
- 2017-11-09 JP JP2017216162A patent/JP6463445B1/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006079180A (en) * | 2004-09-07 | 2006-03-23 | Nec Electronics Corp | Microcomputer |
JP2009116815A (en) * | 2007-11-09 | 2009-05-28 | Denso Corp | Test system and program |
WO2013073009A1 (en) * | 2011-11-15 | 2013-05-23 | トヨタ自動車株式会社 | Microcomputer system and monitoring microcomputer |
Also Published As
Publication number | Publication date |
---|---|
JP2019087118A (en) | 2019-06-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20180137022A1 (en) | Arithmetic operation device and virtual development environment apparatus | |
US20170146987A1 (en) | Electronic control module testing system | |
JP2008009721A (en) | Evaluation system and evaluation method thereof | |
JP2010173633A (en) | Method and operation unit for adjusting control device | |
CN111090915A (en) | Automatic driving simulation method, device and storage medium | |
JP6463445B1 (en) | In-vehicle control device | |
JP5777483B2 (en) | Programmable controller system | |
US10318687B2 (en) | Implementing a constant in FPGA code | |
JP5982845B2 (en) | Trace control apparatus and trace control method | |
JP6870234B2 (en) | Control device, control system and control method | |
JP2007304972A (en) | Microprocessor system | |
JP2003122594A (en) | Semiconductor device and evaluation tool | |
JP2007058450A (en) | Semiconductor integrated circuit | |
JP2005276113A (en) | Pseudo random number generating method, security check method and controller | |
JP4466372B2 (en) | Temporal correlation of messages transmitted by microprocessor monitor circuits. | |
CN110737480A (en) | Multiplexing method and device for serial port drivers | |
US20180090225A1 (en) | Semiconductor device and diagnosis method thereof | |
CN116643998B (en) | AUTOSAR RTM-based test method and device | |
JP4976817B2 (en) | Program processing apparatus and program processing method | |
JP2011034517A (en) | Equivalence verification device, data processing method thereof, and program | |
CN107977315B (en) | Embedded software object code unit testing method based on Bootloader mode | |
JP6761280B2 (en) | Data retention device and data retention system | |
JP5000689B2 (en) | Temporal correlation of messages transmitted by microprocessor monitor circuits. | |
JP6505482B2 (en) | Electronic control unit | |
TWI566179B (en) | Debug Message Outputting Method and Computer Program Product for BIOS |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20171109 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20180914 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20181016 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20181115 |
|
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: 20181204 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20181228 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6463445 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |