JP2005085121A - Data update method for flash memory, data update program, information processor, and information processing system - Google Patents

Data update method for flash memory, data update program, information processor, and information processing system Download PDF

Info

Publication number
JP2005085121A
JP2005085121A JP2003318435A JP2003318435A JP2005085121A JP 2005085121 A JP2005085121 A JP 2005085121A JP 2003318435 A JP2003318435 A JP 2003318435A JP 2003318435 A JP2003318435 A JP 2003318435A JP 2005085121 A JP2005085121 A JP 2005085121A
Authority
JP
Japan
Prior art keywords
data
update
flash memory
information processing
processing apparatus
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.)
Withdrawn
Application number
JP2003318435A
Other languages
Japanese (ja)
Inventor
Takeshi Hiroike
豪 廣池
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2003318435A priority Critical patent/JP2005085121A/en
Publication of JP2005085121A publication Critical patent/JP2005085121A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To enable proper calculation of a checksum without being conscious of unnecessary data, a free area size or the like before update by making a flash memory store size information about data on a program to be updated and executing the checksum calculation about only a data area of the updated program on the basis of the size information. <P>SOLUTION: This data update method updating data stored astride a sector of an erasure forbidden area of the flash memory of an information processor includes: an update data writing step for writing update data and the size information about the update data into a prescribed storage area of the flash memory; a size information reading step for reading the size information written into the prescribed storage area of the flash memory; and a checksum calculation step for reading data of only the storage area storing the update data on the basis of the size information, and performing the checksum calculation to the data. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、情報処理装置に備えられたフラッシュメモリの消去禁止領域のセクタに跨って格納されたデータを更新するデータ更新方法、データ更新プログラム、情報処理装置、及び情報処理システムに関する。   The present invention relates to a data update method, a data update program, an information processing apparatus, and an information processing system for updating data stored across sectors in an erasure prohibited area of a flash memory provided in the information processing apparatus.

情報処理装置に備えられたフラッシュメモリは、セクタ単位でデータを消去可能なメモリであり、情報処理装置を制御するプログラムや各種のデータなどがそれぞれ予め設定された記憶領域に記憶されている。   The flash memory provided in the information processing apparatus is a memory capable of erasing data in units of sectors, and stores a program for controlling the information processing apparatus, various data, and the like in respective preset storage areas.

図8は、従来のフラッシュメモリの記憶領域におけるデータ構造例の一部を示す図である。例えば、図8(a)のプログラムのデータ記憶領域はセクタA,Bに渡り、図中のセクタBに示すように、フラッシュメモリの消去禁止領域である固定情報保存領域のあるセクタにデータが格納され、データ記憶領域の区切りがセクタの境界に一致しないような場合が発生する。   FIG. 8 is a diagram showing a part of a data structure example in a storage area of a conventional flash memory. For example, the data storage area of the program shown in FIG. 8A extends over sectors A and B, and data is stored in a sector having a fixed information storage area, which is an erasure prohibited area of the flash memory, as shown in sector B in the figure. In some cases, the partition of the data storage area does not coincide with the sector boundary.

従来、このようなデータ構造のフラッシュメモリでは、プログラムをバージョンアップなどの際に更新し書き換える場合、古いデータをセクタ単位で消去し、更新された新しいプログラムデータを書き込んでいる。ところが、図8(a)の場合においては、セクタAは完全に消去して新たに更新された新しいプログラムデータを書き込むが、セクタBは消去禁止領域である固定情報保存領域のデータが存在するため、上書き動作をさせる(実際のフラッシュメモリの上書き動作としては、例えば、一旦バッファに元のデータをそのままコピーしてバッファ上にてデータの上書きを行ない、セクタBを消去し、バッファの内容をセクタBに書き込む)。
よって、記憶されているプログラムデータが、例えば、バージョンアップなどにより書き換えられる際、古いプログラムデータよりデータ量が少ない場合には、図8(b)のように更新された新しいプログラムデータが書き込まれ、古いプログラムデータの一部が残留することになる。
Conventionally, in a flash memory having such a data structure, when a program is updated and rewritten at the time of version upgrade, old data is erased in units of sectors, and updated new program data is written. However, in the case of FIG. 8A, sector A is completely erased and newly updated new program data is written, but sector B has data in a fixed information storage area which is an erasure prohibited area. (The actual flash memory overwrite operation is performed, for example, by copying the original data to the buffer as it is and overwriting the data on the buffer, erasing the sector B, and changing the contents of the buffer to the sector Write to B).
Therefore, when the stored program data is rewritten by, for example, upgrading, if the data amount is smaller than that of the old program data, the updated new program data is written as shown in FIG. Some of the old program data will remain.

従来の情報処理装置では、プログラムデータ領域全体に対してチェックサムの計算を実行していたため、たとえ更新データによる書き換えが正常終了しても、図8(b)に示す例ではチェックサム計算において不要な古いプログラムデータまで加算してしまい、チェックサムエラーになるという問題があった。   In the conventional information processing apparatus, since the checksum calculation is performed on the entire program data area, even if rewriting with update data is normally completed, the checksum calculation is not necessary in the example shown in FIG. 8B. There is a problem in that even old program data is added, resulting in a checksum error.

また、フラッシュメモリのチェックサムの計算では、プログラムのデータサイズの変化に応じて変化する空き領域サイズによっても値が変化してチェックサムエラーとなるため、空き領域についても考慮する必要があり、従来、空き領域を考慮したデータ書き込み方法及びチェックサム計算方法が提案されている(例えば、特許文献1参照)。
特開2001−175478号公報(第4〜7頁、図4)
In addition, in the calculation of the checksum of the flash memory, the value also changes depending on the free area size that changes according to the change in the program data size, resulting in a checksum error. In addition, a data writing method and a checksum calculation method in consideration of a free area have been proposed (for example, see Patent Document 1).
JP 2001-175478 A (pages 4-7, FIG. 4)

ところが、従来の空き領域を考慮したデータ更新方法及びチェックサム計算方法はプログラムデータ領域の境界とセクタ間の境界が一致していて、プログラムのデータ領域全てのセクタが消去可能な場合を前提としており、上記のような問題が完全に解決されるものではなかった。   However, conventional data update methods and checksum calculation methods that take into account free space are based on the assumption that the boundaries of the program data area coincide with the boundaries between sectors, and that all sectors of the program data area can be erased. The above problems were not completely solved.

本発明は、前記のような従来の問題を解決するものであり、更新するプログラムのデータのサイズ情報をフラッシュメモリに記憶させ、そのサイズ情報に基づいて、更新されたプログラムのデータ領域だけについてチェックサム計算を実行することにより、更新前の不要なデータや空き領域サイズなどを意識せずに的確にチェックサムの計算が行えるフラッシュメモリのデータ更新方法、データ更新プログラム、情報処理装置、及び情報処理システムを提供することを目的とする。   The present invention solves the conventional problem as described above, stores the size information of the program data to be updated in the flash memory, and checks only the data area of the updated program based on the size information. Flash memory data update method, data update program, information processing apparatus, and information processing that can accurately perform checksum calculation without being aware of unnecessary data or free space size before update by performing sum calculation The purpose is to provide a system.

上記課題を解決するために、請求項1に記載のデータ更新方法は、情報処理装置に備えられたフラッシュメモリの消去禁止領域のセクタに跨って格納されたデータを更新するデータ更新方法であって、更新データと当該更新データのサイズ情報とを前記フラッシュメモリの所定の記憶領域にそれぞれ書き込む更新データ書き込みステップと、前記フラッシュメモリの所定の記憶領域に書き込まれた前記サイズ情報を読み出すサイズ情報読み出しステップと、前記サイズ情報に基づいて、前記更新データが記憶された記憶領域のみのデータを読み出し、当該データに対してチェックサム計算を行うチェックサム計算ステップと、を含むことを特徴とする。   In order to solve the above-described problem, a data update method according to claim 1 is a data update method for updating data stored across sectors in an erase prohibition area of a flash memory provided in an information processing device. An update data write step for writing update data and size information of the update data in a predetermined storage area of the flash memory, and a size information read step for reading the size information written in the predetermined storage area of the flash memory. And a checksum calculation step of reading data only in the storage area in which the update data is stored based on the size information and performing a checksum calculation on the data.

請求項2に記載のデータ更新方法は、前記情報処理装置の再立上げ時に、前記サイズ読み出しステップ及び前記チェックサム計算ステップを実行することを特徴とする。   The data update method according to claim 2 is characterized in that the size reading step and the checksum calculation step are executed when the information processing apparatus is restarted.

請求項3に記載のデータ更新方法は、前記フラッシュメモリに格納されたデータが、前記情報処理装置を制御するプログラムのデータであることを特徴とする。   The data update method according to claim 3 is characterized in that the data stored in the flash memory is data of a program for controlling the information processing apparatus.

請求項4に記載のデータ更新方法は、前記情報処理装置がプリンタであることを特徴とする。   The data update method according to claim 4 is characterized in that the information processing apparatus is a printer.

請求項5に記載のデータ更新方法は、前記フラッシュメモリに格納されたデータが、前記プリンタのフォントデータであることを特徴とする。   The data update method according to claim 5 is characterized in that the data stored in the flash memory is font data of the printer.

請求項6に記載のデータ更新プログラムは、コンピュータに、情報処理装置に備えられたフラッシュメモリの消去禁止領域のセクタに跨って格納されたデータを更新する機能を実現させるデータ更新プログラムであって、更新データと当該更新データのサイズ情報とを前記フラッシュメモリの所定の記憶領域にそれぞれ書き込む更新データ書き込み機能と、前記フラッシュメモリの所定の記憶領域に書き込まれた前記サイズ情報を読み出すサイズ情報読み出し機能と、前記サイズ情報に基づいて、前記更新データが記憶された記憶領域のみのデータを読み出し、当該データに対してチェックサム計算を行うチェックサム計算機能と、を含むことを特徴とする。   The data update program according to claim 6 is a data update program for causing a computer to realize a function of updating data stored across sectors in an erasure prohibited area of a flash memory provided in an information processing apparatus, An update data write function for writing update data and size information of the update data in a predetermined storage area of the flash memory, and a size information read function for reading the size information written in the predetermined storage area of the flash memory; And a checksum calculation function for reading out only data in the storage area in which the update data is stored based on the size information and performing a checksum calculation on the data.

請求項7に記載の情報処理装置は、情報処理装置に備えられたフラッシュメモリの消去禁止領域のセクタに跨って格納されたデータを更新するデータ更新手段を有する情報処理装置であって、前記データ更新手段は、更新データと当該更新データのサイズ情報とを前記フラッシュメモリの所定の記憶領域にそれぞれ書き込む更新データ書き込み手段と、前記フラッシュメモリの所定の記憶領域に書き込まれた前記サイズ情報を読み出すサイズ情報読み出し手段と、前記サイズ情報に基づいて、前記更新データが記憶された記憶領域のみのデータを読み出し、当該データに対してチェックサム計算を行うチェックサム計算手段と、を有することを特徴とする。   The information processing apparatus according to claim 7, wherein the information processing apparatus includes data update means for updating data stored across sectors in an erasure prohibited area of a flash memory provided in the information processing apparatus, The update means includes update data writing means for writing update data and size information of the update data in a predetermined storage area of the flash memory, and a size for reading the size information written in the predetermined storage area of the flash memory. It comprises information reading means and checksum calculation means for reading only data in the storage area in which the update data is stored based on the size information and performing checksum calculation on the data. .

請求項8に記載の情報処理装置は、前記フラッシュメモリに格納されたデータが、情報処理装置を制御するプログラムのデータであることを特徴とする。   An information processing apparatus according to an eighth aspect is characterized in that the data stored in the flash memory is data of a program for controlling the information processing apparatus.

請求項9に記載の情報処理装置は、前記情報処理装置がプリンタであることを特徴とする。   The information processing apparatus according to claim 9 is characterized in that the information processing apparatus is a printer.

請求項10に記載の情報処理装置は、前記フラッシュメモリに格納されたデータが、前記プリンタのフォントデータであることを特徴とする。   The information processing apparatus according to claim 10 is characterized in that the data stored in the flash memory is font data of the printer.

請求項11に記載の情報処理システムは、請求項7〜10のいずれかに記載の情報処理装置と、当該情報処理装置に接続され、データのサイズ情報を含む更新データを前記情報処理装置へ送信するホストコンピュータと、を有することを特徴とする。   An information processing system according to claim 11 is connected to the information processing apparatus according to any one of claims 7 to 10 and the information processing apparatus, and transmits update data including data size information to the information processing apparatus. And a host computer.

以上のように、本発明に係るフラッシュメモリのデータ更新方法、データ更新プログラム、情報処理装置、及び情報処理システムによれば、更新前の不要なデータや空き領域のデータサイズに影響されることなく、更新されたデータのみについてチェックサム計算が実行されるため、バージョンアップなどによりプログラムデータ等が更新される場合に、書き換えが正常終了しているのにチェックサムエラーとなる現象の発生を防止できる。また、セクタの空き領域サイズを考慮した更新プログラムデータ等の作成など、煩雑な作業なども不要となる。   As described above, according to the data update method, data update program, information processing apparatus, and information processing system of the flash memory according to the present invention, it is not affected by unnecessary data before update or the data size of a free area. Since the checksum calculation is executed only for the updated data, it is possible to prevent the occurrence of a checksum error even if rewriting is completed normally when the program data etc. are updated due to version upgrade etc. . In addition, complicated work such as creation of update program data in consideration of the free area size of the sector becomes unnecessary.

以下、本発明の実施の形態を図面を参照して詳細に説明する。なお、本実施の形態では、情報処理装置の一例としてプリンタを用いる。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In this embodiment, a printer is used as an example of the information processing apparatus.

まず、プリンタの概略構成について説明する。図1は、本発明に係る実施の形態におけるプリンタの概略構成を示す斜視図である。
プリンタ10は、図1に示すように、前面が開口した筐体11と、前面開口を開閉自在に覆蓋する蓋体12とによって構成され、当該蓋体12を開放することによって、連続用紙の交換及び内部の保守、点検が可能となっている。
First, a schematic configuration of the printer will be described. FIG. 1 is a perspective view showing a schematic configuration of a printer according to an embodiment of the present invention.
As shown in FIG. 1, the printer 10 includes a casing 11 having a front opening and a lid 12 that covers the front opening so that the front opening can be opened and closed. In addition, internal maintenance and inspection are possible.

連続用紙は、巻回された状態で、プリンタ内部の用紙収容部(図示省略)に収納されている。また、用紙収納部から繰り出された連続用紙の先端側は、搬送路(図示省略)を経由して排紙口13から筐体外へ導かれる。   The continuous paper is stored in a paper storage unit (not shown) inside the printer in a wound state. Further, the leading end side of the continuous paper fed out from the paper storage unit is guided out of the housing from the paper discharge port 13 via a conveyance path (not shown).

また、プリンタ10は、コネクタ等を介してホストコンピュータ70(図2参照)と接続されており、当該ホストコンピュータからの印刷指示にしたがって、印刷制御を行う。
すなわち、ホストコンピュータからの印刷指示により、搬送路上に配置された印刷ヘッド(サーマルヘッド)51、プラテンローラ52、及びカッタ機構53を含む印刷機構部50(いずれも図2参照)を適宜駆動すると共に、連続用紙を排紙口13に向けて搬送を行い、当該搬送に伴ってキャラクタ(文字や記号など)及び絵柄等の印刷を行う。
そして、印刷を完了し、さらに連続用紙を搬送して、印刷済みの部分の後端位置がカッタ機構の切断位置に達したとき、カッタ機構により切断分離し、排紙口13から単票用紙として操作者に提供される。
The printer 10 is connected to a host computer 70 (see FIG. 2) via a connector or the like, and performs print control in accordance with a print instruction from the host computer.
That is, according to a printing instruction from the host computer, the printing mechanism unit 50 including the printing head (thermal head) 51, the platen roller 52, and the cutter mechanism 53 arranged on the conveyance path is appropriately driven (see FIG. 2). Then, the continuous paper is transported toward the paper discharge port 13, and characters (characters, symbols, etc.) and pictures are printed along with the transport.
Then, the printing is completed, the continuous paper is further conveyed, and when the rear end position of the printed portion reaches the cutting position of the cutter mechanism, it is cut and separated by the cutter mechanism, and is cut out from the paper discharge port 13 as a cut sheet paper. Provided to the operator.

また、蓋体12の前面には、プリンタ10内の動作状況や各種エラーを表示する複数のLED41、42,43が設けられている。
なお、LED41、42、43の点灯と同時にビープ音等が発生するようにして、より効果的にエラー報知を行うようにしてもよい。
In addition, a plurality of LEDs 41, 42, and 43 are provided on the front surface of the lid 12 to display the operation status in the printer 10 and various errors.
Note that error notification may be performed more effectively by generating a beep sound or the like simultaneously with the lighting of the LEDs 41, 42, and 43.

次に、本発明に係る実施の形態におけるプリンタについて図を参照して説明する。図2は、プリンタの構成を示す機能ブロック図である。
プリンタ10は、図2に示すように、制御部20と、操作部30と、表示部40と、印刷機構部50と、入出力インターフェース部60と、によって構成される。なお、プリンタ10は、データ書き込み装置としてのホストコンピュータ70に接続され情報処理システムを構成する。
Next, a printer according to an embodiment of the present invention will be described with reference to the drawings. FIG. 2 is a functional block diagram illustrating the configuration of the printer.
As shown in FIG. 2, the printer 10 includes a control unit 20, an operation unit 30, a display unit 40, a printing mechanism unit 50, and an input / output interface unit 60. The printer 10 is connected to a host computer 70 serving as a data writing device and constitutes an information processing system.

制御部20は、プリンタ10の動作に関わる制御を行うブロックであり、プリンタ10全体の動作を統括制御するCPU21と、このCPU21が実行する制御プログラムなどを格納するフラッシュメモリ22と、CPU21の作業エリアとしてのRAM23と、を含んで構成される。   The control unit 20 is a block that performs control related to the operation of the printer 10. The CPU 21 controls the overall operation of the printer 10, the flash memory 22 that stores a control program executed by the CPU 21, and the work area of the CPU 21. And a RAM 23.

操作部30は、プリンタ10への動作命令の入力などを行うための各種キーやボタン類で構成される。また、表示部40は、プリンタ10の動作状況やエラー等を報知するためのLED41、42、43などを含む。   The operation unit 30 includes various keys and buttons for inputting operation commands to the printer 10. In addition, the display unit 40 includes LEDs 41, 42, 43 and the like for notifying the operation status and errors of the printer 10.

さらに、プリンタ10(制御部20)とホストコンピュータ70との間におけるデータや命令の送受信は、入出力インターフェース部60を介して実行される。
本発明の実施の形態における情報処理システムでは、プリンタ10が、ホストコンピュータ70から印刷用データやプリンタ10の各種制御プログラムの更新データなどを受信する。
Further, transmission / reception of data and commands between the printer 10 (control unit 20) and the host computer 70 is executed via the input / output interface unit 60.
In the information processing system according to the embodiment of the present invention, the printer 10 receives print data, update data of various control programs for the printer 10, and the like from the host computer 70.

ここで、フラッシュメモリ22の内部データ構造について説明する。図3は、本発明の実施の形態におけるプリンタのフラッシュメモリのデータ構造を示すメモリマップである。
フラッシュメモリ22は、ブート領域、固定情報保存領域、プログラムデータ領域、グラフィックスデータ保存領域、フォントデータ領域に細分されている。
Here, the internal data structure of the flash memory 22 will be described. FIG. 3 is a memory map showing the data structure of the flash memory of the printer in the embodiment of the present invention.
The flash memory 22 is subdivided into a boot area, a fixed information storage area, a program data area, a graphics data storage area, and a font data area.

ブート領域には、全体のプログラムを起動するための起動プログラム、外部のデータ書き込み装置(すなわち、ホストコンピュータ70)から書き込みデータを受け取るための通信プログラム、書き換え実行プログラム、チェックサム算出プログラムなどが格納されている。   The boot area stores a start program for starting the entire program, a communication program for receiving write data from an external data writing device (that is, the host computer 70), a rewrite execution program, a checksum calculation program, and the like. ing.

また、固定情報保存領域には、プリンタ10の機種名コード、シリアル番号、チェックサム、チェックサム対象領域のサイズ情報、などの情報が格納される。   The fixed information storage area stores information such as the model name code, serial number, checksum, and checksum target area size information of the printer 10.

また、プログラムデータ領域には、プリンタ10を制御するプログラム等が格納される。このプログラムの書き換えは、例えばバージョンアップなどにより発生し、この領域の書き換えが実行される。書き換えを行う際、更新プログラムデータのサイズにより領域末端の空き領域サイズが変化する。   The program data area stores a program for controlling the printer 10 and the like. This rewriting of the program occurs, for example, due to version upgrade and the rewriting of this area is executed. When rewriting, the free space size at the end of the region changes depending on the size of the update program data.

また、グラフィックスデータ保存領域には、ロゴマークなどの画像データが格納され、フォントデータ領域には文字データが格納される。
例えば、対応する言語を変更したい場合はフォントデータを変更する必要があるため、この領域においても書き換えが必要となる。当然のことながら、上記と同様に、書き換えを行うフォントデータのサイズにより領域末端の空き領域サイズが変化する。
The graphics data storage area stores image data such as logo marks, and the font data area stores character data.
For example, if it is desired to change the corresponding language, it is necessary to change the font data, so rewriting is also required in this area. Naturally, as described above, the free space size at the end of the region changes depending on the size of the font data to be rewritten.

次に、プリンタ10のプログラム書き換え動作について説明する。
なお、書き換えデータである更新プログラムデータは、データ書き込み装置としてのホストコンピュータ70等から受信するものとする。
Next, the program rewriting operation of the printer 10 will be described.
Note that update program data, which is rewrite data, is received from a host computer 70 or the like as a data writing device.

図4は、本発明に係る実施の形態におけるプリンタのプログラム更新動作の手順を示すフローチャートである。
まず、プリンタ10の操作者が所定の入力を行うと、CPU21がこれを検知してデータ更新モードに移行する(S101)。CPU21は、ホストコンピュータ70から書き換えデータを受信して(S102)、RAM23に格納する(S103)。
FIG. 4 is a flowchart showing the procedure of the program update operation of the printer according to the embodiment of the present invention.
First, when the operator of the printer 10 makes a predetermined input, the CPU 21 detects this and shifts to the data update mode (S101). The CPU 21 receives the rewrite data from the host computer 70 (S102) and stores it in the RAM 23 (S103).

なお、ホストコンピュータ70から更新プログラムデータを受信するための通信プログラムは予めフラッシュメモリ22から読み出されている。   A communication program for receiving update program data from the host computer 70 is read from the flash memory 22 in advance.

ここで、書き換えデータは、書き換え対象のプリンタ10の機種名コードや基板名コード、日付、バージョン番号等のデータを含むヘッダと、更新プログラム及び当該更新プログラムのデータサイズ、チェックサムなどの情報からなる書き込み情報と、データの終了を示すフッタとを含んでいる。
CPU21は、ヘッダの情報から書き換え対象を判定する(S104)。
Here, the rewrite data includes a header including data such as a model name code, a board name code, a date, and a version number of the printer 10 to be rewritten, and information such as an update program, the data size of the update program, and a checksum. It includes write information and a footer indicating the end of data.
The CPU 21 determines a rewrite target from the header information (S104).

次に、CPU21はフラッシュメモリ22のブート領域から書き込みに必要な書き換え実行プログラムを予め読み出して、RAM23に格納する(S105)。   Next, the CPU 21 reads in advance a rewrite execution program necessary for writing from the boot area of the flash memory 22 and stores it in the RAM 23 (S105).

次に、CPU21は、RAM23に一時記憶された更新プログラムデータをフラッシュメモリ22のプログラムデータ領域に書き込む(S106)。その際、更新プログラムデータのデータサイズ及びチェックサムは、フラッシュメモリ22の固定情報保存領域内の更新プログラムのバージョンに応じた固定アドレスに書き込まれる。   Next, the CPU 21 writes the update program data temporarily stored in the RAM 23 to the program data area of the flash memory 22 (S106). At this time, the data size and checksum of the update program data are written to a fixed address corresponding to the version of the update program in the fixed information storage area of the flash memory 22.

次に、プリンタ10のデータ書き換え後におけるチェックサム計算動作について説明する。
図5は、本発明に係る実施の形態におけるプリンタのチェックサム計算動作の手順を示すフローチャートである。
Next, a checksum calculation operation after data rewriting of the printer 10 will be described.
FIG. 5 is a flowchart showing the procedure of the checksum calculation operation of the printer according to the embodiment of the present invention.

まず、CPU21は、チェックサム計算プログラムに従って、フラッシュメモリ22上にある固定情報保存領域内の更新プログラムのバージョンに応じた固定アドレスにアクセスし、チェックサム対象領域のサイズ(すなわち、上記の手順で書き込みを行った更新プログラムのデータサイズ)情報を取得する(S201)。   First, the CPU 21 accesses a fixed address corresponding to the version of the update program in the fixed information storage area in the flash memory 22 according to the checksum calculation program, and writes the size of the checksum target area (that is, the above procedure). (Data size of the update program that has been performed) information is acquired (S201).

次に、CPU21は対象領域のサイズがフラッシュメモリ22のプログラムデータ領域より大きいか否かを判断する(S202)。
データサイズがプログラムデータ領域より大きい場合(S202;YES)、更新プログラムのデータサイズが大きすぎてプログラムデータ領域内に格納しきれなかったことが想定されるので、CPU21はエラーと判断する。
一方、データサイズがプログラムデータ領域と同じ又はそれより小さい場合(S202;NO)、CPU21は、読み出しポインタをチェックサム対象領域の先頭にセットする(S203)。図3のメモリマップの例では、アドレスFA0000に読み出しポインタがセットされる。
Next, the CPU 21 determines whether or not the size of the target area is larger than the program data area of the flash memory 22 (S202).
When the data size is larger than the program data area (S202; YES), it is assumed that the data size of the update program is too large to be stored in the program data area, so the CPU 21 determines that an error has occurred.
On the other hand, when the data size is the same as or smaller than the program data area (S202; NO), the CPU 21 sets the read pointer at the head of the checksum target area (S203). In the example of the memory map of FIG. 3, a read pointer is set at address FA0000.

次に、CPU21は、変数SUM及び読み出し済みサイズの両方のパラメータを0にクリアして初期化する(S204)。その後、データの読み出しを開始すると、CPU21は、読み出したデータの値を変数DATAに代入し、読み出し済みサイズのパラメータを1インクリメントする(S205)。
そして、CPU21は、変数SUMの値に変数DATAの値を加算する(S206)。
Next, the CPU 21 clears and initializes both parameters of the variable SUM and the read size (S204). Thereafter, when data reading is started, the CPU 21 substitutes the value of the read data into the variable DATA, and increments the read size parameter by 1 (S205).
Then, the CPU 21 adds the value of the variable DATA to the value of the variable SUM (S206).

次に、CPU21は、読み出し済みサイズが対象領域サイズより小さいか否かを判断する(S207)。
すなわち、このステップS207ではプログラムデータ領域内における記憶された更新プログラム部分の読み出しが終了したか否かを判断している。読み出し済みサイズが対象領域サイズより小さい場合、すなわち、更新プログラム部分の読み出しが完了していない場合(S207;YES)、読み出しポインタを1進めてから(S208)、ステップS205に戻り、同様の手順を繰り返してデータの読み出しを行う。
Next, the CPU 21 determines whether or not the read size is smaller than the target area size (S207).
That is, in this step S207, it is determined whether or not reading of the stored update program portion in the program data area has been completed. When the read size is smaller than the target area size, that is, when the reading of the update program part is not completed (S207; YES), the read pointer is advanced by 1 (S208), and the process returns to step S205 and the same procedure is performed. Data is read repeatedly.

一方、読み出し済みサイズが対象領域サイズと同じ又はそれ以上となった場合、すなわち、更新プログラム部分の読み出しが完了した場合(S207;NO)、ステップS209へ進み、フラッシュメモリ22の固定情報保存領域にアクセスし、チェックサム情報を取得する。   On the other hand, when the read size is equal to or larger than the target area size, that is, when the reading of the update program part is completed (S207; NO), the process proceeds to step S209, and the fixed information storage area of the flash memory 22 is stored. Access and get checksum information.

CPU21は、取得したチェックサムを変数SUMに加算して(S210)、この変数SUMの下位4桁がFFFF(16進数)となるか否かを判断する(S211)。   The CPU 21 adds the acquired checksum to the variable SUM (S210), and determines whether or not the lower 4 digits of the variable SUM are FFFF (hexadecimal number) (S211).

上記の通り、更新プログラムのデータの総和とチェックサムの合計の下位4桁がFFFF(16進数)となるように予め算定されたチェックサムがフラッシュメモリの固定情報保存領域に格納されているので、変数SUMの下位4桁がFFFFとならない場合は、データの欠落などが発生して正常な書き込み(書き換え)が行えなかった、すなわちチェックサムエラーと判断する。
一方、変数SUMの下位4桁がFFFFとなる場合はチェックサムが正常であると判断する。
As described above, since the checksum calculated in advance so that the lower 4 digits of the sum of the update program data and the sum of the checksum is FFFF (hexadecimal number) is stored in the fixed information storage area of the flash memory, When the lower 4 digits of the variable SUM do not become FFFF, it is determined that a data write or the like has occurred and normal writing (rewriting) has not been performed, that is, a checksum error.
On the other hand, when the lower 4 digits of the variable SUM are FFFF, it is determined that the checksum is normal.

なお、CPU21は、プリンタ10の電源を一旦オフにした後の再投入時においても上記のチェックサム計算動作をデータのサイズ情報に基づいて同様に実行する。   The CPU 21 similarly performs the above checksum calculation operation based on the data size information even when the printer 10 is turned off and then turned on again.

上述のように書き換えが行われる際に、プリンタ10に設けられたLED41,42,43を利用して、その動作状況やエラーなどを操作者に報知することもできる。
その報知方法としては、LED41,42,43のうちの例えば1つのLEDを使用して、その点滅パターンを変えることにより、複数の種類の情報を操作者に報知することができる。
When rewriting is performed as described above, the operation status or error can be notified to the operator by using the LEDs 41, 42, and 43 provided in the printer 10.
As the notification method, for example, one LED of the LEDs 41, 42, and 43 is used, and by changing the blinking pattern, a plurality of types of information can be notified to the operator.

例えば、図6に示すように、プリンタ10に対してプログラムを書き換えている最中に、現在どのような書き換え動作が行われているかをLEDの点滅パターンにより報知することができる。図6に示す例では、3種類の点滅パターンが設定されており、ホストコンピュータ70からのコマンドに応じた通常のデータ書き換えモード、操作部30の操作によってデータ更新モードに移行する強制書き換えモード、チェックサムエラーによる再書き換えモードのいずれであるかを、LEDの点滅を操作者が目視することにより把握することができる。   For example, as shown in FIG. 6, during rewriting of a program to the printer 10, what rewriting operation is currently performed can be notified by a blinking pattern of LEDs. In the example shown in FIG. 6, three types of flashing patterns are set, a normal data rewrite mode according to a command from the host computer 70, a forced rewrite mode that shifts to a data update mode by operation of the operation unit 30, and a check It can be grasped by the operator visually observing the blinking of the LED which is the rewriting mode due to the thumb error.

また、図7に示すように、現在起動している書き換えプログラムの種類(プログラムA,プログラムB,プログラムC)に応じて、点滅パターンを変化させることなども可能である。書き換えプログラムの一例として、プログラムデータとフォントデータを同時に書き換えるプログラム、プログラムデータのみを書き換えるプログラム、フォントデータのみを書き換えるプログラム等がある。   Further, as shown in FIG. 7, it is possible to change the blinking pattern in accordance with the type of rewriting program that is currently activated (program A, program B, program C). As an example of the rewriting program, there are a program for rewriting program data and font data at the same time, a program for rewriting only program data, a program for rewriting only font data, and the like.

以上のように、LED点滅パターンを使用した報知方法によれば、プログラム書き換え中にLEDが所定のパターンで点滅するため、プログラムの書き換え中に不用意にプリンタ10の電源が切断され、書き換え動作が失敗するというような事態が防止される。   As described above, according to the notification method using the LED blinking pattern, the LED blinks in a predetermined pattern during the program rewriting, so that the printer 10 is inadvertently turned off during the program rewriting and the rewriting operation is performed. The situation of failure is prevented.

以上説明してきたように、従来は、プログラムデータ領域が含まれるすべてのセクタ全体に渡ってチェックサムの計算を行っていたため、更新されたプログラム領域の直後に更新前のプログラムデータが残っているような場合には書き換えが正常終了してもチェックサムエラーが発生することがあったが、上述のデータ更新方法によれば、更新プログラムのデータサイズがフラッシュメモリ内の所定の領域に記憶されるので、記憶されたデータサイズ情報に基づいて、チェックサム対象領域(すなわち、更新プログラム部分)だけでチェックサムの計算を実行することができる。   As described above, conventionally, since the checksum is calculated over the entire sector including the program data area, it seems that the program data before update remains immediately after the updated program area. In this case, a checksum error may occur even if the rewriting is completed normally. However, according to the above data update method, the data size of the update program is stored in a predetermined area in the flash memory. Based on the stored data size information, the checksum can be calculated only in the checksum target area (that is, the update program portion).

つまり、プログラムデータ領域内の不要なデータがチェックサムの計算に供されることが防止される。また、予め空き領域を考慮した更新プログラムの準備や、書き換えを行うフラッシュメモリの空き領域のサイズを算出する特別なプログラムの準備など、煩雑な作業が不要となるため、プリンタ(情報処理装置)の操作者は更新プログラムのデータサイズによって変化する空き領域を意識せずに、しかも的確にプログラムの書き換え動作を行うことができる。   That is, unnecessary data in the program data area is prevented from being used for checksum calculation. In addition, since troublesome work such as preparation of an update program in consideration of the free area in advance and preparation of a special program for calculating the size of the free area of the flash memory to be rewritten is unnecessary, the printer (information processing apparatus) The operator can perform the program rewrite operation accurately without being aware of the free space that changes depending on the data size of the update program.

なお、本実施の形態では、チェックサム計算動作の一例としてプリンタのプログラムの書き換え時について説明したが、例えば、フォントデータ(すなわち、データ)の書き換え時にも同様のチェックサム計算方法が適用できることは言うまでもない。   In the present embodiment, the case of rewriting the printer program has been described as an example of the checksum calculation operation. Needless to say, for example, the same checksum calculation method can be applied when rewriting font data (that is, data). Yes.

つまり、書き換えを行うのは制御プログラムなどのプログラムデータであっても、フォントデータなどのデータであってもよい。また、前述の発明の実施の形態では、プリンタを用いたが、具体的な構成はこの実施の形態に限定されるものではなく、フラッシュメモリを備える情報処理装置であればどのような装置にも適用可能である。   That is, it is possible to rewrite program data such as a control program or data such as font data. In the above-described embodiment of the invention, the printer is used. However, the specific configuration is not limited to this embodiment, and any information processing apparatus including a flash memory may be used. Applicable.

以上説明してきたように、本発明は、フラッシュメモリ備えるプリンタなどの情報処理装置に対して有効に利用可能である。   As described above, the present invention can be effectively used for an information processing apparatus such as a printer having a flash memory.

本発明に係る実施の形態におけるプリンタの概略構成を示す図である。1 is a diagram illustrating a schematic configuration of a printer according to an embodiment of the present invention. 本発明に係る実施の形態におけるプリンタの内部構成を示す図である。1 is a diagram illustrating an internal configuration of a printer according to an embodiment of the present invention. 本発明に係る実施の形態におけるプリンタの、フラッシュメモリのデータ構造を示す図である。It is a figure which shows the data structure of the flash memory of the printer in embodiment which concerns on this invention. 本発明に係る実施の形態におけるプリンタのプログラム書き換え動作の手順を示すフローチャートである。6 is a flowchart illustrating a procedure of a program rewrite operation of the printer according to the embodiment of the present invention. 本発明に係る実施の形態におけるプリンタのチェックサム計算動作の手順を示すフローチャートである。It is a flowchart which shows the procedure of the checksum calculation operation | movement of the printer in embodiment which concerns on this invention. 本発明に係る実施の形態におけるプリンタのLED点滅パターンの一例を示す図である。It is a figure which shows an example of the LED blink pattern of the printer in embodiment which concerns on this invention. 本発明に係る実施の形態におけるプリンタのLED点滅パターンの他の例を示す図である。It is a figure which shows the other example of the LED blink pattern of the printer in embodiment which concerns on this invention. 従来のフラッシュメモリの書き込み可能領域におけるデータ構造例を示す図である。It is a figure which shows the example of a data structure in the writable area | region of the conventional flash memory.

符号の説明Explanation of symbols

10・・・プリンタ(情報処理装置)、11・・・筐体、12・・・蓋体、20・・・制御部、21・・・CPU、22・・・フラッシュメモリ、23・・・RAM、41,42,43・・・LED、70・・・ホストコンピュータ   DESCRIPTION OF SYMBOLS 10 ... Printer (information processing apparatus), 11 ... Case, 12 ... Cover, 20 ... Control part, 21 ... CPU, 22 ... Flash memory, 23 ... RAM 41, 42, 43 ... LED, 70 ... host computer

Claims (11)

情報処理装置に備えられたフラッシュメモリの消去禁止領域のセクタに跨って格納されたデータを更新するデータ更新方法であって、
更新データと当該更新データのサイズ情報とを前記フラッシュメモリの所定の記憶領域にそれぞれ書き込む更新データ書き込みステップと、
前記フラッシュメモリの所定の記憶領域に書き込まれた前記サイズ情報を読み出すサイズ情報読み出しステップと、
前記サイズ情報に基づいて、前記更新データが記憶された記憶領域のみのデータを読み出し、当該データに対してチェックサム計算を行うチェックサム計算ステップと、を含むことを特徴とするデータ更新方法。
A data update method for updating data stored across sectors in an erasure prohibited area of a flash memory provided in an information processing device,
An update data writing step of writing update data and size information of the update data respectively in a predetermined storage area of the flash memory;
A size information reading step of reading the size information written in a predetermined storage area of the flash memory;
A data update method comprising: a checksum calculation step of reading only data in a storage area in which the update data is stored based on the size information and performing a checksum calculation on the data.
前記情報処理装置の再立上げ時に、前記サイズ読み出しステップ及び前記チェックサム計算ステップを実行することを特徴とする請求項1に記載のデータ更新方法。 The data update method according to claim 1, wherein the size reading step and the checksum calculation step are executed when the information processing apparatus is restarted. 前記フラッシュメモリに格納されたデータは、前記情報処理装置を制御するプログラムのデータであることを特徴とする請求項1又は2に記載のデータ更新方法。 The data update method according to claim 1, wherein the data stored in the flash memory is data of a program that controls the information processing apparatus. 前記情報処理装置がプリンタであることを特徴とする請求項1〜3のいずれかに記載のデータ更新方法。 The data update method according to claim 1, wherein the information processing apparatus is a printer. 前記フラッシュメモリに格納されたデータは、前記プリンタのフォントデータであることを特徴とする請求項4に記載のデータ更新方法。 5. The data updating method according to claim 4, wherein the data stored in the flash memory is font data of the printer. コンピュータに、情報処理装置に備えられたフラッシュメモリの消去禁止領域のセクタに跨って格納されたデータを更新する機能を実現させるデータ更新プログラムであって、
更新データと当該更新データのサイズ情報とを前記フラッシュメモリの所定の記憶領域にそれぞれ書き込む更新データ書き込み機能と、
前記フラッシュメモリの所定の記憶領域に書き込まれた前記サイズ情報を読み出すサイズ情報読み出し機能と、
前記サイズ情報に基づいて、前記更新データが記憶された記憶領域のみのデータを読み出し、当該データに対してチェックサム計算を行うチェックサム計算機能と、を含むことを特徴とするデータ更新プログラム。
A data update program for causing a computer to realize a function of updating data stored across sectors in an erasure prohibited area of a flash memory provided in an information processing apparatus,
An update data writing function for writing update data and size information of the update data in a predetermined storage area of the flash memory,
A size information read function for reading the size information written in a predetermined storage area of the flash memory;
A data update program comprising: a checksum calculation function that reads out only data in a storage area in which the update data is stored based on the size information and performs a checksum calculation on the data.
情報処理装置に備えられたフラッシュメモリの消去禁止領域のセクタに跨って格納されたデータを更新するデータ更新手段を有する情報処理装置であって、
前記データ更新手段は、
更新データと当該更新データのサイズ情報とを前記フラッシュメモリの所定の記憶領域にそれぞれ書き込む更新データ書き込み手段と、
前記フラッシュメモリの所定の記憶領域に書き込まれた前記サイズ情報を読み出すサイズ情報読み出し手段と、
前記サイズ情報に基づいて、前記更新データが記憶された記憶領域のみのデータを読み出し、当該データに対してチェックサム計算を行うチェックサム計算手段と、を有することを特徴とする情報処理装置。
An information processing apparatus having data updating means for updating data stored across sectors in an erasure prohibited area of a flash memory provided in the information processing apparatus,
The data update means includes
Update data writing means for writing update data and size information of the update data in a predetermined storage area of the flash memory, and
Size information reading means for reading the size information written in a predetermined storage area of the flash memory;
An information processing apparatus comprising: checksum calculation means for reading out data only in a storage area in which the update data is stored based on the size information and performing checksum calculation on the data.
前記フラッシュメモリに格納されたデータは、情報処理装置を制御するプログラムのデータであることを特徴とする請求項7に記載の情報処理装置。 The information processing apparatus according to claim 7, wherein the data stored in the flash memory is data of a program that controls the information processing apparatus. 前記情報処理装置がプリンタであることを特徴とする請求項7又は8に記載の情報処理装置。 The information processing apparatus according to claim 7, wherein the information processing apparatus is a printer. 前記フラッシュメモリに格納されたデータは、前記プリンタのフォントデータであることを特徴とする請求項9に記載の情報処理装置。 The information processing apparatus according to claim 9, wherein the data stored in the flash memory is font data of the printer. 請求項7〜10のいずれかに記載の情報処理装置と、当該情報処理装置に接続され、データのサイズ情報を含む更新データを前記情報処理装置へ送信するホストコンピュータと、を有することを特徴とする情報処理システム。 An information processing apparatus according to claim 7, and a host computer connected to the information processing apparatus and transmitting update data including data size information to the information processing apparatus. Information processing system.
JP2003318435A 2003-09-10 2003-09-10 Data update method for flash memory, data update program, information processor, and information processing system Withdrawn JP2005085121A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003318435A JP2005085121A (en) 2003-09-10 2003-09-10 Data update method for flash memory, data update program, information processor, and information processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003318435A JP2005085121A (en) 2003-09-10 2003-09-10 Data update method for flash memory, data update program, information processor, and information processing system

Publications (1)

Publication Number Publication Date
JP2005085121A true JP2005085121A (en) 2005-03-31

Family

ID=34417724

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003318435A Withdrawn JP2005085121A (en) 2003-09-10 2003-09-10 Data update method for flash memory, data update program, information processor, and information processing system

Country Status (1)

Country Link
JP (1) JP2005085121A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008108162A (en) * 2006-10-27 2008-05-08 Megachips Lsi Solutions Inc Memory management method
US8352835B2 (en) 2009-06-10 2013-01-08 International Business Machines Corporation Data verification using checksum sidefile
US8468423B2 (en) 2011-09-01 2013-06-18 International Business Machines Corporation Data verification using checksum sidefile
US9442740B2 (en) 2011-04-01 2016-09-13 Seiko Epson Corporation Data writing method and data writing device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008108162A (en) * 2006-10-27 2008-05-08 Megachips Lsi Solutions Inc Memory management method
US8352835B2 (en) 2009-06-10 2013-01-08 International Business Machines Corporation Data verification using checksum sidefile
US9442740B2 (en) 2011-04-01 2016-09-13 Seiko Epson Corporation Data writing method and data writing device
US8468423B2 (en) 2011-09-01 2013-06-18 International Business Machines Corporation Data verification using checksum sidefile
US8473816B2 (en) 2011-09-01 2013-06-25 International Business Machines Corporation Data verification using checksum sidefile

Similar Documents

Publication Publication Date Title
US7634648B2 (en) Data processing apparatus and control method for a data processing apparatus that temporarily provides a plurality of boot sectors in flash ROM
JP2009053901A (en) Printer
JP4513849B2 (en) printer
JP2005085121A (en) Data update method for flash memory, data update program, information processor, and information processing system
JP5299263B2 (en) Printing system, printer, and dedicated USB memory
JP2004341783A (en) Data storage method and data storage device
JPH06314202A (en) Image-forming device
JP4491220B2 (en) Small printed matter creating apparatus, small printed matter creating method, and small printed matter creating program
JP5561149B2 (en) printer
JP4239392B2 (en) Printing apparatus, printing system, and printing method
JP2000263897A (en) Image-forming apparatus and method for updating control program of image-forming apparatus
EP2565778A2 (en) Printer, print processing program, and print processing method
US20220253233A1 (en) Memory control device and method
JPH05274157A (en) Image generating device
JPH06219021A (en) Image forming device
JP2005172843A (en) Display apparatus, display method and computer program
JP4635831B2 (en) Printer and printer control method
JP2004291501A (en) Printing controller and printing control program
JP2006211179A (en) Image forming apparatus
JPH08174922A (en) Electronic apparatus and controlling method therefor
JP2007055042A (en) Image recording device
JP2006264023A (en) Image forming apparatus and method
JPH11306006A (en) Peripheral device and storage medium
JP2005250686A (en) Document creation device, tape printer, program, and method for creating document
JP2004021582A (en) Information processing system, rewriting method of firmware, rewriting program and recording medium

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20061205