JPH09146767A - Method for reloading program - Google Patents

Method for reloading program

Info

Publication number
JPH09146767A
JPH09146767A JP33111895A JP33111895A JPH09146767A JP H09146767 A JPH09146767 A JP H09146767A JP 33111895 A JP33111895 A JP 33111895A JP 33111895 A JP33111895 A JP 33111895A JP H09146767 A JPH09146767 A JP H09146767A
Authority
JP
Japan
Prior art keywords
ram
program
stored
cpu
loaded
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
JP33111895A
Other languages
Japanese (ja)
Inventor
Akihiko 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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP33111895A priority Critical patent/JPH09146767A/en
Publication of JPH09146767A publication Critical patent/JPH09146767A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To shorten a time from the completion of program loading up to its execution in a computer system provided with a non-volatile memory capable of electrically reloading a program to be executed by a CPU and storing the program and RAM loaded with the program stored in the non-volatile memory. SOLUTION: When a program to be stored in a flash EEPROM 13 is loaded from an external system 2 to a 1st RAM 14, control is transferred to the program loaded to the RAM 14. During the execution of the program stored in the RAM 14, the contents of the RAM 14 are copied to the EEPROM 13 by using the idle time of a CPU 11, and after the completion of the copying, control is transferred to the EEPROM 13.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、EEPROM,フ
ラッシュEEPROM等の電気的に書き換え可能な不揮
発性メモリにCPUで実行するプログラムを格納したコ
ンピュータシステムに於けるプログラム書き換え方法に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program rewriting method in a computer system in which a program executed by a CPU is stored in an electrically rewritable non-volatile memory such as an EEPROM or a flash EEPROM.

【0002】[0002]

【従来の技術】フラッシュEEPROM等の電気的に書
き換え可能な不揮発性メモリに、CPUで実行するプロ
グラムを格納したコンピュータシステムは、従来から提
案されている。このように、CPUで実行するプログラ
ムを電気的に書き換え可能な不揮発性メモリに格納する
ようにすることにより、プログラムをRAMやROMに
格納した場合に生じる不都合をなくすことができる。つ
まり、RAMにプログラムを格納した場合には、システ
ム立ち上げ時毎に、外部からRAMにプログラムをロー
ドしなければならないという問題が生じ、ROMにプロ
グラムを格納した場合には、プログラムの書き換えが困
難になるという問題が生じるが、電気的に書き換え可能
な不揮発性メモリを使用することにより、このような問
題を解決することができる。
2. Description of the Related Art A computer system in which a program executed by a CPU is stored in an electrically rewritable non-volatile memory such as a flash EEPROM has been conventionally proposed. In this way, by storing the program executed by the CPU in the electrically rewritable nonvolatile memory, it is possible to eliminate the inconvenience that occurs when the program is stored in the RAM or the ROM. That is, when the program is stored in the RAM, there is a problem that the program must be externally loaded into the RAM every time the system is started up. When the program is stored in the ROM, it is difficult to rewrite the program. However, such a problem can be solved by using an electrically rewritable nonvolatile memory.

【0003】ところで、CPUで実行するプログラムを
電気的に書き換え可能な不揮発性メモリに格納するよう
にしたコンピュータシステムに於いては、プログラムの
書き換えを行う場合、従来は次のようにしていた。
By the way, in a computer system in which a program executed by a CPU is stored in an electrically rewritable non-volatile memory, rewriting of the program has conventionally been performed as follows.

【0004】先ず、コンピュータシステムの運用を中断
させ、その後、外部システムからコンピュータシステム
内のRAMに書き換え用プログラムをロードする。次い
で、不揮発性メモリの一括消去を行い、消去完了後、R
AMにロードされている書き換え用プログラムを不揮発
性メモリに格納する。ここで、RAMに一旦書き換え用
プログラムをロードしてから不揮発性メモリへ書き換え
用プログラムを格納するのは、フラッシュEEPROM
等の不揮発性メモリの書き込み速度が非常に遅く、不揮
発性メモリに直接書き込みを行うことが困難なためであ
る。その後、不揮発性メモリに格納されたプログラムに
制御を移し、コンピュータシステムの運用を再開する
(例えば、特開平3−150651号公報)。
First, the operation of the computer system is interrupted, and then the rewriting program is loaded from the external system to the RAM in the computer system. Next, the nonvolatile memory is collectively erased, and after the erase is completed, R
The rewriting program loaded in the AM is stored in the non-volatile memory. Here, it is the flash EEPROM that loads the rewriting program into the RAM once and then stores the rewriting program in the nonvolatile memory.
This is because the writing speed of such a non-volatile memory is very slow and it is difficult to directly write to the non-volatile memory. After that, the control is transferred to the program stored in the non-volatile memory, and the operation of the computer system is restarted (for example, JP-A-3-150651).

【0005】[0005]

【発明が解決しようとする課題】上述したように、従来
は、外部システムからRAMにロードされた書き換え用
プログラムを書き込み速度が非常に遅い不揮発性メモリ
に書き込み、その後、不揮発性メモリに格納したプログ
ラムに制御を移すようにしているため、外部システムか
らRAMにプログラムがロードされてから、そのプログ
ラムが実行されるまでに多くの時間がかかってしまうと
いう問題があった。
As described above, conventionally, the rewriting program loaded from external system to the RAM is written in the nonvolatile memory having a very slow writing speed, and then the program stored in the nonvolatile memory. Since the control is transferred to, there is a problem that it takes a lot of time after the program is loaded from the external system to the RAM until the program is executed.

【0006】そこで、本発明の目的は、外部システムか
らRAMにプログラムをロードしてから、そのプログラ
ムを実行するまでの時間を短いものにすることができる
プログラム書き換え方法を提供することにある。
Therefore, an object of the present invention is to provide a program rewriting method capable of shortening the time from the loading of the program from the external system to the RAM to the execution of the program.

【0007】[0007]

【課題を解決するための手段】本発明は上記目的を達成
するため、CPUが実行するプログラムを格納した電気
的に書き換え可能な不揮発性メモリと、該不揮発性メモ
リに格納するプログラムがロードされるRAMとを備え
たコンピュータシステムに於けるプログラム書き換え方
法に於いて、前記不揮発性メモリに格納するプログラム
を前記RAMにロードした後、前記RAMにロードされ
たプログラムに制御を移し、前記RAMにロードされた
プログラムの実行中に、前記不揮発性メモリの内容を消
去する処理及び前記RAMにロードされたプログラムを
前記不揮発性メモリにコピーする処理を順次実行し、コ
ピー完了後、前記不揮発性メモリに格納されているプロ
グラムに制御を移すようにしたものである。
In order to achieve the above object, the present invention loads an electrically rewritable nonvolatile memory storing a program executed by a CPU and a program stored in the nonvolatile memory. In a program rewriting method in a computer system including a RAM, a program stored in the nonvolatile memory is loaded into the RAM, control is transferred to the program loaded in the RAM, and the program is loaded into the RAM. During execution of the program, a process of erasing the contents of the non-volatile memory and a process of copying the program loaded in the RAM to the non-volatile memory are sequentially executed, and after the copying is completed, the program is stored in the non-volatile memory. The control is transferred to the existing program.

【0008】また、本発明は、コンピュータシステムで
本来行うべき処理を効率的に行えるようにするため、前
記RAMにロードされたプログラムの前記不揮発性メモ
リへのコピーは、前記CPUの空き時間に行うようにし
たものである。
Further, according to the present invention, the program loaded in the RAM is copied to the non-volatile memory in a free time of the CPU in order to efficiently perform the processing that should be originally performed in the computer system. It was done like this.

【0009】更に、本発明は、コンピュータシステムの
アドレス空間を有効に使用できるようにするため、前記
RAMと前記不揮発性メモリとを同一アドレスに配置
し、前記RAMへのプログラムのロード時には、前記R
AMに対する書き込みを許可すると共に前記不揮発性メ
モリに対する書き込みを禁止し、前記RAMにロードさ
れたプログラムの実行時には、前記RAMからの読み出
しを許可すると共に前記不揮発性メモリからの読み出し
を禁止し、前記不揮発性メモリに格納されたプログラム
の実行時には、前記RAMからの読み出しを禁止すると
共に前記不揮発性メモリからの読み出しを許可するよう
にしたものである。
Furthermore, according to the present invention, in order to effectively use the address space of the computer system, the RAM and the non-volatile memory are arranged at the same address, and when the program is loaded into the RAM, the R
The writing to the AM is prohibited and the writing to the nonvolatile memory is prohibited. When the program loaded in the RAM is executed, the reading from the RAM is prohibited and the reading from the nonvolatile memory is prohibited. When the program stored in the non-volatile memory is executed, reading from the RAM is prohibited and reading from the non-volatile memory is permitted.

【0010】[0010]

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

【0011】図1は本発明のプログラム書き換え方法を
実施するコンピュータシステム1の構成例を示したブロ
ック図であり、コンピュータシステム1は、CPU11
と、ROM12と、電気的に書き換え可能な不揮発性メ
モリであるフラッシュEEPROM13と、第1,第2
のRAM14,15と、並列出力回路16a及びアンド
ゲートAND1〜AND4から構成されるメモリアクセ
ス制御回路16と、デコーダ17と、通信用LSI18
と、オアゲートORとを備えている。また、コンピュー
タシステム1には伝送路3を介して外部システム2が接
続されており、フラッシュEEPROM13に格納され
ているプログラムを書き換える際には、外部システム2
から書き換え用プログラムがロードされる。
FIG. 1 is a block diagram showing a configuration example of a computer system 1 for implementing the program rewriting method of the present invention. The computer system 1 includes a CPU 11
A ROM 12; a flash EEPROM 13 which is an electrically rewritable nonvolatile memory;
RAMs 14 and 15, a memory access control circuit 16 including a parallel output circuit 16a and AND gates AND1 to AND4, a decoder 17, and a communication LSI 18.
And OR gate OR. Also, an external system 2 is connected to the computer system 1 via a transmission path 3, and when rewriting a program stored in the flash EEPROM 13, the external system 2 is used.
The rewriting program is loaded from.

【0012】図2はコンピュータシステム1に於けるメ
モリ配置図であり、アドレスN〜(M−1)には第2の
RAM15のみが配置され、アドレスM〜(L−1)に
はフラッシュEEPROM13と第1のRAM14の第
1エリアとが配置され、アドレスL〜KにはROM12
と第1のRAM14の第2エリアとが配置されているこ
とを示している。
FIG. 2 is a memory layout diagram in the computer system 1, in which only the second RAM 15 is located at addresses N to (M-1) and the flash EEPROM 13 is located at addresses M to (L-1). The first area of the first RAM 14 and the ROM 12 are arranged at addresses L to K.
And the second area of the first RAM 14 are arranged.

【0013】図3はROM12に格納されるプログラム
の一例を示した図であり、その先頭アドレスLには、フ
ラッシュEEPROM13に対する書き込み,第1のR
AM14からの読み出しを禁止し、フラッシュEEPR
OM13からの読み出し,第1のRAM14に対する書
き込み,ROM12からの読み出しを許可するようにす
る命令が格納され、アドレス(L+1)〜(K−2)に
は、外部システム2から第1のRAM14の第1,第2
エリアへプログラムをロードする際に使用するローダが
格納され、アドレス(K−1)にはフラッシュEEPR
OM12に対する書き込み,第1のRAM14からの読
み出しを許可し、フラッシュEEPROM13からの読
み出し,第1のRAM14に対する書き込み,ROM1
2からの読み出しを禁止する命令が格納されている。
尚、最終アドレスKには命令は格納されていない。
FIG. 3 is a diagram showing an example of a program stored in the ROM 12, and at its head address L, writing to the flash EEPROM 13 and the first R
Prohibit reading from AM14, flash EEPR
Instructions for permitting reading from the OM 13, writing to the first RAM 14, and reading from the ROM 12 are stored. The addresses (L + 1) to (K-2) are stored in the first RAM 14 from the external system 2 to the addresses. First and second
The loader used to load the program to the area is stored, and the flash EEPR is stored at address (K-1).
Writing to the OM 12 and reading from the first RAM 14 are permitted, reading from the flash EEPROM 13, writing to the first RAM 14, and ROM 1
An instruction for prohibiting reading from 2 is stored.
No instruction is stored in the final address K.

【0014】図4は第1のRAM14の第2エリアに格
納されるプログラムの一例を示した図であり、その先頭
アドレスLにはフラッシュEEPROM13の一括消去
を指示する消去用フラグをオンにする命令が、アドレス
(L+1)にはRAM14の第1エリアの内容をフラッ
シュEEPROM13にコピーすることを指示するコピ
ー用フラグをオンにする命令が、アドレス(L+2)に
はコピー終了後に、フラッシュEEPROM13へ制御
を移すことを指示する制御移行用フラグをオンにする命
令が、アドレス(L+3)には第1のRAM14の第1
エリアの先頭へ制御を移す命令が格納されている。ま
た、第2エリアの最終アドレスKには第2エリアの先頭
アドレスLへ制御を移す命令が格納されている。尚、ア
ドレス(L+4)〜(K−1)には命令は格納されてい
ない。
FIG. 4 is a diagram showing an example of a program stored in the second area of the first RAM 14, and at the head address L thereof, an instruction for turning on an erase flag for instructing collective erase of the flash EEPROM 13 is made. However, at the address (L + 1), there is an instruction to turn on the copy flag for instructing to copy the contents of the first area of the RAM 14 to the flash EEPROM 13. The instruction to turn on the control transfer flag that instructs the transfer is at the address (L + 3) in the first area of the first RAM 14.
The instruction to transfer control to the beginning of the area is stored. Further, at the final address K of the second area, an instruction for transferring control to the head address L of the second area is stored. No instruction is stored in the addresses (L + 4) to (K-1).

【0015】第1のRAM14の第1エリアには、外部
システム2からロードした書き換え用プログラムが格納
され、第1エリアにロードされた書き換え用プログラム
は、CPU11の空き時間にフラッシュEEPROM1
3に格納される。また、第2のRAM15はワークエリ
アとして使用される。
The rewriting program loaded from the external system 2 is stored in the first area of the first RAM 14, and the rewriting program loaded in the first area is stored in the flash EEPROM 1 while the CPU 11 is idle.
3 is stored. The second RAM 15 is used as a work area.

【0016】CPU11のアドレス端子ADから出力さ
れたアドレスは、デコーダ17に供給されると共に、R
OM12,フラッシュEEPROM13,第1のRAM
14,第2のRAM15,並列出力回路16a,通信用
LSI18のアドレス端子ADに供給される。
The address output from the address terminal AD of the CPU 11 is supplied to the decoder 17 and R
OM12, flash EEPROM13, first RAM
14, the second RAM 15, the parallel output circuit 16a, and the address terminal AD of the communication LSI 18.

【0017】デコーダ17は、CPU11のアドレス端
子ADからアドレスN〜(M−1)が出力された場合は
チップセレクト信号CS1を“1”にして第2のRAM
15を選択し、アドレスM〜(L−1)が出力された場
合はチップセレクト信号CS2を“1”にしてフラッシ
ュEEPROM13及び第1のRAM14を選択し、ア
ドレスL〜Kが出力された場合はチップセレクト信号C
S3を“1”にしてROM12及び第1のRAM14を
選択する。
The decoder 17 sets the chip select signal CS1 to "1" when the address N to (M-1) is output from the address terminal AD of the CPU 11 to the second RAM.
If 15 is selected and the addresses M to (L-1) are output, the chip select signal CS2 is set to "1" to select the flash EEPROM 13 and the first RAM 14, and if the addresses L to K are output. Chip select signal C
The ROM 12 and the first RAM 14 are selected by setting S3 to "1".

【0018】CPU11のデータ端子Dは、ROM1
2,フラッシュEEPROM13,第1のRAM14,
第2のRAM15,並列出力回路16a,通信用LSI
18のデータ端子Dとデータバスによって接続されてい
る。
The data terminal D of the CPU 11 is the ROM 1
2, flash EEPROM 13, first RAM 14,
Second RAM 15, parallel output circuit 16a, communication LSI
The eighteen data terminals D are connected by a data bus.

【0019】メモリアクセス制御回路16は、CPU1
1によってその出力端子ROMW,ROMR,RAM
W,RAMRから出力する信号の値が“1”或いは
“0”に設定される並列出力回路16aの出力信号に従
って、CPU11の書き込み信号端子WRから出力され
た書き込み信号をフラッシュEEPROM13,第1の
RAM14に供給するか否かを制御すると共に、CPU
11の読み出し信号端子RDから出力された読み出し信
号をROM12,フラッシュEEPROM13,第1の
RAM14に供給するか否かを制御する。
The memory access control circuit 16 includes the CPU 1
1, its output terminals ROMW, ROMR, RAM
According to the output signal of the parallel output circuit 16a in which the value of the signal output from W, RAMR is set to "1" or "0", the write signal output from the write signal terminal WR of the CPU 11 is stored in the flash EEPROM 13, the first RAM 14 Control whether or not to supply to
It controls whether or not the read signal output from the read signal terminal RD of 11 is supplied to the ROM 12, the flash EEPROM 13, and the first RAM 14.

【0020】並列出力回路16aの各出力端子ROM
W,ROMR,RAMW,RAMRから出力する信号の
値を設定する際、CPU11は、メモリアクセス制御回
路16に付与されているアドレスを出力すると共にIO
書き込み信号を“1”にし、更に、第1ビット〜第4ビ
ットにそれぞれ出力端子ROMW,ROMR,RAM
W,RAMRから出力させる信号の値(“1”或いは
“0”)を設定したデータを出力する。例えば、CPU
11が第1ビット,第4ビットに“0”を設定し、第2
ビット,第3ビットに“1”を設定したデータを出力し
た場合には、並列出力回路16aの各出力端子ROM
W,ROMR,RAMW,RAMRから出力される信号
はそれぞれ“0”,“1”,“1”,“0”となり、ア
ンドゲートAND1,AND4がオフ状態,アンドゲー
トAND2,AND3がオン状態になる。この結果、C
PU11の書き込み信号端子WRから出力される書き込
み信号は、第1のRAM14には供給されるが、フラッ
シュEEPROM13には供給されない状態となり、読
み出し信号端子RDから出力される読み出し信号は、R
OM12,フラッシュEEPROM13には供給される
が、第1のRAM14には供給されない状態となる。つ
まり、第1のRAM14に対する書き込み及びROM1
2,フラッシュEEPROM13からの読み出しは許可
されるが、フラッシュEEPROM13に対する書き込
み及び第1のRAM14からの読み出しは禁止された状
態になる。尚、CPU11は、初期立ち上げ時には、第
1ビット〜第4ビットにそれぞれ“0”,“1”,
“0”,“0”を設定したデータを出力し、メモリアク
セス制御回路16の状態を、ROM12,フラッシュE
EPROM13からの読み出しを許可し、フラッシュE
EPROM13,第1のRAM14に対する書き込み及
び第1のRAM14からの読み出しを禁止する状態にし
ておく。
Each output terminal ROM of the parallel output circuit 16a
When setting the values of the signals output from W, ROMR, RAMW, and RAMR, the CPU 11 outputs the address assigned to the memory access control circuit 16 and performs IO.
The write signal is set to "1", and the output terminals ROMW, ROMR, and RAM are further provided for the first to fourth bits, respectively.
The data in which the value (“1” or “0”) of the signal to be output from W, RAMR is set is output. For example, CPU
11 sets the first bit and the fourth bit to "0", and the second bit
When the data in which the bit and the third bit are set to "1" is output, each output terminal ROM of the parallel output circuit 16a
The signals output from W, ROMR, RAMW, and RAMR are "0", "1", "1", and "0", respectively, and AND gates AND1 and AND4 are turned off, and AND gates AND2 and AND3 are turned on. . As a result, C
The write signal output from the write signal terminal WR of the PU 11 is supplied to the first RAM 14 but is not supplied to the flash EEPROM 13, and the read signal output from the read signal terminal RD is R
It is supplied to the OM 12 and the flash EEPROM 13, but not supplied to the first RAM 14. That is, writing to the first RAM 14 and the ROM 1
2. Reading from the flash EEPROM 13 is permitted, but writing to the flash EEPROM 13 and reading from the first RAM 14 are prohibited. Note that the CPU 11 sets the first bit to the fourth bit to "0", "1", and
The data in which "0" and "0" are set is output, and the state of the memory access control circuit 16 is changed to the ROM 12 and the flash E.
Reading from the EPROM 13 is permitted, and the flash E
Writing to the EPROM 13 and the first RAM 14 and reading from the first RAM 14 are prohibited.

【0021】次に、フラッシュEEPROM13に格納
されているプログラムの書き換えを行う場合の動作を説
明する。
Next, the operation of rewriting the program stored in the flash EEPROM 13 will be described.

【0022】コンピュータシステム1内の通信用LSI
18は、伝送路3を介して外部システム2から送られて
くる、フラッシュEEPROM13に格納されているプ
ログラムに対する書き換え要求を受信すると、CPU1
1に割り込みをかける。これにより、CPU11は、通
信用LSI18で受信した情報の種類を判断し、それが
プログラムの書き換え要求であると判断すると、現在実
行中の処理を終了させ、その後、ROM12の先頭アド
レスLに制御を移す。
Communication LSI in computer system 1
When receiving a rewrite request for the program stored in the flash EEPROM 13 from the external system 2 via the transmission path 3, the CPU 18 receives the CPU 1
Interrupt 1 As a result, the CPU 11 determines the type of information received by the communication LSI 18, and if it determines that the request is a program rewrite request, it terminates the process that is currently being executed, and then controls the start address L of the ROM 12 to control. Move.

【0023】ROM12の先頭アドレスLには、図3に
示すように、フラッシュEEPROM13に対する書き
込み,第1のRAM14からの読み出しを禁止し、フラ
ッシュEEPROM13からの読み出し,第1のRAM
14に対する書き込み,ROM12からの読み出しを許
可する命令が格納されているので、CPU11は、図5
の流れ図に示すように、フラッシュEEPROM13に
対する書き込み,第1のRAM14からの読み出しを禁
止し、フラッシュEEPROM13からの読み出し,第
1のRAM14に対する書き込み,ROM12からの読
み出しを許可する(S1)。つまり、CPU11は、第
1ビット〜第4ビットにそれぞれ“0”,“1”,
“1”,“0”を設定したデータをデータ端子Dから出
力し、並列出力回路16aの各出力端子ROMW,RO
MR,RAMW,RAMRから出力される信号の値をそ
れぞれ“0”,“1”,“1”,“0”にする。
At the head address L of the ROM 12, as shown in FIG. 3, writing to the flash EEPROM 13 and reading from the first RAM 14 are prohibited, and reading from the flash EEPROM 13 and first RAM are performed.
Since an instruction for permitting writing to the ROM 14 and reading from the ROM 12 is stored, the CPU 11 executes
As shown in the flowchart of FIG. 5, writing to the flash EEPROM 13 and reading from the first RAM 14 are prohibited, and reading from the flash EEPROM 13, writing to the first RAM 14, and reading from the ROM 12 are permitted (S1). That is, the CPU 11 assigns “0”, “1”, to the first to fourth bits, respectively.
Data with "1" and "0" set is output from the data terminal D, and the output terminals ROMW and RO of the parallel output circuit 16a are output.
The values of the signals output from MR, RAMW and RAMR are set to "0", "1", "1" and "0", respectively.

【0024】次いで、CPU11は、ROM12のアド
レス(L+1)〜(K−2)に格納されているローダを
実行し、外部システム2からプログラムを第1のRAM
14にロードする(S2)。第1のRAM14にロード
するプログラムには、フラッシュEEPROM13に格
納されているプログラムと置き換える書き換え用プログ
ラムと、図4に示すプログラムとが含まれており、書き
換え用プログラムは、第1のRAM14の第1エリアに
ロードされ、図4に示すプログラムは第1のRAM14
の第2エリアにロードされる。
Next, the CPU 11 executes the loader stored in the addresses (L + 1) to (K-2) of the ROM 12 to load the program from the external system 2 into the first RAM.
14 is loaded (S2). The programs loaded into the first RAM 14 include a rewriting program that replaces the program stored in the flash EEPROM 13 and the program shown in FIG. 4, and the rewriting program is the first program of the first RAM 14. The program loaded in the area and shown in FIG.
Will be loaded into the second area of.

【0025】その後、CPU11は、ROM12のアド
レス(K−1)に格納されている命令を実行する。この
命令は、図3に示すように、フラッシュEEPROM1
3に対する書き込み,第1のRAM14からの読み出し
を許可し、フラッシュEEPROM13からの読み出
し,第1のRAM14に対する書き込み,ROM12か
らの読み出しを禁止する命令が格納されているので、C
PU11は、フラッシュEEPROM13に対する書き
込み,第1のRAM14からの読み出しを許可し、フラ
ッシュEEPROM13からの読み出し,第1のRAM
14に対する書き込み,ROM12からの読み出しを禁
止する(S3)。つまり、CPU11は、第1ビット〜
第4ビットにそれぞれ“1”,“0”,“0”,“1”
を設定したデータをデータ端子Dから出力し、並列出力
回路16aの各出力端子ROMW,ROMR,RAM
W,RAMRから出力される信号の値をそれぞれ
“1”,“0”,“0”,“1”にする。
After that, the CPU 11 executes the instruction stored in the address (K-1) of the ROM 12. This instruction, as shown in FIG.
3 is stored, and an instruction for permitting writing from the first RAM 14 and reading from the flash EEPROM 13, prohibiting writing from the first RAM 14, and reading from the ROM 12 is stored.
The PU 11 permits writing to the flash EEPROM 13 and reading from the first RAM 14, and reads from the flash EEPROM 13 and the first RAM.
Writing to 14 and reading from ROM 12 are prohibited (S3). That is, the CPU 11 sets the first bit to
"1", "0", "0", "1" in the 4th bit respectively
Is output from the data terminal D, and the output terminals ROMW, ROMR, RAM of the parallel output circuit 16a are output.
The values of the signals output from W and RAMR are set to "1", "0", "0", and "1", respectively.

【0026】その後、CPU11は、プログラムカウン
タ(図示せず)の値が「K」になっており、且つ、メモ
リアクセス制御回路16によってROM12からの読み
出しが禁止され、第1のRAM14からの読み出しが許
可されているので、第1のRAM14のアドレスKに格
納されている命令を実行する。
After that, in the CPU 11, the value of the program counter (not shown) is "K", the reading from the ROM 12 is prohibited by the memory access control circuit 16, and the reading from the first RAM 14 is prohibited. Since it is permitted, the instruction stored in the address K of the first RAM 14 is executed.

【0027】第1のRAM14のアドレスKには、図4
に示すように、第1のRAM14の第2エリアの先頭ア
ドレスLへ制御を移す命令(例えば、ジャンプ先をアド
レスLとするジャンプ命令等)が格納されているので、
CPU11は、制御を第2エリアの先頭アドレスLに移
し、アドレスLからプログラムを実行する(S4)。
The address K of the first RAM 14 is shown in FIG.
As shown in (1), since an instruction for transferring control to the start address L of the second area of the first RAM 14 (for example, a jump instruction with the jump destination as the address L) is stored,
The CPU 11 transfers the control to the start address L of the second area and executes the program from the address L (S4).

【0028】第1のRAM14のアドレスL,(L+
1),(L+2)には、それぞれ図4に示すように、フ
ラッシュEEPROM13の一括消去を指示する消去用
フラグをオンにする命令,第1のRAM14の第1エリ
アの内容をフラッシュEEPROM13にコピーするこ
とを指示するコピー用フラグをオンにする命令,コピー
終了後に、フラッシュEEPROM13へ制御を移すこ
とを指示する制御移行用フラグをオンにする命令が格納
されているので、これらの命令に従って、CPU11
は、消去用フラグ,コピー用フラグ,制御移行用フラグ
をオンにする。尚、これらのフラグは、例えば、第2の
RAM15に設定される。その後、CPU11は、第1
のRAM14のアドレス(L+3)に格納されている、
第1のRAM14の第1エリアの先頭アドレスMへ制御
を移す命令(例えば、ジャンプ先をアドレスMとするジ
ャンプ命令)に従って制御を第1のRAM14の第1エ
リアの先頭アドレスMへ移し、そこからプログラムを実
行する(S5)。
Addresses L, (L + of the first RAM 14
In 1) and (L + 2), as shown in FIG. 4, an instruction to turn on an erasing flag for instructing collective erasing of the flash EEPROM 13, and a content of the first area of the first RAM 14 are copied to the flash EEPROM 13. Since an instruction for turning on the copy flag for instructing that, and an instruction for turning on the control transfer flag for instructing to transfer the control to the flash EEPROM 13 after the copy are stored, the CPU 11 follows these instructions.
Turns on the erase flag, the copy flag, and the control transfer flag. Note that these flags are set in the second RAM 15, for example. After that, the CPU 11 executes the first
Stored in the address (L + 3) of the RAM 14 of
In accordance with an instruction (for example, a jump instruction whose address is the jump destination M) of the control to the first address M of the first area of the first RAM 14, the control is moved to the first address M of the first area of the first RAM 14, and from there. The program is executed (S5).

【0029】第1のRAM14の第1エリアに格納され
ているプログラムには、図6の流れ図に示すように、C
PU11が一定時間Tの経過を待ち合わせている時、即
ちCPU11の空き時間にフラッシュEEPROM13
の一括消去,第1のRAM14の内容をフラッシュEE
PROM13にコピーする処理,制御をフラッシュEE
PROM13に格納されているプログラムに移行させる
処理が組み込まれている。
In the program stored in the first area of the first RAM 14, as shown in the flow chart of FIG.
When the PU 11 is waiting for the elapse of a certain time T, that is, when the CPU 11 is idle, the flash EEPROM 13
Batch erasure, flash EE contents of the first RAM 14
Flash EE for processing and control of copying to PROM13
Processing for shifting to the program stored in the PROM 13 is incorporated.

【0030】CPU11は、図6に示すように、一定時
間Tの経過を待ち合わせる処理を行った後(S11)、
消去用フラグがオンになっているか否かを判断し、消去
用フラグがオンになっている場合はフラッシュEEPR
OM13の記憶内容を一括消去し、その後、消去用フラ
グをオフにする(S13,S14)。
As shown in FIG. 6, the CPU 11 waits for a certain time T to elapse (S11),
It is determined whether the erasing flag is on, and if the erasing flag is on, the flash EEPR
The stored contents of the OM 13 are collectively erased, and then the erase flag is turned off (S13, S14).

【0031】フラッシュEEPROM13の一括消去が
完了した時点に於いて、一定時間Tが経過している場合
は、CPU11は、一定時間が経過した後に行う処理を
実行する(S26)。また、フラッシュEEPROM1
3の記憶内容を一括消去しても、所定時間Tが経過して
いない場合(S12,S13が共にNO)は、コピー用
フラグがオンになっているか否かを判断する(S1
5)。そして、コピー用フラグがオンになっている場合
は、第2のRAM15の所定領域に格納されている次回
のコピー開始アドレスに従って第1のRAM14に格納
されているプログラムをフラッシュEEPROM13に
コピーする(S16)。
When the fixed time T has elapsed at the time when the batch erasing of the flash EEPROM 13 is completed, the CPU 11 executes the processing performed after the fixed time has passed (S26). In addition, flash EEPROM1
If the predetermined time T has not elapsed even after the stored contents of 3 are erased all at once (NO in S12 and S13), it is determined whether the copy flag is on (S1).
5). If the copy flag is on, the program stored in the first RAM 14 is copied to the flash EEPROM 13 according to the next copy start address stored in the predetermined area of the second RAM 15 (S16). ).

【0032】コピーが完了する前に、一定時間Tが経過
した場合(S17,S18)は、CPU11は次回のコ
ピー開始位置を第2のRAM15の所定領域に記録した
後(S19)、S26の処理を行う。また、コピーが完
了した場合は、CPU11は、コピー用フラグをオフに
した後、一定時間Tが経過していなければ、制御移行用
フラグがオンになっているか否かを判断する(S20,
S21,S22)。
If a certain time T has passed before the copy is completed (S17, S18), the CPU 11 records the next copy start position in a predetermined area of the second RAM 15 (S19), and then the process of S26. I do. When the copying is completed, the CPU 11 turns off the copying flag and then determines whether the control shifting flag is turned on if the fixed time T has not passed (S20,
S21, S22).

【0033】そして、制御移行用フラグがオンになって
いないと判断した場合は、一定時間Tが経過するのを待
ち合わせた後(S23)、S26の処理を行う。また、
オンになっていると判断した場合は、制御移行用フラグ
をオフにした後、一定時間Tが経過するのを待つ(S2
3,S24)。
When it is determined that the control transition flag is not turned on, after waiting for the elapse of the fixed time T (S23), the process of S26 is performed. Also,
If it is determined that it is turned on, the control transition flag is turned off, and then a certain period of time T elapses (S2
3, S24).

【0034】そして、一定時間Tが経過すると、CPU
11は、フラッシュEEPROM13に対する書き込
み,第1のRAM14に対する書き込み,第1のRAM
14からの読み出しを禁止し、フラッシュEEPROM
13からの読み出し,ROM12からの読み出しを許可
する(S25)。つまり、CPU11は、第1ビット〜
第4ビットにそれぞれ“0”,“1”,“0”,“0”
を設定したデータをデータ端子Dから出力し、並列出力
回路16aの各出力端子ROMW,ROMR,RAM
W,RAMRから出力される信号の値をそれぞれ
“0”,“1”,“0”,“0”にする。
When a certain time T has passed, the CPU
Reference numeral 11 denotes writing to the flash EEPROM 13, writing to the first RAM 14, and first RAM
Reading from 14 is prohibited, flash EEPROM
Reading from 13 and reading from ROM 12 are permitted (S25). That is, the CPU 11 sets the first bit to
"0", "1", "0", "0" in the 4th bit respectively
Is output from the data terminal D, and the output terminals ROMW, ROMR, RAM of the parallel output circuit 16a are output.
The values of the signals output from W and RAMR are set to "0", "1", "0", and "0", respectively.

【0035】これにより、CPU11は、第1のRAM
14に格納されているプログラムに替えてフラッシュE
EPROM13に格納されているプログラムを実行する
ことになるが(図5,S6)、フラッシュEEPROM
13と第1のRAM14の第1エリアとが同一アドレス
に配置され、且つフラッシュEEPROM13に格納さ
れているプログラムと第1のRAM14の第1エリアに
格納されているプログラムとが同一であることから、第
1のRAM14上で実行していたプログラムを引き続き
フラッシュEEPROM13上で実行することができ
る。
As a result, the CPU 11 has the first RAM
Flash E instead of the program stored in 14
Although the program stored in the EPROM 13 will be executed (FIG. 5, S6), the flash EEPROM
13 and the first area of the first RAM 14 are arranged at the same address, and the program stored in the flash EEPROM 13 is the same as the program stored in the first area of the first RAM 14, The program running on the first RAM 14 can continue to run on the flash EEPROM 13.

【0036】図7は本発明のプログラム書き換え方法を
実施するコンピュータシステムの他の構成例を示したブ
ロック図であり、コンピュータシステム100は、CP
U111と、ROM112と、フラッシュEEPROM
113と、第1のRAM114と、第2のRAM115
と、デコーダ117と、通信用LSI118とを備えて
いる。また、コンピュータシステム100には伝送路3
を介して外部システム2が接続されており、フラッシュ
EEPROM113に格納されているプログラムを書き
換える際には、外部システム2から書き換え用プログラ
ムがロードされる。
FIG. 7 is a block diagram showing another configuration example of a computer system for carrying out the program rewriting method of the present invention. The computer system 100 is a CP.
U111, ROM112, flash EEPROM
113, a first RAM 114, and a second RAM 115
And a decoder 117 and a communication LSI 118. In addition, the computer system 100 includes a transmission line 3
The external system 2 is connected via the external system 2, and when the program stored in the flash EEPROM 113 is rewritten, the rewriting program is loaded from the external system 2.

【0037】図8はコンピュータシステム100に於け
るメモリ配置図であり、アドレスN〜(M−1)には第
2のRAM115が、アドレスM〜(L−1)にはフラ
ッシュEEPROM113が、アドレスL〜KにはRO
M112が、アドレス(K+1)〜Jには第1のRAM
114の第1エリアが、アドレス(J+1)〜Eには第
1のRAM114の第2エリアが配置されていることを
示している。
FIG. 8 is a memory layout diagram in the computer system 100. The second RAM 115 is located at addresses N to (M-1), the flash EEPROM 113 is located at addresses M to (L-1), and the address L is located at address L. RO for K
M112 is the first RAM for addresses (K + 1) to J
The first area 114 indicates that the second area of the first RAM 114 is located at the addresses (J + 1) to E.

【0038】図9はROM112に格納される命令の一
例を示した図であり、アドレスL〜(K−1)には外部
システム2から第1のRAM114の第1エリアへプロ
グラムをロードする際に使用するローダが格納され、ア
ドレスKには第1のRAM114の第2エリアの先頭ア
ドレス(J+1)へ制御を移す命令が格納されている。
FIG. 9 is a diagram showing an example of instructions stored in the ROM 112. When loading a program from the external system 2 to the first area of the first RAM 114 at addresses L to (K-1). A loader to be used is stored, and an address K stores an instruction to transfer control to the head address (J + 1) of the second area of the first RAM 114.

【0039】図10は第1のRAM114の第2エリア
に格納されるプログラムの一例を示した図であり、その
先頭アドレス(J+1)にはフラッシュEEPROM1
14の一括消去を指示する消去用フラグをオンにする命
令が格納され、アドレス(J+2)には第1のRAM1
14の第1エリアの内容をフラッシュEEPROM11
3にコピーすることを指示するコピー用フラグをオンに
する命令が格納され、アドレス(J+3)にはコピー終
了後にフラッシュEEPROM113へ制御を移すこと
を指示する制御移行用フラグをオンにする命令が格納さ
れ、アドレス(J+4)にはRAM114の第1エリア
の先頭アドレスへ制御を移す命令が格納されている。
FIG. 10 is a diagram showing an example of a program stored in the second area of the first RAM 114, and the flash EEPROM 1 is stored at the head address (J + 1).
An instruction for turning on the erase flag for instructing batch erase of 14 is stored, and the first RAM 1 is stored at the address (J + 2).
The contents of the first area 14 of the flash EEPROM 11
3 stores an instruction to turn on a copy flag for instructing copying, and an address (J + 3) stores an instruction to turn on a control transition flag for instructing to transfer control to the flash EEPROM 113 after completion of copying. The address (J + 4) stores an instruction to transfer control to the head address of the first area of the RAM 114.

【0040】第1のRAM114の第1エリアには外部
システム2からロードした書き換え用プログラムが格納
され、第1エリアにロードされた書き換え用プログラム
は、CPU111の空き時間にフラッシュEEPROM
113に格納される。また、第2のRAM115はワー
クエリアとして使用される。
The rewriting program loaded from the external system 2 is stored in the first area of the first RAM 114, and the rewriting program loaded in the first area is stored in the flash EEPROM in the idle time of the CPU 111.
It is stored in 113. The second RAM 115 is used as a work area.

【0041】CPU111のアドレス端子ADから出力
されたアドレスは、デコーダ117に供給されると共
に、ROM112,フラッシュEEPROM113,第
1のRAM114,第2のRAM115,通信用LSI
118のアドレス端子ADに供給される。
The address output from the address terminal AD of the CPU 111 is supplied to the decoder 117 and also the ROM 112, the flash EEPROM 113, the first RAM 114, the second RAM 115, and the communication LSI.
It is supplied to the address terminal AD of 118.

【0042】デコーダ117は、CPU111のアドレ
ス端子ADからアドレスN〜(M−1)が出力された場
合はチップセレクト信号CS1を“1”にして第2のR
AM115を選択し、アドレスM〜(L−1)が出力さ
れた場合はチップセレクト信号CS3を“1”にしてフ
ラッシュEEPROM113を選択し、アドレスL〜K
が出力された場合はチップセレクト信号CS4を“1”
にしてROM112を選択し、アドレス(K+1)〜E
が出力された場合はチップセレクト信号CS2を“1”
にして第1のRAM114を選択する。
The decoder 117 sets the chip select signal CS1 to "1" when the addresses N to (M-1) are output from the address terminal AD of the CPU 111, and the second R is set.
When the AM 115 is selected and the addresses M to (L-1) are output, the chip select signal CS3 is set to "1" to select the flash EEPROM 113, and the addresses L to K are selected.
Is output, the chip select signal CS4 is set to "1".
To select ROM 112 and select addresses (K + 1) to E
Is output, the chip select signal CS2 is set to "1".
Then, the first RAM 114 is selected.

【0043】次に、フラッシュEEPROM113に格
納されているプログラムの書き換えを行う場合の動作を
説明する。
Next, the operation for rewriting the program stored in the flash EEPROM 113 will be described.

【0044】コンピュータシステム100内の通信用L
SI118は、伝送路3を介して外部システム2から送
られてくる、フラッシュEEPROM113に格納され
ているプログラムに対する書き換え要求を受信すると、
CPU111に割り込みをかける。これにより、CPU
111は、通信用LSI18で受信した情報の種類を判
断し、それがプログラムの書き換え要求であると判断す
ると、現在実行中の処理を終了させ、その後、ROM1
12の先頭アドレスLに制御を移す。
L for communication in the computer system 100
When the SI 118 receives the rewrite request for the program stored in the flash EEPROM 113, which is sent from the external system 2 via the transmission line 3,
Interrupt the CPU 111. This allows the CPU
The 111 judges the type of information received by the communication LSI 18, and if it judges that it is a program rewriting request, it terminates the process currently being executed, and then the ROM 1
Control is transferred to the first address L of 12.

【0045】これにより、CPU111はROM112
に格納されているローダを実行し、外部システム2から
プログラムを第1のRAM114にロードする。第1の
RAM114にロードするプログラムには、フラッシュ
EEPROM113に格納されているプログラムと置き
換える書き換え用プログラムと、図10に示すプログラ
ムとが含まれており、書き換え用プログラムは第1のR
AM114の第1エリアにロードされ、図10に示すプ
ログラムは第1のRAM114の第2エリアにロードさ
れる。
As a result, the CPU 111 causes the ROM 112 to
To load the program from the external system 2 into the first RAM 114. The programs loaded into the first RAM 114 include a rewriting program that replaces the program stored in the flash EEPROM 113 and the program shown in FIG. 10. The rewriting program is the first R program.
The program is loaded into the first area of the AM 114, and the program shown in FIG. 10 is loaded into the second area of the first RAM 114.

【0046】その後、CPU111はROM112のア
ドレスKに格納されている命令を実行し、制御を第1の
RAM114の第2エリアの先頭アドレス(J+1)へ
移す。
After that, the CPU 111 executes the instruction stored in the address K of the ROM 112, and transfers the control to the head address (J + 1) of the second area of the first RAM 114.

【0047】第1のRAM114のアドレス(J+
1),(J+2),(J+3)には、それぞれ図10に
示す命令が格納されているので、CPU111はこれら
の命令に従って消去用フラグ,コピー用フラグ,制御移
行用フラグをオンにする。その後、CPU111は第1
のRAM114のアドレス(J+4)に格納されている
命令を実行し、第1のRAM114の第1エリアの先頭
アドレス(K+1)に制御を移す。
Address of the first RAM 114 (J +
Since the instructions shown in FIG. 10 are stored in 1), (J + 2), and (J + 3), the CPU 111 turns on the erase flag, the copy flag, and the control transfer flag in accordance with these instructions. After that, the CPU 111
The instruction stored in the address (J + 4) of the RAM 114 is executed, and the control is transferred to the head address (K + 1) of the first area of the first RAM 114.

【0048】これにより、CPU111は、第1のRA
M114の第1エリアにロードされたプログラムを実行
する。第1のRAM114上でプログラムを実行中に、
CPU111は、前述したようにCPUの空き時間を利
用してフラッシュEEPROM113の一括消去,第1
のRAM114の第1エリアの内容(書き換え用プログ
ラム)をフラッシュEEPROM113へコピーする処
理を行う。そして、コピー処理が完了すると、CPU1
11は、ジャンプ先のアドレスを〔(現在実行中のアド
レス)+(フラッシュEEPROM113とRAM11
4とのアドレスのオフセット量)+1〕としたジャンプ
命令を実行し、制御をフラッシュEEPROM113へ
移す。これにより、第1のRAM114上で実行してい
たプログラムが、引き続きフラッシュEEPROM11
3上で実行される。
As a result, the CPU 111 causes the first RA
The program loaded in the first area of M114 is executed. While executing the program on the first RAM 114,
As described above, the CPU 111 uses the idle time of the CPU to collectively erase the flash EEPROM 113.
The contents of the first area (rewriting program) of the RAM 114 are copied to the flash EEPROM 113. Then, when the copy process is completed, the CPU 1
11 is the address of the jump destination [(address currently being executed) + (flash EEPROM 113 and RAM 11
Then, a jump instruction with an address offset amount of 4) +1] is executed, and control is transferred to the flash EEPROM 113. As a result, the program running on the first RAM 114 continues to run on the flash EEPROM 11
Run on three.

【0049】[0049]

【発明の効果】以上説明したように本発明は、RAMに
プログラムをロードした後、直ちにそのプログラムの制
御を移すようにし、不揮発性メモリへのプログラムの書
き込みはプログラムの実行中に行うようにしているた
め、不揮発性メモリへのプログラムの書き込みが完了し
た後に制御を不揮発性メモリに書き込まれたプログラム
に移す従来の技術に比較して、RAMにプログラムをロ
ードしてからそのプログラムを実行するまでの時間を短
縮することができる効果がある。
As described above, according to the present invention, the control of the program is immediately transferred after the program is loaded into the RAM, and the writing of the program to the non-volatile memory is performed during the execution of the program. Therefore, as compared with the conventional technique in which the control is transferred to the program written in the nonvolatile memory after the writing of the program in the nonvolatile memory is completed, the process from loading the program in RAM to executing the program There is an effect that the time can be shortened.

【0050】また、本発明は、RAMにロードされたプ
ログラムの不揮発性メモリへのコピーは、CPUの空き
時間に行うものであるので、コンピュータシステムで本
来行うべき処理を効率的に行える効果もある。
Further, according to the present invention, the copying of the program loaded in the RAM to the non-volatile memory is performed during the idle time of the CPU, so that there is an effect that the processing originally intended for the computer system can be efficiently performed. .

【0051】更に、本発明は、プログラムがロードされ
るRAMと不揮発性メモリとを同一アドレスに配置する
ようにしたものであるので、コンピュータシステムのア
ドレス空間を有効に使用することができる効果がある。
Further, according to the present invention, since the RAM into which the program is loaded and the non-volatile memory are arranged at the same address, the address space of the computer system can be effectively used. .

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

【図1】本発明のプログラム書き換え方法を実施するコ
ンピュータシステムの構成例を示したブロック図であ
る。
FIG. 1 is a block diagram showing a configuration example of a computer system that implements a program rewriting method of the present invention.

【図2】図1に示したコンピュータシステム1に於ける
メモリ配置図である。
2 is a memory layout diagram in the computer system 1 shown in FIG. 1. FIG.

【図3】ROM12の内容例を示した図である。FIG. 3 is a diagram showing an example of contents of a ROM 12.

【図4】第1のRAM14の第2エリアの内容例を示し
た図である。
FIG. 4 is a diagram showing an example of contents of a second area of the first RAM 14.

【図5】プログラム書き換え時に於けるコンピュータシ
ステム1の処理例を示す流れ図である。
FIG. 5 is a flowchart showing a processing example of the computer system 1 when rewriting a program.

【図6】フラッシュEEPROM13の内容を一括消
し、更にRAM14の第1エリアの内容をフラッシュE
EPROM13にコピーする際のコンピュータシステム
1の処理例を示す流れ図である。
FIG. 6 is a block diagram showing the contents of a first area of the RAM 14 which are erased in a flash EEPROM.
6 is a flowchart showing a processing example of the computer system 1 when copying to the EPROM 13.

【図7】本発明のプログラム書き換え方法を実施するコ
ンピュータシステムの他の構成例を示したブロック図で
ある。
FIG. 7 is a block diagram showing another configuration example of a computer system that implements the program rewriting method of the present invention.

【図8】図7に示したコンピュータシステム100に於
けるメモリ配置図である。
8 is a memory layout diagram in the computer system 100 shown in FIG. 7. FIG.

【図9】ROM112の内容例を示した図である。FIG. 9 is a diagram showing an example of contents of a ROM 112.

【図10】第1のRAM114の第2エリアの内容例を
示した図である。
FIG. 10 is a diagram showing an example of contents of a second area of the first RAM 114.

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

1…コンピュータシステム 11…CPU 12…ROM 13…フラッシュEEPROM 14…第1のRAM 15…第2のRAM 16…メモリアクセス制御回路 16a…並列出力回路 17…デコーダ 18…通信用LSI 2…外部システム 3…伝送路 100…コンピュータシステム 111…CPU 112…ROM 113…フラッシュEEPROM 114…第1のRAM 115…第2のRAM 117…デコーダ 118…通信用LSI DESCRIPTION OF SYMBOLS 1 ... Computer system 11 ... CPU 12 ... ROM 13 ... Flash EEPROM 14 ... First RAM 15 ... Second RAM 16 ... Memory access control circuit 16a ... Parallel output circuit 17 ... Decoder 18 ... Communication LSI 2 ... External system 3 ... Transmission path 100 ... Computer system 111 ... CPU 112 ... ROM 113 ... Flash EEPROM 114 ... First RAM 115 ... Second RAM 117 ... Decoder 118 ... Communication LSI

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 CPUが実行するプログラムを格納した
電気的に書き換え可能な不揮発性メモリと、該不揮発性
メモリに格納するプログラムがロードされるRAMとを
備えたコンピュータシステムに於けるプログラム書き換
え方法に於いて、 前記不揮発性メモリに格納するプログラムを前記RAM
にロードした後、前記RAMにロードされたプログラム
に制御を移し、 前記RAMにロードされたプログラムの実行中に、前記
不揮発性メモリの内容を消去する処理及び前記RAMに
ロードされたプログラムを前記不揮発性メモリにコピー
する処理を順次実行し、 コピー完了後、前記不揮発性メモリに格納されているプ
ログラムに制御を移すことを特徴とするプログラム書き
換え方法。
1. A program rewriting method in a computer system comprising an electrically rewritable non-volatile memory storing a program executed by a CPU, and a RAM loaded with the program stored in the non-volatile memory. Where the program stored in the non-volatile memory is stored in the RAM
The program loaded in the RAM, control is transferred to the program loaded in the RAM, and the program loaded in the RAM is erased while the program loaded in the RAM is being executed. Rewriting method, characterized in that a process of copying to a non-volatile memory is sequentially executed, and after the copying is completed, control is transferred to the program stored in the non-volatile memory.
【請求項2】 前記RAMにロードされたプログラムの
前記不揮発性メモリへのコピーは、前記CPUの空き時
間に行うことを特徴とする請求項1記載のプログラム書
き換え方法。
2. The program rewriting method according to claim 1, wherein the program loaded in the RAM is copied to the non-volatile memory in a free time of the CPU.
【請求項3】 前記RAMと前記不揮発性メモリとを同
一アドレスに配置し、 前記RAMへのプログラムのロード時には、前記RAM
に対する書き込みを許可すると共に前記不揮発性メモリ
に対する書き込みを禁止し、 前記RAMにロードされたプログラムの実行時には、前
記RAMからの読み出しを許可すると共に前記不揮発性
メモリからの読み出しを禁止し、 前記不揮発性メモリに格納されたプログラムの実行時に
は、前記RAMからの読み出しを禁止すると共に前記不
揮発性メモリからの読み出しを許可することを特徴とす
る請求項2記載のプログラム書き換え方法。
3. The RAM and the non-volatile memory are arranged at the same address, and when the program is loaded into the RAM, the RAM
Write to the non-volatile memory is prohibited and write to the non-volatile memory is prohibited. When the program loaded in the RAM is executed, read from the RAM is prohibited and read from the non-volatile memory is prohibited. 3. The program rewriting method according to claim 2, wherein when the program stored in the memory is executed, reading from the RAM is prohibited and reading from the non-volatile memory is permitted.
JP33111895A 1995-11-27 1995-11-27 Method for reloading program Pending JPH09146767A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP33111895A JPH09146767A (en) 1995-11-27 1995-11-27 Method for reloading program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP33111895A JPH09146767A (en) 1995-11-27 1995-11-27 Method for reloading program

Publications (1)

Publication Number Publication Date
JPH09146767A true JPH09146767A (en) 1997-06-06

Family

ID=18240073

Family Applications (1)

Application Number Title Priority Date Filing Date
JP33111895A Pending JPH09146767A (en) 1995-11-27 1995-11-27 Method for reloading program

Country Status (1)

Country Link
JP (1) JPH09146767A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003303112A (en) * 2002-04-10 2003-10-24 Daikin Ind Ltd Equipment management device and equipment management system
JP2007039206A (en) * 2005-08-03 2007-02-15 Hitachi Building Systems Co Ltd Elevator control system
JP2008077474A (en) * 2006-09-22 2008-04-03 Kyocera Mita Corp Firmware update method, electronic device and firmware update program
JP2008084291A (en) * 2006-08-28 2008-04-10 Fujitsu Ltd Storage apparatus, control method, and control device
JP2009080534A (en) * 2007-09-25 2009-04-16 Funai Electric Co Ltd Embedded system, update data updating method for embedded system, and recording/reproduction device
JP2009151384A (en) * 2007-12-18 2009-07-09 Ricoh Co Ltd Recovery control device, control method, program and computer-readable storage medium
US8406059B2 (en) 2009-12-24 2013-03-26 Samsung Electronics Co., Ltd. Nonvolatile semiconductor memory devices, data updating methods thereof, and nonvolatile semiconductor memory systems

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003303112A (en) * 2002-04-10 2003-10-24 Daikin Ind Ltd Equipment management device and equipment management system
JP2007039206A (en) * 2005-08-03 2007-02-15 Hitachi Building Systems Co Ltd Elevator control system
JP2008084291A (en) * 2006-08-28 2008-04-10 Fujitsu Ltd Storage apparatus, control method, and control device
JP2008077474A (en) * 2006-09-22 2008-04-03 Kyocera Mita Corp Firmware update method, electronic device and firmware update program
JP2009080534A (en) * 2007-09-25 2009-04-16 Funai Electric Co Ltd Embedded system, update data updating method for embedded system, and recording/reproduction device
JP2009151384A (en) * 2007-12-18 2009-07-09 Ricoh Co Ltd Recovery control device, control method, program and computer-readable storage medium
US8406059B2 (en) 2009-12-24 2013-03-26 Samsung Electronics Co., Ltd. Nonvolatile semiconductor memory devices, data updating methods thereof, and nonvolatile semiconductor memory systems

Similar Documents

Publication Publication Date Title
US5519847A (en) Method of pipelining sequential writes in a flash memory
US5937424A (en) Method and apparatus for suspending the writing of a nonvolatile semiconductor memory with program suspend command
JP3292864B2 (en) Data processing device
JP3171901B2 (en) Rewriting method of nonvolatile memory card
KR100265266B1 (en) Microcomputer comprsing flash eeprom and method of erasing flash eeprom
KR20010026600A (en) A real-time processing method of a flash-memory
JPH1050078A (en) Erasing method and program protecting method and device for electrically erasable and programmable read only memory
JP3830867B2 (en) Single-chip microcomputer and its boot area switching method
JPH09146767A (en) Method for reloading program
JP3152535B2 (en) Data processing device
US7590793B2 (en) Data access controlling method in flash memory and data access controlling program
JP2000163268A (en) Computer
KR100223844B1 (en) Option circuit
KR100310486B1 (en) Microcumputer
TW567412B (en) Method and apparatus to provide real-time access to flash memory features
JP4958201B2 (en) Microcomputer
JPH09146774A (en) Personal computer system
JP2008181596A (en) Semiconductor storage device
JPH07261997A (en) Flash rom management system
JP2000276461A (en) Microcomputer
JPS61245255A (en) Nonvolatile memory device
JP3669625B2 (en) Data processing system and method of operating data processing system
JPH11242889A (en) Non-volatile semiconductor storage device and its erasing method
JPH0261896A (en) Electrically erasable programmable read only memory
JPH1055278A (en) Memory mixed microcomputer