JP3449812B2 - Control electronics - Google Patents

Control electronics

Info

Publication number
JP3449812B2
JP3449812B2 JP33620994A JP33620994A JP3449812B2 JP 3449812 B2 JP3449812 B2 JP 3449812B2 JP 33620994 A JP33620994 A JP 33620994A JP 33620994 A JP33620994 A JP 33620994A JP 3449812 B2 JP3449812 B2 JP 3449812B2
Authority
JP
Japan
Prior art keywords
program
storage means
address
patch
debug
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP33620994A
Other languages
Japanese (ja)
Other versions
JPH08179958A (en
Inventor
俊彦 藤代
純二 大岩
直樹 村山
巌 山本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Corp
Original Assignee
Sony 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 Sony Corp filed Critical Sony Corp
Priority to JP33620994A priority Critical patent/JP3449812B2/en
Publication of JPH08179958A publication Critical patent/JPH08179958A/en
Application granted granted Critical
Publication of JP3449812B2 publication Critical patent/JP3449812B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、制御プログラムを内蔵
した制御用電子装置に関し、特に、制御プログラムのデ
バッグを容易に行うことができるように構成された制御
用電子装置を提供するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a control electronic device having a control program built therein, and more particularly to a control electronic device configured to facilitate debugging of the control program. .

【0002】[0002]

【従来の技術】一般に、制御対象となる機器にマイコン
等の制御用電子装置を搭載して制御を行う場合、この電
子装置の制御プログラムを開発するに際しては、ハード
ウェアを含めたデバッグを行う必要がある。このような
ハードウェアを含めたデバッグを可能にする方法として
は、従来からIn−Circuit Emulator
(以下、ICEという)或るいはロジックアナライザー
等が使用されているが、通常、ICEを使用してデバッ
グを行う場合には、電子装置内のCPUを取り除いてI
CEと接続可能な評価用チップを作製し、目的の制御対
象である機器にこの評価用チップを搭載した状態でIC
Eと接続して、アプリケーションプログラムの一時実行
停止、メモリの参照/設定、或るいは逆アセンブル等の
デバッグのための処理を実行するようにしている。
2. Description of the Related Art Generally, when a control electronic device such as a microcomputer is mounted on a device to be controlled to perform control, it is necessary to perform debugging including hardware when developing a control program for this electronic device. There is. As a method for enabling debugging including such hardware, there has been a conventional In-Circuit Emulator.
Although a logic analyzer (hereinafter referred to as ICE) or the like is used, normally, when debugging is performed using ICE, the CPU in the electronic device is removed and I
An evaluation chip that can be connected to a CE is manufactured, and an IC is mounted in a state in which the evaluation chip is mounted on the target control target device.
By connecting with E, processing for debugging such as temporary stop of application program, reference / setting of memory, or disassembly is executed.

【0003】[0003]

【発明が解決しようとする課題】上述したように、従
来、ICEを用いてハードウェアを含めたデバッグを行
うには特別に評価用チップを作製しなければならないと
いう問題があり、既にマイコン等の制御用電子装置が組
み込まれてしまった制御対象機器については、制御用電
子装置を取り外して評価用チップ等に交換しなければI
CEを用いたデバッグを行うことができなかった。
As described above, conventionally, there has been a problem that an evaluation chip must be specially manufactured in order to perform debugging including hardware by using ICE. For a control target device in which a control electronic device has been incorporated, the control electronic device must be removed and replaced with an evaluation chip or the like.
It was not possible to debug using CE.

【0004】通常、ICEを使用してメモリの参照/設
定等の操作を行う際にはプログラムのエミュレーション
を一時停止状態にしなければならないが、制御機器によ
ってはエミュレーションを一時停止することによって不
具合を生ずるものもあり、このようなものにおいては容
易にプログラムの実行を一時停止できないため、デバッ
グ処理を進めるうえで不都合なこともあった。
Normally, when performing operations such as memory reference / setting using the ICE, it is necessary to suspend the emulation of the program. However, depending on the control device, the suspension of the emulation causes a problem. Some of them are not easy to suspend the execution of the program, which is inconvenient for the debugging process.

【0005】[0005]

【課題を解決するための手段】本発明は、中央処理手段
と、アプリケーションプログラム並びにデバッグ処理を
実行するためのデバッグ用プログラムが格納された固定
記憶手段と、オペレーターによって選択された所定アド
レスが格納される第1記憶手段と、第2記憶手段と、前
記中央処理手段の実行アドレスと前記第1記憶手段に格
納された所定アドレスとを比較する比較器と、該比較器
の比較出力が入力される切換回路とを備え、バグ等の存
在により前記固定記憶手段内に格納されたアプリケーシ
ョンプログラムにパッチ修正を行いたい部分があるとき
は、このパッチ修正部分の先頭アドレスを前記第1記憶
手段に格納すると共に、このパッチ修正部分に代わって
実行すべき装置内の所定箇所に記憶されたパッチ修正プ
ログラムを実行するパッチ修正動作を開始させるための
パッチ開始用データを前記第2記憶手段に格納して、前
記実行アドレスが前記修正アドレスに一致すると前記比
較器の一致出力に基づいて前記中央処理手段のアクセス
を前記固定記憶手段から前記第2記憶手段へ切り換えて
前記パッチ修正プログラムを実行する制御用電子装置で
あって、デバッグを行う際には外部のホストコンピュー
タからブレイク要求を受け付けると、前記デバッグ用プ
ログラムを実行させてブレイクアドレスを前記第1記憶
手段へ格納すると共に、前記第2記憶手段にデバッグ処
理を開始させるためのデバッグ開始用データを格納し
て、ブレイク解除フラグをOFFにし、前記切換回路
が、前記実行アドレスが前記ブレイクアドレスに一致し
たことを示す比較器の一致出力に基づいて、前記中央処
理手段のアクセスを前記固定記憶手段から前記第2記憶
手段へ切り換えてアプリケーションプログラムをブレイ
ク状態にしてデバッグ処理を行い、前記ホストコンピュ
ータから再開指令が出されたときに再開プログラムを割
り込みプログラムとして実行させ、前記ブレイク解除フ
ラグの値を反転してアプリケーションプログラムの実行
を再開することを特徴とする。
According to the present invention, a central processing means, a fixed storage means for storing an application program and a debugging program for executing a debugging process, and a predetermined address selected by an operator are stored. The first storage means, the second storage means, the comparator for comparing the execution address of the central processing means with the predetermined address stored in the first storage means, and the comparison output of the comparator are input. When there is a portion to be patch-corrected in the application program stored in the fixed storage means due to the presence of a bug or the like, the start address of the patch-corrected portion is stored in the first storage means. At the same time, instead of this patch correction part, the patch correction program stored in a predetermined location in the device to be executed is executed. The patch start data for starting the patch correction operation is stored in the second storage means, and when the execution address matches the correction address, the access of the central processing means is made based on the coincidence output of the comparator. A control electronic device for executing the patch correction program by switching from fixed storage means to the second storage means, and executing the debug program when a break request is received from an external host computer during debugging. The break address is stored in the first storage means, the debug start data for starting the debug process is stored in the second storage means, the break release flag is turned off, and the switching circuit is Based on the match output of the comparator indicating that the execution address matches the break address Switching the access of the central processing means from the fixed storage means to the second storage means to put the application program in a break state for debug processing, and interrupting the restart program when a restart command is issued from the host computer. Then, the value of the break release flag is inverted and the execution of the application program is restarted.

【0006】ここで、前記デバッグ開始用データは、デ
バッグ用プログラムへのジャンプ命令とするのが好適で
ある。
Here, it is preferable that the debug start data is a jump instruction to a debug program.

【0007】[0007]

【作用】制御用電子装置に組み込まれたアプリケーショ
ンプログラムをデバッグするための処理が、制御用電子
装置自身によって行われる。デバッグ処理を行うに際し
ての開始アドレスは、オペレーターが随意指定可能であ
る。デバッグ処理動作中においても、制御用電子装置が
割り込み処理を受け付けることが出来る。
The processing for debugging the application program installed in the control electronic device is performed by the control electronic device itself. The operator can arbitrarily specify the start address for the debug processing. Even during the debug processing operation, the control electronic device can accept the interrupt processing.

【0008】[0008]

【実施例】現在、制御用電子装置としては、様々なマイ
コンが使用されているが、その中で、既に公知であるパ
ッチ修正の可能な1チップマイコンに本発明を適用した
場合の実施例について説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Various microcomputers are currently used as control electronic devices, and among them, an embodiment in which the present invention is applied to a known one-chip microcomputer capable of patch correction is known. explain.

【0009】かかる1チップマイコンの一構成例を図1
に示す。最初にこのマイコンにおけるパッチ修正につい
て以下に簡単に説明する。なお、このようなマイコンに
おけるパッチ修正動作の詳細は、例えば、特開平6−2
22917号公報に記載されている。
An example of the configuration of such a one-chip microcomputer is shown in FIG.
Shown in. First, the patch correction in this microcomputer will be briefly described below. Details of the patch correction operation in such a microcomputer are described in, for example, Japanese Patent Laid-Open No. 6-2
No. 22917.

【0010】図1の構成において、バグ等の存在により
ROM5内に格納されたアプリケーションプログラムに
パッチ修正を行いたい部分があるときは、このパッチ修
正部分の先頭アドレスを修正アドレスレジスタ2へ格納
すると共に、このパッチ修正部分に代わって実行すべき
パッチ修正プログラムをRAM6に格納しておく。ま
た、CPU1におけるプログラム実行をアプリケーショ
ンプログラムからパッチ修正プログラムへ切り換える際
に必要となる種々の前処理を行うための前処理プログラ
ムをROM5内の特定のエリアに格納しておき、更に、
修正データレジスタ4にはCPUの動作をパッチ修正動
作へ移行させるためのテーブルコール命令を格納してお
く。
In the configuration shown in FIG. 1, when there is a portion to be patch-corrected in the application program stored in the ROM 5 due to the presence of a bug or the like, the start address of the patch-corrected portion is stored in the correction address register 2 and A patch correction program to be executed instead of this patch correction portion is stored in the RAM 6. Further, a preprocessing program for performing various kinds of preprocessing required when switching the program execution in the CPU 1 from the application program to the patch correction program is stored in a specific area in the ROM 5, and further,
The correction data register 4 stores a table call instruction for shifting the operation of the CPU to the patch correction operation.

【0011】このマイコンによる制御動作において、以
上のレジスタ2、4、及びRAM6、ROM5に格納さ
れたパッチ修正用のデータに基づいてパッチ修正を実行
させる場合は、制御フラグラッチ3に予め値「1」のフ
ラグを格納しておく。
In the control operation by the microcomputer, when the patch correction is executed based on the patch correction data stored in the registers 2 and 4 and the RAM 6 and the ROM 5, the control flag latch 3 is previously set to the value "1". The flag of is stored.

【0012】以上のように構成されたマイコンにおける
パッチ修正は、次のように行われる。即ち、CPU1に
よるアプリケーションプログラムの実行が進行してその
実行アドレスが修正アドレスに一致すると、比較器7の
出力が値「1」となってアンドゲート8の出力信号がア
クティブ(値「1」)となり、この信号が修正データレ
ジスタ4へ供給されると共に、ROM5へはその反転さ
れたインアクティブの信号が供給される。これにより、
CPU1は、ROM5内のアプリケーションプログラム
のコマンドに代え修正データレジスタ内のテーブルコー
ル命令を受け付けることとなる。このテープルコール命
令によって前記の前処理プログラムの先頭アドレスがコ
ールされるため、この前処理プログラムの実行が開始さ
れ、その後、RAM6内のパッチ修正プログラムへ移行
してこのプログラムの実行を終了すると、ROM5のア
プリケーションプログラムのパッチ修正部分の次のアド
レスへ戻る動作を行う。
Patch correction in the microcomputer configured as described above is performed as follows. That is, when the execution of the application program by the CPU 1 progresses and its execution address matches the correction address, the output of the comparator 7 becomes the value "1" and the output signal of the AND gate 8 becomes active (the value "1"). This signal is supplied to the correction data register 4 and the inverted inactive signal is supplied to the ROM 5. This allows
The CPU 1 will accept the table call instruction in the correction data register instead of the command of the application program in the ROM 5. Since the start address of the preprocessing program is called by this table call instruction, execution of this preprocessing program is started, and after that, when the patch correction program in the RAM 6 is entered and the execution of this program is completed, the ROM 5 Performs the operation to return to the next address of the patch correction part of the application program.

【0013】図1に示されるマイコンにおいては、以上
のようにしてパッチ修正が実行されるが、本実施例は、
このマイコンにおいて、デバッグを行うために必要な様
々な動作、例えば、アプリケーションプログラムの実行
を所望のアドレスで中断させたり、この中断したアドレ
スからアプリケーションプログラムの実行を再開させた
り、或るいは、レジスタ及びメモリの参照/設定等を実
行させる等の動作を実行するためのプログラム(以下、
デバッグモニタという)を予めアプリケーションプログ
ラムと共にマイコン内に組み込んでおくことにより、I
CEを用いることなくデバッグ処理が行えるようにした
ものである。
In the microcomputer shown in FIG. 1, the patch correction is executed as described above.
In this microcomputer, various operations necessary for debugging, for example, execution of the application program is interrupted at a desired address, execution of the application program is restarted from this interrupted address, or registers and A program for executing operations such as memory reference / setting, etc. (hereinafter,
(Which is called a debug monitor) is installed in the microcomputer together with the application program in advance.
The debugging process can be performed without using CE.

【0014】これらのデバッグモニタを実行させるため
の指令は、外部のホストコンピュータからシリアル若し
くはパラレルの通信路を用いてマイコンへ与えるように
構成する。この通信路は、デバッグモニタ占有、或るい
はアプリケーションプログラムとの分割使用のいずれの
形態にしてもよい。次に、デバッグモニタの例として、
アプリケーションプログラムの実行の中断(ブレイク)
及び再開を行わせるためのプログラムを、図2及び図3
を参照して説明する。
The commands for executing these debug monitors are configured to be given to the microcomputer from an external host computer using a serial or parallel communication path. This communication path may be either occupied by the debug monitor or dividedly used with the application program. Next, as an example of the debug monitor,
Interruption of application program execution (break)
2 and FIG.
Will be described with reference to.

【0015】図2は、アプリケーションプログラムの実
行を中断するためのプログラムを示し、マイコンは、ホ
スト側からブレイクアドレスデータを含むブレイク要求
を受け付けると、この図の〔1〕に示されるプログラム
の実行を開始し、そのステップS2及びステップS3に
おいて中断動作の実行に必要なデータを修正アドレスレ
ジスタ及び修正データレジスタ等に格納した後、もとの
アプリケーションプログラムに戻る。そして、アプリケ
ーションプログラムの実行が進行してその実行アドレス
がブレイクアドレスに一致するとブレイク用テーブルコ
ール命令によってコールされるアドレスへジャンプす
る。一方、このコールされたアドレス以降には、この図
の〔2〕に示されるプログラムが書き込まれているの
で、CPUは、このプログラムのステップS4を実行し
て退避処理を行った後、ブレイク解除フラグがONとな
るまでステップS5のループを繰り返して中断状態とな
る。
FIG. 2 shows a program for interrupting the execution of the application program. When the microcomputer receives a break request including break address data from the host side, it executes the program shown in [1] of this figure. At step S2 and step S3, the data necessary for executing the interruption operation are stored in the correction address register, the correction data register, etc., and then the process returns to the original application program. When the execution of the application program progresses and the execution address matches the break address, the address jumps to the address called by the break table call instruction. On the other hand, since the program shown in [2] of this figure is written after this called address, the CPU executes step S4 of this program to perform the save process, and then the break release flag. The loop of step S5 is repeated until is turned on to enter the suspended state.

【0016】ここで、ブレイク解除フラグは、ホスト側
から再開指令が出されたときのみONにされ、この再開
指令に基づいて実行されるプログラムは図3に示すとお
りである。即ち、再開指令が出されたときには、このプ
ログラムの実行により制御フラグ及びブレイク解除フラ
グの値を反転した後、図2の〔2〕のステップS5へ戻
り、更にステップS6でCPUの状態をブレイク直前の
状態に戻してからブレイクアドレスへジャンプし、アプ
リケーションプログラムの実行を再開する。なお、以上
の図2及び図3に示される各プログラムは、いずれもR
OM5内に格納しておくことができる。また、これらの
中断/再開動作では、PSW及びレジスタの値の退避・
復帰処理が行われるので、アプリケーションプログラム
の再開に際して中断による影響を受けることもない。
Here, the break cancellation flag is turned on only when a restart command is issued from the host side, and the program executed based on this restart command is as shown in FIG. That is, when the restart command is issued, the values of the control flag and the break release flag are inverted by the execution of this program, and then the process returns to step S5 of [2] in FIG. After returning to the state of, jump to the break address and resume the execution of the application program. Each of the programs shown in FIGS. 2 and 3 is R
It can be stored in the OM5. In these suspend / resume operations, the PSW and register values are saved and
Since the restoration process is performed, there is no influence of interruption when resuming the application program.

【0017】以上に説明したように、CPUによるプロ
グラム実行をホスト側からの指令に応じてアプリケーシ
ョンプログラム、中断プログラム、及び再開プログラム
の間で相互に切り換えるようにするためには、アプリケ
ーションプログラム、図2の〔1〕及び〔2〕からなる
中断プログラム、及び図3の再開プログラムを、それぞ
れ1つのタスクとして異なる優先度を付与し、ホスト側
からの指令に応じてこれらのタスクを切り換えて実行す
るマルチタスク方式のOS(Operation Sy
stem)を採用すれば簡単に実現できる。また、OS
を使用しなかったマイコンの場合には、例えば、アプリ
ケーションプログラムの中に図2の〔1〕のプログラム
を挿入しておき、中断指令を受け付けたときこの挿入さ
れたプログラムのステップS2を実行させることによ
り、アプリケーションプログラム上のブレイクアドレス
で図2の〔2〕のプログラムへ移行させるようにし、か
つ、図3の再開プログラムを割り込みプログラムとして
実行させることにより実現が可能である。
As described above, in order to switch the program execution by the CPU among the application program, the suspending program, and the resuming program in response to a command from the host side, the application program, FIG. The interrupt program consisting of [1] and [2] and the resume program of FIG. 3 are given different priorities as one task respectively, and these tasks are switched and executed in accordance with a command from the host side. Task-based OS (Operation Sy)
It can be easily realized by adopting a system). Also, the OS
In the case of a microcomputer that did not use, for example, insert the program [1] of FIG. 2 into the application program, and execute the step S2 of the inserted program when the interruption command is received. This can be realized by shifting to the program of [2] of FIG. 2 by the break address on the application program and by executing the restart program of FIG. 3 as an interrupt program.

【0018】なお、図1に示される構成では、2〜4及
び7〜9からなる構成部分をパッチ修正とデバッグ処理
とで共用しているため、パッチ修正に関するプログラム
についてのデバッグ処理を行うことはできないが、上記
の2〜4及び7〜9と同じ構成部分をもう1組マイコン
内に組み込んでおき、それぞれの組をパッチ修正専用及
びデバッグ処理専用として使用すれば、パッチ修正に関
するプログラムについてもデバッグ処理を行うことが可
能である。
In the configuration shown in FIG. 1, since the patch correction and debug processing share the components 2 to 4 and 7 to 9, it is not possible to perform the debug processing on the patch correction program. Although it is not possible, if the same components as 2-4 and 7-9 above are installed in another set in the microcomputer and each set is used only for patch modification and debug processing, the program related to patch modification can also be debugged. Processing can be performed.

【0019】以上に説明した実施例では、修正データレ
ジスタに格納されたテーブルコール命令を使用して中断
のためのプログラムへジャンプするようにしているが、
これに代え、中断指令を受け付けたときは修正データレ
ジスタに中断動作のためのジャンプ命令を書き込むよう
に構成し、かつ、このジャンプ命令のジャンプ先アドレ
スが、テーブルコール命令用のテーブルが設けられてい
るメモリとは異なる特定のレジスタに格納されているも
のとして定義されたマイコンを使用することもできる。
In the embodiment described above, the table call instruction stored in the modified data register is used to jump to the program for interruption.
Instead, when a suspend command is accepted, a jump instruction for suspending operation is written in the correction data register, and the jump destination address of this jump instruction is provided with a table for the table call instruction. It is also possible to use a microcomputer defined as being stored in a specific register different from the memory in which it is stored.

【0020】このようなマイコンの構成を図4に示す。
この図の構成において、レジスタ12は、中断動作のた
めのジャンプ先のアドレスが格納される可変ジャンプ先
アドレスレジスタであり、ホスト側から中断指令が入力
されると図2の〔1〕のプログラムに代えて図5に示さ
れるプログラムが実行される。そして、このプログラム
のステップS21においてジャンプ先アドレスがレジス
タ12に書き込まれる。なお、このジャンプ先のアドレ
ス以降には、図2の〔2〕と同じプログラムが格納され
ており、また、再開動作も図3と同じプログラムに従っ
て実行される。
The structure of such a microcomputer is shown in FIG.
In the configuration of this figure, the register 12 is a variable jump destination address register in which the address of the jump destination for the suspend operation is stored, and when the suspend command is input from the host side, the program of [1] in FIG. Instead, the program shown in FIG. 5 is executed. Then, in step S21 of this program, the jump destination address is written in the register 12. Note that the same program as in [2] of FIG. 2 is stored after this jump destination address, and the restart operation is also executed according to the same program as in FIG.

【0021】この外に、マイコンに対してアプリケーシ
ョンプログラムの実行を中断させるためのより簡略化し
た方法としては、中断指令を受け付けたとき、図1にお
ける修正データレジスタ4にブレイクアドレスで無限ル
ープを実行させる命令(このような命令の具体例として
は、例えば、ブレイクアドレスへジャンプさせる命令を
用いることができる)を書き込むようにしてもよい。こ
のような方法を採用した場合の中断動作のプログラム、
及び再開動作のプログラムの例を図6の〔1〕及び
〔2〕に示す。但し、この例では、この図から明らかな
ように、PSW及びレジスタの値の退避・復帰処理を行
わないので、CPUの内部状態は中断動作中保存されな
い。なお、このように、ブレイクアドレスで無限ループ
を実行させる方法を使用し、かつ、パッチ修正用回路と
して共用することも考慮しない場合は、修正データレジ
スタ4をROMで構成してもよい。
In addition, as a simpler method for interrupting the execution of the application program to the microcomputer, an infinite loop is executed at the break address in the correction data register 4 in FIG. 1 when the interrupt command is received. An instruction to be performed (a specific example of such an instruction may be, for example, an instruction to jump to a break address) may be written. Program of interruption operation when adopting such a method,
An example of the program for the restart operation is shown in [1] and [2] of FIG. However, in this example, as is clear from this figure, since the PSW and register values are not saved / restored, the internal state of the CPU is not saved during the interruption operation. If the method of executing an infinite loop with a break address is used and the sharing of the patch correction circuit is not considered, the correction data register 4 may be configured by a ROM.

【0022】以上、中断/再開のデバッグモニタについ
て述べたが、この外に、メモリの参照/設定、逆アセン
ブル等の動作も、デバッグモニタとしてマイコン内に組
み込んでおくことにより実行することができる。1例と
して、逆アセンブルのためのデバッグモニタの構成を図
7に示す。この図において、マイコンは、逆アセンブル
開始アドレスデータを含む逆アセンブル要求をホスト側
から受け付けるとステップS15〜ステップS17を実
行することによりホスト側で逆アセンブルされたニーモ
ニック言語が表示される。なお、マイコンからは、ニー
モニックへ変換される以前のプログラムコードをホスト
側へ伝送するように構成しておいて、ニーモニックへの
変換動作は、ホスト側で実行するようにしてもよい。ま
た、この逆アセンブル等のデバッグモニタも予めROM
5内に格納しておくが、この逆アセンブル動作について
は、その起動に際して特にアプリケーションプログラム
上のブレイクアドレスを指定することは行われない。
Although the interrupt / resume debug monitor has been described above, in addition to this, operations such as memory reference / setting and disassembly can be executed by incorporating the debug monitor in the microcomputer. As an example, FIG. 7 shows the configuration of a debug monitor for disassembly. In this figure, when the microcomputer receives a disassemble request including disassemble start address data from the host side, steps S15 to S17 are executed to display the disassembled mnemonic language on the host side. The microcomputer may be configured to transmit the program code before being converted to the mnemonic to the host side, and the conversion operation to the mnemonic may be executed on the host side. In addition, a debug monitor for this disassembly etc. is also stored in advance in the ROM.
In this disassembly operation, the break address on the application program is not particularly designated at the time of starting the disassembly operation.

【0023】図1及び図4に関しては、パッチ修正の可
能なマイコンであることを前提として説明を行ったが、
必ずしもパッチ修正を実行するマイコンである必要は無
く、要するに、これらの図に示される2〜4及び7〜9
等の構成部分を備えたマイコンであればよい。ただし、
比較器7は、このようなハードの構成に限らずソフトウ
ェアに置き換えてもよい。
Although FIGS. 1 and 4 have been described on the premise that the microcomputer is a patch-correctable microcomputer,
It does not necessarily have to be a microcomputer that executes patch correction, but in short, 2-4 and 7-9 shown in these figures are necessary.
It is sufficient if the microcomputer has components such as. However,
The comparator 7 is not limited to such a hardware configuration and may be replaced with software.

【0024】[0024]

【発明の効果】本発明は、ICEを使用することなく、
マイコンを制御機器に搭載した状態のままでハードウェ
アを含めてプログラムのデバッグを行うことができるの
で、デバッグのために特別に評価用チップを作製する必
要がない。マイコン自身が、内部に組み込まれたデバッ
グ用プログラムを実行することによりデバッグ動作を行
うものであるため、ICEを使用する場合と異なってデ
バッグ処理動作中であってもマイコン本体が動作状態に
あり、デバッグ処理動作中にも種々の割り込み処理を受
け付けることができる。従って、デバッグのための様々
な処理を行っていくうえで操作がし易い。
According to the present invention, without using ICE,
Since the program can be debugged including the hardware while the microcomputer is still mounted in the control device, it is not necessary to prepare a special evaluation chip for debugging. Since the microcomputer itself performs the debug operation by executing the debug program incorporated therein, unlike the case where the ICE is used, the microcomputer main body is in the operating state even during the debug processing operation. Various interrupt processes can be accepted even during the debug process operation. Therefore, it is easy to operate when performing various processes for debugging.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の一実施例の構成を示す図である。FIG. 1 is a diagram showing a configuration of an exemplary embodiment of the present invention.

【図2】同実施例における中断動作のためのフローを示
す図である。
FIG. 2 is a diagram showing a flow for an interruption operation in the embodiment.

【図3】同実施例における再開動作のためのフローを示
す図である。
FIG. 3 is a diagram showing a flow for a restart operation in the embodiment.

【図4】本発明の他の実施例の構成を示す図である。FIG. 4 is a diagram showing the configuration of another embodiment of the present invention.

【図5】同他の実施例における中段動作のためのフロー
を示す図である。
FIG. 5 is a diagram showing a flow for middle-stage operation in another embodiment.

【図6】本発明の更に他の実施例における中段動作及び
再開動作のためのフローを示す図である。
FIG. 6 is a diagram showing a flow for a middle stage operation and a restart operation in yet another embodiment of the present invention.

【図7】本発明の実施例における逆アセンブル動作のた
めのフローを示す図である。
FIG. 7 is a diagram showing a flow for a disassemble operation in the embodiment of the present invention.

【符号の説明】[Explanation of symbols]

1 CPU、 2 修正アドレスレジスタ、 3 制御
フラグラッチ、 4修正データレジスタ、 5 RO
M、 6 RAM、 7 比較器、 12 ジャンプ先
アドレスレジスタ、
1 CPU, 2 modified address register, 3 control flag latch, 4 modified data register, 5 RO
M, 6 RAM, 7 comparator, 12 jump destination address register,

フロントページの続き (72)発明者 村山 直樹 東京都品川区北品川6丁目7番35号 ソ ニー株式会社内 (72)発明者 山本 巌 東京都品川区北品川6丁目7番35号 ソ ニー株式会社内 (56)参考文献 特開 平6−222917(JP,A) 特開 平5−298462(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 11/22,11/28 Front Page Continuation (72) Inventor Naoki Murayama 6-735 Kita-Shinagawa, Shinagawa-ku, Tokyo Sony Corporation (72) Iwa Yamamoto 6-7-35 Kita-Shinagawa, Shinagawa-ku, Tokyo Sony Shares In-company (56) Reference JP-A-6-222917 (JP, A) JP-A-5-298462 (JP, A) (58) Fields investigated (Int.Cl. 7 , DB name) G06F 11/22, 11/28

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 中央処理手段と、 アプリケーションプログラム並びにデバッグ処理を実行
するためのデバッグ用プログラムが格納された固定記憶
手段と、 オペレーターによって選択された所定アドレスが格納さ
れる第1記憶手段と、 第2記憶手段と、 前記中央処理手段の実行アドレスと前記第1記憶手段に
格納された所定アドレスとを比較する比較器と、 該比較器の比較出力が入力される切換回路とを備え、 バグ等の存在により前記固定記憶手段内に格納されたア
プリケーションプログラムにパッチ修正を行いたい部分
があるときは、このパッチ修正部分の先頭アドレスを前
記第1記憶手段に格納すると共に、このパッチ修正部分
に代わって実行すべき装置内の所定箇所に記憶されたパ
ッチ修正プログラムを実行するパッチ修正動作を開始さ
せるためのパッチ開始用データを前記第2記憶手段に格
納して、前記実行アドレスが前記修正アドレスに一致す
ると前記比較器の一致出力に基づいて前記中央処理手段
のアクセスを前記固定記憶手段から前記第2記憶手段へ
切り換えて前記パッチ修正プログラムを実行する制御用
電子装置であって、 デバッグを行う際には外部のホストコンピュータからブ
レイク要求を受け付けると、前記デバッグ用プログラム
を実行させてブレイクアドレスを前記第1記憶手段へ格
納すると共に、前記第2記憶手段にデバッグ処理を開始
させるためのデバッグ開始用データを格納して、ブレイ
ク解除フラグをOFFにし、前記切換回路が、前記実行
アドレスが前記ブレイクアドレスに一致したことを示す
比較器の一致出力に基づいて、前記中央処理手段のアク
セスを前記固定記憶手段から前記第2記憶手段へ切り換
てアプリケーションプログラムをブレイク状態にして
デバッグ処理を行い、前記ホストコンピュータから再開
指令が出されたときに再開プログラムを割り込みプログ
ラムとして実行させ、前記ブレイク解除フラグの値を反
転してアプリケーションプログラムの実行を再開するこ
とを特徴とする制御用電子装置。
1. Central processing means, fixed storage means for storing an application program and a debugging program for executing debug processing, first storage means for storing a predetermined address selected by an operator, and 2 storage means, a comparator for comparing the execution address of the central processing means with a predetermined address stored in the first storage means, and a switching circuit to which the comparison output of the comparator is input, When there is a portion in the application program stored in the fixed storage means to be patch-corrected due to the existence of the patch, the start address of the patch-corrected portion is stored in the first storage means and the patch-corrected portion is replaced. Start patch correction operation that executes the patch correction program stored in the specified location in the device to be executed The patch starting data for storing the data is stored in the second storage means, and when the execution address matches the correction address, the access of the central processing means is accessed from the fixed storage means based on the coincidence output of the comparator. An electronic control device for switching to the second storage means to execute the patch correction program, wherein an external host computer is used for debugging.
When receiving the rake request, by executing the debug program stores the break address to the first memory means, stores the debug initiation data for initiating debugging process in the second storage means, Bray
And the switching circuit turns off the access of the central processing means from the fixed storage means based on the coincidence output of the comparator indicating that the execution address coincides with the break address. Switch to the means and put the application program in the break state
Performs debug processing and restarts from the host computer
Interrupt the restart program when a command is issued
Run as a ram and reset the value of the break release flag.
Rolling and control electronics, characterized that you resume execution of the application program.
【請求項2】 前記デバッグ開始用データは、デバッグ
用プログラムへのジャンプ命令であることを特徴とする
請求項1記載の制御用電子装置。
2. The control electronic device according to claim 1, wherein the debug start data is a jump instruction to a debug program.
JP33620994A 1994-12-22 1994-12-22 Control electronics Expired - Fee Related JP3449812B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP33620994A JP3449812B2 (en) 1994-12-22 1994-12-22 Control electronics

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP33620994A JP3449812B2 (en) 1994-12-22 1994-12-22 Control electronics

Publications (2)

Publication Number Publication Date
JPH08179958A JPH08179958A (en) 1996-07-12
JP3449812B2 true JP3449812B2 (en) 2003-09-22

Family

ID=18296767

Family Applications (1)

Application Number Title Priority Date Filing Date
JP33620994A Expired - Fee Related JP3449812B2 (en) 1994-12-22 1994-12-22 Control electronics

Country Status (1)

Country Link
JP (1) JP3449812B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002202900A (en) 2000-12-28 2002-07-19 Seiko Epson Corp Debug device

Also Published As

Publication number Publication date
JPH08179958A (en) 1996-07-12

Similar Documents

Publication Publication Date Title
US5574892A (en) Use of between-instruction breaks to implement complex in-circuit emulation features
US20100153786A1 (en) Processor, multiprocessor, and debugging method
JP2655615B2 (en) Information processing device
WO2009144892A1 (en) Device emulation support device, device emulation support method, device emulation support circuit, and information processor
US5390332A (en) Method and apparatus for performing a takeover of a microprocessor
JP2522158B2 (en) Program debugging method for multiprocessor system
US8701089B2 (en) Program execution device and method for controlling the same
JP3449812B2 (en) Control electronics
JPH10326205A (en) System call issuing method
JPH0588933A (en) Parallel processing system with debugging function
JPH02135545A (en) Execution control processing system for debugger
US7386712B2 (en) Firmware developer user interface with break command polling
JP3046492B2 (en) Computer system
JPH11316691A (en) Execution method for operating system and information processor using the method
JPH04363710A (en) Resuming control system
JPH11175366A (en) Electronic circuit analysis device, electronic circuit analysis method, medium recording electronic circuit analysis program and electronic circuit analysis system
JPS6214240A (en) Program inspecting system
JP2000293402A (en) Microprocessor and debugging method
JPH04264932A (en) In-circuit emulator
JPH01142945A (en) Control system for microprocessor
JPH0772874B2 (en) Interrupt receiving device
JPH076036A (en) Interruption simulated control method
JPH01154252A (en) Program debug back-up device for parallel processors
JPH01232446A (en) Program development assisting device for computer
JPS62264340A (en) Debug device

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20010918

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080711

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090711

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees