JP4517607B2 - Electronic device and method for updating the program - Google Patents
Electronic device and method for updating the program Download PDFInfo
- Publication number
- JP4517607B2 JP4517607B2 JP2003309260A JP2003309260A JP4517607B2 JP 4517607 B2 JP4517607 B2 JP 4517607B2 JP 2003309260 A JP2003309260 A JP 2003309260A JP 2003309260 A JP2003309260 A JP 2003309260A JP 4517607 B2 JP4517607 B2 JP 4517607B2
- Authority
- JP
- Japan
- Prior art keywords
- file
- program
- initial program
- file name
- stored
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Stored Programmes (AREA)
Description
本発明は、内部メモリに格納されているプログラムに基づき動作する電子機器、及び、そのような電子機器のプログラムを更新するためのプログラム更新方法に関するものである。 The present invention relates to an electronic device that operates based on a program stored in an internal memory, and a program update method for updating a program of such an electronic device.
近年の家庭用電化製品、オフィス機器、携帯電話機等の各種の電子機器は、内部にCPU(Central Processing Unit)等の制御用の回路が設けられており、ROM(Read Only Memory)に格納されているプログラムコードに基づき動作する。 Various electronic devices such as household appliances, office equipment, and cellular phones in recent years are provided with control circuits such as a CPU (Central Processing Unit) and are stored in ROM (Read Only Memory). Operates based on program code.
このようなCPU内蔵の電子機器では、電源をオンした後のシステム起動過程が、比較的小さな実行コード群から構成されているブートローダを実行し、続いて、このブートローダがそのシステムのオペレーションシステムプログラムの初期コードを読み出すといった、段階的な起動動作となっているのが一般的である。 In such an electronic device with a built-in CPU, the system startup process after the power is turned on executes a boot loader composed of a relatively small group of executable codes, and then the boot loader executes the operation system program of the system. In general, it is a step-by-step activation operation such as reading an initial code.
また、近年、コンピュータ等のアプリケーションプログラムと同様に、CPU内蔵の電子機器でも、装置の完成後や出荷後にプログラムコードをアップデートして、その装置の機能拡張や機能補正が行えるようになってきている。 In recent years, as with application programs such as computers, even in electronic devices with a built-in CPU, the program code can be updated after completion of the device or after shipment to expand or correct the function of the device. .
ところで、プログラムコードのアップデートが可能な電子機器の場合、プログラムコードが格納されているメモリ内には、工場出荷時から存在するプログラムファイルに加えて、アップデートを行った回数分のプログラムファイルが格納されている。そのため、このような電子機器に適用されるブートローダには、複数のプログラムファイルのうちから最新バージョンのプログラムファイルを検索する、という検索処理を行わなければならない。 By the way, in the case of an electronic device capable of updating the program code, in the memory where the program code is stored, in addition to the program file existing at the time of shipment from the factory, the program file for the number of times of updating is stored. ing. For this reason, a boot loader applied to such an electronic device must perform a search process of searching for the latest version of a program file from among a plurality of program files.
しかしながら、起動時にこのような検索処理を実行すると、その分起動処理が複雑となり、ブートローダの実行コードが長くなってしまう。
本発明が解決しようとする問題点は、組み込みプログラムのアップデートが可能な電子機器において、起動処理が複雑となってしまう点並びにブートローダの実行コードが大きくなってしまう点である。 The problem to be solved by the present invention is that the startup process becomes complicated and the execution code of the boot loader becomes large in an electronic device capable of updating the embedded program.
そこで、本発明は、組み込みプログラムのアップデートが可能な電子機器において、起動時に実行される初期プログラムのバージョンの意識せずに簡単な起動処理を行い、さらに、ブートローダの実行コードを短くすることが可能な、電子機器及びそのプログラム更新方法を提供することを目的とする。 Therefore, the present invention can perform a simple startup process in an electronic device capable of updating an embedded program without being aware of the version of the initial program executed at startup, and can further shorten the execution code of the boot loader. An object of the present invention is to provide an electronic device and a program update method thereof.
本発明に係る電子機器は、プログラムコードが展開されるワーキングメモリと、ファイルタイトル及びそのファイルの種別を示す拡張子からなる第1のファイル名が付与された第1の初期プログラムファイルと、第1の初期プログラムファイルよりもバージョンの新しい初期プログラムファイルであることを示し、第1のファイル名と拡張子のみが異なる第2のファイル名が付与され、上記第1の初期プログラムファイルよりもバージョンの新しい第2の初期プログラムファイルとが外部からアップデート可能な状態で格納されるプログラムメモリと、上記第2の初期プログラムファイルが上記プログラムメモリに格納されている場合には、当該第2の初期プログラムファイルを上記ワーキングメモリに展開し、上記第2の初期プログラムファイルが上記プログラムメモリに格納されていない場合には、上記第1の初期プログラムファイルに付与されたファイル名を、上記第1のファイル名から拡張子のみを変更することによって上記第2のファイル名に変更した後で、当該ファイル名の変更後の第1の初期プログラムファイルを上記ワーキングメモリに展開した後、展開したプログラムを起動する起動処理を実行するためのブートローダが所定の物理量域に格納されているブートメモリと、上記ブートメモリからブートローダをシステム起動時に読み出す処理と、上記プログラムメモリに上記第2の初期プログラムファイルが格納されている場合に当該第2の初期プログラムファイルをプログラムコードが展開されるワーキングメモリに展開し、上記第2の初期プログラムファイルが上記プログラムメモリに格納されていない場合に上記第1の初期プログラムファイルに付与されたファイル名の拡張子のみを変更することによって上記第1のファイル名から上記第2のファイル名に変更した後で、当該ファイル名の変更後の第1の初期プログラムを上記ワーキングメモリに展開した後、展開した初期プログラムファイルを起動する起動処理と、アップデート時に、アップデート用プログラムが記憶された不揮発性メモリからアップデート用プログラムを読み出し、しかる後、外部から入力された最新バージョンである第3の初期プログラムファイルに対して第3のファイル名を付与した後で、上記第3のファイル名を付与した第3の初期プログラムファイルを上記プログラムメモリに格納し、上記第1の初期プログラムファイルがプログラムメモリに格納されているとき、上記第2の初期プログラムファイルが上記プログラムメモリ内に格納されている場合には、上記第1の初期プログラムファイルを削除し、しかる後、上記第2の初期プログラムファイルに付与されたファイル名を上記第2のファイル名から上記第1のファイル名に、上記第3の初期プログラムファイルに付与されたファイル名を第3のファイル名から第2のファイル名にそれぞれ変更する第1の処理と、上記第1の初期プログラムファイルが上記プログラムメモリ内に格納されているとき、上記第2の初期プログラムファイルが上記プログラムメモリ内に格納されていない場合には、上記第3の初期プログラムファイルに付与された第3のファイル名を上記第2のファイル名に変更する第2の処理と、上記第1の初期プログラムファイルが上記プログラムメモリ内に格納されていないとき、上記第2の初期プログラムファイルが上記プログラムメモリ内に格納されている場合には、上記第2の初期プログラムファイルに付与されたファイル名を上記第2のファイル名から上記第1のファイル名に、上記第3の初期プログラムファイルに付与されたファイル名を、上記第3のファイル名から上記第2のファイル名にそれぞれ変更する第3の処理と、上記第1の初期プログラムファイルが上記プログラムメモリに格納されていないとき、上記第2の初期プログラムファイルが上記プログラムメモリに格納されていない場合には、上記第3の初期プログラムファイルに付与されたファイル名を、上記第3のファイル名から上記第2のファイル名に変更する第4の処理とを含むアップデート処理とを実行するCPUとを備えることを特徴とする。 An electronic apparatus according to the present invention includes a working memory in which a program code is expanded, a first initial program file to which a first file name including a file title and an extension indicating the type of the file is assigned, a first indicates than the initial program file, a new initial program file version, the first file name and the second file name only a different extension is applied, version than the first initial program files A program memory in which a new second initial program file is stored in an updateable state from the outside, and the second initial program file when the second initial program file is stored in the program memory In the working memory and the second initial program file. If there are not stored in the program memory, the file name given to the first initial program file, the second file name by changing only the extension from the first file name Then, after the first initial program file after the change of the file name is expanded in the working memory, a boot loader for executing a startup process for starting the expanded program is stored in a predetermined physical quantity area. Boot memory, a process for reading the boot loader from the boot memory when the system is started, and the program code is expanded when the second initial program file is stored in the program memory. expand the working memory that, the second of the initial program files After There was changed to the second file name from the first file name by changing only the extension of the file name assigned to the first initial program file if not stored in the program memory in, after the first initial program after the change of the file name was developed in the working memory, and start processing you start the initial program extracted files, when updating the non-volatile memory update program is stored After the update program is read out, a third file name is given to the third initial program file which is the latest version inputted from the outside , and then the third file name is given. Are stored in the program memory, and the first initial program file is stored. When the second initial program file is stored in the program memory when the file is stored in the program memory, the first initial program file is deleted, and then the second initial program file is deleted. The file name assigned to the initial program file is changed from the second file name to the first file name, and the file name assigned to the third initial program file is changed from the third file name to the second file name. And when the first initial program file is stored in the program memory and the second initial program file is not stored in the program memory, A second file name is changed from the third file name assigned to the third initial program file to the second file name. And when the second initial program file is stored in the program memory when the first initial program file is not stored in the program memory, the second initial program file From the second file name to the first file name, and from the third file name to the second file name. And when the second initial program file is not stored in the program memory when the first initial program file is not stored in the program memory and the second initial program file is not stored in the program memory. The file name assigned to the initial program file 3 is changed from the third file name to the second file. Characterized in that it comprises a CPU for executing the update process and a fourth process of changing the name.
上記本発明の電子機器に対して、ブートローダにより読み出される初期プログラムのアップデートを行う場合には、新しい初期プログラムファイルをプログラムメモリに格納するとともにその名称を最新バージョンの初期プログラムファイルであることを示した名称とし、並びに、上記プログラムメモリに元々格納されていた最新バージョンの初期プログラムファイルであることを示した名称のファイルを削除又は名称変更する。 When updating the initial program read by the boot loader for the electronic device of the present invention, a new initial program file is stored in the program memory and its name indicates that it is the latest version of the initial program file. A file having a name indicating that it is the latest version of the initial program file originally stored in the program memory is deleted or renamed.
そして、本発明の電子機器のブートローダは、最新バージョンの初期プログラムファイルであることを示した名称のファイルを、上記プログラムメモリから選択してワーキングメモリに展開する処理を行う。 Then, the boot loader of the electronic device according to the present invention performs a process of selecting a file having a name indicating that it is the latest version of the initial program file from the program memory and expanding it to the working memory.
本発明に係るプログラム更新方法は、電子機器に組み込まれているプログラムをバージョンアップするプログラム更新方法において、ファイルタイトル及びそのファイルの種別を示す拡張子からなる第1のファイル名が付与された第1の初期プログラムファイルと、第1の初期プログラムファイルよりもバージョンの新しい初期プログラムファイルであることを示し、第1のファイル名と拡張子のみが異なる第2のファイル名が付与され、上記第1の初期プログラムファイルよりもバージョンの新しい第2の初期プログラムファイルとが外部からアップデート可能な状態で格納されるプログラムメモリに上記第2の初期プログラムファイルが格納されている場合には、当該第2の初期プログラムファイルを上記ワーキングメモリに展開し、上記第2の初期プログラムファイルが上記プログラムメモリに格納されていない場合には、上記第1の初期プログラムファイルに付与されたファイル名を上記第1のファイル名から拡張子のみを変更することによって第2のファイル名に変更した後で、当該ファイル名の変更後の第1の初期プログラムファイルを上記ワーキングメモリに展開した後、展開したプログラムを起動する起動処理を実行するためのブートローダが所定の物理量域に格納されているブートメモリから上記ブートローダをシステム起動時に上記電子機器のCPUが読み出す処理を実行するブートローダ読み出しステップと、上記プログラムメモリに上記第2の初期プログラムファイルが格納されている場合に当該第2の初期プログラムファイルをプログラムコードが展開されるワーキングメモリに展開し、上記第2の初期プログラムファイルが上記プログラムメモリに格納されていない場合に上記第1の初期プログラムファイルに付与されたファイル名の拡張子のみを変更することによって、上記第1のファイル名から上記第2のファイル名に変更した後で、当該ファイル名の変更後の第1の初期プログラムファイルを上記ワーキングメモリに展開した後、展開した初期プログラムファイルを起動する起動処理を上記電子機器のCPUが実行する起動処理実行ステップと、アップデート時にアップデート用プログラムが記憶された不揮発性メモリからアップデート用プログラムを読み出し、しかる後、外部から入力された最新バージョンである第3の初期プログラムファイルに対して第3のファイル名を付与した後で、上記第3のファイル名を付与した第3の初期プログラムファイルを上記プログラムメモリに格納し、上記第1の初期プログラムファイルがプログラムメモリに格納されているとき、上記第2の初期プログラムファイルが上記プログラムメモリに格納されている場合には、上記第1の初期プログラムファイルを削除し、しかる後、上記第2の初期プログラムファイルに付与されたファイル名を上記第2のファイル名から上記第1のファイル名に、上記第3の初期プログラムファイルに付与されたファイル名を、上記第3のファイル名から上記第2のファイル名にそれぞれ変更する第1の処理と、上記第1の初期プログラムファイルが上記プログラムメモリ内に格納されているとき、上記第2の初期プログラムファイルが上記プログラムメモリに格納されていない場合には、上記第3の初期プログラムファイルに付与されたファイル名を上記第3のファイル名から上記第2のファイル名に変更する第2の処理と、上記第1の初期プログラムファイルが上記プログラムメモリ内に格納されていないとき、上記第2の初期プログラムファイルが上記プログラムメモリ内に格納されている場合には、上記第2の初期プログラムファイルに付与されたファイル名を上記第2のファイル名から上記第1のファイル名に、上記第3の初期プログラムファイルに付与されたファイル名を、上記第3のファイル名から上記第2のファイル名にそれぞれ変更する第3の処理と、上記第1の初期プログラムファイルが上記プログラムメモリに格納されていないとき、上記第2の初期プログラムファイルが上記プログラムメモリに格納されていない場合には、上記第3の初期プログラムファイルに付与されたファイル名を上記第3のファイル名から上記第2のファイル名に変更する第4の処理とを含むアップデート処理を上記電子機器のCPUが実行するアップデート処理実行ステップとを含むことを特徴とする。 The program update method according to the present invention is a program update method for upgrading a program incorporated in an electronic device, wherein a first file name including a file title and an extension indicating a type of the file is assigned. an initial program file, that than the first initial program file, a new initial program file version shows, the first file name and the second file name only a different extension is applied, the first When the second initial program file is stored in a program memory in which a second initial program file whose version is newer than the initial program file is stored in an updateable state from the outside, the second initial program file is stored. Extract the initial program file to the above working memory and If the second initial program file is not stored in the program memory, the above-mentioned file name given to the first initial program file by changing only the extension from the first file name 2 After the file name is changed, the first initial program file after the change of the file name is expanded in the working memory, and then a boot loader for executing a startup process for starting the expanded program has a predetermined physical quantity area. A boot loader read step for executing a process for the CPU of the electronic device to read the boot loader from the boot memory stored in the system at the time of system startup, and the second initial program file when the second initial program file is stored in the program memory. Program code expands the initial program file of 2 By expanded in the working memory, the second initial program files to change only the extension of the file name assigned to the first initial program file if not stored in the program memory, the first after changing to the second file name from the first file name, after the first initial program file after the change of the file name was developed in the working memory, start you start the initial program extracted files A startup process execution step in which the CPU of the electronic device executes the process, and an update program is read from the non-volatile memory in which the update program is stored at the time of update, and then the third version which is the latest version input from the outside. A third file name was assigned to the initial program file Later, when the third initial program file assigned with the third file name is stored in the program memory, and the first initial program file is stored in the program memory, the second initial program file is stored. Is stored in the program memory, the first initial program file is deleted, and then the file name assigned to the second initial program file is changed from the second file name to the first file name. A first process for changing the file name assigned to the third initial program file from the third file name to the second file name, and the first initial program. When the file is stored in the program memory, the second initial program file is stored in the program memory. A second process for changing the file name assigned to the third initial program file from the third file name to the second file name; and When the initial program file is not stored in the program memory and the second initial program file is stored in the program memory, the file name given to the second initial program file is The third file name is changed from the second file name to the first file name, and the file name given to the third initial program file is changed from the third file name to the second file name. When the processing and the first initial program file are not stored in the program memory, the second initial program file An update including a fourth process for changing the file name assigned to the third initial program file from the third file name to the second file name if not stored in the program memory And an update process execution step executed by the CPU of the electronic device.
本発明の電子機器では、ブートローダにより読み出される初期プログラムのアップデートが行われる場合には、新しい初期プログラムファイルがプログラムメモリに格納されるとともにその名称が最新バージョンの初期プログラムファイルであることを示した名称とされ、並びに、上記プログラムメモリに元々格納されていた最新バージョンの初期プログラムファイルであることを示した名称のファイルが削除又は名称変更される。 In the electronic device of the present invention, when the initial program read by the boot loader is updated, a new initial program file is stored in the program memory, and the name indicates that the name is the latest version of the initial program file. In addition, the file having the name indicating that it is the latest version of the initial program file originally stored in the program memory is deleted or renamed.
そして、本発明の電子機器では、ブートローダが、最新バージョンの初期プログラムファイルであることを示した名称のファイルを、上記プログラムメモリから選択してワーキングメモリに展開する処理を行う。 In the electronic device of the present invention, the boot loader performs a process of selecting a file having a name indicating that it is the latest version of the initial program file from the program memory and expanding it to the working memory.
このことにより本発明の電子機器では、起動時に実行される初期プログラムのバージョンの意識せずにブートローダが簡単な起動処理を行い、さらに、ブートローダの実行コードを短くすることができる。 As a result, in the electronic device of the present invention, the boot loader can perform a simple start process without being aware of the version of the initial program executed at the time of start, and the execution code of the boot loader can be shortened.
また、本発明のプログラム更新方法では、電子機器に対してブートローダにより読み出される初期プログラムのアップデートを行う場合には、新しい初期プログラムファイルをプログラムメモリに格納するとともにその名称を最新バージョンの初期プログラムファイルであることを示した名称とし、並びに、上記プログラムメモリに元々格納されていた最新バージョンの初期プログラムファイルであることを示した名称のファイルを削除又は名称変更する。 Also, in the program update method of the present invention, when updating an initial program read by a boot loader to an electronic device, a new initial program file is stored in the program memory and its name is the latest version of the initial program file. A file having a name indicating that it is present, and a file having a name indicating that it is the latest version of the initial program file originally stored in the program memory is deleted or renamed.
そのため、上記電子機器のブートローダは、最新バージョンの初期プログラムファイルであることを示した名称のファイルを、上記プログラムメモリから選択してワーキングメモリに展開する処理を行うことが可能となり、このことにより、起動時に実行される初期プログラムのバージョンの意識せずにブートローダが簡単な起動処理を行い、さらに、ブートローダの実行コードを短くすることができる。 Therefore, the boot loader of the electronic device can perform a process of selecting a file having a name indicating that it is the latest version of the initial program file from the program memory and expanding the file to the working memory. The boot loader can perform a simple start process without being aware of the version of the initial program executed at the time of startup, and the execution code of the boot loader can be shortened.
本発明を実施するための最良の形態として、CPU(Central Processing Unit)を内蔵し、このCPUにより電子的な制御がされる電子機器について説明をする。なお、電子機器とは、家庭用電化製品、オフィス機器、オーディオビジュアル機器、携帯電話機、通信機器等の電気的に動作をするあらゆる機器を含んでいる。 As the best mode for carrying out the present invention, an electronic device incorporating a CPU (Central Processing Unit) and electronically controlled by the CPU will be described. Note that electronic devices include all devices that operate electrically, such as household appliances, office devices, audiovisual devices, mobile phones, and communication devices.
図1に、本発明を適用した電子機器10の内部ブロック図を示す。
FIG. 1 shows an internal block diagram of an
電子機器10は、図1に示すように、当該電子機器10内に設けられた電子制御がなされるユニットである電子制御対象部11と、この電子制御対象部11の動作制御及び演算処理を行うCPU12と、CPU12の作業領域となるとともにプログラムコードが展開されるランダムアクセスメモリ(RAM)13とを備えている。CPU12は、RAM13上に展開されたプログラムコードを順次実行してゆき、このプログラムコードに基づき演算処理を行ったり、電子制御対象部11に対して各種制御を行ったりする。電子制御対象部11、CPU12及びRAM13は、第1のバス14上に設けられており、当該第1のバス14を介して相互にデータ転送が行われる。
As shown in FIG. 1, the
また、電子機器10は、不揮発性の書き換え可能なメモリ手段であるフラッシュメモリ15と、不揮発性の書き換え不可能なメモリ手段であるリードオンリーメモリ(ROM)16と、外部からデータの入力がされるデータ入力ポート17とを備えている。フラッシュメモリ15、ROM16及びデータ入力ポート17は、第2のバス18上に設けられており、当該第2のバス17を介して相互にデータ転送が行われる。
The
また、電子機器10は、バスブリッジ19を備えている。バスブリッジ19は、第1のバス14と第2のバス18との間のデータ転送制御を行う。
In addition, the
フラッシュメモリ15には、CPU12が実行処理をする各種の動作プログラムがファイル化されて格納されている。これらの動作プログラムのうち、電源がオンした直後のシステム起動時にCPU12に実行されるプログラムコードが記述されたファイルのことを、ここでは初期プログラムファイル21という。初期プログラムファイル21は、データ入力ポート17を介して外部からアップデートが可能となっている。
The
少なくとも1回のアップデート処理がされた後は、通常の状態であれば、2種類の初期プログラムファイル21がフラッシュメモリ15内に格納される。一つは、最新バージョンのプログラムコードが記述された最新初期プログラムファイル22であり、もう一つは、旧バージョンのプログラムコードが記述された旧初期プログラムファイル23である。ただし、工場出荷時には、フラッシュメモリ15内に最新初期プログラムファイル22のみが格納されていてもよい。
After at least one update process , two types of
また、電子機器10では、フラッシュメモリ15内に格納されるファイルの名称を、ファイルタイトル及びそのファイルの種別を示す拡張子とから構成している。ファイルタイトルと拡張子との間はドットで接続されている。また、電子機器10では、最新初期プログラムファイル22の名称と旧初期プログラムファイル23の名称とを、ファイルタイトルが同一で拡張子のみが異なる形式で管理をしている。例えば、図1に示すように、最新初期プログラムファイル22及び旧初期プログラムファイル23のファイルタイトルをともに「program」とし、最新初期プログラムファイル22の拡張子を「run」とし、旧初期プログラムファイル23の拡張子を「old」として管理している。
In the
また、フラッシュメモリ15には、ブートローダ24がある特定の物理アドレスに格納されている。ブートローダ24は、当該電子機器10のシステム起動時に最新初期プログラムファイル22を読み出して、CPU12が実行可能なようにRAM13上に展開する処理を行う実行コードが記述されているプログラムである。
Further, the
以上のような構成の電子機器10では、ブートローダ24が格納されていることにより、段階的なシステム起動が行われる。すなわち、システム起動時には、ブートローダ24がCPU12により読み出され、CPU12によりブートローダ24の実行がされる。続いて、このブートローダ24の実行に応じてCPU12により最新初期プログラムファイル22が読み出されて、最新初期プログラムファイル22のプログラムコードがRAM13上に展開される。そして、CPU12がRAM13上に展開されたプログラムコードを実行することにより、当該電子機器10の起動動作が完了する。
In the
さらに、以上のような構成の電子機器10では、外部から初期プログラムファイル21のアップデートが可能となっている。アップデート時には、データ入力ポート17から新しいバージョンの初期プログラムファイル21が入力される。そして、入力された初期プログラムファイル21がフラッシュメモリ15上の空き領域に記録されることにより、アップデートが完了する。なお、アップデート処理の主体は、CPU12であっても、外部機器であってもよい。CPU12が行う場合には、例えばROM16内等に格納されているアップデート処理用のプログラムを実行することにより行われ、外部機器が行う場合には、例えば、フラッシュメモリ15を自己の外付けストレージ機器と認識して処理が行われる。
Furthermore, in the
つぎに、ブートローダ24の具体的な処理内容について、図2のフローチャートを参照して説明をする。
Next, specific processing contents of the
電子機器10の電源がオンされると、CPU12は、ブートローダ24をフラッシュメモリ15から読み出して実行し、このことにより以下のステップS102からステップS106までの処理を行う(S101)。CPU12は、まず、フラッシュメモリ15内に最新初期プログラムファイル(program.run)22が存在するか否かを検出する(S102)。最新初期プログラムファイル(program.run)22が存在すれば、CPU12は、そのファイルのプログラムコードをRAM13上に展開し(S105)、続いて、展開したプログラムを起動する(S106)。一方、最新初期プログラムファイル(program.run)22が存在しない場合には、CPU12は、旧初期プログラムファイル(program.old)23がフラッシュメモリ15上に存在するか否かを判断し(ステップS103)、存在すれば旧初期プログラムファイル(program.old)23の名称を本来最新初期プログラムファイル22に付けられる名称(program.run)に変更する(S104)。この結果、最新初期プログラムファイル22がフラッシュメモリ15内に格納されることとなる。そして、CPU12は、名称の変更をしたそのファイルのプログラムコードをRAM13上に展開し(S105)、続いて、展開したプログラムを起動する(S106)。
When the power of the
以上のようにCPU12は、ブートローダ24を実行して、起動処理を行う。
As described above, the
つぎに、初期プログラムファイル21のアップデート時における処理内容について、図3のフローチャートを参照して説明する。なお、この処理は、外部機器が行ってもCPU12が行ってもよい処理であるが、ここではCPU12が行うものとして説明をする。
Next, the processing contents when the
まず、アップデート処理の開始命令が与えられ、この命令に応答してデータ入力ポート17から新しいバージョンの初期プログラムファイル21が入力される。CPU12は、入力されたそのファイルに仮名称を付けて、フラッシュメモリ15に格納する(S201)。なお、この仮名称は、最新初期プログラムファイル(program.run)22及び旧初期プログラムファイル(program.old)23と、ファイルタイトルが同一で、拡張子のみが異なっている。例えば、仮名称のファイルタイトルは、最新初期プログラムファイル22及び旧初期プログラムファイル23と同一の「program」とし、拡張子は「tmp」としている。
First, an update processing start command is given, and in response to this command, a new version of the
続いて、CPU12は、フラッシュメモリ15内に旧初期プログラムファイル(program.old)23が存在するか否かを検出する(S202)。存在すれば、ステップS203に進み、存在しなければ、ステップS206に進む。
Subsequently, the
CPU12は、ステップS203において、フラッシュメモリ15内に最新初期プログラムファイル(program.run)22が存在するか否かを検出する(S203)。
In step S203, the
ステップS203で最新初期プログラムファイル(program.run)22が存在すると判断した場合には、ステップS208に進む。ステップS203で最新初期プログラムファイル(program.run)22が存在しないと判断した場合には、旧初期プログラムファイル(program.old)23を削除し(S204)、続いて、最新初期プログラムファイル(program.run)22の名称を旧初期プログラムファイル23に付けられる名称(program.old)に変更し(ステップS205)、ステップS208に進む。 If it is determined in step S203 that the latest initial program file (program.run) 22 exists, the process proceeds to step S208. If it is determined in step S203 that the latest initial program file (program.run) 22 does not exist, the old initial program file (program.old) 23 is deleted (S204), followed by the latest initial program file (program.run). run) 22 is changed to a name (program.old) assigned to the old initial program file 23 (step S205), and the process proceeds to step S208.
また、CPU12は、ステップS206において、フラッシュメモリ15内に、最新初期プログラムファイル(program.run)22が存在するか否かを検出する(S206)。
In step S206, the
ステップS206で最新初期プログラムファイル(program.run)22が存在すると判断した場合には、ステップS208に進む。ステップS206で最新初期プログラムファイル(program.run)22が存在しないと判断した場合には、最新初期プログラムファイル(program.run)22の名称を旧初期プログラムファイル23に付けられる名称(program.old)に変更し(ステップS207)、ステップS208に進む。 If it is determined in step S206 that the latest initial program file (program.run) 22 exists, the process proceeds to step S208. If it is determined in step S206 that the latest initial program file (program.run) 22 does not exist, the name of the latest initial program file (program.run) 22 can be given to the old initial program file 23 (program.old). (Step S207), and the process proceeds to step S208.
ステップS208において、CPU12は、仮名称で付けていた新しい初期プログラムファイル(program.tmp)の名称を、本来最新初期プログラムファイル22に付けられる名称(program.run)に変更する。この結果、最新初期プログラムファイル22がフラッシュメモリ15内に格納されることとなる。そして、CPU12は、アップデート処理を終了する。
In step S <b> 208, the
以上のように、電子機器10では、ブートローダ24により読み出される初期プログラムファイル21のアップデートを行う場合、その新しい初期プログラムファイルの名称を最新バージョンのファイルの名称(program.run)として格納し、元々格納されていた最新バージョンのファイルの名称を他の名前に変更したり、そのファイル自体を削除したりする。
As described above, in the
このことによりブートローダ24は、最新バージョンの検索処理等を行わなくても、特定の名称のファイルを読み出しさえすれば、常に最新バージョンのファイルを読み出すことが可能となる。
As a result, the
このことにより電子機器10では、起動時に実行される初期プログラムファイルのバージョンの意識しない簡単な実行コードにより起動処理を行うことが可能となり、さらに、その実行コードを短くすることができる。
As a result, the
また、電子機器10では、最新初期プログラムファイル22と旧初期プログラムファイル23の名称を、ファイルタイトルを同一として拡張子のみ変更している。このことにより、記述子の検索のみを行えば、バージョンを新、旧のバージョンの判断をすることができ、ブートローダの処理を簡略化することが可能となる。
Further, in the
なお、電子機器10では、ブートローダ24をフラッシュメモリ15に格納しているが、その他のメモリや領域に格納してもよい。
In the
10 電子機器、11 電子制御対象部、12 CPU、13 RAM、14 第1のバス、15 フラッシュメモリ、16 ROM、17 データ入力ポート、18 第2のバス、19 バスブリッジ、21 初期プログラムファイル、22 最新初期プログラムファイル、23 旧初期プログラムファイル、24 ブートローダ
DESCRIPTION OF
Claims (2)
ファイルタイトル及びそのファイルの種別を示す拡張子からなる第1のファイル名が付与された第1の初期プログラムファイルと、第1の初期プログラムファイルよりもバージョンの新しい初期プログラムファイルであることを示し、第1のファイル名と拡張子のみが異なる第2のファイル名が付与され、上記第1の初期プログラムファイルよりもバージョンの新しい第2の初期プログラムファイルとが外部からアップデート可能な状態で格納されるプログラムメモリと、
上記第2の初期プログラムファイルが上記プログラムメモリに格納されている場合には、当該第2の初期プログラムファイルを上記ワーキングメモリに展開し、上記第2の初期プログラムファイルが上記プログラムメモリに格納されていない場合には、上記第1の初期プログラムファイルに付与されたファイル名を、上記第1のファイル名から拡張子のみを変更することによって上記第2のファイル名に変更した後で、当該ファイル名の変更後の第1の初期プログラムファイルを上記ワーキングメモリに展開した後、展開したプログラムを起動する起動処理を実行するためのブートローダが所定の物理量域に格納されているブートメモリと、
上記ブートメモリからブートローダをシステム起動時に読み出す処理と、上記プログラムメモリに上記第2の初期プログラムファイルが格納されている場合に当該第2の初期プログラムファイルをプログラムコードが展開されるワーキングメモリに展開し、上記第2の初期プログラムファイルが上記プログラムメモリに格納されていない場合に上記第1の初期プログラムファイルに付与されたファイル名の拡張子のみを変更することによって上記第1のファイル名から上記第2のファイル名に変更した後で、当該ファイル名の変更後の第1の初期プログラムを上記ワーキングメモリに展開した後、展開した初期プログラムファイルを起動する起動処理と、アップデート時に、アップデート用プログラムが記憶された不揮発性メモリからアップデート用プログラムを読み出し、しかる後、外部から入力された最新バージョンである第3の初期プログラムファイルに対して第3のファイル名を付与した後で、上記第3のファイル名を付与した第3の初期プログラムファイルを上記プログラムメモリに格納し、上記第1の初期プログラムファイルがプログラムメモリに格納されているとき、上記第2の初期プログラムファイルが上記プログラムメモリ内に格納されている場合には、上記第1の初期プログラムファイルを削除し、しかる後、上記第2の初期プログラムファイルに付与されたファイル名を上記第2のファイル名から上記第1のファイル名に、上記第3の初期プログラムファイルに付与されたファイル名を第3のファイル名から第2のファイル名にそれぞれ変更する第1の処理と、上記第1の初期プログラムファイルが上記プログラムメモリ内に格納されているとき、上記第2の初期プログラムファイルが上記プログラムメモリ内に格納されていない場合には、上記第3の初期プログラムファイルに付与された第3のファイル名を上記第2のファイル名に変更する第2の処理と、上記第1の初期プログラムファイルが上記プログラムメモリ内に格納されていないとき、上記第2の初期プログラムファイルが上記プログラムメモリ内に格納されている場合には、上記第2の初期プログラムファイルに付与されたファイル名を上記第2のファイル名から上記第1のファイル名に、上記第3の初期プログラムファイルに付与されたファイル名を、上記第3のファイル名から上記第2のファイル名にそれぞれ変更する第3の処理と、上記第1の初期プログラムファイルが上記プログラムメモリに格納されていないとき、上記第2の初期プログラムファイルが上記プログラムメモリに格納されていない場合には、上記第3の初期プログラムファイルに付与されたファイル名を、上記第3のファイル名から上記第2のファイル名に変更する第4の処理とを含むアップデート処理とを実行するCPUと
を備える電子機器。 Working memory where the program code is deployed,
Shows the first and the initial program file first file name composed from the file title and extension indicating the type of the file has been applied, that than the first initial program file is new initial program file versions A second file name that is different only in extension from the first file name is assigned, and a second initial program file that is newer than the first initial program file is stored in a state that can be updated from the outside. Program memory
When the second initial program file is stored in the program memory, the second initial program file is expanded in the working memory, and the second initial program file is stored in the program memory. If not, the file name assigned to the first initial program file is changed to the second file name by changing only the extension from the first file name, and then the file name is changed. A boot memory in which a boot loader for executing a startup process for starting the expanded program is stored in a predetermined physical quantity area after expanding the first initial program file after the change to the working memory;
A process for reading boot loader system startup from the boot memory, expanded in working memory the second initial program files program code are expanded when in the program memory the second initial program files are stored When the second initial program file is not stored in the program memory, the first file name is changed from the first file name by changing only the extension of the file name given to the first initial program file. after changing to the second file name, after the first initial program after changing the file name to expand into the working memory, and start processing start the initial program extracted files, when updating, for updating Upgrade from non-volatile memory that stores programs Reads over preparative program, thereafter, after applying a third file name for the third initial program file, the latest version that is input from the outside, third imparted with the third file name When the first initial program file is stored in the program memory and the second initial program file is stored in the program memory, the second initial program file is stored in the program memory. The first initial program file is deleted, and then the file name given to the second initial program file is changed from the second file name to the first file name, and the third initial program file is deleted. The first process for changing the file name assigned to each from the third file name to the second file name When the first initial program file is stored in the program memory and the second initial program file is not stored in the program memory, the first initial program file is assigned to the third initial program file. A second process for changing the third file name to the second file name, and when the first initial program file is not stored in the program memory, the second initial program file is When stored in the program memory, the file name assigned to the second initial program file is changed from the second file name to the first file name, and to the third initial program file. Third process for changing the assigned file name from the third file name to the second file name When the first initial program file is not stored in the program memory and the second initial program file is not stored in the program memory, the first initial program file is assigned to the third initial program file. And a CPU for executing an update process including a fourth process for changing the file name from the third file name to the second file name.
ファイルタイトル及びそのファイルの種別を示す拡張子からなる第1のファイル名が付与された第1の初期プログラムファイルと、第1の初期プログラムファイルよりもバージョンの新しい初期プログラムファイルであることを示し、第1のファイル名と拡張子のみが異なる第2のファイル名が付与され、上記第1の初期プログラムファイルよりもバージョンの新しい第2の初期プログラムファイルとが外部からアップデート可能な状態で格納されるプログラムメモリに上記第2の初期プログラムファイルが格納されている場合には、当該第2の初期プログラムファイルを上記ワーキングメモリに展開し、上記第2の初期プログラムファイルが上記プログラムメモリに格納されていない場合には、上記第1の初期プログラムファイルに付与されたファイル名を上記第1のファイル名から拡張子のみを変更することによって第2のファイル名に変更した後で、当該ファイル名の変更後の第1の初期プログラムファイルを上記ワーキングメモリに展開した後、展開したプログラムを起動する起動処理を実行するためのブートローダが所定の物理量域に格納されているブートメモリから上記ブートローダをシステム起動時に上記電子機器のCPUが読み出す処理を実行するブートローダ読み出しステップと、
上記プログラムメモリに上記第2の初期プログラムファイルが格納されている場合に当該第2の初期プログラムファイルをプログラムコードが展開されるワーキングメモリに展開し、上記第2の初期プログラムファイルが上記プログラムメモリに格納されていない場合に上記第1の初期プログラムファイルに付与されたファイル名の拡張子のみを変更することによって、上記第1のファイル名から上記第2のファイル名に変更した後で、当該ファイル名の変更後の第1の初期プログラムファイルを上記ワーキングメモリに展開した後、展開した初期プログラムファイルを起動する起動処理を上記電子機器のCPUが実行する起動処理実行ステップと、
アップデート時にアップデート用プログラムが記憶された不揮発性メモリからアップデート用プログラムを読み出し、しかる後、外部から入力された最新バージョンである第3の初期プログラムファイルに対して第3のファイル名を付与した後で、上記第3のファイル名を付与した第3の初期プログラムファイルを上記プログラムメモリに格納し、上記第1の初期プログラムファイルがプログラムメモリに格納されているとき、上記第2の初期プログラムファイルが上記プログラムメモリに格納されている場合には、上記第1の初期プログラムファイルを削除し、しかる後、上記第2の初期プログラムファイルに付与されたファイル名を上記第2のファイル名から上記第1のファイル名に、上記第3の初期プログラムファイルに付与されたファイル名を、上記第3のファイル名から上記第2のファイル名にそれぞれ変更する第1の処理と、上記第1の初期プログラムファイルが上記プログラムメモリ内に格納されているとき、上記第2の初期プログラムファイルが上記プログラムメモリに格納されていない場合には、上記第3の初期プログラムファイルに付与されたファイル名を上記第3のファイル名から上記第2のファイル名に変更する第2の処理と、上記第1の初期プログラムファイルが上記プログラムメモリ内に格納されていないとき、上記第2の初期プログラムファイルが上記プログラムメモリ内に格納されている場合には、上記第2の初期プログラムファイルに付与されたファイル名を上記第2のファイル名から上記第1のファイル名に、上記第3の初期プログラムファイルに付与されたファイル名を、上記第3のファイル名から上記第2のファイル名にそれぞれ変更する第3の処理と、上記第1の初期プログラムファイルが上記プログラムメモリに格納されていないとき、上記第2の初期プログラムファイルが上記プログラムメモリに格納されていない場合には、上記第3の初期プログラムファイルに付与されたファイル名を上記第3のファイル名から上記第2のファイル名に変更する第4の処理とを含むアップデート処理を上記電子機器のCPUが実行するアップデート処理実行ステップと
を含むプログラム更新方法。 In a program update method for upgrading a program incorporated in an electronic device,
Shows the first and the initial program file first file name composed from the file title and extension indicating the type of the file has been applied, that than the first initial program file is new initial program file versions A second file name that is different only in extension from the first file name is assigned, and a second initial program file that is newer than the first initial program file is stored in a state that can be updated from the outside. When the second initial program file is stored in the program memory, the second initial program file is expanded in the working memory, and the second initial program file is stored in the program memory. If not, it is added to the first initial program file. File name and the after changing the second file name by changing only the extension from the first file name, the first initial program file after the change of the file name was developed in the working memory after the boot loader reads executing the CPU reads the processing of the electronic device boot loader from the boot memory which is stored in the predetermined physical quantity range the boot loader at system startup for executing the startup process to start the program developed ,
When the second initial program file is stored in the program memory, the second initial program file is expanded in a working memory where program code is expanded , and the second initial program file is stored in the program memory. If the file name is changed from the first file name to the second file name by changing only the extension of the file name given to the first initial program file when not stored, the file is changed. after deploying the name first initial program file after changing the in the working memory, and starts the process execution step of executing the expanded initial program file to that start process starts CPU of the electronic apparatus,
After the update program is read from the non-volatile memory in which the update program is stored at the time of update, and then the third file name is assigned to the third initial program file that is the latest version input from the outside. When the third initial program file assigned with the third file name is stored in the program memory, and the first initial program file is stored in the program memory, the second initial program file is stored in the program memory. If stored in the program memory, the first initial program file is deleted, and then the file name assigned to the second initial program file is changed from the second file name to the first file name. The file name is assigned to the file assigned to the third initial program file. The first process for changing the file name from the third file name to the second file name, and when the first initial program file is stored in the program memory, Second process for changing the file name given to the third initial program file from the third file name to the second file name when the initial program file is not stored in the program memory When the first initial program file is not stored in the program memory and the second initial program file is stored in the program memory, the second initial program file is stored in the second initial program file. The assigned file name is changed from the second file name to the first file name to the third initial program file. A third process for changing the file name given to the file from the third file name to the second file name, and when the first initial program file is not stored in the program memory, If the second initial program file is not stored in the program memory, the file name assigned to the third initial program file is changed from the third file name to the second file name. An update process execution step in which the CPU of the electronic device executes an update process including a fourth process.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2003309260A JP4517607B2 (en) | 2003-09-01 | 2003-09-01 | Electronic device and method for updating the program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2003309260A JP4517607B2 (en) | 2003-09-01 | 2003-09-01 | Electronic device and method for updating the program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2005078455A JP2005078455A (en) | 2005-03-24 |
| JP4517607B2 true JP4517607B2 (en) | 2010-08-04 |
Family
ID=34411477
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2003309260A Expired - Fee Related JP4517607B2 (en) | 2003-09-01 | 2003-09-01 | Electronic device and method for updating the program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4517607B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP6235211B2 (en) * | 2012-12-21 | 2017-11-22 | 株式会社東芝 | Method and apparatus |
| US9727731B2 (en) | 2012-12-21 | 2017-08-08 | Kabushiki Kaisha Toshiba | Setting method, program, and information processing apparatus |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2862036B2 (en) * | 1991-09-17 | 1999-02-24 | 三菱電機株式会社 | Numerical control unit |
| JPH08263446A (en) * | 1995-03-22 | 1996-10-11 | Toshiba Corp | Complex computer system and shared memory replacement method applied to the system |
| JP3841581B2 (en) * | 1999-01-18 | 2006-11-01 | 富士通テン株式会社 | Switching between old and new versions after downloading a program on an in-vehicle terminal |
| IL129947A (en) * | 1999-05-13 | 2003-06-24 | Tadiran Telecom Business Syste | Method and apparatus for downloading software into an embedded system |
| JP3932547B2 (en) * | 2001-10-15 | 2007-06-20 | ソニー株式会社 | Broadcast receiving apparatus and method |
-
2003
- 2003-09-01 JP JP2003309260A patent/JP4517607B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2005078455A (en) | 2005-03-24 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP3252605B1 (en) | Vehicle-mounted control device, program writing device, program generating device and program | |
| JP3838840B2 (en) | Computer | |
| JP2011095952A (en) | Method for updating firmware and electronic equipment | |
| CN106325911A (en) | Method and device for implementing BOOTROM upgrade | |
| WO2012071852A1 (en) | Method and apparatus for upgrading bootstrap program | |
| CN106775874B (en) | System upgrading method of terminal equipment | |
| JP2001331327A (en) | Electronics | |
| US20060174099A1 (en) | Embedded system, automatic loading system, and method capable of automatically loading a root file system | |
| JP6074064B2 (en) | Electronics | |
| CN113672296A (en) | Switching method, switching device, electronic device and storage medium for customized application | |
| CN111176686B (en) | BIOS upgrading method and system, electronic equipment and storage medium | |
| JP6526357B2 (en) | CONTROL DEVICE AND PROGRAM UPDATE METHOD | |
| CN112860291A (en) | Firmware upgrading method and device | |
| JP4517607B2 (en) | Electronic device and method for updating the program | |
| CN112199109B (en) | Firmware upgrading method, device, equipment and medium | |
| JP2011175352A (en) | Firmware updating device, communication apparatus, electronic apparatus, firmware updating system, firmware updating method and program | |
| JP5158883B2 (en) | Firmware update method and firmware update apparatus | |
| JP2005092708A (en) | Software update system and method, and computer program | |
| JP2019008693A (en) | Vehicle-purpose electronic control unit | |
| KR100628176B1 (en) | How to update the stored program of the information terminal | |
| JP5521437B2 (en) | Portable terminal device, software update method and program | |
| JP2018077690A (en) | Installation and firmware upgrade method considering compatibility depending on the application execution environment | |
| KR100520192B1 (en) | Software update method of mobile station | |
| KR100734303B1 (en) | How to Download System Program | |
| JP2003122575A (en) | Information processing equipment |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20060629 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20080929 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090602 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20090713 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090811 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20090925 |
|
| A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20091104 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20091216 |
|
| A911 | Transfer to examiner for re-examination before appeal (zenchi) |
Free format text: JAPANESE INTERMEDIATE CODE: A911 Effective date: 20100215 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20100316 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100408 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20100427 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20100510 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130528 Year of fee payment: 3 |
|
| LAPS | Cancellation because of no payment of annual fees |