JPH11249887A - Program correcting device - Google Patents

Program correcting device

Info

Publication number
JPH11249887A
JPH11249887A JP4597998A JP4597998A JPH11249887A JP H11249887 A JPH11249887 A JP H11249887A JP 4597998 A JP4597998 A JP 4597998A JP 4597998 A JP4597998 A JP 4597998A JP H11249887 A JPH11249887 A JP H11249887A
Authority
JP
Japan
Prior art keywords
program
correction
rom
address
ram
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
JP4597998A
Other languages
Japanese (ja)
Inventor
Keita Yamashita
慶太 山下
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP4597998A priority Critical patent/JPH11249887A/en
Publication of JPH11249887A publication Critical patent/JPH11249887A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

PROBLEM TO BE SOLVED: To configure this device without increasing a circuit scale and to almost limitlessly correct the number of program correctable address places without being affected by the limitation of the hardware of a built-in microcomputer. SOLUTION: In a program stored in a ROM 3, a program correction processing specification instruction is arranged in every head of a subroutine program whose correction is preliminarily estimated. A ROM correction functioning part 5 decides the existence of program correction processing from program counter(PC) value when the correction processing is called and correction program data stored in an EEPROM 7, reads the correction program data of the EEPROM 7 in the case of needing correction processing and stores the read correction program data in a RAM 4 at a correcting ROM address 1 corresponding to the leading address of a correcting ROM 3 program and a CPU 2 executes what is after the leading address of the program based on the correction program data stored in the RAM 4.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、組み込みマイコン
におけるプログラム訂正方法に関し、特にプログラム修
正可能なROMアドレス箇所数が該組み込みマイコンの
ハードウェアに制限されずにプログラム訂正処理を行う
のに好適のプログラム訂正装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program correction method for an embedded microcomputer, and more particularly to a program correction method suitable for performing a program correction process without limiting the number of ROM addresses at which the program can be corrected to the hardware of the embedded microcomputer. It relates to a correction device.

【0002】[0002]

【従来の技術】一般に、組み込みマイコンにおけるプロ
グラム訂正方法としては、必要なプログラムをリードオ
ンリーメモリ(以下、ROMと称す)に記憶しておき、
システム起動時にROM内容の特定アドレスからプログ
ラムの実行を開始している。しかしながら、このような
プログラム訂正方法では、組み込みプログラムが予めR
OM内に記憶されているが、ROM内に記憶されたプロ
グラムを誤りを修正するために変更しようとすると、R
OM内のプログラムを全て書き換えなければならない。
2. Description of the Related Art In general, as a method of correcting a program in an embedded microcomputer, a necessary program is stored in a read-only memory (hereinafter referred to as a ROM).
When the system is started, execution of the program is started from a specific address in the ROM content. However, in such a program correction method, the embedded program is
If an attempt is made to change a program stored in the OM but in the ROM to correct an error, R
All programs in the OM must be rewritten.

【0003】そこで、上記問題に鑑み、ROM内の組み
込みプログラムに誤りがあったときでも、組み込みプロ
グラムを書き換えることなく実行するとともに、プログ
ラム訂正機能の利用方法として、特願平4−13713
6号公報に記載の提案がなされている。
In view of the above problem, even if there is an error in the embedded program in the ROM, the embedded program is executed without rewriting, and a method of using the program correction function is disclosed in Japanese Patent Application No. Hei 4-137713.
No. 6 proposes a proposal.

【0004】この提案によるプログラム記憶方式では、
組み込みプログラムのプログラム記憶方式において、中
央処理装置(以下、CPUと称す)と、このCPUから
アクセス可能なランダムアクセスメモリ(以下、RAM
と称す)と、組み込みプログラムの変更情報を記憶した
第1のROMと、前記組み込みプログラムの変更情報を
記憶した書き換え可能な第2のROMと、前記第1のR
OMのデータを前記RAMに書き込むときのベースアド
レスを記憶しているベースアドレス生成部と、前記第1
及び第2のROMに記憶されている相対アドレスと前記
ベースアドレス生成部のアドレスとを加えてデータを前
記RAMに書き込むためのアドレスを生成するアドレス
生成部と、前記第1及び第2のROMに記憶されている
情報を前記アドレス生成部で生成したアドレスに書き込
むRAM書き込み部と、前記CPUからの指示により、
前記第2のROMに記憶されている情報を書き換える書
き換え可能ROM書き込み部と、を含んで構成されてい
る。
In the program storage method according to this proposal,
In a program storage method of an embedded program, a central processing unit (hereinafter, referred to as a CPU) and a random access memory (hereinafter, a RAM) accessible from the CPU are used.
), A first ROM storing change information of the embedded program, a rewritable second ROM storing change information of the embedded program, and the first ROM.
A base address generation unit that stores a base address when writing OM data to the RAM;
An address generator for adding an address of the base address generator and a relative address stored in a second ROM to generate an address for writing data to the RAM; A RAM writing unit that writes stored information to an address generated by the address generation unit, and an instruction from the CPU,
A rewritable ROM writer for rewriting information stored in the second ROM.

【0005】上記構成においては、前記第2のROMと
して電気的消去型プログラマブルROM(以下、EEP
ROMと称す)が用いられており、アドレス生成部によ
って前記第1のROM及びEEPROMに記憶されてい
る相対アドレスと前記ベースアドレス生成部のアドレス
とを加えてデータを前記RAMに書き込むためのアドレ
スを生成し、RAM書き込み部によって前記第1のRO
M及びEEPROMに記憶されている情報を前記アドレ
ス生成部で生成したアドレスに書き込む。そして、書き
換え可能ROM書き込み部、すなわちEEPROM書き
込み部によって、前記CPUからの指示により、前記E
EPROMに記憶されている情報を書き換える。これに
より、CPUのプログラムでEEPROMの記憶データ
を自由に変更することができる。
In the above configuration, an electrically erasable programmable ROM (hereinafter referred to as EEP) is used as the second ROM.
And an address for writing data to the RAM by adding the relative address stored in the first ROM and the EEPROM and the address of the base address generation unit by an address generation unit. The first RO is generated by the RAM writing unit.
The information stored in the M and the EEPROM is written to the address generated by the address generator. The rewritable ROM writing unit, that is, the EEPROM writing unit, issues an instruction from the CPU to
Rewrites information stored in the EPROM. Thus, the data stored in the EEPROM can be freely changed by the program of the CPU.

【0006】したがって、この提案によれば、組み込み
プログラムをROMに記憶し、直接CPUのアドレス空
間にマッピングするのではなく、組み込みプログラムの
本体をROMに、その変更(修正)情報をEEPROM
に格納し、システム起動時にCPUからアクセス可能な
RAMに転送することにより、組み込みプログラムに誤
りがあったときでも、修正のため、それを書き換えるこ
となくEEPROMの情報によりRAM上の組み込みプ
ログラムのコピーを修正し、プログラムを実行すること
ができる。
Therefore, according to this proposal, instead of storing the embedded program in the ROM and directly mapping it in the address space of the CPU, the main body of the embedded program is stored in the ROM, and its change (correction) information is stored in the EEPROM.
And transfer it to a RAM accessible from the CPU when the system is started, so that if there is an error in the embedded program, a copy of the embedded program on the RAM can be corrected using the information in the EEPROM without rewriting it. You can modify and run the program.

【0007】しかしながら、このような従来のプログラ
ム訂正方法では、組み込みマイコンのハードウェアとし
て用意されている修正ROMアドレス設定機能がN箇所
とすると、N箇所を越える修正は不可能である。また、
修正可能箇所を増やそうとすると、前記ハードウェアの
回路規模が大きくなり、特に廉価マイコンでは、コスト
的にそれを実行することも困難である。
However, in such a conventional program correction method, if the number of correction ROM address setting functions provided as hardware of the embedded microcomputer is N, correction beyond N is impossible. Also,
If an attempt is made to increase the number of modifiable parts, the circuit scale of the hardware becomes large, and it is also difficult to execute such a part at low cost, especially with a low-cost microcomputer.

【0008】このような理由から、従来技術では、プロ
グラム修正可能なROMアドレス箇所数が前記マイコン
のハードウェアで制限されてしまうという問題点があっ
た。
For this reason, in the prior art, there is a problem that the number of ROM addresses where the program can be corrected is limited by the hardware of the microcomputer.

【0009】[0009]

【発明が解決しようとする課題】上記の如く、従来のプ
ログラム訂正方法では、組み込みマイコンのハードウェ
アとして用意されている修正ROMアドレス設定機能が
N箇所とすると、N箇所を越える修正は不可能であり、
また可能箇所を増やそうとすると、前記ハードウェアの
回路規模が大きくなり、特に廉価マイコンでは、コスト
的にそれを実行することも困難であるため、結果として
修正可能なROMアドレス箇所数が前記マイコンのハー
ドウェアで制限されてしまうという問題点があった。
As described above, in the conventional program correction method, if the correction ROM address setting function prepared as hardware of the embedded microcomputer has N locations, correction beyond the N locations is impossible. Yes,
In addition, if the number of possible locations is increased, the circuit scale of the hardware becomes large. In particular, it is difficult to execute the hardware at a low cost with a low cost microcomputer. There was a problem that it was limited by hardware.

【0010】そこで、本発明は上記問題点に鑑みてなさ
れたもので、回路規模を増大させずに構成でき、プログ
ラム修正可能なアドレス箇所数が組み込みマイコンのハ
ードウェアの制限を受けることなく略無限に行うことの
できるプログラム訂正装置の提供を目的とする。
Therefore, the present invention has been made in view of the above problems, and can be configured without increasing the circuit scale. The number of address locations that can be programmed is almost infinite without being limited by the hardware of the embedded microcomputer. It is an object of the present invention to provide a program correction device which can be performed in a computer.

【0011】[0011]

【課題を解決するための手段】本発明によるプログラム
訂正装置は、CPUと、このCPUを実行させるととも
に予め修正が予想されるサブルーチンプログラムの先頭
毎にプログラム修正処理指示が配置されているプログラ
ムを記憶する書き換えが不可能な第1のROMと、前記
CPUからアクセスが可能で前記プログラムを修正する
ための修正プログラムデータを格納し且つロードするた
めの書き換え可能なRAMと、前記修正プログラムデー
タを記憶している書き換え可能な第2のROMと、前記
第1のROMのプログラムを修正するのに必要なプログ
ラム修正処理制御が可能なもので、前記プログラム修正
処理指示したときのプログラムカウンタ値と前記修正プ
ログラムデータとから前記プログラムの修正処理の有無
を判定し、修正処理が必要である場合には、前記第2の
ROMの修正プログラムデータの読み出し、読み出した
修正プログラムデータを修正する前記第1のROMのプ
ログラムの先頭アドレスに対応するアドレスで前記RA
Mに格納し、前記第1のROMのプログラムの先頭アド
レス以降、該RAMに格納した修正プログラムデータに
基づき前記CPUにて実行させるように制御するROM
修正機能部と、を具備したことを特徴とするものであ
る。
A program correction apparatus according to the present invention stores a CPU and a program for executing the CPU and in which a program correction processing instruction is arranged at each head of a subroutine program which is expected to be corrected in advance. A non-rewritable first ROM, a rewritable RAM accessible from the CPU for storing and loading correction program data for correcting the program, and storing the correction program data. A rewritable second ROM, capable of controlling a program correction process required to correct a program in the first ROM, a program counter value when the program correction process is instructed, and the correction program It is determined from the data whether or not the program has been modified, and If it is necessary, the in the second modification program data ROM read, said modifying the read patch data first address corresponding to the start address of the program ROM RA
M for controlling the CPU to execute the program based on the correction program data stored in the RAM after the start address of the program in the first ROM.
And a correction function unit.

【0012】本発明においては、前記第2のROMは、
修正プログラムデータを記憶している電気的消去型プロ
グラマブルリードオンリーメモリ(EEPROM)であ
り、プログラム修正が発生した場合には、前記ROM修
正機能部によってその修正プログラムデータが読み出さ
れ、前記RAMに転送して格納される。前記第1のRO
Mに記憶されているプログラムには、予め修正が予想さ
れるサブルーチンプログラムの先頭毎にプログラム修正
処理指示が配置されている。このため、前記ROM修正
機能部は、このプログラム修正処理指示したときのプロ
グラムカウンタ値と前記修正プログラムデータとから前
記プログラムの修正処理の有無を判定し、修正処理が必
要である場合には、前記第2のROMの修正プログラム
データの読み出し、読み出した修正プログラムデータを
修正する前記第1のROMのプログラムの先頭アドレス
に対応するアドレスで前記RAMに格納し、前記第1の
ROMのプログラムの先頭アドレス以降、該RAMに格
納した修正プログラムデータに基づき前記CPUにて実
行させるように制御する。このため、このようなプログ
ラム修正処理はプログラム内の各サブルーチン処理前に
幾度も実行することが可能となる。これにより、回路規
模を増大させずに組み込みマイコンを構成でき、プログ
ラム修正可能なアドレス箇所数がこの組み込みマイコン
のハードウェアの制限を受けることなく略無限に行うこ
とが可能となる。
In the present invention, the second ROM includes:
An electrically erasable programmable read only memory (EEPROM) storing correction program data. When a program correction occurs, the correction program data is read by the ROM correction function unit and transferred to the RAM. Stored. The first RO
In the program stored in M, a program correction processing instruction is arranged for each head of a subroutine program that is expected to be corrected in advance. For this reason, the ROM correction function unit determines the presence or absence of the correction processing of the program from the program counter value at the time of instructing the program correction processing and the correction program data, and when the correction processing is necessary, Reading the correction program data from the second ROM, storing the read correction program data in the RAM at an address corresponding to the start address of the program in the first ROM, and starting the start address of the program in the first ROM Thereafter, the CPU is controlled so as to be executed by the CPU based on the correction program data stored in the RAM. Therefore, such a program correction process can be executed many times before each subroutine process in the program. As a result, the embedded microcomputer can be configured without increasing the circuit scale, and the number of addresses at which the program can be corrected can be almost infinite without being limited by the hardware of the embedded microcomputer.

【0013】[0013]

【発明の実施の形態】発明の実施の形態について図面を
参照して説明する。
Embodiments of the present invention will be described with reference to the drawings.

【0014】図1は本発明に係るプログラム訂正装置の
一実施形態例を示し、該装置を構成する組み込みマイコ
ンとその周辺回路部との全体構成を示すブロック図であ
る。
FIG. 1 is a block diagram showing an embodiment of a program correction device according to the present invention, and showing the entire configuration of a built-in microcomputer constituting the device and its peripheral circuit section.

【0015】図1に示すように、本発明に係るプログラ
ム訂正装置は、組み込みマイコン1に組み込まれて構成
されており、プログラム訂正機能を有している。
As shown in FIG. 1, the program correction device according to the present invention is built in a built-in microcomputer 1 and has a program correction function.

【0016】具体的構成としては、この組み込みマイコ
ン1は、CPU2と、組み込みプログラムを記憶してい
る書き換え不可能なROM3と、修正プログラムデータ
をロードし格納するための書き換え可能なRAM4と、
前記ROM3に記憶している組み込みプログラムを訂正
するための処理機能を行うことの可能なROM修正機能
部5と、外部接続されたEEPROM7に対してデータ
伝送するためのI/Oインターフェース6とで構成され
ている。
Specifically, the built-in microcomputer 1 includes a CPU 2, a non-rewritable ROM 3 storing a built-in program, a rewritable RAM 4 for loading and storing correction program data,
A ROM correction function unit 5 capable of performing a processing function for correcting the embedded program stored in the ROM 3 and an I / O interface 6 for transmitting data to an externally connected EEPROM 7. Have been.

【0017】上記構成の組み込みマイコン1の外部に
は、前記EEPROM7が前記I/Oインターフェース
6を介して接続されており、該EEPROM7は、従来
技術で述べたように修正プログラム情報(組み込みプロ
グラムの変更情報ともいう)を記憶するもので、記憶し
た修正プログラム情報の書き換えが可能である。EEP
ROM7は、上記ROM修正機能部5によってI/Oイ
ンターフェース6が制御されることにより、その記憶し
ている修正プログラム情報の読み出しや、該修正変更情
報の書き換えができるようになっている。つまり、プロ
グラム訂正機能実行時においては、ROM間の修正プロ
グラムデータの転送、書き込み・読み出しは上記ROM
修正機能部5によって制御される。尚、通常の場合は、
CPU2によって上記EEPROM7及びI/Oインタ
ーフェース6が制御されるようになっている。
The EEPROM 7 is connected to the outside of the built-in microcomputer 1 having the above-described configuration via the I / O interface 6. The EEPROM 7 stores correction program information (change of the built-in program) as described in the prior art. Information), and the stored correction program information can be rewritten. EEP
By controlling the I / O interface 6 by the ROM correction function unit 5, the ROM 7 can read stored correction program information and rewrite the correction change information. That is, when the program correction function is executed, the transfer, writing, and reading of the correction program data between the ROMs are performed by the ROM.
Controlled by the correction function unit 5. In the usual case,
The CPU 7 controls the EEPROM 7 and the I / O interface 6.

【0018】また、該EEPROM7内に記憶している
修正プログラムデータのレコード形式は、例えば図2に
示すように訂正処理が配置されているアドレス、つまり
この訂正処理をCALLしたプログラムカウンタ(以
下、PC)の値(PC1〜PCn)と、修正ROMアド
レス1〜nと、格納RAM先頭アドレス1〜nと、これ
らのアドレスから書き込まれる修正プログラムデータ長
n及び修正プログラムデータとから成り立っている。
The record format of the correction program data stored in the EEPROM 7 is, for example, an address where a correction process is arranged as shown in FIG. 2, that is, a program counter (hereinafter, PC ), Correction ROM addresses 1 to n, storage RAM head addresses 1 to n, a correction program data length n and correction program data written from these addresses.

【0019】一方、RAM4は、CPU2の主記憶装置
であり、CPU2のメモリ空間にマッピングされている
が、システムスタートアップ時はプログラムが記憶され
ていない。また、RAM4はプログラム訂正処理時に
は、修正プログラムデータをロードし、且つ格納するた
めの書き換えが可能なメモリである。したがって、プロ
グラム訂正時にはこのRAM4に修正プログラムデータ
が書き込まれ、また、このRAM4はCPU2からのア
クセスが可能であることから、CPU2が該RAM4内
に記憶している修正プログラムデータをロードすること
で修正プログラムを実行することが可能となる。
On the other hand, the RAM 4 is a main storage device of the CPU 2 and is mapped in a memory space of the CPU 2, but does not store a program at the time of system startup. The RAM 4 is a rewritable memory for loading and storing the correction program data during the program correction processing. Therefore, at the time of program correction, the correction program data is written into the RAM 4, and since the RAM 4 can be accessed from the CPU 2, the CPU 2 loads the correction program data stored in the RAM 4 to correct the program. The program can be executed.

【0020】ROM3には、組み込みプログラムが格納
されており、ROM3に組み込みプログラムとして格納
されたデータは、ROM修正機能部5による訂正機能を
用いることによってその修正に基づく変更が可能であ
る。
The ROM 3 stores a built-in program, and the data stored as the built-in program in the ROM 3 can be changed based on the correction by using the correction function of the ROM correction function unit 5.

【0021】ROM修正機能部5は、上記RAM4を用
いて組み込みマイコンにおけるプログラム訂正するのに
必要な処理機能等を有するとともに、I/Oインターフ
ェイス6を制御してCPU2が目的とするのI/Oポー
トを選定することにより、上記EEPROM7に対する
修正プログラム情報の書き換え・読み出しを実行するこ
とができる。また、ROM修正機能部5の構成として
は、例えばROM3内に記憶された組み込みプログラム
に対する訂正処理等を実行するためのプログラム訂正回
路等で構成されている。つまり、プログラム修正が必要
である場合には、このROM修正機能部5は、前記EE
PROM内に記憶された修正プログラム情報から修正が
必要なプログラムの先頭アドレス(修正ROMアドレス
1)を得てこれをセットし、次に該プログラム訂正機能
によりジャンプするRAM4の先頭アドレス(格納RA
M先頭アドレス1)をセットし、得られたアドレスに基
づいてRAM4に修正プログラムデータを格納させる。
The ROM correction function unit 5 has a processing function necessary for correcting a program in the embedded microcomputer using the RAM 4 and controls the I / O interface 6 to control the I / O to be performed by the CPU 2. By selecting a port, it is possible to execute rewriting and reading of the correction program information with respect to the EEPROM 7. The configuration of the ROM correction function unit 5 includes, for example, a program correction circuit and the like for executing a correction process and the like for an embedded program stored in the ROM 3. That is, when the program needs to be corrected, the ROM correction function unit 5
The start address (correction ROM address 1) of the program that needs correction is obtained from the correction program information stored in the PROM, this is set, and then the start address (storage RA) of the RAM 4 to which the program correction function jumps is performed.
The M head address 1) is set, and the correction program data is stored in the RAM 4 based on the obtained address.

【0022】次に、動作について図3及び図4を参照し
ながら詳細に説明する。図3はプログラム訂正装置によ
るプログラム訂正方法を実行するためのメインフローチ
ャートであり、図4は図3に示す制御動作を説明するた
めの説明図で、図4(a)はプログラム訂正処理のサブ
ルーチンを示し、図4(b)はOSD処理実行前に配置
された同様の訂正処理を示すサブルーチン、図4(c)
はVCD処理実行前に配置された同様の訂正処理を示す
サブルーチンをそれぞれ示している。
Next, the operation will be described in detail with reference to FIGS. FIG. 3 is a main flowchart for executing a program correction method by the program correction device. FIG. 4 is an explanatory diagram for explaining the control operation shown in FIG. 3, and FIG. FIG. 4B is a subroutine showing the same correction processing arranged before the execution of the OSD processing, and FIG.
Indicates subroutines indicating the same correction processing arranged before the execution of the VCD processing.

【0023】尚、説明簡略化のためにハードウェアのプ
ログラム訂正機能は1つのみとして説明する。また、上
記OSD処理はテレビジョン受像機でのオンスクリーン
ディスプレイに関わる処理で、VCD処理はビデオ・ク
ロマ・偏向係に関わる処理を示している。
For simplicity, the description will be made assuming that the hardware has only one program correction function. The OSD process is a process related to an on-screen display in a television receiver, and the VCD process is a process related to a video, a chroma, and a deflection.

【0024】いま、組み込みマイコン1の電源を投入す
ると、CPU2は動作を開始し、ステップS10により
リセットを行うとともに、ROM3内に記憶されたプロ
グラムを実行し、このプログラムによって訂正処理をコ
ールし、この状態が該CPU2によって認識される。こ
のとき、CPU2は訂正処理を施す直前のアドレスをR
AM4の例えばスタック領域に書き込むように制御す
る。
When the power of the built-in microcomputer 1 is turned on, the CPU 2 starts operation, resets the program in step S10, executes a program stored in the ROM 3, calls a correction process by this program, and The state is recognized by the CPU 2. At this time, the CPU 2 sets the address immediately before performing the correction process to R
Control is performed so that the data is written to, for example, a stack area of the AM 4.

【0025】その後、CPU2からROM修正機能部5
に、プログラム訂正処理にコールがなされたことが通知
されると、CPU2は一時的に動作を停止し、同時にR
OMプログラム修正機能部5によるプログラム訂正機能
が働いてステップS11によるプログラム訂正処理が起
動する。
Thereafter, the CPU 2 sends the ROM correction function unit 5
Is notified that a call has been made to the program correction processing, the CPU 2 temporarily stops its operation and
The program correction function of the OM program correction function unit 5 operates, and the program correction processing in step S11 is started.

【0026】このステップS11によるプログラム訂正
処理では、例えば図4(a)のサブルーチンに示すよう
な処理が施される。つまり、この訂正処理をコールした
プログラムカウンタ(PC)の値、すなわちRAM4の
スタック領域に記憶されたアドレス値が、図2に示すE
EPROM7内に記憶されている修正プログラムデータ
レコードを検索し(ステップS20)、続くステップS
21による処理で一致したか否かの判断を行う。仮に一
致して見つかった場合には、これ識別するためのフラ
グ、例えばROM識別フラグを“1”としてこれをCP
U2に転送し(ステップS22)、そのPC値に応じた
修正プログラムデータレコードを読み出して(ステップ
S24)、以降の処理を行う。つまり、この一致するか
否かの処理を行うことにより、プログラム訂正処理を実
行するか否かを判定している。
In the program correction process in step S11, for example, a process shown in a subroutine of FIG. 4A is performed. In other words, the value of the program counter (PC) that called this correction process, that is, the address value stored in the stack area of the RAM 4 is the value of E shown in FIG.
A search is made for a correction program data record stored in the EPROM 7 (step S20), and the subsequent step S20 is executed.
It is determined whether or not they match in the processing by 21. If a match is found, a flag for identifying this, for example, a ROM identification flag is set to "1" and the
The data is transferred to U2 (step S22), a correction program data record corresponding to the PC value is read (step S24), and the subsequent processing is performed. In other words, by performing the process of whether or not they match, it is determined whether or not to execute the program correction process.

【0027】続く処理では、ステップS25による処理
で、修正プログラムデータレコードから読み出した、修
正が必要なプログラムの先頭アドレス(修正ROMアド
レス1)を該ROM修正機能部5内にセットし、次のス
テップS26による処理で、該プログラム訂正機能によ
りジャンプするRAM4の先頭アドレス(格納RAM先
頭アドレス1)をセットし、ステップS27による処理
でこの得られたアドレスに基づいてRAM4に対して修
正プログラムデータを格納させるようにデータ転送を行
い、例えば主となるメイン(図中にはMAINと記載)
処理動作前のプログラム訂正処理を終了し、図3に示す
メインルーチンのステップS12に処理を移行する。一
方、上記ステップS21による判断処理で一致せず見つ
からなかった場合には、図4(a)のサブルーチンに示
すステップS23によって、例えばROM識別フラグを
“0”としてこれをCPU2に転送し、プログラム訂正
処理が必要でないとみなして処理を図3に示すメインル
ーチンのステップS12に処理を移行する。
In the subsequent processing, the start address (corrected ROM address 1) of the program requiring correction, read from the corrected program data record in the processing in step S25, is set in the ROM correction function unit 5, and the next step In the process in S26, the start address of the RAM 4 (storage RAM start address 1) to which the program correction function jumps is set, and the corrected program data is stored in the RAM 4 based on the obtained address in the process in step S27. Data transfer is performed in the following manner, for example, the main main (in the figure, MAIN is described).
The program correction processing before the processing operation is completed, and the processing shifts to step S12 of the main routine shown in FIG. On the other hand, if no match is found in the judgment processing in step S21, no data is set to, for example, a ROM identification flag of "0" in step S23 shown in the subroutine of FIG. Assuming that the process is not necessary, the process proceeds to step S12 of the main routine shown in FIG.

【0028】そして、CPU2は再起動し、ステップ1
2aによる判断処理によって、転送された例えばROM
識別フラグが“1”であるか否かを判別し、“1”であ
る場合には、訂正処理が必要であったことを示している
ため、修正が必要なプログラムによる処理動作、つまり
ROM3内に記憶された該プログラムに基づく処理(ス
テップS12)を回避(ジャンプ)して、RAM4内に
格納している修正がなされたプログラムをこのRAM4
でロードして実行させ、処理をメイン処理(ステップS
14)に移行する。一方、ステップ12aによる判断処
理でROM識別フラグが“0”である場合には、訂正処
理が必要でなかったことを示しているため、修正がなさ
れていないプログラムによる処理動作、つまりROM3
内に記憶された該プログラムに基づく処理(ステップS
12)を行い、処理をメイン処理(ステップS14)に
移行する。
Then, the CPU 2 is restarted, and step 1 is executed.
For example, the ROM transferred by the determination
It is determined whether or not the identification flag is "1". If the identification flag is "1", it indicates that a correction process was required. The processing (step S12) based on the program stored in the RAM 4 is avoided (jumped), and the corrected program stored in the RAM 4 is stored in the RAM 4
Is loaded and executed, and the processing is performed in the main processing (step S
Go to 14). On the other hand, if the ROM identification flag is "0" in the judgment processing in step 12a, it indicates that no correction processing is necessary, and therefore, the processing operation by the program without correction, that is, the ROM 3
(Step S)
12), and the process proceeds to the main process (Step S14).

【0029】本実施形態例においては、ROM3に記憶
している組み込みプログラムには、事前に修正が発生す
ると思われる主要なサブルーチンの先頭毎に上記のよう
な訂正処理をCALLするように指示するデータが含ま
れている。つまり、先頭に配置することにより、そのサ
ブルーチン内のプログラムの領域のどこでもプログラム
訂正することが可能となる。したがって、本実施形態例
では、図3に示すように例えば上述のメイン処理の前、
OSD処理の前、VCD処理の前等に配置した場合でも
実行可能である。
In this embodiment, the built-in program stored in the ROM 3 contains, at each head of a main subroutine that is supposed to be corrected in advance, data for instructing the CALL to perform the above-described correction processing. It is included. That is, by arranging at the head, it is possible to correct the program anywhere in the program area in the subroutine. Accordingly, in the present embodiment, for example, as shown in FIG.
It can be executed even before the OSD processing, before the VCD processing, or the like.

【0030】したがって、CPU2は、メイン処理実行
後、処理をステップS15によるOSD処理に移行する
が、このOSD処理実行前にまた上記と同様にROM修
正機能部5によるプログラム訂正処理(図4(b)参
照、処理内容は図4(a)と同様)が実行された後、こ
のOSD処理(ステップS15)を実行させる。
Therefore, after executing the main processing, the CPU 2 shifts the processing to the OSD processing in step S15. Before the execution of the OSD processing, the CPU 2 executes the program correction processing by the ROM correction function unit 5 (FIG. 4 (b)). 4), the OSD process (step S15) is executed.

【0031】その後についても同様に、CPU2はOS
D処理実行後、処理をステップS16によるVCD処理
に移行するが、このVCD処理実行前にまたROM修正
機能部5によるプログラム訂正処理(図4(c)参照、
処理内容は図4(a)と同様)が実行された後、このV
CD処理(ステップS16)を実行させる。尚、EEP
ROMに記憶されているPC値は、訂正処理が配置され
るアドレスに応じて複数設けられており、例えばOSD
処理前に実行される訂正処理のPC値はPC1であり、
その後のVCD処理前に実行される訂正処理のPC値に
ついてはPCnとなる。
Thereafter, similarly, the CPU 2 executes the OS
After the execution of the D processing, the processing shifts to the VCD processing in step S16. Before the execution of the VCD processing, the program correction processing by the ROM correction function unit 5 (see FIG. 4C,
After the processing is the same as that shown in FIG.
A CD process (step S16) is executed. In addition, EEP
A plurality of PC values stored in the ROM are provided in accordance with the address where the correction processing is arranged.
The PC value of the correction process executed before the process is PC1,
The PC value of the correction processing executed before the subsequent VCD processing is PCn.

【0032】以上、説明したように本実施形態例によれ
ば、プログラム修正可能なROMアドレス箇所数をプロ
グラム訂正機能を実行するためのハードウェアの制限を
受けることなく、略無限に行うことができるプログラム
訂正装置を提供することが可能となる。
As described above, according to the present embodiment, the number of ROM addresses that can be programmed can be determined almost infinitely without being restricted by hardware for executing the program correction function. A program correction device can be provided.

【0033】尚、本発明に係る実施形態例においては、
プログラム訂正処理をCALLする度にEEPROM7
からプログラム修正情報を読み込んで実行下場合につい
て説明したが、これに限定されることはなく、例えばプ
ログラム修正個所数が1箇所で且つ修正規模が小さい場
合や、RAM4の記憶容量が十分に用意されている場合
等は、ぜんきEEPROM7からのプログラム修正情報
の読み出しをシステム起動時に一括して行うようにして
も良く、この場合のプログラム訂正処理では、ROM修
正機能部5のプログラム訂正回路等に対してデータ設定
のみなるように制御させても良い。すなわち、図4に示
すステップS27を実行せずに動作させるようにする。
したがって、このような実施形態例でも、前記実施形態
例と同様の効果を得ることは明らかである。
In the embodiment according to the present invention,
EEPROM7 every time the program correction process is CALL
Although the description has been given of the case where the program correction information is read from the program and executed, the present invention is not limited to this. In such a case, the reading of the program correction information from the EEPROM 7 may be performed collectively at the time of starting the system. In this case, the program correction processing of the ROM correction function unit 5 is performed in the program correction process. May be controlled so that only data setting is performed. That is, the operation is performed without executing step S27 shown in FIG.
Therefore, it is clear that the same effects as those of the above-described embodiment can be obtained in such an embodiment.

【0034】[0034]

【発明の効果】以上、説明したように本発明によれば、
回路規模を増大させずに組み込みマイコンを含むプログ
ラム訂正装置を構成でき、プログラム修正可能なアドレ
ス箇所数が組み込みマイコンのハードウェアの制限を受
けることなく略無限に行うことができるプログラム訂正
機能を備えたプログラム訂正装置の提供が可能となる。
As described above, according to the present invention,
A program correction device that includes a built-in microcomputer can be configured without increasing the circuit scale, and a program correction function is provided that allows the number of addresses that can be corrected to be almost infinite without being limited by the hardware of the built-in microcomputer. It is possible to provide a program correction device.

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

【図1】本発明のプログラム訂正装置の全体構成を示す
ブロック図。
FIG. 1 is a block diagram showing the overall configuration of a program correction device according to the present invention.

【図2】図1のEEPROM内の修正プログラムデータ
レコードの形式を示す図。
FIG. 2 is a view showing a format of a correction program data record in the EEPROM of FIG. 1;

【図3】図1の装置によるプログラム訂正方法を説明す
るためのメインフローチャート。
FIG. 3 is a main flowchart for explaining a program correction method by the apparatus of FIG. 1;

【図4】図3の訂正処理を説明するための説明図。FIG. 4 is an explanatory diagram for explaining the correction processing of FIG. 3;

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

1…組み込みマイコン、 2…中央処理装置(CPU)、 3…リードオンリーメモリ(ROM)、 4…ランダムアクセスメモリ(RAM)、 5…ROM修正機能部、 6…I/Oインターフェース、 7…電気的消去型プログラマブルリードオンリーメモリ
(EEPROM)。
1 embedded microcomputer, 2 central processing unit (CPU), 3 read-only memory (ROM), 4 random access memory (RAM), 5 ROM correction function unit, 6 I / O interface, 7 electrical Erasable programmable read only memory (EEPROM).

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 CPUと、 このCPUを実行させるとともに予め修正が予想される
サブルーチンプログラムの先頭毎にプログラム修正処理
指示が配置されているプログラムを記憶する書き換えが
不可能な第1のROMと、 前記CPUからアクセスが可能で前記プログラムを修正
するための修正プログラムデータを格納し且つロードす
るための書き換え可能なRAMと、 前記修正プログラムデータを記憶している書き換え可能
な第2のROMと、 前記第1のROMのプログラムを修正するのに必要なプ
ログラム修正処理制御が可能なもので、前記プログラム
修正処理指示したときのプログラムカウンタ値と前記修
正プログラムデータとから前記プログラムの修正処理の
有無を判定し、修正処理が必要である場合には、前記第
2のROMの修正プログラムデータの読み出し、読み出
した修正プログラムデータを修正する前記第1のROM
のプログラムの先頭アドレスに対応するアドレスで前記
RAMに格納し、前記第1のROMのプログラムの先頭
アドレス以降、該RAMに格納した修正プログラムデー
タに基づき前記CPUにて実行させるように制御するR
OM修正機能部と、 を具備したことを特徴とするプログラム訂正装置。
A non-rewritable first ROM for storing a program in which a program correction processing instruction is arranged at each head of a subroutine program which is to be executed and which is expected to be corrected in advance; A rewritable RAM accessible from the CPU for storing and loading correction program data for correcting the program, a rewritable second ROM storing the correction program data, A program correction process control required to correct the program in the first ROM can be performed, and the presence or absence of the program correction process is determined from the program counter value when the program correction process instruction is given and the correction program data. However, if a correction process is necessary, the second ROM Program data read, said modifying the read patch data first ROM
R is stored in the RAM at an address corresponding to the start address of the first program, and the CPU executes control based on the modified program data stored in the RAM after the first address of the program in the first ROM.
A program correction device comprising: an OM correction function unit.
【請求項2】 前記ROM修正機能部は、前記第1のR
OMに記憶しているプログラムの各サブルーチンプログ
ラムの先頭毎に配置されたプログラム修正処理指示に拘
わらず、前記第2のROMから前記RAMに対する修正
プログラムデータの転送を該プログラム初期化処理時を
含むシステム起動時に一括して行い、前記CPUに対し
て必要なアドレス設定については、プログラム修正処理
毎に行うことを特徴とする請求項1に記載のプログラム
訂正装置。
2. The ROM correction function unit according to claim 1, wherein:
A system that includes transferring the correction program data from the second ROM to the RAM regardless of a program correction processing instruction arranged at the beginning of each subroutine program of the program stored in the OM, including the time of the program initialization processing 2. The program correction apparatus according to claim 1, wherein the program correction is performed collectively at the time of startup, and the necessary address setting for the CPU is performed for each program correction process.
【請求項3】 前記第2のROMは、電気的消去型プロ
グラマブルリードオンリーメモリであることを特徴とす
る請求項1に記載のプログラム訂正装置。
3. The program correction device according to claim 1, wherein the second ROM is an electrically erasable programmable read only memory.
JP4597998A 1998-02-26 1998-02-26 Program correcting device Pending JPH11249887A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4597998A JPH11249887A (en) 1998-02-26 1998-02-26 Program correcting device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4597998A JPH11249887A (en) 1998-02-26 1998-02-26 Program correcting device

Publications (1)

Publication Number Publication Date
JPH11249887A true JPH11249887A (en) 1999-09-17

Family

ID=12734321

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4597998A Pending JPH11249887A (en) 1998-02-26 1998-02-26 Program correcting device

Country Status (1)

Country Link
JP (1) JPH11249887A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010073444A1 (en) * 2008-12-24 2010-07-01 パナソニック株式会社 Bus controller and initial boot program patch method
US11270003B2 (en) 2019-10-18 2022-03-08 Samsung Electronics Co., Ltd. Semiconductor device including secure patchable ROM and patch method thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010073444A1 (en) * 2008-12-24 2010-07-01 パナソニック株式会社 Bus controller and initial boot program patch method
US11270003B2 (en) 2019-10-18 2022-03-08 Samsung Electronics Co., Ltd. Semiconductor device including secure patchable ROM and patch method thereof

Similar Documents

Publication Publication Date Title
US7334121B2 (en) Flash memory system including a duplicate booting program and apparatus and method for protecting the same flash memory
US7991988B2 (en) Communication device and firmware update method thereof
KR100324834B1 (en) Electronics
KR100415371B1 (en) Computer
JPH03141447A (en) Method and apparatus for updating farm ware residing in electrically reloadable programmable read-only memory
US6237120B1 (en) Program patching of a ROM
JP2003345730A (en) Interface device, method for updating firmware in interface device and program therefor
JP3563768B2 (en) ROM program change device
JP2004046453A (en) Single chip microcomputer and boot sector switching method
JP5084853B2 (en) Firmware update device, communication device, electronic device, firmware update system, firmware update method, and program
JPH11249887A (en) Program correcting device
KR100310486B1 (en) Microcumputer
JP2001117766A (en) Information processor with patch function of mask rom
JPWO2006101123A1 (en) Nonvolatile memory device, nonvolatile memory controller, and nonvolatile memory system
JP2000293376A (en) Circuit and method for switching boot program
JPH11265283A (en) Correction method for firmware in storage device, and storage device
JP3358214B2 (en) Electronic equipment
JPH08305561A (en) Method and device for down-loading firmware
JP3843189B2 (en) Optical disk system control chip and update method used for optical disk system
JP2001273143A (en) Electronic controller
JPH1040094A (en) Program controller for firmware
JP2003122575A (en) Information processing unit
JP2023020590A (en) Information processing apparatus and monitoring method
JP2000305768A (en) Method for re-writing system software
JP2001256061A (en) Information storage device