JP2001265621A - On-rom program debugging system - Google Patents

On-rom program debugging system

Info

Publication number
JP2001265621A
JP2001265621A JP2000080417A JP2000080417A JP2001265621A JP 2001265621 A JP2001265621 A JP 2001265621A JP 2000080417 A JP2000080417 A JP 2000080417A JP 2000080417 A JP2000080417 A JP 2000080417A JP 2001265621 A JP2001265621 A JP 2001265621A
Authority
JP
Japan
Prior art keywords
program
flash rom
rom
instruction
sector
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.)
Pending
Application number
JP2000080417A
Other languages
Japanese (ja)
Inventor
Tomohiro Takahashi
友浩 高橋
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.)
Kyocera Corp
Original Assignee
Kyocera 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 Kyocera Corp filed Critical Kyocera Corp
Priority to JP2000080417A priority Critical patent/JP2001265621A/en
Publication of JP2001265621A publication Critical patent/JP2001265621A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To set a software breakpoint in a ROM area. SOLUTION: In the on-ROM program debugging system provided with a flash ROM where program instructions and addresses can be divided and erased/ written by the sector of a minimum unit, a RAM and a maintenance means for performing optional rewrite by the sector unit of the flash ROM, in the case of performing the program inside the flash ROM, the sector containing the instruction to be a point for activating a debugger is copied onto the RAM, a program control change instruction is rewritten and written to the flash ROM by using the maintenance means and thus, an operation is performed as the software breakpoint is set in the flash ROM area.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、インサーキットエ
ミュレータ(ICE)等を用いないROM上のプログラ
ム中の誤りを訂正するROMデバッグ方式に関するもの
である。
[0001] 1. Field of the Invention [0002] The present invention relates to a ROM debugging method for correcting an error in a program on a ROM without using an in-circuit emulator (ICE) or the like.

【0002】[0002]

【従来の技術】従来のプログラムのデバッグ方式の一つ
としてソフトウエアブレークポイントデバッグ方式が知
られている。このソフトウエアブレークポイントデバッ
グ方式は、スイッチポイントを設定したいプログラム命
令を、プログラム制御を変更するための命令たとえば割
り込みを発生させる命令(トラップ命令)に、一時的に
置き換えるようにしていた。
2. Description of the Related Art A software breakpoint debugging method is known as one of the conventional program debugging methods. In the software breakpoint debugging method, a program instruction for setting a switch point is temporarily replaced with an instruction for changing program control, for example, an instruction for generating an interrupt (trap instruction).

【0003】この方式によれば、ブレークポイントを設
定する領域が、RAM領域に展開されたプログラムに限
られてしまうためROM領域にソフトウエアブレークポ
イントを設定することは物理的にできなかった。
According to this method, the area for setting a breakpoint is limited to a program developed in the RAM area, so that it was not physically possible to set a software breakpoint in the ROM area.

【0004】その例として、特開9−288598号公
報に記載された内容を示すと、ROM上のプログラムを
ターゲットとして、プログラムの予め設定した所定のス
イッチポイントから、テーブルを参照して、プログラム
の制御をデバッガへ制御移行させる移行制御手段を設け
ている。移行制御手段としては、テーブルを管理するテ
ーブルマネージャが設けられ、テーブルマネージャがデ
バッガの対象となるプログラムを切換え、ROM上の異
なる複数のプログラムを選択変更してデバッガすること
が提案されている。
[0004] As an example, the contents described in Japanese Patent Application Laid-Open No. 9-288598 are shown. A program in a ROM is set as a target, a predetermined switch point of the program is referred to, and a table is referred to. There is provided a transfer control means for transferring control to a debugger. It has been proposed that a table manager that manages tables is provided as the transfer control means, and the table manager switches programs to be debugged, and selects and changes a plurality of different programs on the ROM to perform the debugger.

【0005】[0005]

【発明が解決しようとする課題】しかしながら、この方
式によると、プログラムを実行する都度、参照テーブル
を比較する動作に多大の時間を要することになる。さら
に、所定のブレークポイントとなるスイッチポイントを
予めプログラム命令の中に埋め込む必要があるが、RO
M作成後には任意の位置にスイッチポイントを設定する
ことは困難である。また、プログラム命令の中に、スイ
ッチポイントを必要数埋め込むことを前提とする方式の
ため、ROM容量が極めて増大し、その結果、トータル
プログラムサイズが増大し、設計の自由度が束縛される
結果となる。
However, according to this method, every time the program is executed, a large amount of time is required for the operation of comparing the reference tables. Further, it is necessary to embed a switch point which is a predetermined break point in a program instruction in advance.
After creating M, it is difficult to set a switch point at an arbitrary position. In addition, since the required number of switch points is embedded in the program instructions, the ROM capacity is extremely increased, resulting in an increase in the total program size, which limits the degree of freedom in design. Become.

【0006】本発明の目的は、従来技術のこれらの問題
点を解決し、ROM領域にソフトウエアブレークポイン
トの設定を可能にすることにある。
It is an object of the present invention to solve these problems of the prior art and to enable setting of a software breakpoint in a ROM area.

【0007】[0007]

【課題を解決するための手段】上記課題を解決するため
に、本発明は、最小単位のセクタでプログラム命令及び
アドレスを分割して消去・書き込み可能なフラッシュR
OMと、RAMと、前記フラッシュROMのセクタ単位
で任意に書き換えるメンテナンス手段とを備えたROM
上のプログラムのデバッグ方式において、前記フラッシ
ュROM内のプログラムをする場合に、デバッガを起動
するポイントとなるべき命令を包含するセクタを前記R
AM上に複写してプログラム制御変更命令を書き換え、
前記メンテナンス手段を用いてフラッシュROMに書き
込むことによりフラッシュROM領域にソフトウエアブ
レークポイントが設定されたように動作させるようにし
た。
SUMMARY OF THE INVENTION In order to solve the above-mentioned problems, the present invention provides a flash ROM capable of erasing and writing by dividing a program instruction and an address by a minimum unit sector.
ROM comprising OM, RAM, and maintenance means for arbitrarily rewriting the flash ROM in sector units.
In the above program debugging method, when a program in the flash ROM is programmed, a sector containing an instruction to be a point to start a debugger is stored in the R.
Copy on AM and rewrite program control change instruction,
By writing to the flash ROM using the maintenance means, the operation is performed as if a software breakpoint was set in the flash ROM area.

【0008】[0008]

【発明の実施の形態】本発明の実施形態を図1を参照し
て説明する。
An embodiment of the present invention will be described with reference to FIG.

【0009】図1は、本発明のプログラムデバッグ方式
を説明するための説明図である。
FIG. 1 is an explanatory diagram for explaining a program debugging method according to the present invention.

【0010】図1において、1はデバッグの対象となる
プログラムデータが格納され電気的にデータの消去・書
き込みが可能なフラッシュROMであり、このプログラ
ム中にはデバッガを起動するポイントとなるべき命令が
包含されている。フラッシュROM1の内部構造を2に
示す。ROM1の内部は、分割して消去・書き込み可能
な最小単位である各セクタの形態を示しており、フラッ
シュROM1はいくつかのセクタ(セクタ1、セクタ
2、…………セクタn)に分かれている。3は、各セク
タ内におけるプログラム命令の格納形式を示しており、
アドレスに対応した命令がアドレス順に格納されている
様子を示す。
In FIG. 1, reference numeral 1 denotes a flash ROM in which program data to be debugged is stored and data can be electrically erased and written. In this program, an instruction to be a point for starting a debugger is provided. Is included. The internal structure of the flash ROM 1 is shown in FIG. The inside of the ROM 1 shows the form of each sector, which is the smallest unit that can be divided and erased and written, and the flash ROM 1 is divided into several sectors (sector 1, sector 2,..., Sector n). I have. 3 indicates a storage format of the program instruction in each sector,
This shows how instructions corresponding to addresses are stored in address order.

【0011】4はセントラルプロセッシングユニット
(CPU)であり、フラッシュROM1に格納されてい
るプログラムを前記アドレスをもとに読み出し、プログ
ラムを実行する制御手段である。フラッシュROM1上
でデバッガを起動するポイントとなるべき命令が包含さ
れているセクタを、書き換え可能なメモリ空間であるR
AM5のセクタ一時記憶領域7に一時記憶し、そこでプ
ログラム制御を変更するための命令に書き換えられた元
の命令と、その命令のフラッシュROM1上での元のア
ドレスとをRAM5上の命令一時記憶領域8に格納す
る。6は、デバッグを起動するポイントとなるべき命令
を、プログラム制御を変更するための命令に書き換える
動作を行うメンテナンス手段である。9は、CPU4が
フラッシュROM1からプログラム命令を読み出すため
のインストラクションバスを示している。
Reference numeral 4 denotes a central processing unit (CPU), which is a control means for reading a program stored in the flash ROM 1 based on the address and executing the program. A sector on the flash ROM 1 containing an instruction to be a point for starting a debugger is stored in a rewritable memory space R
The original instruction, which is temporarily stored in the sector temporary storage area 7 of the AM 5 and rewritten by the instruction for changing the program control there, and the original address of the instruction on the flash ROM 1 are stored in the instruction temporary storage area in the RAM 5. 8 is stored. Reference numeral 6 denotes a maintenance unit that performs an operation of rewriting an instruction to be a point for starting debugging to an instruction for changing program control. Reference numeral 9 denotes an instruction bus for the CPU 4 to read a program command from the flash ROM 1.

【0012】本発明は、上記のように構成されているの
で、フラッシュROM1内の対象となるプログラムをデ
バッグする必要が生じたとき、フラッシュROM1内で
デバッガを起動するポイントとなるべき命令を包含する
セクタを前記メンテナンス手段6を使用してRAM5上
のセクタ一時記憶領域7に書き換え、書き換えたセクタ
をフラッシュROM1内の消去したセクタの位置に書き
込むことにより、CPU4がフラッシュROM1内のプ
ログラムを読み出す動作を実行したとき、予め書き込ん
でおいたプログラム制御を変更するための命令をフラッ
シュROM1から読み出し、デバッグを支援するデバッ
ガプログラムに制御を移すことで、あたかもフラッシュ
ROM1領域内のプログラムに、デバッグに必要なソフ
トウエアブレークポイントを設定したかのように動作さ
せることができる。
Since the present invention is configured as described above, when it becomes necessary to debug a target program in the flash ROM 1, the present invention includes an instruction to be a point for starting the debugger in the flash ROM 1. By rewriting the sector in the sector temporary storage area 7 on the RAM 5 using the maintenance means 6 and writing the rewritten sector at the position of the erased sector in the flash ROM 1, the operation of the CPU 4 for reading the program in the flash ROM 1 is performed. When the program is executed, an instruction for changing program control written in advance is read from the flash ROM 1 and control is transferred to a debugger program that supports debugging, so that software necessary for debugging can be added to the program in the flash ROM 1 area. Wear break It can be operated as if you set the Into.

【0013】[0013]

【発明の効果】以上説明したように、本発明の構成なら
びに方法によれば、フラッシュROM上のプログラムを
ターゲットとして、メモリ上のプログラムの予め設定し
た所定のブレークポイントから本来の命令を読み出す代
わりに、予め設定した所定のプログラム制御変更命令
を、セクタ単位で消去・書き込みができる手段によっ
て、フラッシュROM内で書き換えることにより、プロ
グラムの制御をデバッガへ移行させることができるの
で、フラッシュROM上のプログラムをデバッグするこ
とが可能になる。
As described above, according to the configuration and method of the present invention, instead of reading the original instruction from a predetermined breakpoint set in advance in the program on the memory, the program on the flash ROM is targeted. By rewriting a predetermined program control change command set in advance in the flash ROM by means of erasing / writing in sector units, the control of the program can be shifted to the debugger. It becomes possible to debug.

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

【図1】図1は、本発明のプログラムデバッグ方式を説
明するための説明図である。
FIG. 1 is an explanatory diagram for explaining a program debugging method of the present invention.

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

1 フラッシュROM 2 ROM内部構造 3 プログラム命令格納方式 4 CPU 5 RAM 6 メンテナンス手段 7 セクタ一時記憶領域 8 命令一時記憶領域 9 命令バス DESCRIPTION OF SYMBOLS 1 Flash ROM 2 ROM internal structure 3 Program instruction storage method 4 CPU 5 RAM 6 Maintenance means 7 Sector temporary storage area 8 Instruction temporary storage area 9 Instruction bus

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】最小単位のセクタでプログラム命令及びア
ドレスを分割して消去・書き込み可能なフラッシュRO
Mと、RAMと、前記フラッシュROMのセクタ単位で
任意に書き換えるメンテナンス手段とを備えたROM上
のプログラムのデバッグ方式において、前記フラッシュ
ROM内のプログラムをする場合に、デバッガを起動す
るポイントとなるべき命令を包含するセクタを前記RA
M上に複写してプログラム制御変更命令を書き換え、前
記メンテナンス手段を用いてフラッシュROMに書き込
むことによりフラッシュROM領域にソフトウエアブレ
ークポイントが設定されたように動作させることを特徴
とするROM上のプログラムデバッグ方式。
1. A flash RO that can be erased and written by dividing a program instruction and an address by a minimum unit sector.
M, a RAM, and a maintenance method for arbitrarily rewriting data in units of sectors of the flash ROM. In a method of debugging a program on a ROM, when a program in the flash ROM is to be executed, a point to be a starting point of a debugger should be set. The sector containing the instruction is
A program on the ROM, wherein the program control change instruction is rewritten and written to the flash ROM by using the maintenance means to operate as if a software breakpoint was set in the flash ROM area. Debug method.
JP2000080417A 2000-03-22 2000-03-22 On-rom program debugging system Pending JP2001265621A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000080417A JP2001265621A (en) 2000-03-22 2000-03-22 On-rom program debugging system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000080417A JP2001265621A (en) 2000-03-22 2000-03-22 On-rom program debugging system

Publications (1)

Publication Number Publication Date
JP2001265621A true JP2001265621A (en) 2001-09-28

Family

ID=18597522

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000080417A Pending JP2001265621A (en) 2000-03-22 2000-03-22 On-rom program debugging system

Country Status (1)

Country Link
JP (1) JP2001265621A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2424500A (en) * 2005-03-22 2006-09-27 Rolf Segger Debugging code stored in EEPROM by inserting a breakpoint into code using a read/modify/write cycle on block containing individual instruction to be modified

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2424500A (en) * 2005-03-22 2006-09-27 Rolf Segger Debugging code stored in EEPROM by inserting a breakpoint into code using a read/modify/write cycle on block containing individual instruction to be modified

Similar Documents

Publication Publication Date Title
JP2664137B2 (en) IC card
KR100415371B1 (en) Computer
KR920022093A (en) How to operate a computer system with recoverable basic firmware
JP2012252576A (en) Information processing device, start method and program
KR970066888A (en) Microcomputers Using Nonvolatile Memory
JP2001265620A (en) Program debugging system for rom
JP2001265621A (en) On-rom program debugging system
JP5900336B2 (en) Emulator verification system and emulator verification method
JP2005353020A (en) Simulation system for computer program
JP3846540B2 (en) PLC control program execution simulation apparatus and PLC having control program execution simulation function
JP2006139440A (en) Emulator apparatus and its control method
JP2004126658A (en) Processor system
CN112802527B (en) Method for realizing high-speed programming of embedded flash memory and programming system of embedded flash memory
JP7219813B2 (en) Arithmetic processing device, vehicle control device and update method
JP2004240717A (en) Software updating device
JP2005063311A (en) Patch method and patch application program for processor system
JP2001101030A (en) Program debugging system
JP2006268472A (en) Program debugging method on flash memory, and debugging system
JPH10228373A (en) Control method for rewritable rom
JPH1165884A (en) Microcomputer and debugging method therefor
JP2020004448A (en) Automotive electronic control device
JPS63156231A (en) Changing method for instruction in read-only memory
JP2002268907A (en) Memory controller
CN116737528A (en) Debugging method of microcontroller software, debugging server and electronic equipment
JP2004220089A (en) Debug program and debugging method