JP2008040924A - Firmware rewriting method and firmware reading method - Google Patents
Firmware rewriting method and firmware reading method Download PDFInfo
- Publication number
- JP2008040924A JP2008040924A JP2006216397A JP2006216397A JP2008040924A JP 2008040924 A JP2008040924 A JP 2008040924A JP 2006216397 A JP2006216397 A JP 2006216397A JP 2006216397 A JP2006216397 A JP 2006216397A JP 2008040924 A JP2008040924 A JP 2008040924A
- Authority
- JP
- Japan
- Prior art keywords
- area
- kernel
- data
- program
- firmware
- 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
Links
Images
Landscapes
- Stored Programmes (AREA)
Abstract
Description
本発明は、ファームウェアの書き換え方法、及び、ファームウェアの読み込み方法に関し、詳しくは、記憶装置の個々の記憶領域にデータの種類別に分割して記憶されているファームウェアの書き換え方法、及び、読み込み方法に関するものである。 The present invention relates to a method for rewriting firmware and a method for reading firmware, and more particularly to a method for rewriting and reading firmware stored in individual storage areas of a storage device according to the type of data. It is.
自装置のファームウェアを、ファームウェアのデータの種類別に分割してFlashROMの個々の記憶領域にそれぞれ記憶し、ファームウェアのデータの種類の単位で、FlashROMに記憶されているファームウェアを書き換えてバージョンアップするデータ処理装置が発明されている(例えば、特許文献1)。特許文献1に係るデータ処理装置では、データの種類別に分割されたファームウェアのそれぞれに誤り検出データを埋め込み、この誤り検出データを使用してサムチェックを行うことにより、書き換えたファームウェアの誤り検出をファームウェアのデータの種類の単位で行うことができる。
しかし、特許文献1に記載のデータ処理装置は、書き換えたファームウェアの誤りを検出するのみであり、ファームウェアの誤りに対処することができなかった。したがって、例えば、特許文献1に記載のデータ処理装置を備えた複合機において、データ処理装置のファームウェアの書き換え中の電源断などによってファームウェアのカーネルプログラムに破損(誤り)が起こった場合には、当該データ処理装置を使用する複合機の機能は動作不能となり、機能の復旧のためには複合機のサービスマンに頼るほかなかった。
However, the data processing apparatus described in
本発明は、かかる課題に鑑みてなされたものであり、記憶装置の個々の記憶領域にデータの種類別に分割して記憶されているファームウェアに破損が起こった場合でも、自装置を正常に機能させることが可能な、ファームウェアの書き換え方法、及び、ファームウェアの読み込み方法を提供することを目的とする。 The present invention has been made in view of such a problem, and allows the device itself to function normally even when the firmware stored by dividing the data into the individual storage areas of the storage device has been damaged. It is an object of the present invention to provide a method for rewriting firmware and a method for reading firmware.
上記目的を達成するために、請求項1のファームウェアの書き換え方法は、記憶装置の個々の記憶領域にデータの種類別に分割して記憶されているファームウェアの書き換えデータによる書き換え方法であって、前記書き換えデータに含まれるカーネルプログラムを前記記憶装置の記憶領域の第1カーネル領域に書き込むステップ(A)と、前記書き換えデータに含まれるカーネルプログラムを前記記憶装置の記憶領域の第2カーネル領域に書き込むステップ(B)とを含むことを特徴としている。
In order to achieve the above object, a firmware rewriting method according to
このファームウェアの書き換え方法においては、記憶装置の個々の記憶領域にデータの種類別に分割して記憶されているファームウェアの書き換えデータによる書き換え方法であって、ステップ(A)で、書き換えデータに含まれるカーネルプログラムを記憶装置の記憶領域の第1カーネル領域に書き込み、ステップ(B)で、書き換えデータに含まれるカーネルプログラムを記憶装置の記憶領域の第2カーネル領域に書き込む。 This firmware rewriting method is a rewriting method using firmware rewriting data that is stored separately for each data type in each storage area of the storage device, and includes a kernel included in the rewriting data in step (A). The program is written in the first kernel area of the storage area of the storage device, and in step (B), the kernel program included in the rewrite data is written in the second kernel area of the storage area of the storage device.
このようなファームウェアの書き換え方法によれば、記憶装置の記憶領域の第1カーネル領域と第2カーネル領域が個別に書き換えられるので、書き換えデータによるカーネルプログラムの書き換え中に停電などが起こり、当該ファームウェア(カーネルプログラム)によって機能する装置に電源断が発生してカーネルプログラムが破損した場合でも、第1カーネル領域のカーネルプログラムと第2カーネル領域のカーネルプログラムとが一度に破損することがないので、当該ファームウェア(カーネルプログラム)によって機能する装置を、第1カーネル領域に記憶されているカーネルプログラムと第2カーネル領域に記憶されているプログラムとのうちの正常なカーネルプログラムによって正常に機能させることができる。 According to such a firmware rewriting method, since the first kernel area and the second kernel area of the storage area of the storage device are individually rewritten, a power failure or the like occurs during rewriting of the kernel program by the rewrite data, and the firmware ( Even when a power failure occurs in a device functioning by a kernel program) and the kernel program is damaged, the kernel program in the first kernel area and the kernel program in the second kernel area are not damaged at one time. A device functioning by (kernel program) can be normally functioned by a normal kernel program out of the kernel program stored in the first kernel area and the program stored in the second kernel area.
また、記憶装置の記憶領域に重複して書き込まれるのは、カーネルプログラムのみである。したがって、ファームウェアの全体を一括して書き込まねばならず、電源断に対処するために、ファームウェアの全体を重複して記憶装置の記憶領域に書き込む方法に比べて、書込みに要する時間を短縮し、記憶装置の記憶資源を節約することができる。 Only the kernel program is written in the storage area of the storage device in an overlapping manner. Therefore, the entire firmware must be written in a lump, and in order to cope with the power interruption, the time required for writing is shortened compared to the method of writing the entire firmware in the storage area of the storage device in an overlapping manner. The storage resources of the device can be saved.
請求項2に記載のファームウェアの書き換え方法は、請求項1に記載のファームウェアの書き換え方法であって、前記記憶装置の記憶領域の第1カーネル領域に記憶されているカーネルプログラムが正常であるか否かを判断するステップ(C)と、前記記憶装置の記憶領域の第2カーネル領域に記憶されているカーネルプログラムが正常であるか否かを判断するステップ(D)とをさらに含み、前記記憶装置の記憶領域の第1カーネル領域に記憶されているカーネルプログラムが正常でない場合に、前記ステップ(B)に先立って前記ステップ(A)を実行し、前記記憶装置の記憶領域の第2カーネル領域に記憶されているカーネルプログラムが正常でない場合に、前記ステップ(A)に先立って前記ステップ(B)を実行することを特徴としている。
The firmware rewriting method according to claim 2 is the firmware rewriting method according to
このファームウェアの書き換え方法においては、ステップ(C)で記憶装置の記憶領域の第1カーネル領域に記憶されているカーネルプログラムが正常であるか否かを判断し、ステップ(D)で記憶装置の記憶領域の第2カーネル領域に記憶されているカーネルプログラムが正常であるか否かを判断する。そして、記憶装置の記憶領域の第1カーネル領域に記憶されているカーネルプログラムが正常でない場合に、ステップ(B)に先立ってステップ(A)を実行し、記憶装置の記憶領域の第2カーネルプログラムに記憶されているカーネルプログラムが正常でない場合に、ステップ(A)に先立ってステップ(B)を実行する。 In this firmware rewriting method, it is determined in step (C) whether or not the kernel program stored in the first kernel area of the storage area of the storage device is normal, and in step (D) the storage of the storage device is determined. It is determined whether or not the kernel program stored in the second kernel area of the area is normal. When the kernel program stored in the first kernel area of the storage area of the storage device is not normal, step (A) is executed prior to step (B), and the second kernel program in the storage area of the storage device is executed. Step (B) is executed prior to Step (A) when the kernel program stored in is not normal.
このようなファームウェアの書き換え方法によれば、第1カーネル領域に記憶されているカーネルプログラムが電源断による破損などにより正常でない場合には、第2カーネル領域に記憶されているカーネルプログラムに先立って第1カーネル領域に記憶されているカーネルプログラムの書き換えを行い、第2カーネル領域に記憶されているカーネルプログラムが正常でない場合には、第1カーネル領域に記憶されているカーネルプログラムに先立って第2カーネル領域に記憶されているカーネルプログラムの書き換えを行う。したがって、第1カーネル領域のカーネルプログラムと第2カーネル領域のカーネルプログラムとのどちらかが正常でない状態で、第1カーネル領域のカーネルプログラム及び第2カーネル領域のカーネルプログラムの書き換えを行う場合に電源断などが再び発生した場合でも、第1カーネル領域又は第2カーネル領域のどちらかに正常なカーネルプログラムが存在することになるので、当該正常なカーネルプログラムを実行することによって当該ファームウェア(カーネルプログラム)によって機能する装置を正常に機能させることができる。 According to such a firmware rewriting method, if the kernel program stored in the first kernel area is not normal due to damage caused by power interruption or the like, the first program is executed prior to the kernel program stored in the second kernel area. If the kernel program stored in the first kernel area is rewritten and if the kernel program stored in the second kernel area is not normal, the second kernel is prior to the kernel program stored in the first kernel area. Rewrite the kernel program stored in the area. Accordingly, when the kernel program in the first kernel area and the kernel program in the second kernel area are rewritten while either the kernel program in the first kernel area or the kernel program in the second kernel area is not normal, the power is cut off. Even if the error occurs again, a normal kernel program exists in either the first kernel area or the second kernel area. Therefore, by executing the normal kernel program, the firmware (kernel program) A functioning device can function normally.
請求項3に記載のファームウェアの書き換え方法は、請求項2に記載のファームウェアの書き換え方法であって、前記ステップ(C)及び前記ステップ(D)において、カーネルプログラムに含まれる誤り検出データに基づいてカーネルプログラムが正常であるか否かを判断することを特徴としている。
The firmware rewriting method according to
このファームウェアの書き換え方法においては、ステップ(C)及びステップ(D)において、カーネルプログラムに含まれる誤り検出データに基づいてカーネルプログラムが正常であるか否かが判断される。したがって、カーネルプログラムのデータのみを用いて簡便にカーネルプログラムが正常であるか否かを判断することができる。 In this firmware rewriting method, in step (C) and step (D), it is determined whether or not the kernel program is normal based on error detection data included in the kernel program. Therefore, it is possible to easily determine whether or not the kernel program is normal using only the kernel program data.
上記課題を達成するために、請求項4に記載のファームウェアの読み込み方法は、副記憶装置の個々の記憶領域にデータの種類別に分割して記憶されているファームウェアの主記憶装置への読み込み方法であって、前記副記憶装置の記憶領域の第1カーネル領域に記憶されているカーネルプログラムを前記主記憶装置に読み込みつつ、当該カーネルプログラムに含まれる誤り検出データに基づいて当該カーネルプログラムが正常であるか否かを判断するステップ(A)と、前記ステップ(A)において、前記副記憶装置の記憶領域の第1カーネル領域に記憶されているカーネルプログラムが正常でないと判断した場合に、前記副記憶装置の記憶領域の第2カーネル領域に記憶されているカーネルプログラムを前記主記憶装置に読み込むステップ(B)とを備えることを特徴としている。
In order to achieve the above object, the firmware reading method according to
このファームウェアの読み込み方法においては、ステップ(A)で、FlashROMなどの副記憶装置の記憶領域の第1カーネル領域に記載されているカーネルプログラムをSDRAMなどの主記憶装置に読み込みつつ、当該カーネルプログラムに含まれる誤り検出データに基づいて当該カーネルプログラムが正常であるか否かを判断し、ステップ(B)で、ステップ(A)において、副記憶装置の記憶領域の第1カーネル領域に記載されているカーネルプログラムが正常でないと判断した場合に、副記憶装置の記憶領域の第2カーネル領域に記憶されているカーネルプログラムを主記憶装置に読み込む。 In this firmware reading method, in step (A), the kernel program described in the first kernel area of the storage area of the secondary storage device such as FlashROM is read into the main storage device such as SDRAM, and the kernel program is loaded. Based on the error detection data included, it is determined whether or not the kernel program is normal. In step (B), it is described in the first kernel area of the storage area of the secondary storage device in step (A). When it is determined that the kernel program is not normal, the kernel program stored in the second kernel area of the storage area of the secondary storage device is read into the main storage device.
このようなファームウェアの読み込み方法によれば、副記憶装置の記憶領域の第1カーネル領域に記憶されているカーネルプログラムと第2カーネル領域に記憶されているカーネルプログラムとのうち、正常なカーネルプログラムが主記憶装置に読み込まれる。したがって、ファームウェアの書き換え中に、当該ファームウェアによって機能する装置に電源断などが起こり、副記憶装置の記憶領域の第1カーネル領域のカーネルプログラム又は第2カーネル領域のカーネルプログラムのどちらかが破損などして正常でない場合でも、当該ファームウェア(カーネルプログラム)によって機能する装置を正常に機能させることができる。 According to such a firmware reading method, a normal kernel program among the kernel programs stored in the first kernel area and the second kernel area of the storage area of the secondary storage device is Read into main memory. Therefore, during rewriting of the firmware, a power failure or the like occurs in a device functioning with the firmware, and either the kernel program in the first kernel area or the kernel program in the second kernel area in the storage area of the secondary storage device is damaged. Even if it is not normal, the device functioning by the firmware (kernel program) can be functioned normally.
また、副記憶装置の記憶領域の第1カーネル領域及び第2カーネル領域に記憶されているカーネルプログラムを読み出して、主記憶装置の記憶領域の第1カーネル領域又は第2カーネル領域に書き込みつつ、順次にサムチェックのための演算を行うので、カーネルプログラムの読み込みにかかる時間を短縮することができる。 In addition, the kernel program stored in the first kernel area and the second kernel area of the storage area of the secondary storage device is read and written in the first kernel area or the second kernel area of the storage area of the main storage device, sequentially Therefore, the time required for reading the kernel program can be shortened.
以下、本発明のファームウェアの書き換え方法、及び、ファームウェアの読み込み方法を実行するデータ処理装置を例として、本発明の実施の形態について説明する。図1に示すように、データ処理装置1は、コピー機能、スキャナ機能、PCプリント機能などを備える複合機2の本体に組み込まれており、複合機2の本体、及び、ネットワークインターフェースコントローラ3と通信可能に接続されている。データ処理装置1は、LAN4上のクライアントPC5(Personal Computer)から送信された印刷用のPDL(Page Description Language)データを、ネットワークインターフェースコントローラ3を介して受信し、受信したPDLデータに所定のデータ処理を行って複合機2の本体に転送する。
Embodiments of the present invention will be described below by taking as an example a data processing apparatus that executes a firmware rewriting method and a firmware reading method of the present invention. As shown in FIG. 1, the
クライアントPC5は、一般的な機能を備えたPCであり、ユーザが作成した文書などのデータをPDLデータに変換し、当該PDLデータを、LAN4を介して複合機2のネットワークインターフェースコントローラ3に送信する。なお、ここで使用されるPDL(ページ記述言語)は特に限定されるものではないが、例えばPCL(Printer Control Language)などを用いることができる。また、後述するが、データ処理装置1が自装置1のファームウェアをアップデートするための書き換えデータもこのクライアントPC5から送信される。
The client PC 5 is a PC having a general function, converts data such as a document created by the user into PDL data, and transmits the PDL data to the
ネットワークインターフェースコントローラ3は、複合機2の本体がLAN4上のクライアントPC5との間で各種データを送受信する際に、そのデータの送受信を制御するものである。具体的には、クライアントPC5から受信したPDLデータや書き換えデータをデータ処理装置1に転送し、複合機2で読取られた原稿の画像データなどをLAN4上のクライアントPC5に送信する。
The
一方、ネットワークインターフェースコントローラ3から転送されたPDLデータに所定のデータ処理を行って複合機2の本体に転送するデータ処理装置1は、図示するように、制御部(MPU:Microprocessing Unit)6、インターフェース回路7、FlashROM(Read Only Memory)8、SDRAM(Synchronous Dynamic Random Access Memory)9、及び、データ処理回路10を備えたものであって、各部6乃至10は、バス11によって通信可能に接続されている。
On the other hand, the
制御部6は、FlashROM8に記憶されているファームウェアの各種プログラムに従って、このデータ処理装置1を構成する各部を制御する。インターフェース回路7は、ネットワークインターフェースコントローラ3から転送されたPDLデータや書き換えデータを受信するものである。また、インターフェース回路7が受信したPDLデータは、データ処理回路10において所定のデータ処理が施された後に複合機2の本体に転送される。
The
FlashROM8は、制御部6によってデータ処理装置1の各部が制御されるためのファームウェアを記憶するフラッシュメモリであり、図2に示すようにブート領域F−B、第1カーネル領域F−K1、第2カーネル領域F−K2、一般プログラム領域F−P、及び、フォント領域F−Fの5つの記憶領域に論理的に分割されている。SDRAM9は、制御部6の主メモリ、ワークエリアなどとして機能し、プログラム領域SD−P及び、データ領域SD−Dの2つの記憶領域に論理的に分割されている。
The
FlashROM8のブート領域F−Bは、システム起動時に実行されるブートプログラムを記憶している記憶領域である。第1カーネル領域F−K1及び、第2カーネル領域F−K2は、カーネルプログラムを記憶している記憶領域である。カーネルプログラムには、自装置1と複合機2の本体との間の通信の初期化、自己書き換え(バージョンアップ)、ジョブ管理、データ管理、タスク管理などを行うための制御プログラムや初期パラメータ、受信した書き換えデータによりFlashROM8のファームウェアをアップデート(書き換え)するための書き換えコード、ファームウェアをアップデートした後に書き換えが正常に行われたか否かを検査するためのデータチェックコードなどが含まれる。一般プログラム領域F−Pは、データ処理装置1が各種処理動作を行うための一般プログラムを記憶している記憶領域であり、例えば、インターフェース回路7が受信したPDLデータに所定のデータ処理を行うためのデータ処理プログラムなどを記憶している。フォント領域F−Fは、フォントデータを記憶している記憶領域である。
The boot area FB of the
また、FlashROM8のこれらの各記憶領域F−B、F−K1、F−K2、F−P、及び、F−Fのサイズは、それぞれ常に一定の値となるように設定されており、ここではブート領域F−Bが8kB(キロバイト)、第1カーネル領域F−K1、及び、第2カーネル領域F−K2がそれぞれ248kB、一般プログラム領域F−Pが2816kB、フォント領域F−Fが5120kBに設定されている。このように、データ処理装置1のファームウェアは、データの種類別に分割されて異なるサイズの記憶領域F−B、F−K1、F−K2、F−P、及び、F−Fにそれぞれ記憶されているが、これらの各記憶領域の全体にプログラムやフォントデータが記憶されているわけではなく、プログラムやフォントデータに適当なデータサイズの空きデータ、すなわち16進数で「00」又は「FF」の値を持つ空きデータが付加されたデータがそれぞれ対応する記憶領域に記憶されている。例えば、2816kBの一般プログラム領域F−Pの場合、実際に使用する一般プログラム全体のデータサイズが2600kBであれば、これに216kBの空きデータが付加された一般プログラム領域F−Pのサイズと等しい2816kBのデータが該一般プログラム領域F−Pに記憶されている。なお、これらの各記憶領域に記憶されているデータは、各記憶領域毎に個別に外部から受信した書き換えデータによって書き換えることが可能である。FlashROM8に記憶されているファームウェアは、書き換えデータによって、例えば、第1カーネル領域F−K1及び、第2カーネル領域F−K2のデータのみを書き換えたり、一般プログラム領域F−Pとフォント領域F−Fのデータのみを書き換えたりすることが可能である。
In addition, the size of each of the storage areas FB, F-K1, F-K2, FP, and FF of the
一方、SDRAM9のプログラム領域SD−Pは、制御部6によってFlashROM8に記憶されている各種データを制御部6で実行するために一時的に読み込む領域である。SDRAM9のプログラム領域SD−Pのうち、FlashROM8のブート領域F−Bに記憶されているブートプログラムを読み込む領域をブート領域SD−B、第1カーネル領域F−K1に記憶されているカーネルプログラム、又は、第2カーネル領域F−K2に記憶されているカーネルプログラムを読み込む領域を第1カーネル領域SD−K1、第2カーネル領域F−K2に記憶されているカーネルプログラムを読み込む領域を第2カーネル領域SD−K2、一般プログラム領域F−Pに記憶されている一般プログラムを読み込む領域を一般プログラム領域SD−P、フォント領域F−Fに記憶されているフォントデータを読み込む領域をフォント領域SD−Fとそれぞれ呼ぶ。
On the other hand, the program area SD-P of the
制御部6は、システム起動時にFlashROM8のブート領域F−BのブートプログラムをSDRAM9のプログラム領域SD−Pに読み込み、プログラム領域SD−Pに読み込まれたブートプログラムに基づいて、FlashROM8の第1カーネル領域F−K1に記憶されているカーネルプログラム、第2カーネル領域F−K2に記憶されているカーネルプログラム、一般プログラム領域F−Pに記憶されている一般プログラム、フォント領域F−Fに記憶されているフォントデータをそれぞれSDRAM9のプログラム領域SD−Pに読み込む。制御部6は、このようにしてFlashROM8の各記憶領域のデータをSDRAM9のプログラム領域SD−Pにロードし、ロードしたプログラムを必要に応じて実行することにより、例えば、外部から受信したPDLデータに所定のデータ処理を行って複合機2の本体に転送したり、外部から受信した書き換えデータにより自身のファームウェアをアップデートしたりすることができる。SDRAM9のデータ領域SD−Dは、各種データを一時的に格納する領域であり、ネットワークインターフェースコントローラ3によって転送されたPDLデータや書き換えデータ、複合機2の本体から受信した画像データなどを一時的に格納する。
The
データ処理回路10は、インターフェース回路7が受信したPDLデータに所定のデータ処理を施すものであり、具体的にはインターフェース回路7が受信したPDLデータを解析して複合機2の本体で処理可能な画像データに展開した後、その画像データをMMR(Modified Modified Read)方式で符号化(エンコード)する。このようにしてデータ処理回路10において所定のデータ処理が施された画像データは、インターフェース回路7によって複合機2の本体へと転送される。なお、ここで使用する符号化方式は、複合機2の本体において復号が可能な方式であればMMR方式に限定されるものではなく、例えば、MH(Modified Huffman)、MR(Modified Read)、JBIG(Joint Bi-level Image Group)方式などの他の符号化方式を使用してもよい。また、ここでは、画像データの転送速度などを考慮して展開した画像データをMMR方式で符号化して転送しているが、展開した画像データを符号化することなくそのまま複合機2の本体に転送するようにしてもよい。
The
一方、データ処理装置1から転送された画像データの印刷処理を行う複合機2の本体は、制御部(MPU)21、ROM(Read Only Memory)22、RAM(Random Access Memory)23、原稿読取部24、コーデック(CODEC:Coder and Decoder)25、画像メモリ26、記録部27、操作部28、及び、表示部29を備えており、各部21乃至29は、バス30によって通信可能に接続されている。
On the other hand, the main body of the MFP 2 that performs the printing process of the image data transferred from the
制御部21は、ROM22に記憶されているプログラムに従って、この複合機2を構成する各部を制御する。ROM22は、前記プログラムを記憶している。RAM23は、制御部21の主メモリ、ワークエリアなどとして機能し、予め登録された各種設定情報などを記憶している。原稿読取部24は、例えば、CCD(Charge Coupled Device)などのイメージセンサによって原稿の画像データを読取る。
The control unit 21 controls each unit constituting the multifunction device 2 according to a program stored in the
コーデック25は、画像データの符号化及び、復号(デコード)を行うものであり、原稿読取部24で読取られた原稿の画像データをMH、MR、MMR、JBIG方式などにより符号化し、符号化されている画像データを復号する。なお、データ処理装置1から転送された画像データは、このコーデック25において復号される。画像メモリ26は、コーデック25によって符号化された原稿の画像データ、データ処理装置1から転送された画像データなどを格納する。
The
記録部27は、原稿読取部24において読取られた原稿の画像データ、データ処理装置1から転送された画像データなどの画像を用紙に記録するものであり、この記録部27における記録方式としては、例えば、電子写真方式を用いることができる。データ処理装置1から転送された画像データは、画像メモリ26に一旦格納された後、コーデック25によって復号され、この記録部27においてその画像が用紙に記録される。
The
操作部28は、図示しないが原稿読取部24に原稿の読取開始を指示するためのスタートキー、コピー部数などを入力するためのテンキー、各種設定を行うためのカーソルキーなど、表示部29と連動した各種操作キーを備えている。表示部29は、各種の設定状態や複合機2の動作状態などを文字や図形などで表示する液晶表示装置(LCD:Liquid Crystal Display)や、点灯又は消灯で表示するLEDランプなどを備えている。
Although not shown, the
以上に説明したように構成された複合機2に対して、LAN4上のクライアントPC5からPDLデータが送信されると、当該PDLデータはネットワークインターフェースコントローラ3によってデータ処理装置1に転送される。そして、PDLデータは、データ処理装置1において展開されて所定の符号化方式で符号化された後、複合機2の本体へと転送されて当該複合機2の本体においてその画像が用紙に記録される。また、クライアントPC5は、複合機2において印刷すべきPDLデータの他に、データ処理装置1のFlashROM8に記憶されているファームウェアの全体又は一部をアップデートするための書き換えデータを複合機2に対して送信する。
When PDL data is transmitted from the
データ処理装置1は、FlashROM8の各記憶領域F−B、F−K1、F−K2、F−P、及び、F−Fに記憶されているファームウェアの全体、すなわち、記憶領域F−B、F−K1、F−K2、F−P、及び、F−Fのデータの全てをアップデートすることは当然に可能であるが、一部の記憶領域のデータのみをアップデートすることも可能である。FlashROM8の各記憶領域の一部のみのアップデートを行う場合には、クライアントPC5から、FlashROM8の記憶領域F−B、F−K1、F−K2、F−P、及び、F−Fのうち、書き換えが必要な記憶領域に対応する書き換えデータのみを送信する。
The
以下、FlashROM8の第1カーネル領域F−K1及び第2カーネル領域F−K2のデータのみをアップデートするための書き換えデータ(以下、「K領域用書き換えデータ」という。)を例としてクライアントPC5から送信される書き換えデータについて、図3に基づいて説明する。このK領域用書き換えデータは、図3に示すようにFlashROM8の第1カーネル領域F−K1及び第2カーネル領域F−K2に記憶されているデータと同様に、カーネルプログラムのデータに適当なデータサイズの空きデータとから構成されており、そのデータサイズは第1カーネル領域F−K1又は第2カーネル領域F−K2のサイズと等しい248kBである。このように、書き換え用のカーネルプログラムに適当なサイズの空きデータを付加することにより、カーネルプログラムのデータサイズが変動したとしても、常に第1カーネル領域F−K1又は第2カーネル領域F−K2のサイズと同じデータサイズのK領域用書き換えデータをデータ処理装置1に送信することができる。
Hereinafter, rewrite data for updating only the data in the first kernel area F-K1 and the second kernel area F-K2 of the FlashROM 8 (hereinafter referred to as “K area rewrite data”) is transmitted from the
このようにして作成されたK領域用書き換えデータがデータ処理装置1に送信された場合、データ処理装置1は、K領域用書き換えデータを受信した後、一旦SDRAM9のデータ領域SD−Dに格納する。そして、FlashROM8の第1カーネル領域F−K1及び第2カーネル領域2のカーネルプログラムをデータ領域SD−Dに格納したK領域用書き換えデータで書き換える。この書き換えに際して、書き換えを行う前に書き換えデータが正常であるか否かを判断し、書き換えを行った後に書き換えられたデータが正常であるか否かを判断する。このデータが正常であるか否かの判断では、所定の誤り検出データ作成手順に基づいて演算処理を行ってデータ検査を実行する。具体的には、データ処理装置1の制御部6は、チェックサム(Check Sum)によるデータ検査(サムチェック)を行う。そのため、クライアントPC5から送信される書き換えデータには、書き換えデータを構成する各データを数値として加算し、その総和の値から一定の計算をして求めた誤り検出データ(以下、「チェッカ」という。)が埋め込まれている。
When the K area rewrite data created in this way is transmitted to the
この書き換えデータに埋め込まれる1個のチェッカで表すことのできるデータの領域サイズをNとすると、領域サイズNは任意に設定することができるが、領域サイズNを無限大に設定した場合、いかなるデータサイズの書き換えデータであっても埋め込まれるチェッカの個数は1個である。しかし、データ処理装置1においてサムチェックを行う場合に、書き換えデータのどの部分において書き換えエラーが発生したかを特定できるようにするため、ここでは一例としてNの値は1024kBに設定されている。そして、書き換えデータのデータサイズをMとすると、書き換えデータのデータサイズMが領域サイズN以下である場合にはその書き換えデータに1個のチェッカを埋め込み、データサイズMが領域サイズNを越える場合には領域サイズNに基づいてその書き換えデータを複数の部分領域に分割し、各部分領域毎にチェッカの値を算出し、書き換えデータの後端に算出した複数のチェッカを埋め込む。
If the area size of data that can be represented by one checker embedded in the rewrite data is N, the area size N can be set arbitrarily, but if the area size N is set to infinity, any data The number of checkers to be embedded is one even for rewritten data of size. However, when performing a sum check in the
そこで、書き換えデータにチェッカを埋め込む場合、まず予め設定されている領域サイズNと送信すべき書き換えデータのデータサイズMから埋め込むチェッカの個数でもある部分領域数cを算出する。図3に示すように、書き換えデータがK領域用書き換えデータである場合には、書き換えデータのデータサイズMが248kBであり、領域サイズNの値である1024kB以下であるため、部分領域数cは「1」でありこの書き換えデータには1個のチェッカが埋め込まれる。 Therefore, when the checker is embedded in the rewrite data, first, the number of partial areas c which is also the number of checkers to be embedded is calculated from the preset area size N and the data size M of the rewrite data to be transmitted. As shown in FIG. 3, when the rewrite data is K area rewrite data, the data size M of the rewrite data is 248 kB, and the area size N is 1024 kB or less. “1”, and one checker is embedded in the rewritten data.
次に、算出した部分領域数cに基づいて各部分領域のデータを加算してサム値を算出する。なお、ここでは、部分領域数cは1であるため、書き換えデータを複数の部分領域に分割することなく248kBのデータサイズの書き換えデータを部分領域としてデータに対してサム値S1を算出する。具体的には、248kBのK領域用書き換えデータを構成する全データを数値として先頭部分から加算してその総和を算出する。このようにして全てのデータの総和からサム値S1を算出することができるが、ここでは1個のチェッカのデータサイズbが2バイトであり、書き換えデータの最後の2バイトにチェッカを埋め込むため、最後の2バイトに元々あった値v1をサム値S1から差引く。そして、このようにして求めたS1−v1を反転させた値−(S1−v1)をチェッカの値として書き換えデータの最後の2バイトに埋め込む。なお、ここでは、K領域用書き換えデータの最後の2バイトに元々あった値v1を−(S1−v1)の値のチェッカに書き換えているが、チェッカに書き換える部分のv1の値は空きデータの値であるため、チェッカを埋め込んだとしても書き換えデータの内容(ここでは、カーネルプログラム)が変化することはない。すなわち、書き換えデータの内容に影響を与えることなくチェッカを埋め込むことができる。 Next, the sum value is calculated by adding the data of each partial area based on the calculated number of partial areas c. Here, since the number of partial areas c is 1, the sum value S 1 is calculated for the data with the rewritten data having a data size of 248 kB as a partial area without dividing the rewritten data into a plurality of partial areas. Specifically, all the data constituting the 248 kB K area rewrite data is added as a numerical value from the top and the sum is calculated. In this way, the sum value S 1 can be calculated from the sum of all data, but here the data size b of one checker is 2 bytes, and the checker is embedded in the last 2 bytes of the rewritten data. Subtract the value v 1 originally in the last 2 bytes from the sum value S 1 . Then, the value-(S 1 -v 1 ) obtained by inverting S 1 -v 1 obtained in this way is embedded as the checker value in the last two bytes of the rewrite data. Note that here, the value v 1 originally in the last two bytes of the rewrite data for the K area is rewritten to a checker having a value of − (S 1 −v 1 ), but the value of v 1 of the portion to be rewritten to the checker Is a value of empty data, so even if the checker is embedded, the content of the rewritten data (here, the kernel program) does not change. That is, the checker can be embedded without affecting the contents of the rewritten data.
以上に説明したように、書き換えデータのデータサイズMが1個のチェッカで表すことのできる領域サイズN以下である場合には、書き換えデータには1個のチェッカが埋め込まれる。一方、データサイズMが領域サイズNを越える場合には、書き換えデータには複数のチェッカが埋め込まれる。例えば、図4に例示するように書き換えデータが、FlashROM8の一般プログラム領域のデータを書き換えるためのP領域用書き換えデータである場合、そのデータサイズMは2816kBであり、領域サイズNの値である1024kBを越えており、部分領域数cは3となる。そして、算出した部分領域数cに対応する部分領域を図4に示すように、部分領域X、部分領域Y、及び、部分領域Zのように設定する。ここでは、複数の部分領域のうち、最初の部分領域である部分領域Xが端数を受け持つように部分領域Xのデータサイズを768kBに設定し、部分領域Y、及び、部分領域Zのデータサイズを領域サイズNと等しい1024kBに設定する。
As described above, when the data size M of the rewrite data is equal to or smaller than the area size N that can be represented by one checker, one checker is embedded in the rewrite data. On the other hand, when the data size M exceeds the region size N, a plurality of checkers are embedded in the rewritten data. For example, as shown in FIG. 4, when the rewrite data is rewrite data for P area for rewriting data in the general program area of the
このようにして、部分領域X乃至Zを設定した後、まず部分領域Xについてサム値を算出するが、サム値を算出して各部分領域毎にチェッカを埋め込むと、各部分領域、ここでは部分領域X、及び、部分領域Yのデータの内容が変化してしまう。そこで、部分領域X乃至Zのチェッカは、空きデータが付加されている最後の部分領域Zの後端に埋め込む。具体的には、部分領域Xと部分領域Yについて、それぞれ算出した各領域のサム値をそのまま反転させてチェッカとして埋め込む。すなわち、図4に示すように、768kBの部分領域Xの全データの総和であるサム値S2を算出し、これを反転させた−S2の値を部分領域Xのチェッカとして部分領域Zにおけるチェッカ領域の先頭に埋め込む。ここで、チェッカ領域の先頭は、1個のチェッカのデータサイズbと、書き換えデータのデータサイズMと、部分領域数(チェッカの個数)cとに基づいて、M−c×bの関係式から算出することができる。 After setting the partial areas X to Z in this way, first, the sum value is calculated for the partial area X. When the sum value is calculated and the checker is embedded for each partial area, The contents of the data in the area X and the partial area Y change. Therefore, the checkers of the partial areas X to Z are embedded at the rear end of the last partial area Z to which empty data is added. Specifically, for the partial areas X and Y, the calculated sum values of the respective areas are inverted as they are and embedded as checkers. That is, as shown in FIG. 4, the sum value S 2 that is the sum of all the data in the partial area X of 768 kB is calculated, and the inverted value −S 2 is used as a checker for the partial area X. Embed at the beginning of the checker area. Here, the head of the checker area is based on a relational expression of M−c × b based on the data size b of one checker, the data size M of rewrite data, and the number of partial areas (number of checkers) c. Can be calculated.
このようにして部分領域Xのチェッカを埋め込んだ後、部分領域Yについても同様にサム値S3を算出し、算出したサム値をそのまま反転させた値−S3を部分領域Yのチェッカとして部分領域Zにおける部分領域Xのチェッカの次の2バイトに埋め込む。そして、最後の部分領域である部分領域Zのサム値S4から求めたチェッカを部分領域Zの最後の2バイトに埋め込むが、この部分領域Zには、前記部分領域X及び、Yのチェッカと部分領域Zのチェッカの3個のチェッカを埋め込むためのチェッカ領域が存在するため、部分領域Zの全データの総和であるサム値S4からチェッカ領域に元々存在したデータ、すなわち、書き換えデータの最後の6バイト分のデータの総和であるv2を部分領域を設定した段階で算出しておき、サム値S4から差引く。そして、これを反転させた値−(S4−v2)を部分領域Zのチェッカとして部分領域Zの最後の2バイトに埋め込む。 After embedding the checker of the thus partial region X, part similarly calculates a sum value S 3 also partial region Y, as the value -S 3 obtained by inverting the calculated sum value as a checker subregion Y It is embedded in the next 2 bytes of the checker of the partial area X in the area Z. And while embedding the checker determined from sum value S 4 of the partial region Z is the last partial area in the last two bytes of the partial region Z, in this portion region Z, the partial region X and a Y checker since the checker area for embedding the three checker checker partial region Z is present, the partial region Z of the entire data of the sum is a sum value S 4 originally present data to the checker area from, i.e., the last rewrite data the v 2 which is the sum of the data of 6 bytes previously calculated at the stage of setting the partial region is subtracted from the sum value S 4. Then, the inverted value-(S 4 -v 2 ) is embedded in the last two bytes of the partial area Z as a checker for the partial area Z.
以上に説明したように、実データに適当なデータサイズの空きデータが付加された書き換えデータに、該書き換えデータのデータサイズMに基づいて1又は複数のチェッカが埋め込まれるが、ブート領域F−Bのデータを書き換えるためのB領域用書き換えデータ及び、フォント領域F−Fのデータを書き換えるためのF領域用書き換えデータについても同様に書き換えデータを作成してチェッカを埋め込むことができる。そして、このようにチェッカが埋め込まれた後、書き換えが必要な記憶領域の書き換えデータのみがクライアントPC5から送信される。例えば、一般プログラム領域F−Pのデータのみ書き換えが必要な場合には、P領域用書き換えデータのみからなる2816kBの書き換えデータが送信され、第1カーネル領域F−K1及び第2カーネル領域F−K2、並びに、一般プログラム領域F−Pのデータについて書き換えが必要な場合には、K領域用書き換えデータとP領域用書き換えデータとからなる3064kBの書き換えデータがクライアントPC5から送信される。
As described above, one or a plurality of checkers are embedded in the rewrite data in which empty data of an appropriate data size is added to the actual data based on the data size M of the rewrite data, but the boot area FB Similarly, the rewrite data can be created and the checker can be embedded with respect to the rewrite data for the B area for rewriting the data of F and the rewrite data for the F area for rewriting the data of the font area FF. After the checker is embedded in this way, only rewrite data in a storage area that needs to be rewritten is transmitted from the
次に、以上に説明したようにチェッカを用いて書き換えデータが正常であるか否かを判断するデータ検査の方法について説明する。以下においては、書き換えデータによって書き換えられた後のFlashROM8の記憶領域のデータが正常であるか否かを判断するデータ検査の場合について説明するが、書き換え前に一旦SDRAM9のデータ領域SD−Dに記憶されている書き換えデータが正常であるか否かを判断するデータ検査の場合も同様にして実行できる。
Next, a data inspection method for determining whether or not rewritten data is normal using a checker as described above will be described. In the following, a case of data inspection for determining whether or not the data in the storage area of the
まず、書き換えデータによる自装置1のファームウェアの書き換え処理が終了した後、書き換えた記憶領域のサイズM及び、1個のチェッカで表すことができる領域サイズNからサムチェックを行う対象領域の部分領域数cを算出し、部分領域を設定する。ここで、対象領域は、FlashROM8の記憶領域F−B、F−K1、F−K2、F−P、及び、F−Fのうちの書き換えデータに書き換えた記憶領域であり、複数の記憶領域に対して書き換えを行った場合には、まず、その複数の記憶領域のうちのいずれか1つの記憶領域を対象領域してサムチェックを行う。上述したように、対象領域のデータ(書き換えデータ)には、サムチェックを行う部分領域の数と等しい数のチェッカが埋め込まれている。書き換えたFlashROM8の記憶領域のサイズMと該記憶領域のデータを書き換えた書き換えデータのデータサイズは等しいため、対象領域のデータを書き換えた書き換えデータのデータサイズについてもMで表すことができる。
First, after the rewriting process of the firmware of the
例えば、図5に示すように対象領域が2816kBの一般プログラム領域F−Pである場合には、対象領域のサイズ、すなわち一般プログラム領域F−Pを書き換えたP領域用書き換えデータのデータサイズMが1個のチェッカで表すことができる領域サイズN(1024kB)を越えており、部分領域数cは3である。そして、図4と同様に一般プログラム領域F−Pを768kBの部分領域X、1024kBの部分領域Y、1024kBの部分領域Zの3つの部分領域を設定する。なお、ここでも複数の部分領域のうち、先頭の部分領域が端数を受け持つように各部分領域のサイズが設定される。 For example, as shown in FIG. 5, when the target area is a general program area FP of 2816 kB, the size of the target area, that is, the data size M of the P area rewrite data obtained by rewriting the general program area FP is set. The area size N (1024 kB) that can be represented by one checker is exceeded, and the number of partial areas c is 3. Then, in the same way as in FIG. 4, the general program area FP is set with three partial areas, a partial area X of 768 kB, a partial area Y of 1024 kB, and a partial area Z of 1024 kB. Here, the size of each partial area is set so that the top partial area of the plurality of partial areas is responsible for fractions.
そして、対象領域におけるチェッカ領域からチェッカを読み出す。対象領域におけるチェッカ領域の先頭アドレスDは、対象領域の先頭アドレスをA、対象領域(書き換えた記憶領域)のサイズM、チェッカの個数(部分領域数)c、1個のチェッカのデータサイズbに基づいて、D=A+M−c×bの関係式から算出することができる。この関係式からチェッカ領域の先頭アドレスDを算出してチェッカの位置を特定し、その先頭アドレスD以降のデータをチェッカの値として読み出す。ここで、図5に示す一般プログラム領域F−Pの場合には、部分領域Xのチェッカと部分領域Yのチェッカと部分領域Zのチェッカの3つのチェッカの値を読み出すことができる。なお、1個のチェッカで表すことができる領域サイズNと1個のチェッカのデータサイズbは、第1カーネル領域F−K1又は第2カーネル領域F−K2に記憶されているデータチェックコードによって予め設定されている。1個のチェッカで表すことができる領域サイズNと1個のチェッカのデータサイズbは、書き換えデータにチェッカを埋め込む際の領域サイズとデータサイズに等しい値がそれぞれ設定されており、例えば、領域サイズNが1024kB、データサイズbが2バイトである。 Then, the checker is read from the checker area in the target area. The start address D of the checker area in the target area is set such that the start address of the target area is A, the size M of the target area (rewritten storage area), the number of checkers (number of partial areas) c, and the data size b of one checker. Based on the relational expression, D = A + M−c × b. From this relational expression, the head address D of the checker area is calculated, the position of the checker is specified, and data after the head address D is read as the value of the checker. Here, in the case of the general program area FP shown in FIG. 5, the values of the three checkers of the checker of the partial area X, the checker of the partial area Y, and the checker of the partial area Z can be read. Note that the area size N that can be represented by one checker and the data size b of one checker are determined in advance by the data check code stored in the first kernel area F-K1 or the second kernel area F-K2. Is set. The area size N that can be represented by one checker and the data size b of one checker are respectively set to values equal to the area size and data size when the checker is embedded in the rewrite data. N is 1024 kB and the data size b is 2 bytes.
次に、部分領域の先頭アドレスとサイズに基づいてサム値を計算する。例えば、一般プログラム領域F−Pのように、3つの部分領域が設定されている場合、まず、部分領域Xの先頭アドレス、すなわち、対象領域の先頭アドレスAから768kBの部分領域Xの全データを数値として加算してサム値を計算する。そして、計算したサム値とチェッカの値の和がゼロになるか否かを判断する。サム値とチェッカの値の和がゼロである場合には、部分領域に誤りはないと判断し、ゼロでない場合には部分領域に誤りがあると判断する。すべての部分領域(部分領域X,Y,Z)についてサムチェックを行い、すべての部分領域に誤りがない場合に、当該対象領域のデータが正常であると判断する。 Next, the sum value is calculated based on the start address and size of the partial area. For example, when three partial areas are set as in the general program area FP, first, the top address of the partial area X, that is, all data in the partial area X from the start address A of the target area to 768 kB Add the numbers and calculate the sum value. Then, it is determined whether or not the sum of the calculated sum value and the checker value becomes zero. When the sum of the sum value and the checker value is zero, it is determined that there is no error in the partial area, and when it is not zero, it is determined that there is an error in the partial area. Sum check is performed on all partial areas (partial areas X, Y, and Z), and if all partial areas have no error, it is determined that the data in the target area is normal.
以下に、図6及び図7を用いて、クライアントPC5から送信された書き換えデータに基づいてデータ処理装置1のFlashROM8に記憶されているファームウェアをアップデート(書き換え)する場合に、データ処理装置1の制御部6が実行する処理(ファームウェアの書き換え方法)について説明する。データ処理装置1の制御部6は、FlashROM8の第1カーネル領域F−K1又は第2カーネル領域F−K2からSDRAM9の第1カーネル領域SD−K1に読み込まれたカーネルプログラムに従って処理を実行する。FlashROM8に記憶されているファームウェアは、ブート領域F−B、第1カーネル領域F−K1、第2カーネル領域F−K2、一般プログラム領域F−P、フォント領域F−F毎にそれぞれ単独でアップデート(書き換え)可能であるが、以下には、第1カーネル領域F−K1、第2カーネル領域F−K2、一般プログラム領域F−P、フォント領域F−Fをアップデート(書き換え)する場合について説明する。なお、図6及び図7に示す各処理の実行順序は図示するものに限定されるものではなく、処理の実行順序を変更しても本発明を実現できる場合には適宜に変更してもよい。
Hereinafter, the control of the
まず、制御部6は、クライアントPC5から送信され、一時的にSDRAM9のデータ領域SD−Dに記憶されている書き換えデータの正当性のチェックを行う(S101)。この正当性のチェックでは、SDRAM9のデータ領域SD−Dに記憶されているデータが書き換えデータであるか否かのチェックと書き換えデータが正常であるか否かのチェックを行う。FlashROM8の第1カーネル領域F−K1に記憶されているカーネルプログラム、及び、第2カーネル領域F−K2に記憶されているカーネルプログラムには、図8に示すような、書き換えデータのデータサイズとFlashROM8の各記憶領域F−B、F−K1、F−K2、F−P、及び、F−Fとを対応付けたテーブルが含まれている。したがって、制御部6は、受信してSDRAM9のデータ領域SD−Dに記憶されているデータのデータサイズが図8に示すデータサイズのいずれかであるか否かによって、受信したデータが書き換えデータであるか否かを判断することができる。例えば、受信した書き換えデータのデータサイズが248kBであれば、書き換えデータは第1カーネル領域F−K1及び第2カーネル領域F−K2のデータを書き換えるためのK領域用書き換えデータであると判断し、また、受信した書き換えデータのデータサイズが7936kBであれば、書き換えデータは一般プログラム領域F−Pのデータを書き換えるためのP領域用書き換えデータとフォント領域F−Fのデータを書き換えるためのF領域用書き換えデータであると判断する。受信した書き換えデータが正常であるか否かは、上述したチェッカを用いたサムチェックによってチェックする。
First, the
そして、書き換えデータが正当であるか否かを判断する(S102)。受信したデータが書き換えデータであり、かつ、書き換えデータが正常である場合に書き換えデータが正当であると判断する。書き換えデータが正当でないと判断すると(S102:NO)、所定のエラー処理を行う(S129)。一方、書き換えデータが正当であると判断すると(S102:YES)、FlashROM8の第1カーネル領域F−K1に現時点で記憶されているカーネルプログラムが正常であるか(破損しているか)否かのチェックを行い(S103)、チェックの結果に基づいて当該カーネルプログラムが正常であるか否かを判断する(S104)。カーネルプログラムが正常であるか否かのチェックは、上述したチェッカを用いたサムチェックによって行う。
Then, it is determined whether the rewritten data is valid (S102). When the received data is rewrite data and the rewrite data is normal, it is determined that the rewrite data is valid. If it is determined that the rewritten data is not valid (S102: NO), predetermined error processing is performed (S129). On the other hand, if it is determined that the rewritten data is valid (S102: YES), whether or not the kernel program currently stored in the first kernel area F-K1 of the
第1カーネル領域F−K1に記憶されているカーネルプログラムが正常でないと判断すると(S104:NO)、SDRAM9のデータ領域SD−Dに記憶されている書き換えデータからカーネルプログラムの書き換えデータを読み出し、FlashROM8の第1カーネル領域F−K1を書き換える(S105)。そして、チェッカを用いたサムチェックによりFlashROM8の第1カーネル領域F−K1に書き込まれたカーネルプログラムが正常であるか否かをチェックし(S106)、当該カーネルプログラムが正常であるか否かを判断する(S107)。
If it is determined that the kernel program stored in the first kernel area F-K1 is not normal (S104: NO), the rewrite data of the kernel program is read from the rewrite data stored in the data area SD-D of the
FlashROM8の第1カーネル領域F−K1に書き込まれたカーネルプログラムが正常でないと判断すると(S107:NO)、所定のエラー処理を行う(S129)。一方、当該カーネルプログラムが正常であると判断すると(S107:YES)、SDRAM9のデータ領域SD−Dに記憶されている書き換えデータから一般プログラムの書き換えデータを読み出し、FlashROM8の一般プログラム領域F−Pを書き換える(S108)。そして、チェッカを用いたチェックサムによりFlashROM8の一般プログラム領域F−Pに書き込まれた一般プログラムが正常であるか否かをチェックし(S109)、当該一般プログラムが正常であるか否かを判断する(S110)。
If it is determined that the kernel program written in the first kernel area F-K1 of the
FlashROM8の一般プログラム領域F−Pに書き込まれた一般プログラムが正常でないと判断すると(S110:NO)、所定のエラー処理を行う(S129)。一方、当該一般プログラムが正常であると判断すると(S110:YES)、SDRAM9のデータ領域SD−Dに記憶されている書き換えデータからフォントデータの書き換えデータを読み出し、FlashROM8のフォント領域F−Fを書き換える(S111)。そして、チェッカを用いたサムチェックによりFlashROM8のフォント領域F−Fに書き込まれたフォントデータが正常であるか否かをチェックし(S112)、当該フォントデータが正常であるか否かを判断する(S113)。
If it is determined that the general program written in the general program area FP of the
FlashROM8のフォント領域F−Fに書き込まれたフォントデータが正常でないと判断すると(S113:NO)、所定のエラー処理を行う(S129)。一方、当該フォントデータが正常であると判断すると(S113:YES)、SDRAM9のデータ領域SD−Dに記憶されている書き換えデータからカーネルプログラムの書き換えデータを読み出し、FlashROM8の第2カーネル領域F−K2を書き換える(S114)。そして、チェッカを用いたサムチェックによりFlashROM8の第2カーネル領域F−K2に書き込まれたカーネルプログラムが正常であるか否かをチェックし(S115)、当該カーネルプログラムが正常であるか否かを判断する(S116)。当該カーネルプログラムが正常でないと判断すると(S116:NO)、所定のエラー処理を行う(S129)。一方、当該カーネルプログラムが正常であると判断すると(S116:YES)、ファームウェアの書き換え処理を終了する。
If it is determined that the font data written in the font area FF of the
ステップS104において、FlashROM8の第1カーネル領域F−K1に現時点で記憶されているカーネルプログラムが正常であると判断すると(S104:YES)、SDRAM9のデータ領域SD−Dに記憶されている書き換えデータから一般プログラムの書き換えデータを読み出し、FlashROM8の一般プログラム領域F−Pを書き換える(S117)。そして、チェッカを用いたサムチェックによりFlashROM8の一般プログラム領域F−Pに書き込まれた一般プログラムが正常であるか否かをチェックし(S118)、当該一般プログラムが正常であるか否かを判断する(S119)。
If it is determined in step S104 that the kernel program currently stored in the first kernel area F-K1 of the
FlashROM8の一般プログラム領域F−Pに書き込まれた一般プログラムが正常でないと判断すると(S119:NO)、所定のエラー処理を行う(S129)。一方、当該一般プログラムが正常であると判断すると(S119:YES)、SDRAM9のデータ領域SD−Dに記憶されている書き換えデータからフォントデータの書き換えデータを読み出し、FlashROM8のフォント領域F−Fを書き換える(S120)。そして、チェッカを用いたサムチェックによりFlashROM8のフォント領域F−Fに書き込まれたフォントデータが正常であるか否かをチェックし(S121)、当該フォントデータが正常であるか否かを判断する(S122)。
If it is determined that the general program written in the general program area FP of the
FlashROM8のフォント領域F−Fに書き込まれたフォントデータが正常でないと判断すると(S122:NO)、所定のエラー処理を行う(S129)。一方、当該フォントデータが正常であると判断すると(S112:YES)、SDRAM9のデータ領域SD−Dに記憶されている書き換えデータからカーネルプログラムの書き換えデータを読み出し、FlashROM8の第2カーネル領域F−K2を書き換える(S123)。そして、チェッカを用いたサムチェックによりFlashROM8の第2カーネル領域F−K2に書き込まれたカーネルプログラムが正常であるか否かをチェックし(S124)、当該カーネルプログラムが正常であるか否かを判断する(S125)。
If it is determined that the font data written in the font area FF of the
FlashROM8の第2カーネル領域F−K2に書き込まれたカーネルプログラムが正常でないと判断すると(S125:NO)、所定のエラー処理を行う(S129)。一方、当該カーネルデータが正常であると判断すると(S125:YES)、SDRAM9のデータ領域SD−Dに記憶されている書き換えデータからカーネルプログラムの書き換えデータを読み出し、FlashROM8の第1カーネル領域F−K1を書き換える(S126)。そして、チェッカを用いたサムチェックによりFlashROM8の第1カーネル領域F−K1に書き込まれたカーネルプログラムが正常であるか否かをチェックし(S127)、当該カーネルプログラムが正常であるか否かを判断する(S128)。当該カーネルプログラムが正常でないと判断すると(S128:NO)、所定のエラー処理を行う(S129)。一方、当該カーネルプログラムが正常であると判断すると(S128:YES)、ファームウェアの書き換え処理を終了する。
If it is determined that the kernel program written in the second kernel area F-K2 of the
このように、データ処理装置1では、ファームウェアを、データの種類別に分割してFlashROM8の各記憶領域F−B、F−K1、F−K2、F−P、及び、F−Fに記憶し、書き換えデータによってファームウェアをアップデートする際には、FlashROM8の各記憶領域F−B、F−K1、F−K2、F−P、及び、F−F毎にデータの書き換えを行う。そして、書き換えデータに含まれるカーネルプログラムを、FlashROM8の第1カーネル領域F−K1と第2カーネル領域F−K2との2箇所に書き込む。このような方法によってファームウェアのアップデート(書き換え)を行うと、アップデート中の停電などによりデータ処理装置1に電源断が発生した場合でも、第1カーネル領域F−K1のカーネルプログラムと第2カーネル領域F−K2のカーネルプログラムとが一度に破損することを防止することができる。つまり、例えば、第1カーネル領域F−K1のカーネルプログラムの書き換えを行った後に、第2カーネル領域F−K2のカーネルプログラムの書き換えを行う場合において、第1カーネル領域F−K1のカーネルプログラムの書き換え中に電源断が発生して当該カーネルプログラムが破損した際には、第2カーネル領域F−K2にアップデート前の古いカーネルプログラムが記憶されているので当該カーネルプログラムを実行することによってデータ処理装置1を正常に機能させることができる。また、第2カーネル領域F−K2のカーネルプログラムの書き換え中に電源断が発生して当該カーネルプログラムが破損した際には、第1カーネル領域F−K1にアップデートされた新たなカーネルプログラムが記憶されているので当該カーネルプログラムを実行することによってデータ処理装置1を正常に機能させることができる。
Thus, in the
また、FlashROM8の第1カーネル領域F−K1のカーネルプログラム及び第2カーネル領域F−K2のカーネルプログラムの書き換えを行う際に、第1カーネル領域F−K1のカーネルプログラムが破損しているか(正常であるか)否かを判断し、破損している場合には、第2カーネル領域F−K2のカーネルプログラムの書き換えに先立って第1カーネル領域F−K1のカーネルプログラムの書き換えを行う。また、第2カーネル領域F−K2のカーネルプログラムが損傷している場合(図6のステップ104の判断におけるYESの場合に含まれる)には、第1カーネル領域F−K1のカーネルプログラムの書き換えに先立って第2カーネル領域F−K2のカーネルプログラムの書き換えを行う。したがって、第1カーネル領域F−K1のカーネルプログラムと第2カーネル領域F−K2のカーネルプログラムとのどちらかが破損している状態で、第1カーネル領域F−K1のカーネルプログラム及び第2カーネル領域F−K2のカーネルプログラムの書き換えを行う場合に電源断が再び発生した場合でも、第1カーネル領域F−K1又は第2カーネル領域F−K2のどちらかに正常なカーネルプログラムが存在することとなるので、当該正常なカーネルプログラムを実行することによってデータ処理装置1を正常に機能させることができる。
In addition, when the kernel program in the first kernel area F-K1 and the kernel program in the second kernel area F-K2 of the
次に、図9を用いて、FlashROM8の第1カーネル領域F−K1に記憶されているカーネルプログラム、及び、第2カーネル領域F−K1に記憶されているカーネルプログラムを実行するためにSDRAM9の第1カーネル領域SD−K1及び第2カーネル領域SD−K2に読み込む場合に、データ処理装置1の制御部6が実行する処理(ファームウェアの読み込み方法)について説明する。データ処理装置1の制御部6は、FlashROM8のブート領域F−BからSDRAM9のブート領域SD−Bに読み込まれたブートプログラムに従って処理を実行する。なお、図9に示す各処理の実行順序は図示するものに限定されるものではなく、処理の実行順序を変更しても本発明を実現できる場合には適宜に変更してもよい。
Next, referring to FIG. 9, in order to execute the kernel program stored in the first kernel area F-K1 of the
まず、データ処理装置1に電源が投入されると、FlashROM8のブート領域F−Bに記憶されているブートプログラムがSDRAM9のブート領域SD−Bに読み込まれ、実行される(S201)。次に、制御部6は、FlashROM8の第1カーネル領域F−K1に記憶されているカーネルプログラムをSDRAM9の第1カーネル領域SD−K1に読み込みつつ、当該カーネルプログラムが正常であるか否かをチェックする(S202)。このカーネルプログラムが正常であるか否かのチェックは、FlashROM8の第1カーネル領域F−K1のチェッカ領域に記憶されているチェッカに基づくサムチェックによって行われる。つまり、制御部6は、FlashROM8の第1カーネル領域F−K1からカーネルプログラムのデータを順次に読み出して第1カーネル領域SD−K1に書き込みつつ、第1カーネル領域F−K1から読み出した各データを数値として加算し、サムチェックのための総和を求める。そして、サムチェックの結果に基づいて、FlashROM8の第1カーネル領域F−K1に記憶されているカーネルプログラム、すなわち、SDRAM9の第1カーネル領域SD−K1に読み込まれたカーネルプログラムが正常であるか否かを判断する(S203)。
First, when the
FlashROM8の第1カーネル領域F−K1に記憶されているカーネルプログラムが正常であると判断すると(S203:YES)、次に、FlashROM8の第2カーネル領域F−K2に記憶されているカーネルプログラムをSDRAM9の第2カーネル領域SD−K2に読み込みつつ、当該カーネルプログラムが正常であるか否かをチェックする(S204)。このカーネルプログラムが正常であるか否かのチェックは、FlashROM8の第2カーネル領域F−K2のチェッカ領域に記憶されているチェッカに基づくサムチェックによって行われる。そして、サムチェックの結果に基づいて、FlashROM8の第2カーネル領域F−K2に記憶されているカーネルプログラム、すなわち、SDRAM9の第2カーネル領域SD−K2に読み込まれたカーネルプログラムが正常であるか否かを判断する(S205)。
If it is determined that the kernel program stored in the first kernel area F-K1 of the
FlashROM8の第2カーネル領域F−K2に記憶されているカーネルプログラムが正常でないと判断すると(S205:NO)、第2カーネル領域F−K2のカーネルプログラムが正常であるか否かを記憶するためのF−K2エラーフラグをオン状態にし(S206)、ファームウェア(カーネルプログラム)の読み込み処理を終了する。このF−K2エラーフラグは、例えば、SDRAM9のデータ領域SD−Dなどに設けられた1バイトのデータであり、F−K2エラーフラグの最下位ビットを「1」にすることによってフラグがオン状態となる。一方、第2カーネル領域F−K2に記憶されているカーネルプログラムが正常であると判断すると(S205:YES)、ファームウェア(カーネルプログラム)の読み込み処理を終了する。
If it is determined that the kernel program stored in the second kernel area F-K2 of the
ステップS203において、FlashROM8の第1カーネル領域F−K1に記憶されているカーネルプログラムが正常でないと判断すると(S203:NO)、次に、FlashROM8の第2カーネル領域F−K2に記憶されているカーネルプログラムをSDRAM9の第1カーネル領域SD−K1に読み込みつつ、当該カーネルプログラムが正常であるか否かをチェックする(S207)。このカーネルプログラムが正常であるか否かのチェックは、FlashROM8の第2カーネル領域F−K2のチェッカ領域に記憶されているチェッカに基づくサムチェックによって行われる。そして、サムチェックの結果に基づいて、FlashROM8の第2カーネル領域F−K2に記憶されているカーネルプログラム、すなわち、SDRAM9の第1カーネル領域SD−K1に読み込まれたカーネルプログラムが正常であるか否かを判断する(S208)。
If it is determined in step S203 that the kernel program stored in the first kernel area F-K1 of the
FlashROM8の第2カーネル領域F−K2に記憶されているカーネルプログラムが正常であると判断すると(S208:YES)、第1カーネル領域F−K1のカーネルプログラムが正常であるか否かを記憶するためのF−K1エラーフラグをオン状態にし(S209)、ファームウェア(カーネルプログラム)の読み込み処理を終了する。このF−K1エラーフラグは、例えば、SDRAM9のデータ領域SD−Dなどに設けられた1バイトのデータであり、F−K1エラーフラグの最下位ビットを「1」にすることによってフラグがオン状態となる。
When it is determined that the kernel program stored in the second kernel area F-K2 of the
一方、第2カーネル領域F−K2に記憶されているカーネルプログラムが正常でないと判断すると(S208:NO)、FlashROM8の第1カーネル領域F−K1に記憶されているカーネルプログラム(破損している)を、SDRAM9の第1カーネル領域SD−K1に読み込み(S210)、F−K1エラーフラグ及びF−K2エラーフラグをともにオン状態として(S211)、ファームウェア(カーネルプログラム)の読み込み処理を終了する。なお、データ処理装置1では、上述したようなファームウェアの書き換え方法を採用しているので、第1カーネル領域F−K1のカーネルプログラムと第2カーネル領域F−K2のカーネルプログラムのどちらかは正常であり、ステップS208において、第2カーネル領域F−K2に記憶されているカーネルプログラムが正常でない(NO)と判断され、ステップS210及びステップS211に処理が進むことは想定され難い。
On the other hand, if it is determined that the kernel program stored in the second kernel area F-K2 is not normal (S208: NO), the kernel program stored in the first kernel area F-K1 of the FlashROM 8 (corrupted). Are loaded into the first kernel area SD-K1 of the SDRAM 9 (S210), both the F-K1 error flag and the F-K2 error flag are turned on (S211), and the firmware (kernel program) reading process is terminated. Since the
このように、FlashROM8の第1カーネル領域F−K1に記憶されているカーネルプログラムと第2カーネル領域F−K2に記憶されているカーネルプログラムとのうちの破損していない正常なカーネルプログラムがSDRAM9の第1カーネル領域SD−K1に読み込まれるので、ファームウェアのアップデート(書き換え)中の電源断などにより、FlashROM8の第1カーネル領域F−K1のカーネルプログラム又は第2カーネル領域F−K2のカーネルプログラムのどちらかが破損などして正常でない場合でも、データ処理装置1を正常に機能させることができる。
As described above, a normal kernel program which is not damaged among the kernel program stored in the first kernel area F-K1 and the kernel program stored in the second kernel area F-K2 of the
また、FlashROM8の第1カーネル領域F−K1及び第2カーネル領域F−K2に記憶されているカーネルプログラムを読み出して、SDRAM9の第1カーネル領域SD−K1又は第2カーネル領域SD−K2に書き込みつつ、順次にサムチェックのための演算を行うので、カーネルプログラムなどの読み込みにかかる時間を短縮することができる。
Further, the kernel program stored in the first kernel area F-K1 and the second kernel area F-K2 of the
以上に説明したように、データ処理装置1において実行されるファームウェアの書き換え方法、及び、ファームウェアの読み込み方法によれば、ファームウェアのアップデート(書き換え)中に電源断などが発生してカーネルプログラムが破損した場合でも、正常に自装置1を機能させることができる。
As described above, according to the firmware rewriting method and the firmware reading method executed in the
なお、本発明の実施形態は上述の形態に限らず、本発明の技術的思想の範囲内において種々に変更してもよい。 The embodiment of the present invention is not limited to the above-described embodiment, and various modifications may be made within the scope of the technical idea of the present invention.
本発明は、記憶装置の個々の記憶領域にデータの種類別に分割して記憶されているファームウェアの書き換え方法、及び、読み込み方法に適用可能である。 The present invention can be applied to a firmware rewriting method and a reading method in which data is divided and stored in individual storage areas of a storage device.
1 データ処理装置
6 制御部(MPU)
7 インターフェース回路
8 FlashROM
9 SDRAM
F−B ブート領域
F−K1 第1カーネル領域
F−K2 第2カーネル領域
F−P 一般プログラム領域
F−F フォント領域
1
7
9 SDRAM
FB Boot area F-K1 First kernel area F-K2 Second kernel area FP General program area FF Font area
Claims (4)
前記書き換えデータに含まれるカーネルプログラムを前記記憶装置の記憶領域の第1カーネル領域に書き込むステップ(A)と、
前記書き換えデータに含まれるカーネルプログラムを前記記憶装置の記憶領域の第2カーネル領域に書き込むステップ(B)とを含むことを特徴とするファームウェアの書き換え方法。 A rewriting method by rewriting data of firmware stored in each storage area of the storage device divided according to data type,
Writing a kernel program included in the rewrite data into a first kernel area of the storage area of the storage device;
A firmware rewriting method comprising: (B) writing a kernel program included in the rewriting data into a second kernel area of the storage area of the storage device.
前記記憶装置の記憶領域の第2カーネル領域に記憶されているカーネルプログラムが正常であるか否かを判断するステップ(D)とをさらに含み、
前記記憶装置の記憶領域の第1カーネル領域に記憶されているカーネルプログラムが正常でない場合に、前記ステップ(B)に先立って前記ステップ(A)を実行し、前記記憶装置の記憶領域の第2カーネル領域に記憶されているカーネルプログラムが正常でない場合に、前記ステップ(A)に先立って前記ステップ(B)を実行することを特徴とする請求項1に記載のファームウェアの書き換え方法。 Determining whether the kernel program stored in the first kernel area of the storage area of the storage device is normal (C);
And (D) determining whether the kernel program stored in the second kernel area of the storage area of the storage device is normal,
If the kernel program stored in the first kernel area of the storage area of the storage device is not normal, the step (A) is executed prior to the step (B), and the second storage area of the storage device 2. The firmware rewriting method according to claim 1, wherein when the kernel program stored in the kernel area is not normal, step (B) is executed prior to step (A).
前記副記憶装置の記憶領域の第1カーネル領域に記憶されているカーネルプログラムを前記主記憶装置に読み込みつつ、当該カーネルプログラムに含まれる誤り検出データに基づいて当該カーネルプログラムが正常であるか否かを判断するステップ(A)と、
前記ステップ(A)において、前記副記憶装置の記憶領域の第1カーネル領域に記憶されているカーネルプログラムが正常でないと判断した場合に、前記副記憶装置の記憶領域の第2カーネル領域に記憶されているカーネルプログラムを前記主記憶装置に読み込むステップ(B)とを備えることを特徴とするファームウェアの読み込み方法。 A method of reading firmware stored in a separate storage area of a secondary storage device according to the type of data into a main storage device,
Whether or not the kernel program is normal based on the error detection data included in the kernel program while reading the kernel program stored in the first kernel area of the storage area of the secondary storage device into the main storage device Step (A) for determining
In the step (A), when it is determined that the kernel program stored in the first kernel area of the storage area of the secondary storage device is not normal, it is stored in the second kernel area of the storage area of the secondary storage device. And a step (B) of reading a stored kernel program into the main storage device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006216397A JP2008040924A (en) | 2006-08-09 | 2006-08-09 | Firmware rewriting method and firmware reading method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006216397A JP2008040924A (en) | 2006-08-09 | 2006-08-09 | Firmware rewriting method and firmware reading method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2008040924A true JP2008040924A (en) | 2008-02-21 |
Family
ID=39175831
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006216397A Pending JP2008040924A (en) | 2006-08-09 | 2006-08-09 | Firmware rewriting method and firmware reading method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2008040924A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2014106758A (en) * | 2012-11-28 | 2014-06-09 | Kyocera Document Solutions Inc | Data write circuit and image forming apparatus |
JP2017091057A (en) * | 2015-11-05 | 2017-05-25 | 株式会社デンソー | Electronic control device and data rewrite system |
CN112527207A (en) * | 2020-12-18 | 2021-03-19 | 深圳市元征科技股份有限公司 | Method and device for storing data in EEPROM |
-
2006
- 2006-08-09 JP JP2006216397A patent/JP2008040924A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2014106758A (en) * | 2012-11-28 | 2014-06-09 | Kyocera Document Solutions Inc | Data write circuit and image forming apparatus |
JP2017091057A (en) * | 2015-11-05 | 2017-05-25 | 株式会社デンソー | Electronic control device and data rewrite system |
CN112527207A (en) * | 2020-12-18 | 2021-03-19 | 深圳市元征科技股份有限公司 | Method and device for storing data in EEPROM |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102327309B1 (en) | Information processing apparatus and method for controlling information processing apparatus | |
US10819877B2 (en) | Printing apparatus, printing apparatus control method, and storage medium connecting to an option unit update option unit program using an update program stored a storage | |
JP2008238799A (en) | Image forming device | |
JP2022135443A (en) | Information processor, method for processing information, and program | |
JP2009081742A (en) | Image forming device | |
JP2008040924A (en) | Firmware rewriting method and firmware reading method | |
JP2008085457A (en) | Image information output device, program and image information output system | |
JP2010170360A (en) | Image output device and image output system | |
JP2005275843A (en) | Data processor | |
JP2009033539A (en) | Image forming apparatus | |
JP4103823B2 (en) | Data processing device | |
US10956090B2 (en) | Memory system and electronic apparatus | |
JP4556104B2 (en) | Data processing device | |
US20200150947A1 (en) | Information processing apparatus, updating method by information processing apparatus, and recording medium | |
JP2008048229A (en) | Image processing device | |
JP2005032014A (en) | Data processor, starting program for data processor, and starting method for data processor | |
JP7500400B2 (en) | Information processing device, method for controlling information processing device, and program | |
US20220382533A1 (en) | Information processing apparatus and control method of the same | |
JP5135987B2 (en) | Image forming apparatus and erroneous printing prevention method | |
US11947948B2 (en) | Information processing apparatus, information processing method, and storage medium | |
JP7543842B2 (en) | COMMUNICATION APPARATUS, IMAGE FORMING APPARATUS, AND METHOD FOR CONTROLLING COMMUNICATION APPARATUS | |
JP2018092417A (en) | Image processing device | |
JP2011120005A (en) | Image processing apparatus and data on information processing apparatus | |
JP2010182001A (en) | Image forming apparatus | |
JP5290880B2 (en) | Electronic apparatus and image forming apparatus |