JP2004240717A - Software updating device - Google Patents

Software updating device Download PDF

Info

Publication number
JP2004240717A
JP2004240717A JP2003029191A JP2003029191A JP2004240717A JP 2004240717 A JP2004240717 A JP 2004240717A JP 2003029191 A JP2003029191 A JP 2003029191A JP 2003029191 A JP2003029191 A JP 2003029191A JP 2004240717 A JP2004240717 A JP 2004240717A
Authority
JP
Japan
Prior art keywords
memory
cpu
software
conversion table
memory block
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
JP2003029191A
Other languages
Japanese (ja)
Inventor
Satoshi Matsushita
敏 松下
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.)
Kawasaki Microelectronics Inc
Original Assignee
Kawasaki Microelectronics Inc
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 Kawasaki Microelectronics Inc filed Critical Kawasaki Microelectronics Inc
Priority to JP2003029191A priority Critical patent/JP2004240717A/en
Publication of JP2004240717A publication Critical patent/JP2004240717A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a software updating device capable of instantaneously updating software for controlling the operation of electronic equipment without stopping the original function of the electronic equipment. <P>SOLUTION: This semiconductor memory is provided with at least one first memory block in which software to be executed is stored and at least one second memory block in which software for update is stored. A comparator compares the address signal of a CPU with the contents of a conversion table to detect a timing when the software to be executed is not used according to instruction information stored in a register. A rewriting circuit changes the contents of the conversion table in order to exchange at least one first memory block with at least one second memory block according to the instruction information stored in the register. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、ソフトウェアの内容を瞬時に更新することができるソフトウェア更新装置に関するものである。
【0002】
【従来の技術】
電子機器の動作を制御するソフトウェアは、例えばファームウェアとしてフラッシュメモリ等の不揮発性メモリに書き込まれ、CPU(中央演算装置)のメモリ空間内の一部に配置されて使用される場合がある。
【0003】
この場合、不揮発性メモリに書き込まれたソフトウェアの内容を更新する際には、電子機器本来の動作、すなわち不揮発性メモリに書き込まれたソフトウェアの実行を一時的に停止させてからその内容を書き換えた後、さらにリセットや再起動を経て電子機器本来の機能を復旧させるといった手順をとる必要があった。これは、書き換え中のプログラムコードがCPUにより誤って実行されるのを防止するためである。
【0004】
しかし、リアルタイム性が求められたり、一時的な停止さえも許されない電子機器については、上記の手順を適用することができず、ソフトウェアの更新を行うのが困難であるという問題があった。
【0005】
【発明が解決しようとする課題】
本発明の目的は、前記従来技術に基づく問題点を解消し、電子機器本来の機能を停止させることなく、電子機器の動作を制御するソフトウェアを瞬時に更新することができるソフトウェア更新装置を提供することにある。
【0006】
【課題を解決するための手段】
上記目的を達成するために、本発明は、CPUのメモリ空間と半導体メモリのメモリ空間との間の対応付けの情報が記憶された変換テーブルと、この変換テーブルの内容に従って、前記CPUのメモリ空間と前記半導体メモリのメモリ空間との間のアドレス変換を行うアドレス変換回路と、前記変換テーブルの内容を書き換える指示情報を保持するレジスタと、このレジスタに保持された指示情報に従い、前記CPUのアドレス信号と前記変換テーブルの内容とを比較して実行対象のソフトウェアが使用されていないタイミングを検出し、前記変換テーブルの内容を書き換えるように指示を出すコンパレータと、このコンパレータの指示に従って前記変換テーブルの内容を変更する書換回路とを備え、
前記半導体メモリは、前記実行対象のソフトウェアが記憶される少なくとも1つの第1のメモリブロックと、更新用のソフトウェアが記憶される少なくとも1つの第2のメモリブロックとからなり、
前記書換回路は、前記レジスタに保持された指示情報に従って、前記半導体メモリの少なくとも1つの第1のメモリブロックと少なくとも1つの第2のメモリブロックとを入れ換えるように前記変換テーブルの内容を変更することを特徴とするソフトウェア更新装置を提供するものである。
【0007】
【発明の実施の形態】
以下に、添付の図面に示す好適実施形態に基づいて、本発明のソフトウェア更新装置を詳細に説明する。
【0008】
図1は、本発明のソフトウェア更新装置を適用する電子機器の一実施形態の構成概略図である。同図に示す電子機器10は、CPU(中央演算装置)12と、アドレスデコーダ14と、フラッシュメモリ16と、SRAM(スタティックラム)18とを備えている。CPU12とアドレスデコーダ14とはCPUバス20を介して接続され、アドレスデコーダ14とフラッシュメモリ16およびSRAM18とはメモリバス22を介して接続されている。
【0009】
ここで、フラッシュメモリ16はファームウェアであり、電子機器10の固定的な動作を制御する基本プログラムを記憶する。また、SRAM18は、CPU12の動作を制御するアプリケーションプログラムを記憶したり、CPU12が動作する際の作業領域として使用される。フラッシュメモリ16およびSRAM18のメモリ空間はCPU12のメモリ空間内の所定位置に配置され、CPU12は、フラッシュメモリ16およびSRAM18に記憶されているプログラムを読み出し、読み出したプログラムに従って動作する。
【0010】
アドレスデコーダ14は、本発明のソフトウェア更新装置の一例であり、CPU12の論理的なメモリ空間とフラッシュメモリ16およびSRAM18の物理的なメモリ空間との間のアドレス変換を行う機能を持つ。図示例のアドレスデコーダ14は、それぞれCPUバス20およびメモリバス22を駆動するバスドライバ24,26と、アドレス変換回路28と、変換テーブル30と、書換回路32と、コンパレータ34と、レジスタ36とを備えている。
【0011】
バスドライバ24は、CPUバス20、アドレス変換回路28およびコンパレータ34とそれぞれ相互に接続され、バスドライバ26は、メモリバス22およびアドレス変換回路28とそれぞれ相互に接続されている。また、アドレス変換回路28は変換テーブル30と相互に接続され、変換テーブル30はコンパレータ34と相互に接続され、コンパレータ34はレジスタ36と相互に接続されている。また、コンパレータ34の出力は書換回路32に入力され、書換回路32の出力は、図示を省略しているが、変換テーブル30に入力されている。
【0012】
ここで、変換テーブル30は、CPU12の論理的なメモリ空間とフラッシュメモリ16およびSRAM18の物理的なメモリ空間との間の対応付けを行う情報が記憶されたテーブルである。
【0013】
アドレス変換回路28は、変換テーブル30の内容に従って、CPU12の論理的なメモリ空間とフラッシュメモリ16およびSRAM18の物理的なメモリ空間との間のアドレス変換を行う。CPU12から出力されるアドレス信号は、CPUバス20およびバスドライバ24を介してアドレス変換回路28に入力され、アドレス変換回路28によって変換された後、バスドライバ26およびメモリバス22を介してフラッシュメモリ16およびSRAM18に入力される。
【0014】
また、レジスタ36は、変換テーブル30の内容を書き換えるための指示情報を保持する。この指示情報は、後述するように、実行対象のどのメモリブロックと更新用のどのメモリブロックとを入れ換えるのかという情報である。図示を省略しているが、レジスタ36には、例えばCPU12から指示情報が書き込まれる。
【0015】
コンパレータ34は、レジスタ36に指示情報が書き込まれると、この指示情報に従って、バスドライバ24を介して入力されるCPU12のアドレス信号と変換テーブル30に記憶されているテーブルの内容とを比較し、実行対象のソフトウェアが使用されていないタイミングを検出して、書換回路32に対し、レジスタ36の指示情報に従って変換テーブル30の内容を書き換えるように指示を出す。
【0016】
書換回路32は、コンパレータ34からの指示により、レジスタ36の指示情報に従って変換テーブル30の内容を書き換える。
【0017】
次に、図2に示す一例を挙げて、フラッシュメモリ16に記憶されているソフトウェアの更新を行う場合の電子機器10の動作を説明する。
【0018】
図2は、CPUのメモリ空間とフラッシュメモリのメモリ空間との対応関係を表す一実施形態の概念図である。図中左側は、更新前のメモリ空間の対応関係を表し、右側は、更新後のメモリ空間の対応関係を表す。ここで、CPU12のメモリ空間において、メモリブロックi〜i+3は実行対象のプログラムが記憶されるメモリブロックであり、メモリブロックj〜j+3は、更新用のプログラムが記憶される予備のメモリブロックである。
【0019】
実行対象のプログラムが記憶されるメモリブロックは、CPU12によりアクセスされ、記憶されているプログラムが読み出されて実行される、現在使用中のプログラムが記憶されるメモリブロックである。これに対し、更新用のプログラムが記憶される予備のメモリブロックは、実行対象のメモリブロックに記憶されているプログラムと入れ換えられる、更新用のプログラムが記憶されるメモリブロックである。
【0020】
まず、図2の左側に示すように、更新前のCPU12のメモリ空間では、メモリブロックi〜i+3にそれぞれコードA,B,C,Dが記憶され、メモリブロックj、j+1にはそれぞれ新コードA,新コードCが記憶されている。この場合、変換テーブル30には、CPU12のメモリブロックi〜i+3がそれぞれフラッシュメモリ16のメモリブロックi〜i+3に対応し、CPU12のメモリブロックj〜j+3がそれぞれフラッシュメモリ16のメモリブロックj〜j+3に対応するという情報が記憶されている。
【0021】
これに対し、図2の右側に示すように、更新後のCPU12のメモリ空間では、メモリブロックi〜i+3にそれぞれ新コードA,コードB,新コードC,コードDが記憶され、メモリブロックj、j+1にはそれぞれコードA,コードCが記憶されている。この場合、変換テーブル30には、CPU12のメモリブロックi〜i+3がそれぞれフラッシュメモリ16のメモリブロックj、i+1,j+1,i+3に対応し、CPU12のメモリブロックj〜j+3がそれぞれフラッシュメモリ16のメモリブロックi、i+2,j+2,j+3に対応するという情報が記憶されている。
【0022】
すなわち、CPU12が、メモリブロックi、i+2内のメモリアドレスにアクセスすると、実際にはフラッシュメモリ16のメモリブロックj、j+1内の対応するメモリアドレスにアクセスされる。また、これとは逆に、CPU12が、メモリブロックj、j+1内のメモリアドレスにアクセスすると、実際にはフラッシュメモリ16のメモリブロックi、i+2内の対応するメモリアドレスにアクセスされる。
【0023】
なお、コードA,B,C,Dは、実行対象のコードであり、新コードA,Cは、それぞれコードA,Cと入れ換えられる更新用の新規コードである。また、コードA,B,C,Dおよび新コードA,Cは、それぞれ機能的に独立して動作するプログラムであり、例えばCPU12がコードB,C,Dのプログラムを実行している間は、コードAのプログラムを新コードAのプログラムに更新する(入れ換える)ことが可能である。
【0024】
ソフトウェアの更新を行う場合、CPU12により、ソフトウェア更新プログラムに従って、フラッシュメモリ16の予備のメモリブロックに更新用のプログラムの書き込みが行われる。本実施形態では、図2の左側に示すように、フラッシュメモリ16のメモリブロックjに新コードAが書き込まれ、フラッシュメモリ16のメモリブロックj+1に新コードCが書き込まれる。
【0025】
この更新用の新規コードの書き込みは、実行対象のプログラムが格納されているメモリブロックi〜i+3の内容を変更するものではないため、電子機器10本来の機能を停止させることなく実施することが可能である。なお、ソフトウェア更新プログラムは、例えばフラッシュメモリ16に記憶されているものを使用してもよいし、あるいは外部の記憶装置等からSRAM18に読み込まれたものを使用してもよい。
【0026】
新規コードの書き込みが終了すると、CPU12からレジスタ36に対して、フラッシュメモリ16のメモリブロックi〜i+3のうちのどのメモリブロックと、予備のメモリブロックj〜j+3のうちのどのメモリブロックとを入れ換えるのかを指示する情報が書き込まれる。本実施形態では、メモリブロックiとメモリブロックjとを入れ換え、かつメモリブロックi+2とメモリブロックj+1とを入れ換えるよう指示する情報が書き込まれる。
【0027】
レジスタ36に指示情報が書き込まれると、この指示情報に従ってコンパレータ34が動作を開始する。コンパレータ34は、変換テーブル30の内容を参照して、CPU12のメモリブロックi、i+2とフラッシュメモリ16のメモリブロックi、i+2とが対応していることを認識し、CPU12のアドレス信号をモニタして、CPU12がメモリブロックi、i+2内のメモリアドレスをアクセスしているかどうかを検出する。
【0028】
コンパレータ34により、CPU12がメモリブロックi、i+2内のメモリアドレスをアクセスしていないことが検出されると、コンパレータ34から書換回路32に対し、レジスタ36の指示情報に従って変換テーブル30の内容を書き換えるように指示する信号が与えられる。
【0029】
書換回路32は、コンパレータ34から指示を受け取ると、レジスタ36に保持されている指示情報に従って変換テーブル30の内容を書き換える。本実施形態では、図2の右側に示すように、CPU12のメモリブロックi、i+2とフラッシュメモリ16のメモリブロックj、j+1とが対応付けされ、CPU12のメモリブロックj、j+1とフラッシュメモリ16のメモリブロックi、i+2とが対応付けされるように変換テーブル30の内容が書き換えられる。
【0030】
アドレス変換回路28は、変更後の変換テーブル30の内容に従ってCPU12のメモリ空間を変換する。本実施形態の場合、CPU12がメモリブロックi内のメモリアドレスをアクセスした場合、フラッシュメモリ16のメモリブロックj内の対応するメモリアドレスに変換し、CPU12がメモリブロックi+2内のメモリアドレスをアクセスした場合、フラッシュメモリ16のメモリブロックj+1内の対応するメモリアドレスに変換する。
【0031】
これにより、CPU12から見ると、フラッシュメモリ16のメモリブロックi、i+2の内容がメモリブロックj、j+1の内容に瞬時に変更されたように見える。このため、電子機器10本来の動作を停止させることなく、フラッシュメモリ16に記憶されているソフトウェアの更新を瞬時に行うことができる。
【0032】
なお、フラッシュメモリ16やSRAM18に限定されず、従来公知のどのような半導体メモリを用いてもよい。また、半導体メモリは、実行対象のソフトウェアが記憶される少なくとも1つのメモリブロックと、更新用のソフトウェアが記憶される少なくとも1つのメモリブロックとを備えていればよい。また、本発明のソフトウェア更新装置は、ファームウェアに限定されるわけではなく、どのようなソフトウェアの更新にも適用可能である。
【0033】
本発明は、基本的に以上のようなものである。
以上、本発明のソフトウェア更新装置について詳細に説明したが、本発明は上記実施形態に限定されず、本発明の主旨を逸脱しない範囲において、種々の改良や変更をしてもよいのはもちろんである。
【0034】
【発明の効果】
以上詳細に説明した様に、本発明のソフトウェア更新装置は、コンパレータにより、レジスタに保持された指示情報に従い、CPUのアドレス信号と変換テーブルの内容とを比較して実行対象のソフトウェアが使用されていないタイミングを検出し、書換回路により、レジスタに保持された指示情報に従って、半導体メモリの少なくとも1つの第1のメモリブロックと少なくとも1つの第2のメモリブロックとを入れ換えるように変換テーブルの内容を変更するものである。
これにより、本発明のソフトウェア更新装置によれば、電子機器本来の機能を停止させることなく、電子機器の動作を制御するソフトウェアを瞬時に更新することができる。
【図面の簡単な説明】
【図1】本発明のソフトウェア更新装置を適用する電子機器の一実施形態の構成概略図である。
【図2】CPUのメモリ空間を表す一実施形態の概念図である。
【符号の説明】
10 電子機器
12 CPU
14 アドレスデコーダ
16 フラッシュメモリ
18 SRAM
20 CPUバス
22 メモリバス
24,26 バスドライバ
28 アドレス変換回路
30 変換テーブル
32 書換回路
34 コンパレータ
36 レジスタ
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a software update device that can instantly update the contents of software.
[0002]
[Prior art]
The software for controlling the operation of the electronic device is written in a nonvolatile memory such as a flash memory as firmware, for example, and is sometimes used by being arranged in a part of a memory space of a CPU (Central Processing Unit).
[0003]
In this case, when updating the content of the software written in the nonvolatile memory, the original operation of the electronic device, that is, the execution of the software written in the nonvolatile memory is temporarily stopped and then the content is rewritten. Thereafter, it was necessary to take a procedure of restoring the original functions of the electronic device through a reset and a restart. This is to prevent the program code being rewritten from being erroneously executed by the CPU.
[0004]
However, there is a problem that the above procedure cannot be applied to an electronic device that requires real-time properties or that cannot be temporarily stopped, and it is difficult to update software.
[0005]
[Problems to be solved by the invention]
SUMMARY OF THE INVENTION An object of the present invention is to provide a software updating apparatus which solves the problems based on the conventional technology and can instantaneously update software for controlling the operation of an electronic device without stopping the original functions of the electronic device. It is in.
[0006]
[Means for Solving the Problems]
In order to achieve the above object, the present invention provides a conversion table in which information of correspondence between a memory space of a CPU and a memory space of a semiconductor memory is stored; An address conversion circuit for performing address conversion between the memory space of the semiconductor memory and a register holding instruction information for rewriting the contents of the conversion table; and an address signal of the CPU according to the instruction information held in the register. And a comparator that compares the content of the conversion table with the content of the conversion table to detect timing when the software to be executed is not used, and issues an instruction to rewrite the content of the conversion table, and the content of the conversion table according to the instruction of the comparator. And a rewriting circuit for changing
The semiconductor memory includes at least one first memory block storing the execution target software and at least one second memory block storing update software,
The rewriting circuit changes contents of the conversion table so as to replace at least one first memory block and at least one second memory block of the semiconductor memory according to the instruction information held in the register. And a software updating apparatus characterized by the following.
[0007]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, a software update device of the present invention will be described in detail based on a preferred embodiment shown in the accompanying drawings.
[0008]
FIG. 1 is a schematic configuration diagram of an embodiment of an electronic device to which a software update device of the present invention is applied. The electronic device 10 shown in FIG. 1 includes a CPU (Central Processing Unit) 12, an address decoder 14, a flash memory 16, and an SRAM (Static RAM) 18. The CPU 12 and the address decoder 14 are connected via a CPU bus 20, and the address decoder 14 and the flash memory 16 and the SRAM 18 are connected via a memory bus 22.
[0009]
Here, the flash memory 16 is firmware, and stores a basic program for controlling a fixed operation of the electronic device 10. The SRAM 18 stores an application program for controlling the operation of the CPU 12 and is used as a work area when the CPU 12 operates. The memory space of the flash memory 16 and the SRAM 18 is arranged at a predetermined position in the memory space of the CPU 12, and the CPU 12 reads a program stored in the flash memory 16 and the SRAM 18, and operates according to the read program.
[0010]
The address decoder 14 is an example of the software update device of the present invention, and has a function of performing address conversion between a logical memory space of the CPU 12 and a physical memory space of the flash memory 16 and the SRAM 18. The illustrated address decoder 14 includes bus drivers 24 and 26 for driving the CPU bus 20 and the memory bus 22, an address conversion circuit 28, a conversion table 30, a rewrite circuit 32, a comparator 34, and a register 36, respectively. Have.
[0011]
The bus driver 24 is mutually connected to the CPU bus 20, the address conversion circuit 28, and the comparator 34, and the bus driver 26 is mutually connected to the memory bus 22 and the address conversion circuit 28, respectively. Further, the address conversion circuit 28 is mutually connected to the conversion table 30, and the conversion table 30 is mutually connected to the comparator 34, and the comparator 34 is mutually connected to the register 36. The output of the comparator 34 is input to the rewriting circuit 32, and the output of the rewriting circuit 32 is input to the conversion table 30, although not shown.
[0012]
Here, the conversion table 30 is a table in which information for associating the logical memory space of the CPU 12 with the physical memory spaces of the flash memory 16 and the SRAM 18 is stored.
[0013]
The address conversion circuit 28 performs address conversion between the logical memory space of the CPU 12 and the physical memory spaces of the flash memory 16 and the SRAM 18 according to the contents of the conversion table 30. The address signal output from the CPU 12 is input to an address conversion circuit 28 via a CPU bus 20 and a bus driver 24, is converted by the address conversion circuit 28, and then is transferred to the flash memory 16 via a bus driver 26 and a memory bus 22. And input to the SRAM 18.
[0014]
The register 36 holds instruction information for rewriting the contents of the conversion table 30. This instruction information is information as to which memory block to be executed is to be replaced with which memory block for updating, as described later. Although not shown, instruction information is written in the register 36 from, for example, the CPU 12.
[0015]
When the instruction information is written into the register 36, the comparator 34 compares the address signal of the CPU 12 input via the bus driver 24 with the contents of the table stored in the conversion table 30 according to the instruction information, and executes The timing at which the target software is not used is detected, and the rewriting circuit 32 is instructed to rewrite the contents of the conversion table 30 in accordance with the instruction information of the register 36.
[0016]
The rewriting circuit 32 rewrites the contents of the conversion table 30 according to the instruction information of the register 36 according to the instruction from the comparator 34.
[0017]
Next, the operation of the electronic device 10 when updating the software stored in the flash memory 16 will be described with reference to an example shown in FIG.
[0018]
FIG. 2 is a conceptual diagram of an embodiment showing a correspondence relationship between a memory space of a CPU and a memory space of a flash memory. The left side of the figure represents the correspondence of the memory space before the update, and the right side represents the correspondence of the memory space after the update. Here, in the memory space of the CPU 12, memory blocks i to i + 3 are memory blocks in which a program to be executed is stored, and memory blocks j to j + 3 are spare memory blocks in which a program for updating is stored.
[0019]
The memory block in which the program to be executed is stored is a memory block in which the currently used program is stored, which is accessed by the CPU 12 and the stored program is read and executed. On the other hand, the spare memory block in which the update program is stored is a memory block in which the update program is stored, which is replaced with the program stored in the execution target memory block.
[0020]
First, as shown on the left side of FIG. 2, in the memory space of the CPU 12 before the update, the codes A, B, C, and D are stored in the memory blocks i to i + 3, respectively, and the new codes A are stored in the memory blocks j and j + 1. , New code C is stored. In this case, in the conversion table 30, the memory blocks i to i + 3 of the CPU 12 correspond to the memory blocks i to i + 3 of the flash memory 16, respectively, and the memory blocks j to j + 3 of the CPU 12 correspond to the memory blocks j to j + 3 of the flash memory 16, respectively. Information that corresponds is stored.
[0021]
On the other hand, as shown on the right side of FIG. 2, in the updated memory space of the CPU 12, the new codes A, B, C, and D are stored in the memory blocks i to i + 3, respectively. A code A and a code C are stored in j + 1, respectively. In this case, in the conversion table 30, the memory blocks i to i + 3 of the CPU 12 respectively correspond to the memory blocks j, i + 1, j + 1, i + 3 of the flash memory 16, and the memory blocks j to j + 3 of the CPU 12 correspond to the memory blocks of the flash memory 16, respectively. Information that corresponds to i, i + 2, j + 2, j + 3 is stored.
[0022]
That is, when the CPU 12 accesses a memory address in the memory block i, i + 2, the CPU 12 actually accesses a corresponding memory address in the memory block j, j + 1 of the flash memory 16. Conversely, when the CPU 12 accesses a memory address in the memory block j, j + 1, the CPU 12 actually accesses a corresponding memory address in the memory block i, i + 2 of the flash memory 16.
[0023]
The codes A, B, C, and D are codes to be executed, and the new codes A and C are new codes for updating that are replaced with the codes A and C, respectively. The codes A, B, C, and D and the new codes A and C are programs that operate independently of each other. For example, while the CPU 12 is executing the program of the codes B, C, and D, It is possible to update (replace) the program of code A with the program of new code A.
[0024]
When updating the software, the CPU 12 writes the update program into the spare memory block of the flash memory 16 according to the software update program. In the present embodiment, as shown on the left side of FIG. 2, the new code A is written in the memory block j of the flash memory 16, and the new code C is written in the memory block j + 1 of the flash memory 16.
[0025]
The writing of the new code for updating does not change the contents of the memory blocks i to i + 3 in which the program to be executed is stored, and therefore can be executed without stopping the original functions of the electronic device 10. It is. As the software update program, for example, a program stored in the flash memory 16 may be used, or a program read into the SRAM 18 from an external storage device or the like may be used.
[0026]
When the writing of the new code is completed, the CPU 12 tells the register 36 which of the memory blocks i to i + 3 of the flash memory 16 is to be replaced with which of the spare memory blocks j to j + 3. Is written. In the present embodiment, information for instructing to exchange the memory block i with the memory block j and to exchange the memory block i + 2 with the memory block j + 1 is written.
[0027]
When the instruction information is written into the register 36, the comparator 34 starts operating according to the instruction information. The comparator 34 refers to the contents of the conversion table 30 and recognizes that the memory blocks i and i + 2 of the CPU 12 correspond to the memory blocks i and i + 2 of the flash memory 16 and monitors the address signal of the CPU 12. , CPU 12 accesses memory addresses in memory blocks i and i + 2.
[0028]
When the comparator 34 detects that the CPU 12 has not accessed the memory address in the memory block i, i + 2, the comparator 34 instructs the rewriting circuit 32 to rewrite the contents of the conversion table 30 in accordance with the instruction information of the register 36. Is given.
[0029]
Upon receiving the instruction from the comparator 34, the rewriting circuit 32 rewrites the contents of the conversion table 30 according to the instruction information held in the register 36. In the present embodiment, as shown on the right side of FIG. 2, the memory blocks i and i + 2 of the CPU 12 are associated with the memory blocks j and j + 1 of the flash memory 16, and the memory blocks j and j + 1 of the CPU 12 and the memory The contents of the conversion table 30 are rewritten so that the blocks i and i + 2 are associated with each other.
[0030]
The address conversion circuit 28 converts the memory space of the CPU 12 according to the contents of the changed conversion table 30. In the case of the present embodiment, when the CPU 12 accesses a memory address in the memory block i, the CPU 12 converts the memory address into a corresponding memory address in the memory block j of the flash memory 16, and the CPU 12 accesses a memory address in the memory block i + 2. , To a corresponding memory address in the memory block j + 1 of the flash memory 16.
[0031]
Accordingly, from the viewpoint of the CPU 12, it appears that the contents of the memory blocks i and i + 2 of the flash memory 16 are instantaneously changed to the contents of the memory blocks j and j + 1. Therefore, the software stored in the flash memory 16 can be updated instantaneously without stopping the original operation of the electronic device 10.
[0032]
Note that the present invention is not limited to the flash memory 16 and the SRAM 18, and any conventionally known semiconductor memory may be used. Further, the semiconductor memory only needs to include at least one memory block in which software to be executed is stored and at least one memory block in which software for updating is stored. Further, the software update device of the present invention is not limited to firmware, but can be applied to any software update.
[0033]
The present invention is basically as described above.
As described above, the software updating device of the present invention has been described in detail. However, the present invention is not limited to the above embodiment, and various improvements and changes may be made without departing from the gist of the present invention. is there.
[0034]
【The invention's effect】
As described above in detail, in the software updating apparatus of the present invention, the execution target software is used by comparing the address signal of the CPU with the contents of the conversion table by the comparator according to the instruction information held in the register. The non-existent timing is detected, and the contents of the conversion table are changed by the rewriting circuit so that at least one first memory block and at least one second memory block of the semiconductor memory are replaced according to the instruction information held in the register. Is what you do.
Thus, according to the software updating device of the present invention, the software for controlling the operation of the electronic device can be instantaneously updated without stopping the original function of the electronic device.
[Brief description of the drawings]
FIG. 1 is a schematic configuration diagram of an embodiment of an electronic device to which a software update device of the present invention is applied.
FIG. 2 is a conceptual diagram illustrating an embodiment of a memory space of a CPU.
[Explanation of symbols]
10 Electronic equipment 12 CPU
14 address decoder 16 flash memory 18 SRAM
Reference Signs List 20 CPU bus 22 Memory bus 24, 26 Bus driver 28 Address conversion circuit 30 Conversion table 32 Rewriting circuit 34 Comparator 36 Register

Claims (1)

CPUのメモリ空間と半導体メモリのメモリ空間との間の対応付けの情報が記憶された変換テーブルと、この変換テーブルの内容に従って、前記CPUのメモリ空間と前記半導体メモリのメモリ空間との間のアドレス変換を行うアドレス変換回路と、前記変換テーブルの内容を書き換える指示情報を保持するレジスタと、このレジスタに保持された指示情報に従い、前記CPUのアドレス信号と前記変換テーブルの内容とを比較して実行対象のソフトウェアが使用されていないタイミングを検出し、前記変換テーブルの内容を書き換えるように指示を出すコンパレータと、このコンパレータの指示に従って前記変換テーブルの内容を変更する書換回路とを備え、
前記半導体メモリは、前記実行対象のソフトウェアが記憶される少なくとも1つの第1のメモリブロックと、更新用のソフトウェアが記憶される少なくとも1つの第2のメモリブロックとからなり、
前記書換回路は、前記レジスタに保持された指示情報に従って、前記半導体メモリの少なくとも1つの第1のメモリブロックと少なくとも1つの第2のメモリブロックとを入れ換えるように前記変換テーブルの内容を変更することを特徴とするソフトウェア更新装置。
A conversion table storing information on the correspondence between the memory space of the CPU and the memory space of the semiconductor memory; and an address between the memory space of the CPU and the memory space of the semiconductor memory according to the contents of the conversion table. An address conversion circuit for performing conversion, a register for storing instruction information for rewriting the contents of the conversion table, and comparing the address signal of the CPU with the contents of the conversion table in accordance with the instruction information stored in the register; A comparator that detects timing when the target software is not used, and issues a command to rewrite the content of the conversion table, and a rewriting circuit that changes the content of the conversion table according to the instruction of the comparator,
The semiconductor memory includes at least one first memory block storing the execution target software and at least one second memory block storing update software,
The rewriting circuit changes contents of the conversion table so as to replace at least one first memory block and at least one second memory block of the semiconductor memory according to the instruction information held in the register. A software update device characterized by the above-mentioned.
JP2003029191A 2003-02-06 2003-02-06 Software updating device Pending JP2004240717A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003029191A JP2004240717A (en) 2003-02-06 2003-02-06 Software updating device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003029191A JP2004240717A (en) 2003-02-06 2003-02-06 Software updating device

Publications (1)

Publication Number Publication Date
JP2004240717A true JP2004240717A (en) 2004-08-26

Family

ID=32956430

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003029191A Pending JP2004240717A (en) 2003-02-06 2003-02-06 Software updating device

Country Status (1)

Country Link
JP (1) JP2004240717A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007026416A (en) * 2005-07-12 2007-02-01 Eigyotatsu Kofun Yugenkoshi Update system and method
JP2009048557A (en) * 2007-08-22 2009-03-05 Mitsubishi Electric Corp Data update device, data update method, and data update program
JP2012220990A (en) * 2011-04-04 2012-11-12 Fujitsu Ltd Hypervisor replacing method and information processor

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007026416A (en) * 2005-07-12 2007-02-01 Eigyotatsu Kofun Yugenkoshi Update system and method
JP2009048557A (en) * 2007-08-22 2009-03-05 Mitsubishi Electric Corp Data update device, data update method, and data update program
JP2012220990A (en) * 2011-04-04 2012-11-12 Fujitsu Ltd Hypervisor replacing method and information processor

Similar Documents

Publication Publication Date Title
JP5783809B2 (en) Information processing apparatus, activation method, and program
JP2005071303A (en) Program starting device
JP2875842B2 (en) Programmable controller
US6925522B2 (en) Device and method capable of changing codes of micro-controller
US9223697B2 (en) Computer reprogramming method, data storage medium and motor vehicle computer
JP2004240717A (en) Software updating device
US7107407B2 (en) Arithmetic unit with reduced startup time and method of loading data
JP2001265620A (en) Program debugging system for rom
JP2021515308A (en) Devices and methods for accessing metadata when debugging devices
JP2012022479A (en) Microcontroller and its control method
JP2011164827A (en) Electronic apparatus including flash memory and method for updating program stored in flash memory
JP2009205277A (en) Controller for machine tool
JP2004126658A (en) Processor system
JP2007048090A (en) Nand type flash memory device compatible with sequential rom interface, and controller therefor
JP2009238071A (en) Built-in system
JP2006243810A (en) Microcomputer system
JP3040828U (en) Board computer with ROM
JP2006313421A (en) Microcomputer and debug method
JPH1050086A (en) Microcomputer having eeprom and its rewriting method
JPH1040094A (en) Program controller for firmware
JP2003242046A (en) Information processor, and operational method and program for information processor
JP2011232804A (en) Bios system and pac with the same bios system
JP2008181456A (en) Semiconductor memory device and write control method thereof
JP2002140205A (en) Data processor and method of booting the same
JPH06103056A (en) Address controller

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20051130

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080215

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080617

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20081216