JP4652492B2 - Program rewriting device - Google Patents

Program rewriting device Download PDF

Info

Publication number
JP4652492B2
JP4652492B2 JP05667498A JP5667498A JP4652492B2 JP 4652492 B2 JP4652492 B2 JP 4652492B2 JP 05667498 A JP05667498 A JP 05667498A JP 5667498 A JP5667498 A JP 5667498A JP 4652492 B2 JP4652492 B2 JP 4652492B2
Authority
JP
Japan
Prior art keywords
program
rewrite
rewriting
normal
storage unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP05667498A
Other languages
Japanese (ja)
Other versions
JPH11259287A (en
Inventor
孝弘 池田
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.)
Nikon Corp
Original Assignee
Nikon 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 Nikon Corp filed Critical Nikon Corp
Priority to JP05667498A priority Critical patent/JP4652492B2/en
Priority to US09/263,195 priority patent/US6311322B1/en
Publication of JPH11259287A publication Critical patent/JPH11259287A/en
Application granted granted Critical
Publication of JP4652492B2 publication Critical patent/JP4652492B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、電子機器に内蔵されるプログラム書き換え装置にかかり、特に電子機器の動作を制御するプログラムを書き換えるプログラム書き換え装置に関する。
【0002】
【従来の技術】
電子機器の動作を制御するプログラムは、通常、電子機器内に設けられたMASKROM、EPROM、EEPROM、フラッシュメモリなどに格納されている。これらのメモリは、読み出し専用のメモリである。しかし、EPROM、EEPROM、フラッシュメモリなどは、特別の装置を使用することにより、メモリに格納されたプログラムを電気的に書き換えることができる。電子機器内に設けられたCPUは、前記メモリに格納されたプログラムにしたがって、電子機器内の各部を制御する。
【0003】
最近では、パソコンの周辺機器(スキャナ、プリンタ、モデムなど)やパソコンのマザーボードなどの電子機器において、電子機器における機能追加や電子機器に生じる障害の解消のため、前記メモリに格納されたプログラムを書き換える必要が生じる。この様な場合、電子機器内の前記メモリと更新されたプログラムを格納しているメモリとを交換する手間を省くため、下記の2つの方法が用いられている。
【0004】
(1)プログラムを格納するメモリは、EEPROMやフラッシュメモリなどの電気的に書き換え可能なメモリとする。電子機器は、メモリに格納されているプログラムを書き換える場合、パソコンから変更されたプログラムをダウンロードする。次に、電子機器は、電子機器内において、プログラムの書き換えを行う。
こうして、電子機器の機能追加や障害の解消が行われる。
【0005】
(2)プログラムのブート部分(通信等の初期化部分)だけが、MASKROMやEPROMに格納されている。電子機器の電源投入時には、パソコンと電子機器との通信機能だけが動作可能になる。電子機器を制御するためのプログラムは、パソコン側において、前記電子機器のドライバソフトを立ち上げる度に、前記通信機能により、電子機器内のRAMにダウンロードされる。そして、CPUは、RAMにダウンロードされたプログラムにしたがって、電子機器内の各部を制御する。電子機器の機能追加や障害の解消をする場合、最新のドライバソフトがパソコンにセットされる。したがって、電子機器は、電子機器を制御するための更新されたプログラムをRAM格納することができる。電子機器は、プログラムを格納しているメモリを交換する必要は無い。こうして、電子機器の機能追加や障害の解消が行われる。
【0006】
上記2つの方法において、機能追加や障害を解消する変更プログラムは、パソコン通信やインターネットのホームページから、通信回線を介してユーザに配布される。したがって、ユーザがメーカに電子機器を送り返したり、ユーザがサービスの窓口まで電子機器を持ち込む必要がない。また、メーカの担当者が電子機器を分解して、メモリを交換する必要がない。
【0007】
【発明が解決しようとする課題】
前記従来技術には、次のような問題点がある。
第1に、前記(1)の方法の場合、プログラムをEEPROMやフラッシュメモリに書き込んでいる最中に電源がダウンし、プログラムの書き込みに失敗することがある。さらに、EEPROMやフラッシュメモリへの書き込みが、何らかの原因で失敗することがある。この場合、書き換えが途中まで進んでいるプログラムは、書き換え前の部分と書き換え後の部分との間で、プログラムとしての整合が取れない。したがって、プログラムが暴走して、正常に動作しない。
【0008】
上記の状態になった電子機器は、ユーザサイドにおけるプログラムの書き換えが不可能になる。したがって、ユーザがメーカに電子機器を送り返したり、ユーザがサービスの窓口まで電子機器を持ち込む必要がある。また、メーカの担当者が電子機器を分解して、メモリを交換する必要がある。
第2に、前記(2)の方法の場合、MASKROMやEPROMに書き込まれているブート部分のプログラムは、パソコンからのダウンロードでは書き換えることができない。したがって、機能追加や障害の解消がブート部分のプログラムに生じた場合、ユーザがメーカに電子機器を送り返したり、サービスの窓口まで電子機器を持ち込む必要がある。また、メーカの担当者が電子機器を分解して、メモリを交換する必要がある。
【0009】
本発明の目的は、プログラムの書き換え中に電源が切れてしまったり、なんらかの原因でプログラムの書き換えに失敗した場合、ユーザが、再度書き換えを実行することが可能なプログラム書き換え装置を提供することにある。
【0010】
本発明の他の目的は、ユーザが、プログラムのどの部分でも、書き換えすることが可能なプログラム書き換え装置を提供することにある。
【0011】
【課題を解決するための手段】
請求項1記載のプログラム書き換え装置によれば、プログラム書き換え装置を内蔵する装置の通常プログラムと書き換え予備プログラムとを記憶する通常プログラム記憶部と、通常プログラムと書き換え予備プログラムとを外部装置から受信する受信手順と、受信した通常プログラムと書き換え予備プログラムとを通常プログラム記憶部に上書きする上書き手順と、を示す書き換えプログラムを記憶する書き換えプログラム記憶部と、第1期間に、書き換えプログラムの受信手順と上書き手順とに基づいて、通常プログラム及び書き換え予備プログラムの上書きを実行し、第1期間と異なる第2期間に、通常プログラムに基づいて、通常プログラム記憶部に上書きされた書き換え予備プログラムを書き換えプログラム記憶部に複写する制御手段とを有することを特徴とする。
【0012】
請求項2記載のプログラム書き換え装置によれば、請求項1記載のプログラム書き換え装置において、プログラムの書き換えの進行状態を判別する状態判別プログラムを記憶する状態判別プログラム記憶部を更に有し、制御手段は、第1期間よりも前に、通常プログラムが更新されたことを示す通常プログラム更新記録を設定されていない状態にするとともに、通常プログラム及び書き換え予備プログラムの上書きが完了することに応答して、通常プログラム更新記録をフラグ記憶部に設定し、また状態判別プログラムに基づいて通常プログラム更新記録の設定有無を判断し、通常プログラム更新記録が設定されていないと判断した場合、書き換えプログラムの受信手順と上書き手順とに基づいて、通常プログラム記憶部の上書きを実行することを特徴とする。
【0013】
請求項記載のプログラム書き換え装置によれば、請求項記載のプログラム書き換え装置において、制御手段は、プログラム書き換え装置を内蔵する装置の電源投入時に、通常プログラム更新記録の設定有無を判断することを特徴とする。
【0014】
請求項4記載のプログラム書き換え装置によれば、請求項2または請求項3記載のプログラム書き換え装置において、制御手段は、第2期間よりも前に、書き換え予備プログラムが更新されたことを示す書き換えプログラム更新記録を設定されていない状態にするとともに、書き換え予備プログラムの書き換えプログラム記憶部への複写が完了することに応答して、書き換えプログラム更新記録をフラグ記憶部に設定し、また通常プログラム更新記録が設定されていると判断した後、または通常プログラム更新記録が設定されていないと判断して通常プログラム記憶部の上書きが実行された後に、状態判別プログラムに基づいて書き換えプログラム更新記録の設定有無を判断し、書き換えプログラム更新記録が設定されていないと判断した場合、通常プログラムに基づいて、通常プログラム記憶部に上書きされた書き換え予備プログラムを書き換えプログラム記憶部に複写することを特徴とする。
【0015】
他のプログラム書き換え装置によれば、制御手段は、プログラム書き換え装置を内蔵する装置の電源投入時に、書き換えプログラム更新記録の設定有無を判断してもよい。
【0016】
(作用)
請求項1記載のプログラム書き換え装置によれば、通常プログラム記憶部が、プログラム書き換え装置を内蔵する装置の制御手順を含む通常プログラムと書き換え予備プログラムとを記憶し、書き換えプログラム記憶部が、通常プログラムと書き換え予備プログラムとを外部装置から受信する受信手順と、受信した通常プログラムと書き換え予備プログラムとを通常プログラム記憶部に上書きする上書き手順と、を示す書き換えプログラムを記憶し、制御手段が、第1期間に、書き換えプログラムの受信手順と上書き手順とに基づいて、通常プログラム及び書き換え予備プログラムの上書きを実行し、第1期間と異なる第2期間に、通常プログラムに基づいて、通常プログラム記憶部に上書きされた書き換え予備プログラムを書き換えプログラム記憶部に複写する。
【0017】
したがって、請求項1記載のプログラム書き換え装置によれば、外部装置から受信した通常プログラムと書き換え予備プログラムとが、第1期間に、通常プログラム記憶部に上書きされる。また、通常プログラム記憶部に上書きされた書き換え予備プログラムが、第2期間に、書き換えプログラム記憶部に複写される。
そのため、第1期間において、電子機器の電源が切れてしまうなどの原因により、通常プログラム記憶部の上書きに失敗した場合には、次のように動作する。すなわち、書き換えプログラム記憶部に格納されている書き換えプログラム(書き換え前のプログラム)が起動され、電子機器は外部装置から通常プログラムと書き換え予備プログラムを受信する。そして、受信した通常プログラムと書き換え予備プログラムが、正常に通常プログラム記憶部に上書きされる。
【0018】
また、第2期間において、電子機器の電源が切れてしまうなどの原因により、書き換え予備プログラムを書き換えプログラム記憶部に複写することに失敗した場合には、次のように動作する。すなわち、通常プログラム(書き換え後のプログラム)が再度起動され、書き換え予備プログラムの複写が行われる。これによって、書き換えプログラム記憶部は、正常に上書きされる。
【0019】
したがって、請求項1記載のプログラム書き換え装置は、通常プログラム記憶部の上書きと書き換えプログラム記憶部の上書きとを異なるタイミングで実行する。そのため、請求項1記載のプログラム書き換え装置は、プログラムの書き換え中に電源が切れてしまったり、なんらかの原因でプログラムの書き換えに失敗した場合、ユーザが、再度書き換えを実行できる。
【0020】
また、請求項1記載のプログラム書き換え装置は、ユーザが、プログラムのどの部分でも書き換えできる。
請求項2記載のプログラム書き換え装置によれば、制御手段は、通常プログラム及び書き換え予備プログラムの上書きが完了することに応答して、通常プログラム更新記録を設定する。
【0021】
したがって、請求項2記載のプログラム書き換え装置は、通常プログラム更新記録を参照することにより、通常プログラム記憶部の書き換えが完了したか否かを確認することができる。また、制御手段は、通常プログラム更新記録が設定されていないと判断した場合、書き換えプログラムの受信手順と上書き手順とに基づいて、通常プログラム記憶部の上書きを実行する。
【0022】
したがって、請求項のプログラム書き換え装置は、通常プログラム記憶部が更新されていないと判断された場合、外部装置から通常プログラムと書き換え予備プログラムを受信して、通常プログラム記憶部の上書きを実行することができる。請求項記載のプログラム書き換え装置によれば、制御手段は、プログラム書き換え装置を内蔵する装置の電源投入時に、通常プログラム更新記録の設定有無を判断する。したがって、プログラム書き換え装置を内蔵する装置が、前回の起動中に、何らかの原因により、通常プログラムの上書きに失敗したことを検出できる。
【0023】
請求項4記載のプログラム書き換え装置によれば、制御手段は、書き換え予備プログラムの書き換えプログラム記憶部への複写が完了することに応答して、書き換えプログラム更新記録をフラグ記憶部に設定し、また通常プログラム更新記録が設定されていると判断した後、または通常プログラム更新記録が設定されていないと判断して通常プログラム記憶部の上書きが実行された後に、状態判別プログラムに基づいて書き換えプログラム更新記録の設定有無を判断し、書き換えプログラム更新記録が設定されていないと判断した場合、通常プログラムに基づいて、通常プログラム記憶部に上書きされた書き換え予備プログラムを書き換えプログラム記憶部に複写する。したがって、請求項4記載のプログラム書き換え装置は、書き換えプログラム更新記録を参照することにより、書き換えプログラム記憶部の書き換えが完了したか否かを確認することができる。
【0024】
また、請求項4記載のプログラム書き換え装置によれば、制御手段は、書き換えプログラム更新記録が設定されていないと判断した場合、通常プログラムに基づいて、通常プログラム記憶部に上書きされた書き換え予備プログラムを書き換えプログラム記憶部に複写することができる。他のプログラム書き換え装置によれば、制御手段は、プログラム書き換え装置を内蔵する装置の電源投入時に、書き換えプログラム更新記録の設定有無を判断する。したがって、プログラム書き換え装置を内蔵する装置が、前回の起動中に、何らかの原因により、書き換えプログラムの上書きに失敗したことを検出できる。
【0025】
のプログラム書き換え装置によれば、通常プログラム記憶部が、プログラム書き換え装置を内蔵する装置の制御手順を含む通常プログラムを記憶し、書き換えプログラム記憶部が、通常プログラムを外部装置から受信する受信手順と、受信した通常プログラムを通常プログラム記憶部に上書きする上書き手順と、を示す書き換えプログラムを記憶し、制御手段が、書き換えプログラムに基づく通常プログラム記憶部の記憶内容の更新と、書き換えプログラム記憶部の記憶内容の更新とを異なる期間に実行する。
【0026】
したがって、のプログラム書き換え装置によれば、制御手段が、異なる期間に、通常プログラム記憶部の記憶内容の更新と書き換えプログラム記憶部の記憶内容の更新を行う。したがって、のプログラム書き換え装置は、プログラムの書き換え中に電源が切れてしまったり、なんらかの原因でプログラムの書き換えに失敗した場合、再度書き換えを実行することが可能である。また、のプログラム書き換え装置は、プログラムのどの部分でも、書き換えすることが可能である。
【0027】
【発明の実施の形態】
以下、本発明の実施の形態について図面を参照して説明する。以下に説明する実施の形態は、フィルムスキャナのフラッシュメモリに格納されたプログラムの書き換え動作を例にしている。フラッシュメモリに格納されたプログラムは、フィルムスキャナのCPUによって実行され、フィルムスキャナの各部の動作を制御する。また、以下に説明する実施の形態は、前記全ての請求項に対応する。
【0028】
図1は、フィルムスキャナ20とパソコン30とから構成される画像読取システムの一例を示すブロック図である。図1に示すように、フィルムスキャナ20は、SCSIインタフェース2を通してパソコン30と接続されている。パソコン30は、モニタ31と操作部32を備えている。モニタ31は、パソコン30の指示により表示をするものであり、CRTや液晶ディスプレイから成る。操作部32は、キーボードやマウス等の入力機器である。
【0029】
フィルムスキャナ20のCPU1は、パソコン30からの指示をSCSIインタフェース2を通して受けて、フィルムスキャナ20の各部を制御する。ここで、CPU1は、フラッシュメモリ3に格納されているプログラムに基づいて、処理を行う。また、RAM4は、CPU1が処理を行うときに、データを一時的に格納するメモリである。
【0030】
LED駆動回路5は、CPU1により制御され、LED光源11を駆動する。LED光源11は、フィルム原稿17を照明する。LED光源11から発せられる光は、図示するように、レンズ12により集光され、CCD13に到達する。CCD13の結像面には、フィルム原稿17の画像が結像する。CCD13は、フィルム原稿17上の画像を電気的な画像信号に変換する。ここで、CCD駆動回路6は、CPU1により制御され、CCD13を駆動する回路である。
【0031】
また、フィルム原稿17は、カートリッジ15からの送り出しと巻取りが可能である。すなわち、原稿駆動モータ駆動回路9は、CPU1により制御され、原稿駆動モータ16を駆動する。ここで、CPU1が、原稿駆動モータ16の回転方向や回転速度を制御することにより、フィルム原稿17の送り出しや巻き取りが可能になる。また、フィルム原稿17の位置は、CPU1が、原稿位置センサ14から出力される信号に基づいて検出する。
【0032】
CCD13は、フィルム原稿17上の画像を電気的な画像信号に変換する。CCD13から出力される画像信号は、信号処理回路7に入力される。
信号処理回路7は、CPU1により制御され、入力された画像信号に各種の信号処理を行い、A/D変換器8に出力する。
A/D変換器8は、CPU1により制御され、入力された画像信号をディジタル信号に変換する。
【0033】
A/D変換器8から出力された画像信号は、RAM4に記憶される。
RAM4に記憶された画像信号は、SCSIインタフェース2を通してパソコン30に出力される。パソコン30は画像信号を受け取り、モニタ31に表示する。
図2は、図1に示すフラッシュメモリ3の記憶内容を示す説明図である。図2に示すように、フラッシュメモリ3は、6つのプログラム領域(P1〜P6)を有している。
【0034】
ベクタ領域P1は、各プログラム領域(P1,P2〜P6)の先頭アドレス、最終アドレスなどを格納している。
状態判別プログラムP2は、フラグ領域P3を参照して、プログラムの書き換えの進行状態を判別する。
フラグ領域P3は、プログラムの書き換えの進行状態を示す複数のフラグを備える。具体的には、フラグ領域P3は、特許請求の範囲に記載する通常プログラム更新記録を示すフラグ(以下に説明する実施の形態では、通常プログラム更新フラグと称する)を格納し、また、特許請求の範囲に記載する書き換えプログラム更新記録(以下に説明する実施の形態では、書き換えプログラム更新フラグと称する)を示すフラグを格納する。
【0035】
書き換えプログラムP4は、パソコンと簡易通信するときに用いられる書き換え動作用簡易通信プログラムと、フラッシュメモリ書き換え動作制御プログラムとを備える。
通常プログラムP5は、パソコンとの通信機能とフィルムスキャナ20内の各部を制御する制御機能を備える。
【0036】
書き換え予備プログラムP6は、パソコンと簡易通信するときに用いられる書き換え動作用簡易通信プログラムと、フラッシュメモリ書き換え動作制御プログラムとを備える。
以上の構成において、特許請求の範囲に記載する書き換えプログラム記憶部は、図示するように、書き換えプログラムP4を記憶する記憶領域に相当する。
【0037】
また、特許請求の範囲に記載する通常プログラム記憶部は、図示するように、通常プログラムP5を記憶する記憶領域と書き換え予備プログラムP6を記憶する記憶領域とに相当する。
図3は、フラッシュメモリ3の書き換え処理を示すフローチャートである。なお、図3に示すフローチャートは、CPU1が、フラッシュメモリ3に格納されているプログラムにしたがって実行する。また、図3に示す各ステップS1〜S12は、図2に示す書き換えプログラムP4及び通常プログラムP5に基づいて実行される。具体的には、ステップS1,S2,S10,S11,S12は、図2に示す通常プログラムP5に基づいて実行される。また、ステップS3〜S9は、図2に示す書き換えプログラムP4に基づいて実行される。以下、図3に示すフローチャートについて説明する。
【0038】
ステップS1において、CPU1は、フラッシュメモリ3に格納されている通常プログラムP5の通信機能に基づいて、パソコン30から送信されたプログラム書き換え命令を受信する処理をおこなう。
ステップS2において、CPU1は、フラッシュメモリ3に格納されている通常プログラムP5の制御機能に基づいて、フラッシュメモリ3の読み出しアドレスを書き換えプログラムP4の先頭アドレスにジャンプさせる。
【0039】
ステップS3において、CPU1は、フラッシュメモリ3に格納されている書き換えプログラムP4内のフラッシュメモリ書き換え動作制御プログラムに基づいて、フラグ領域P3に格納されている書き換えプログラム更新フラグを0にセットする。
なお、書き換えプログラム更新フラグは、図3に示す書き換えプログラムP4が書き換えられたか否かを示すフラグである。書き換えプログラム更新フラグが1のときは、書き換え予備プログラムP6が書き換えプログラムP4に上書きされたことを意味する。書き換えプログラム更新フラグが0のときは、前記上書きを実行中であるか、又は上書きが実行されなかったか、又は何らかの原因で上書きに失敗したことを意味する。
【0040】
ステップS4において、CPU1は、フラッシュメモリ3に格納されている書き換えプログラムP4内のフラッシュメモリ書き換え動作制御プログラムに基づいて、フラグ領域P3に格納されている通常プログラム更新フラグを0にセットする。
なお、通常プログラム更新フラグは、図3に示す通常プログラムP5と書き換え予備プログラムP6が、パソコン30から受信した更新プログラムによって、上書きされたか否かを示すフラグである。通常プログラム更新フラグが1のときは、上書きが完了したことを意味する。また、書き換えプログラム更新フラグが0のときは、上書き実行中の状態にあるか、又は上書きが実行されなかったか、又は何らかの原因で上書きに失敗したことを意味する。
【0041】
次に、ステップS5において、CPU1は、フラッシュメモリ3に格納されている書き換えプログラムP4内の書き換え動作用簡易通信プログラムに基づいて、パソコン30からSCSIインタフェース2を介して更新プログラムの受信を開始する。受信する更新プログラムは、図2に示す通常プログラムP5と書き換え予備プログラムP6を更新するものである。
【0042】
ステップS6において、CPU1は、フラッシュメモリ3に格納されている書き換えプログラムP4内のフラッシュメモリ書き換え動作制御プログラムに基づいて、受信した更新プログラムをフラッシュメモリ3に格納する。格納する領域は、通常プログラムP5と書き換え予備プログラムP6が格納されている通常プログラム記憶部(図2参照)である。
【0043】
ステップS7において、CPU1は、フラッシュメモリ3に格納されている書き換えプログラムP4内のフラッシュメモリ書き換え動作制御プログラムに基づいて、ステップ6における書き込みが終了したか否かを判断する。CPU1は、書き込みが終了するまで、前記判断する状態を維持する。CPU1は、書き込みが終了したと判断したとき、処理をステップS8に進める。
【0044】
ステップS8において、CPU1は、フラッシュメモリ3に格納されている書き換えプログラムP4のフラッシュメモリ書き換え動作制御プログラムに基づいて、フラグ領域P3に格納されている通常プログラム更新フラグを1にセットする。
ステップS9において、CPU1は、フラッシュメモリ3に格納されている書き換えプログラムP4のフラッシュメモリ書き換え動作制御プログラムに基づいて、フラッシュメモリ3の読み出しアドレスを通常プログラムP5の先頭アドレスにジャンプさせる。
【0045】
ステップS10において、CPU1は、上書きされた通常プログラムP5に基づいて、上書きされた書き換え予備プログラムP6を書き換えプログラムP4に複写(上書き)する。
ステップS11において、CPU1は、上書きされた通常プログラムP5に基づいて、ステップ10における上書きが終了したか否かを判断する。CPU1は、上書きが終了するまで、前記判断する状態を維持する。CPU1は、上書きが終了したと判断したとき、処理をステップS12に進める。
【0046】
ステップS1において、CPU1は、上書きされた通常プログラムP5に基づいて、書き換えプログラム更新フラグを1にセットする。
図4及び図5は、図1に示すフィルムスキャナ20の初期化時(電源投入時など)の動作を示すフローチャートである。図4及び図5に示すフローチャートは、CPU1がフラッシュメモリ3に格納されているプログラムにしたがって実行する。具体的には、ステップS21は、図2に示すベクタ領域P1のプログラムにしたがって実行される。また、ステップS22,S23,S30は、図2に示すフラグ領域P2のプログラムにしたがって実行される。また、ステップS24〜S29は、図2に示す通常プログラムP5にしたがって実行される。また、ステップS31〜S38は、図2に示す書き換えプログラムP4にしたがって実行される。以下、図4及び図5に示すフローチャートに基づいて、初期化時の動作について説明する。
【0047】
電源の投入などのフィルムスキャナ20の初期化により、図4及び図5に示すフローチャートが開始する。
ステップS21において、CPU1は、図2に示すベクタ領域P1のプログラムに基づいて、状態判別プログラムP2の先頭にジャンプする。
ステップS22において、CPU1は、状態判別プログラムP2に基づいて、通常プログラム更新フラグが1か否かを判断する。ここで、通常プログラム更新フラグが1であれば、前回のプログラムの書き換え動作において、通常プログラムP5と書き換え予備プログラムP6との上書きは、正常に終了している。通常プログラム更新フラグが1でない場合には、前回のプログラムの書き換え動作において、通常プログラムP5と書き換え予備プログラムP6との上書きは、正常に終了していない。CPU1は、通常プログラム更新フラグが1と判断された場合、処理をステップS23へ進める。CPU1は、通常プログラム更新フラグが1ではないと判断された場合、処理をステップS30(図5参照)へ進める。ここでは、通常プログラム更新フラグが1であり、ステップS23に進むものとして説明を続ける。
【0048】
ステップS23において、CPU1は、状態判別プログラムP2に基づいて、フラッシュメモリ3の読み出しアドレスを通常プログラムP5の先頭アドレスにジャンプさせる。
ステップS24において、CPU1は、通常プログラムP5の制御機能に基づいて、書き換えプログラム更新フラグが1か否かを判断する。ここで、書き換えプログラム更新フラグが1と判断された場合、前回の書き換え動作において、書き換え予備プログラムP6が書き換えプログラムP4に正常に複写されている。書き換えプログラム更新フラグが1ではないと判断された場合、前回の書き換え動作において、書き換え予備プログラムP6が書き換えプログラムP4に正常に複写されていない。すなわち、書き換えプログラム更新フラグが1でない場合、複写が何らかの原因で失敗している。CPU1は、書き換えプログラム更新フラグが1でない場合、処理をステップS27に進める。
【0049】
ステップS27において、CPU1は、通常プログラムP5の制御機能に基づいて、書き換え予備プログラムP6を書き換えプログラムP4に複写(上書き)する。
ステップS28において、CPU1は、通常プログラムP5の制御機能に基づいて、ステップS28における書き込みが終了したか否かを判断する。CPU1は、書き込みが終了するまで、前記判断する状態を維持する。CPU1は、書き込みが終了したと判断したとき、処理をステップS29に進める。
【0050】
また、前記したステップS24において、書き換えプログラム更新フラグが1であると判断された場合、CPU1は、ステップS27〜S29の処理を行うことなく、処理をステップS25に進める。
ステップS29において、CPU1は、通常プログラムP5の制御機能に基づいて、書き換えプログラム更新フラグを1にセットする。その後、CPU1は、通常プログラムP5の制御機能に基づいて、処理をステップS25に進める。
【0051】
ステップ25において、CPU1は、通常プログラムP5の制御機能に基づいて、フィルムスキャナ20の初期化動作を実行する。
ステップS26において、CPU1は、通常プログラムP5の制御機能に基づいて、ステップS25における初期化動作が終了したか否かを判断する。CPU1は、初期化動作が終了するまで、前記判断する状態を維持する。CPU1は、初期化動作が終了したと判断したとき、処理を終了する。
【0052】
前記したように、ステップS22において、CPU1は、通常プログラム更新フラグが1ではないと判断された場合、処理をステップS30(図5参照)へ進める。
ステップS30において、CPU1は、状態判別プログラムP2に基づいて、フラッシュメモリ3の読み出しアドレスを書き換えプログラムP4の先頭アドレスにジャンプさせる。
【0053】
ステップS31において、CPU1は、フラッシュメモリ3に格納されている書き換えプログラムP4内のフラッシュメモリ書き換え動作制御プログラムに基づいて、フラグ領域P3に格納されている書き換えプログラム更新フラグを0にセットする。
次に、ステップS32において、CPU1は、フラッシュメモリ3に格納されている書き換えプログラムP4内の書き換え動作用簡易通信プログラムに基づいて、パソコン30との通信を開始する。
【0054】
ステップS33において、CPU1は、書き換えプログラムP4内の書き換え動作用簡易通信プログラムに基づいて、パソコン30に対して更新プログラムの送信を命令する。
ステップS34において、CPU1は、書き換えプログラムP4内の書き換え動作用簡易通信プログラムに基づいて、パソコン30からSCSIインタフェース2を介して更新プログラムの受信を開始する。受信する更新プログラムは、図2に示す通常プログラムP5と書き換え予備プログラムP6とを更新するものである。
【0055】
ステップS35において、CPU1は、書き換えプログラムP4内のフラッシュメモリ書き換え動作制御プログラムに基づいて、受信した更新プログラムをフラッシュメモリ3に格納する。格納する領域は、通常プログラムP5と書き換え予備プログラムP6が格納されている通常プログラム記憶部(図2参照)である。
ステップS36において、CPU1は、フラッシュメモリ3に格納されている書き換えプログラムP4内のフラッシュメモリ書き換え動作制御プログラムに基づいて、ステップS3における書き込みが終了したか否かを判断する。CPU1は、書き込みが終了するまで、前記判断する状態を維持する。CPU1は、書き込みが終了したと判断したとき、処理をステップS37に進める。
【0056】
ステップS37において、CPU1は、書き換えプログラムP4のフラッシュメモリ書き換え動作制御プログラムに基づいて、フラグ領域P3に格納されている通常プログラム更新フラグを1にセットする。
ステップS38において、CPU1は、書き換えプログラムP4のフラッシュメモリ書き換え動作制御プログラムに基づいて、フラッシュメモリ3の読み出しアドレスを通常プログラムP5の先頭アドレスにジャンプさせる。次に、CPU1は、前記フラッシュメモリ書き換え動作制御プログラムに基づいて、処理をステップS24に進める。以後の処理は、前記したとおりである。
【0057】
前記した実施の形態においては、フラッシュメモリを例にして説明した。しかし、本発明はこれに限定されるものではなく、電気的に消去、書き込み、上書きができるメモリであれば適用することができる。
また、前記した実施の形態においては、フィルムスキャナとパソコンのシステムを例にして説明した。しかし、本発明はこれに限定されるものではなく、外部装置からプログラムを受信するシステムであれば適用することができる。
【0058】
以上の説明から明らかなように、前記実施の形態によれば、フラッシュメモリに格納しているプログラムの書き換えに失敗した場合、再度、書き換えを実行することが可能になる。
また、前記実施の形態によれば、書き換えプログラム記憶部(P4の記憶領域)及び通常プログラム記憶部(P5,P6の記憶領域)の両方を書き換えることができるため、通信機能における機能追加や障害の解消を実行することができる。
【0059】
【発明の効果】
請求項1記載のプログラム書き換え装置は、書き換えプログラム記憶部に格納されている書き換えプログラム(書き換え前のプログラム)を第1期間に起動する。したがって、請求項1記載のプログラム書き換え装置は、第1期間に、外部装置から通常プログラムと書き換え予備プログラムを受信し、受信した通常プログラムと書き換え予備プログラムを通常プログラム記憶部に上書きする。
【0060】
また、請求項1記載のプログラム書き換え装置は、通常プログラム(書き換え後のプログラム)を第2期間に起動する。したがって、請求項1記載のプログラム書き換え装置は、第2期間に、起動された通常プログラムに基づいて、書き換え予備プログラムを書き換えプログラム記憶部に複写する。
したがって、請求項1記載のプログラム書き換え装置によれば、通常プログラム記憶部の上書きと書き換えプログラム記憶部の上書きが、異なるタイミングで実行される。そのため、請求項1記載のプログラム書き換え装置は、プログラムの書き換え中に電源が切れてしまったり、なんらかの原因でプログラムの書き換えに失敗した場合、ユーザが、再度書き換えを実行できる。
【0061】
また、請求項1記載のプログラム書き換え装置は、ユーザが、プログラムのどの部分でも書き換えすることができる。
請求項2記載のプログラム書き換え装置によれば、通常プログラム更新記録を参照することにより、通常プログラム記憶部の書き換えが完了したか否かを確認することができる。
【0062】
請求項記載のプログラム書き換え装置によれば、通常プログラム記憶部が更新されていないと判断された場合、外部装置から通常プログラムと書き換え予備プログラムを受信して、通常プログラム記憶部の上書きを実行することができる。請求項記載のプログラム書き換え装置によれば、制御手段は、プログラム書き換え装置を内蔵する装置の電源投入時に、通常プログラム更新記録の設定有無を判断する。したがって、プログラム書き換え装置を内蔵する装置が、前回の起動中に、何らかの原因により、通常プログラムの上書きに失敗したことを検出できる。
【0063】
請求項記載のプログラム書き換え装置によれば、書き換えプログラム更新記録を参照することにより、書き換えプログラム記憶部の書き換えが完了したか否かを確認することができる。また、制御手段は、書き換えプログラム更新記録が設定されていないと判断した場合、通常プログラムに基づいて、通常プログラム記憶部に上書きされた書き換え予備プログラムを書き換えプログラム記憶部に複写することができる。
【0064】
他のプログラム書き換え装置によれば、制御手段は、プログラム書き換え装置を内蔵する装置の電源投入時に、書き換えプログラム更新記録の設定有無を判断する。したがって、プログラム書き換え装置を内蔵する装置が、前回の起動中に、何らかの原因により、書き換えプログラムの上書きに失敗したことを検出できる。
【0065】
のプログラム書き換え装置によれば、制御手段が、異なる期間に、通常プログラム記憶部の記憶内容の更新と書き換えプログラム記憶部の記憶内容の更新を行う。したがって、のプログラム書き換え装置は、プログラムの書き換え中に電源が切れてしまったり、なんらかの原因でプログラムの書き換えに失敗した場合、ユーザが、再度書き換えを実行できる。また、のプログラム書き換え装置は、ユーザが、プログラムのどの部分でも書き換えを実行できる。
【図面の簡単な説明】
【図1】フィルムスキャナとパソコンとから構成される画像読取システムの一例を示すブロック図。
【図2】図1に示すフラッシュメモリの記憶内容を示す説明図。
【図3】フラッシュメモリの書き換え処理を示すフローチャート。
【図4】図1に示すフィルムスキャナ初期化時の動作を示すフローチャート。
【図5】図1に示すフィルムスキャナ初期化時の動作を示すフローチャート。
【符号の説明】
1 CPU
2 SCSIインタフェース
3 フラッシュメモリ
4 RAM
5 LED駆動回路
6 CCD駆動回路
7 信号処理回路
8 A/D変換器
9 原稿駆動モータ駆動回路
11 LED光源
12 レンズ
13 CCD
14 原稿位置センサ
15 カートリッジ
16 原稿駆動モータ
17 フィルム原稿
20 フィルムスキャナ
30 パソコン
31 モニタ
32 操作部
P1 ベクタ領域
P2 状態判別プログラム
P3 フラグ領域
P4 書き換えプログラム
P5 通常プログラム
P6 書き換え予備プログラム
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a program rewriting device built in an electronic device, and more particularly to a program rewriting device for rewriting a program for controlling the operation of the electronic device.
[0002]
[Prior art]
A program for controlling the operation of the electronic device is normally stored in a MASKROM, EPROM, EEPROM, flash memory or the like provided in the electronic device. These memories are read-only memories. However, EPROM, EEPROM, flash memory, and the like can electrically rewrite a program stored in the memory by using a special device. A CPU provided in the electronic device controls each unit in the electronic device according to a program stored in the memory.
[0003]
Recently, in electronic devices such as personal computer peripherals (scanners, printers, modems, etc.) and personal computer motherboards, the programs stored in the memory are rewritten in order to add functions in the electronic devices and to solve problems that occur in the electronic devices. Need arises. In such a case, the following two methods are used in order to save the trouble of exchanging the memory in the electronic device and the memory storing the updated program.
[0004]
(1) The memory for storing the program is an electrically rewritable memory such as an EEPROM or a flash memory. When the electronic device rewrites the program stored in the memory, the electronic device downloads the changed program from the personal computer. Next, the electronic device rewrites the program in the electronic device.
In this way, functions of electronic devices are added and troubles are solved.
[0005]
(2) Only the boot part of the program (initialization part for communication, etc.) is stored in the MASKROM or EPROM. When the electronic device is turned on, only the communication function between the personal computer and the electronic device can be operated. A program for controlling the electronic device is downloaded to the RAM in the electronic device by the communication function every time the driver software for the electronic device is started on the personal computer side. And CPU controls each part in an electronic device according to the program downloaded to RAM. The latest driver software is installed in the PC when adding functions to electronic devices or solving problems. Therefore, the electronic device can store the updated program for controlling the electronic device in the RAM. The electronic device does not need to replace the memory storing the program. In this way, functions of electronic devices are added and troubles are solved.
[0006]
In the above two methods, a function addition program and a change program for eliminating a failure are distributed to users via a communication line from a personal computer communication or an Internet homepage. Therefore, it is not necessary for the user to send the electronic device back to the manufacturer or to bring the electronic device to the service window. In addition, it is not necessary for the person in charge of the manufacturer to disassemble the electronic device and replace the memory.
[0007]
[Problems to be solved by the invention]
The prior art has the following problems.
First, in the case of the method (1), the power may be shut down while the program is being written to the EEPROM or flash memory, and the program writing may fail. Furthermore, writing to the EEPROM or flash memory may fail for some reason. In this case, a program in which rewriting has progressed halfway cannot be matched as a program between the part before rewriting and the part after rewriting. Therefore, the program runs out of control and does not operate normally.
[0008]
The electronic device in the above state cannot be rewritten on the user side. Therefore, the user needs to send the electronic device back to the manufacturer, or the user must bring the electronic device to the service window. In addition, the person in charge of the manufacturer needs to disassemble the electronic device and replace the memory.
Secondly, in the case of the method (2), the boot program written in the MASKROM or EPROM cannot be rewritten by downloading from a personal computer. Therefore, when the function addition or the resolution of the failure occurs in the boot part program, the user needs to send the electronic device back to the manufacturer or bring the electronic device to the service window. In addition, the person in charge of the manufacturer needs to disassemble the electronic device and replace the memory.
[0009]
An object of the present invention is to provide a program rewriting apparatus that allows a user to execute rewriting again when the power is cut off during rewriting of the program or when rewriting of the program fails for some reason. .
[0010]
Another object of the present invention is to provide a program rewriting apparatus in which a user can rewrite any part of a program.
[0011]
[Means for Solving the Problems]
According to the program rewriting device of claim 1, the program rewriting device is incorporated.Normal program of the deviceA normal program storage unit for storing the program and the rewrite spare program, a reception procedure for receiving the normal program and the rewrite spare program from the external device, and an overwrite procedure for overwriting the received normal program and the rewrite spare program on the normal program storage unit And a rewrite program storage unit for storing a rewrite program indicating, overwriting the normal program and the rewrite preliminary program based on the rewrite program reception procedure and the overwrite procedure in the first period, which is different from the first period Control means for copying the rewrite preliminary program overwritten in the normal program storage unit to the rewrite program storage unit based on the normal program in the second period.
[0012]
  According to a second aspect of the program rewriting apparatus of the present invention, the program rewriting apparatus according to the first aspect further includes a state determination program storage unit for storing a state determination program for determining a progress state of the program rewriting. ,Prior to the first period, the normal program update record indicating that the normal program has been updated is not set, andIn response to completion of overwriting of the normal program and the rewriting spare program, the normal program update record is set in the flag storage unit, and the presence / absence of the normal program update record is determined based on the state determination program to update the normal program When it is determined that the recording is not set, the normal program storage unit is overwritten based on the rewrite program reception procedure and the overwrite procedure.
[0013]
Claim3According to the described program rewriting device, the claim2In the program rewriting device described above, the control means is a device that includes the program rewriting device.Power onSometimes, it is determined whether or not normal program update recording is set.
[0014]
  According to the program rewriting device of claim 4, the claim of claim2 or claim 3In the program rewriting device described, SystemThe control unit sets the rewrite program update record indicating that the rewrite preliminary program has been updated before the second period to the state where it is not set, and completes the copying of the rewrite preliminary program to the rewrite program storage unit. In response, the rewrite program update record is set in the flag storage unit, andAfter determining that the normal program update record is set, or after determining that the normal program update record is not set and overwriting the normal program storage unit,Based on the status determination program, it is determined whether the rewrite program update record is set. If it is determined that the rewrite program update record is not set, the rewrite spare program overwritten in the normal program storage unit is rewritten based on the normal program. The program is copied to the program storage unit.
[0015]
  otherAccording to the program rewriting device, SystemThe control means determines whether or not the rewrite program update record is set when the power of the device incorporating the program rewrite device is turned on.May be.
[0016]
(Function)
According to the program rewriting apparatus of claim 1, the normal program storage unit stores the normal program including the control procedure of the device incorporating the program rewriting device and the rewriting spare program, and the rewriting program storage unit includes the normal program and A rewrite program indicating a reception procedure for receiving the rewrite spare program from the external device and an overwrite procedure for overwriting the received normal program and the rewrite spare program in the normal program storage unit is stored. In addition, the normal program and the rewrite preliminary program are overwritten based on the rewrite program receiving procedure and the overwrite procedure, and overwritten in the normal program storage unit based on the normal program in a second period different from the first period. Rewrite program Copied to arm the storage unit.
[0017]
Therefore, according to the program rewriting device of the first aspect, the normal program and the rewriting spare program received from the external device are overwritten in the normal program storage unit in the first period. In addition, the rewriting spare program overwritten in the normal program storage unit is copied to the rewriting program storage unit in the second period.
Therefore, in the first period, when overwriting of the normal program storage unit fails due to a cause such as power failure of the electronic device, the following operation is performed. That is, the rewriting program (program before rewriting) stored in the rewriting program storage unit is activated, and the electronic device receives the normal program and the rewriting spare program from the external device. The received normal program and rewritten spare program are normally overwritten in the normal program storage unit.
[0018]
In addition, in the second period, when copying of the rewrite preliminary program to the rewrite program storage unit fails due to the power of the electronic device being turned off, the following operation is performed. That is, the normal program (program after rewriting) is started again, and the rewriting preliminary program is copied. As a result, the rewrite program storage unit is normally overwritten.
[0019]
Therefore, the program rewriting apparatus according to the first aspect executes overwriting of the normal program storage unit and overwriting of the rewriting program storage unit at different timings. Therefore, the program rewriting apparatus according to claim 1 can be rewritten by the user again when the power is turned off during the rewriting of the program or when the rewriting of the program fails for some reason.
[0020]
In the program rewriting apparatus according to claim 1, the user can rewrite any part of the program.
According to the program rewriting apparatus of the second aspect, the control means sets the normal program update record in response to the completion of overwriting of the normal program and the rewriting spare program.
[0021]
Therefore, the program rewriting apparatus according to claim 2 can confirm whether or not the rewriting of the normal program storage unit is completed by referring to the normal program update record.AlsoWhen it is determined that the normal program update record is not set, the control unit executes overwriting of the normal program storage unit based on the rewrite program reception procedure and the overwrite procedure.
[0022]
Therefore, the claims2When it is determined that the normal program storage unit has not been updated, the program rewriting device can receive the normal program and the rewriting spare program from the external device and can overwrite the normal program storage unit. Claim3According to the described program rewriting device, the control means is a device that incorporates the program rewriting device.Power onSometimes it is determined whether or not normal program update recording is set. Therefore, it is possible to detect that the device incorporating the program rewriting device has failed to overwrite the normal program for some reason during the previous activation.
[0023]
  According to the program rewriting device of claim 4, SystemIn response to the completion of copying of the preliminary rewrite program to the rewrite program storage unit, the control unit sets a rewrite program update record in the flag storage unit, andAfter determining that the normal program update record is set, or after determining that the normal program update record is not set and overwriting the normal program storage unit,Based on the status determination program, it is determined whether the rewrite program update record is set. If it is determined that the rewrite program update record is not set, the rewrite spare program overwritten in the normal program storage unit is rewritten based on the normal program. Copy to program storage. Therefore, the program rewriting apparatus according to claim 4 can confirm whether or not the rewriting of the rewriting program storage unit is completed by referring to the rewriting program update record.
[0024]
  According to the program rewriting apparatus of the fourth aspect, when the control unit determines that the rewriting program update record is not set, the rewriting spare program overwritten in the normal program storage unit is determined based on the normal program. It can be copied to the rewrite program storage unit.otherAccording to the program rewriting apparatus, the control means determines whether or not the rewriting program update record is set when the apparatus incorporating the program rewriting apparatus is turned on. Therefore, it is possible to detect that the device incorporating the program rewriting device has failed to overwrite the rewriting program for some reason during the previous activation.
[0025]
otherAccording to the program rewriting device, the normal program storage unit stores a normal program including a control procedure of a device incorporating the program rewriting device, and the rewriting program storage unit receives a normal program from an external device; An overwriting procedure for overwriting the received normal program in the normal program storage unit is stored, and the control means updates the storage content of the normal program storage unit based on the rewriting program, and the storage content of the rewrite program storage unit The update is performed in different periods.
[0026]
Therefore,ThisAccording to this program rewriting apparatus, the control means updates the storage contents of the normal program storage section and the storage contents of the rewrite program storage section during different periods. Therefore,ThisThis program rewriting apparatus can perform rewriting again when the power is turned off during rewriting of the program or when rewriting of the program fails for some reason. Also,otherThis program rewriting apparatus can rewrite any part of the program.
[0027]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the embodiment described below, a rewrite operation of a program stored in a flash memory of a film scanner is taken as an example. The program stored in the flash memory is executed by the CPU of the film scanner and controls the operation of each part of the film scanner. The embodiments described below correspond to all the claims.
[0028]
FIG. 1 is a block diagram illustrating an example of an image reading system including a film scanner 20 and a personal computer 30. As shown in FIG. 1, the film scanner 20 is connected to a personal computer 30 through the SCSI interface 2. The personal computer 30 includes a monitor 31 and an operation unit 32. The monitor 31 displays according to instructions from the personal computer 30, and is composed of a CRT or a liquid crystal display. The operation unit 32 is an input device such as a keyboard and a mouse.
[0029]
The CPU 1 of the film scanner 20 receives an instruction from the personal computer 30 through the SCSI interface 2 and controls each part of the film scanner 20. Here, the CPU 1 performs processing based on a program stored in the flash memory 3. The RAM 4 is a memory that temporarily stores data when the CPU 1 performs processing.
[0030]
The LED drive circuit 5 is controlled by the CPU 1 and drives the LED light source 11. The LED light source 11 illuminates the film document 17. As shown in the figure, the light emitted from the LED light source 11 is collected by the lens 12 and reaches the CCD 13. An image of the film original 17 is formed on the image forming surface of the CCD 13. The CCD 13 converts the image on the film original 17 into an electrical image signal. Here, the CCD drive circuit 6 is a circuit that is controlled by the CPU 1 and drives the CCD 13.
[0031]
The film document 17 can be sent out from the cartridge 15 and taken up. That is, the document drive motor drive circuit 9 is controlled by the CPU 1 and drives the document drive motor 16. Here, when the CPU 1 controls the rotation direction and the rotation speed of the document driving motor 16, the film document 17 can be sent out and taken up. Further, the position of the film document 17 is detected by the CPU 1 based on a signal output from the document position sensor 14.
[0032]
The CCD 13 converts the image on the film original 17 into an electrical image signal. The image signal output from the CCD 13 is input to the signal processing circuit 7.
The signal processing circuit 7 is controlled by the CPU 1, performs various types of signal processing on the input image signal, and outputs it to the A / D converter 8.
The A / D converter 8 is controlled by the CPU 1 and converts the input image signal into a digital signal.
[0033]
The image signal output from the A / D converter 8 is stored in the RAM 4.
The image signal stored in the RAM 4 is output to the personal computer 30 through the SCSI interface 2. The personal computer 30 receives the image signal and displays it on the monitor 31.
FIG. 2 is an explanatory diagram showing the storage contents of the flash memory 3 shown in FIG. As shown in FIG. 2, the flash memory 3 has six program areas (P1 to P6).
[0034]
The vector area P1 stores the top address, the last address, etc. of each program area (P1, P2 to P6).
The state determination program P2 refers to the flag area P3 to determine the progress of program rewriting.
The flag area P3 includes a plurality of flags indicating the progress of program rewriting. Specifically, the flag area P3 stores a flag indicating the normal program update record described in the claims (referred to as a normal program update flag in the embodiment described below). A flag indicating a rewrite program update record (referred to as a rewrite program update flag in the embodiment described below) described in the range is stored.
[0035]
The rewrite program P4 includes a simple communication program for rewrite operation used for simple communication with a personal computer and a flash memory rewrite operation control program.
The normal program P5 has a communication function with a personal computer and a control function for controlling each part in the film scanner 20.
[0036]
The rewrite preliminary program P6 includes a simple communication program for rewrite operation used for simple communication with a personal computer and a flash memory rewrite operation control program.
In the above configuration, the rewrite program storage unit described in the claims corresponds to a storage area for storing the rewrite program P4 as shown in the figure.
[0037]
In addition, the normal program storage unit described in the claims corresponds to a storage area for storing the normal program P5 and a storage area for storing the rewrite preliminary program P6, as shown in the figure.
FIG. 3 is a flowchart showing the rewrite process of the flash memory 3. Note that the flowchart shown in FIG. 3 is executed by the CPU 1 in accordance with a program stored in the flash memory 3. Moreover, each step S1-S12 shown in FIG. 3 is performed based on the rewriting program P4 and the normal program P5 shown in FIG. Specifically, steps S1, S2, S10, S11, and S12 are executed based on the normal program P5 shown in FIG. Steps S3 to S9 are executed based on the rewrite program P4 shown in FIG. Hereinafter, the flowchart shown in FIG. 3 will be described.
[0038]
In step S1, the CPU 1 performs a process of receiving a program rewrite command transmitted from the personal computer 30 based on the communication function of the normal program P5 stored in the flash memory 3.
In step S2, the CPU 1 jumps the read address of the flash memory 3 to the start address of the rewrite program P4 based on the control function of the normal program P5 stored in the flash memory 3.
[0039]
In step S3, the CPU 1 sets the rewrite program update flag stored in the flag area P3 to 0 based on the flash memory rewrite operation control program in the rewrite program P4 stored in the flash memory 3.
The rewrite program update flag is a flag indicating whether or not the rewrite program P4 shown in FIG. 3 has been rewritten. When the rewrite program update flag is 1, it means that the rewrite preliminary program P6 is overwritten on the rewrite program P4. When the rewrite program update flag is 0, it means that the overwriting is being executed, overwriting has not been executed, or overwriting has failed for some reason.
[0040]
In step S4, the CPU 1 sets the normal program update flag stored in the flag area P3 to 0 based on the flash memory rewrite operation control program in the rewrite program P4 stored in the flash memory 3.
The normal program update flag is a flag indicating whether or not the normal program P5 and the rewriting spare program P6 shown in FIG. 3 have been overwritten by the update program received from the personal computer 30. When the normal program update flag is 1, it means that overwriting has been completed. In addition, when the rewrite program update flag is 0, it means that the overwrite program is being executed, the overwrite has not been executed, or the overwrite has failed for some reason.
[0041]
Next, in step S <b> 5, the CPU 1 starts receiving an update program from the personal computer 30 via the SCSI interface 2 based on the rewrite operation simple communication program in the rewrite program P <b> 4 stored in the flash memory 3. The received update program is for updating the normal program P5 and the rewrite spare program P6 shown in FIG.
[0042]
In step S <b> 6, the CPU 1 stores the received update program in the flash memory 3 based on the flash memory rewrite operation control program in the rewrite program P <b> 4 stored in the flash memory 3. The area to be stored is a normal program storage unit (see FIG. 2) in which the normal program P5 and the rewrite preliminary program P6 are stored.
[0043]
In step S <b> 7, the CPU 1 determines whether or not the writing in step 6 has been completed based on the flash memory rewrite operation control program in the rewrite program P <b> 4 stored in the flash memory 3. The CPU 1 maintains the determined state until the writing is completed. When the CPU 1 determines that the writing has been completed, the process proceeds to step S8.
[0044]
In step S8, the CPU 1 sets the normal program update flag stored in the flag area P3 to 1 based on the flash memory rewrite operation control program of the rewrite program P4 stored in the flash memory 3.
In step S9, the CPU 1 jumps the read address of the flash memory 3 to the head address of the normal program P5 based on the flash memory rewrite operation control program of the rewrite program P4 stored in the flash memory 3.
[0045]
In step S10, the CPU 1 copies (overwrites) the overwritten rewrite preliminary program P6 to the rewrite program P4 based on the overwritten normal program P5.
In step S11, the CPU 1 determines whether or not the overwriting in step 10 has ended based on the overwritten normal program P5. The CPU 1 maintains the determined state until overwriting is completed. When the CPU 1 determines that the overwriting has been completed, the process proceeds to step S12.
[0046]
  Step S12The CPU 1 sets the rewrite program update flag to 1 based on the overwritten normal program P5.
  4 and 5 are flowcharts showing the operation of the film scanner 20 shown in FIG. 1 at the time of initialization (when the power is turned on). The flowcharts shown in FIGS. 4 and 5 are executed by the CPU 1 in accordance with a program stored in the flash memory 3. Specifically, step S21 is executed according to the program of the vector area P1 shown in FIG. Steps S22, S23, and S30 are executed according to the program in the flag area P2 shown in FIG. Steps S24 to S29 are executed according to the normal program P5 shown in FIG. Steps S31 to S38 are executed according to the rewrite program P4 shown in FIG. Hereinafter, the operation at the time of initialization will be described based on the flowcharts shown in FIGS. 4 and 5.
[0047]
With the initialization of the film scanner 20 such as turning on the power, the flowcharts shown in FIGS. 4 and 5 are started.
In step S21, the CPU 1 jumps to the head of the state determination program P2 based on the program in the vector area P1 shown in FIG.
In step S22, the CPU 1 determines whether or not the normal program update flag is 1 based on the state determination program P2. Here, if the normal program update flag is 1, the overwrite of the normal program P5 and the rewrite preliminary program P6 is normally completed in the previous program rewrite operation. When the normal program update flag is not 1, overwriting of the normal program P5 and the rewrite preliminary program P6 is not normally completed in the previous program rewrite operation. If it is determined that the normal program update flag is 1, the CPU 1 advances the process to step S23. When it is determined that the normal program update flag is not 1, the CPU 1 advances the process to step S30 (see FIG. 5). Here, the description is continued assuming that the normal program update flag is 1 and the process proceeds to step S23.
[0048]
In step S23, the CPU 1 jumps the read address of the flash memory 3 to the head address of the normal program P5 based on the state determination program P2.
In step S24, the CPU 1 determines whether or not the rewrite program update flag is 1 based on the control function of the normal program P5. If it is determined that the rewrite program update flag is 1, the rewrite preliminary program P6 is normally copied to the rewrite program P4 in the previous rewrite operation. If it is determined that the rewrite program update flag is not 1, the preliminary rewrite program P6 is not normally copied to the rewrite program P4 in the previous rewrite operation. That is, when the rewrite program update flag is not 1, copying has failed for some reason. If the rewrite program update flag is not 1, the CPU 1 advances the process to step S27.
[0049]
In step S27, the CPU 1 copies (overwrites) the rewrite preliminary program P6 to the rewrite program P4 based on the control function of the normal program P5.
In step S28, the CPU 1 determines whether or not the writing in step S28 has been completed based on the control function of the normal program P5. The CPU 1 maintains the determined state until the writing is completed. When the CPU 1 determines that the writing has been completed, the process proceeds to step S29.
[0050]
If it is determined in step S24 that the rewrite program update flag is 1, the CPU 1 proceeds to step S25 without performing steps S27 to S29.
In step S29, the CPU 1 sets a rewrite program update flag to 1 based on the control function of the normal program P5. Thereafter, the CPU 1 advances the process to step S25 based on the control function of the normal program P5.
[0051]
In step 25, the CPU 1 executes the initialization operation of the film scanner 20 based on the control function of the normal program P5.
In step S26, the CPU 1 determines whether or not the initialization operation in step S25 has ended based on the control function of the normal program P5. The CPU 1 maintains the determined state until the initialization operation is completed. When the CPU 1 determines that the initialization operation has ended, it ends the process.
[0052]
As described above, when it is determined in step S22 that the normal program update flag is not 1, the CPU 1 advances the process to step S30 (see FIG. 5).
In step S30, the CPU 1 jumps the read address of the flash memory 3 to the start address of the rewrite program P4 based on the state determination program P2.
[0053]
In step S31, the CPU 1 sets the rewrite program update flag stored in the flag area P3 to 0 based on the flash memory rewrite operation control program in the rewrite program P4 stored in the flash memory 3.
Next, in step S <b> 32, the CPU 1 starts communication with the personal computer 30 based on the simple communication program for rewrite operation in the rewrite program P <b> 4 stored in the flash memory 3.
[0054]
In step S33, the CPU 1 instructs the personal computer 30 to transmit the update program based on the rewrite operation simple communication program in the rewrite program P4.
In step S <b> 34, the CPU 1 starts receiving an update program from the personal computer 30 via the SCSI interface 2 based on the simple communication program for rewrite operation in the rewrite program P <b> 4. The received update program is for updating the normal program P5 and the rewrite spare program P6 shown in FIG.
[0055]
  In step S35, the CPU 1 stores the received update program in the flash memory 3 based on the flash memory rewrite operation control program in the rewrite program P4. The area to be stored is a normal program storage unit (see FIG. 2) in which the normal program P5 and the rewrite preliminary program P6 are stored.
  In step S36, the CPU 1 executes step S3 based on the flash memory rewrite operation control program in the rewrite program P4 stored in the flash memory 3.5It is determined whether or not the writing in is completed. The CPU 1 maintains the determined state until the writing is completed. When the CPU 1 determines that the writing has been completed, the process proceeds to step S37.
[0056]
In step S37, the CPU 1 sets the normal program update flag stored in the flag area P3 to 1 based on the flash memory rewrite operation control program of the rewrite program P4.
In step S38, the CPU 1 jumps the read address of the flash memory 3 to the head address of the normal program P5 based on the flash memory rewrite operation control program of the rewrite program P4. Next, the CPU 1 advances the process to step S24 based on the flash memory rewriting operation control program. The subsequent processing is as described above.
[0057]
In the above-described embodiment, the flash memory has been described as an example. However, the present invention is not limited to this, and can be applied to any memory that can be electrically erased, written, and overwritten.
In the above-described embodiment, the film scanner and personal computer system has been described as an example. However, the present invention is not limited to this, and can be applied to any system that receives a program from an external device.
[0058]
As is clear from the above description, according to the embodiment, when rewriting of a program stored in the flash memory fails, rewriting can be executed again.
In addition, according to the embodiment, both the rewrite program storage unit (P4 storage area) and the normal program storage unit (P5, P6 storage area) can be rewritten. Resolution can be performed.
[0059]
【The invention's effect】
The program rewriting apparatus according to claim 1 starts the rewriting program (program before rewriting) stored in the rewriting program storage unit in the first period. Therefore, the program rewriting apparatus according to claim 1 receives the normal program and the rewriting spare program from the external device in the first period, and overwrites the received normal program and the rewriting spare program in the normal program storage unit.
[0060]
The program rewriting apparatus according to claim 1 starts the normal program (program after rewriting) in the second period. Therefore, the program rewriting apparatus according to claim 1 copies the rewrite preliminary program to the rewrite program storage unit based on the activated normal program in the second period.
Therefore, according to the program rewriting apparatus of the first aspect, overwriting of the normal program storage unit and overwriting of the rewriting program storage unit are executed at different timings. Therefore, the program rewriting apparatus according to claim 1 can be rewritten by the user again when the power is turned off during the rewriting of the program or when the rewriting of the program fails for some reason.
[0061]
In the program rewriting apparatus according to claim 1, the user can rewrite any part of the program.
According to the program rewriting apparatus of the second aspect, it is possible to confirm whether or not the rewriting of the normal program storage unit is completed by referring to the normal program update record.
[0062]
Claim2According to the described program rewriting device, when it is determined that the normal program storage unit has not been updated, the normal program and the rewriting spare program can be received from the external device and the normal program storage unit can be overwritten. . Claim3According to the described program rewriting device, the control means is a device that incorporates the program rewriting device.Power onSometimes it is determined whether or not normal program update recording is set. Therefore, it is possible to detect that the device incorporating the program rewriting device has failed to overwrite the normal program for some reason during the previous activation.
[0063]
Claim4According to the described program rewriting apparatus, it is possible to confirm whether or not the rewriting of the rewriting program storage unit is completed by referring to the rewriting program update record.Also,When it is determined that the rewrite program update record is not set, the control unit can copy the rewrite preliminary program overwritten in the normal program storage unit to the rewrite program storage unit based on the normal program.
[0064]
  otherAccording to the program rewriting apparatus, the control means determines whether or not the rewriting program update record is set when the apparatus incorporating the program rewriting apparatus is turned on. Therefore, it is possible to detect that the device incorporating the program rewriting device has failed to overwrite the rewriting program for some reason during the previous activation.
[0065]
otherAccording to this program rewriting apparatus, the control means updates the storage contents of the normal program storage section and the storage contents of the rewrite program storage section during different periods. Therefore,ThisIn the program rewriting apparatus, when the power is turned off during the rewriting of the program or the rewriting of the program fails for some reason, the user can execute the rewriting again. Also,ThisWith this program rewriting apparatus, the user can rewrite any part of the program.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating an example of an image reading system including a film scanner and a personal computer.
FIG. 2 is an explanatory diagram showing storage contents of the flash memory shown in FIG. 1;
FIG. 3 is a flowchart showing flash memory rewriting processing;
FIG. 4 is a flowchart showing an operation at the time of initializing the film scanner shown in FIG. 1;
FIG. 5 is a flowchart showing an operation at the time of initializing the film scanner shown in FIG. 1;
[Explanation of symbols]
1 CPU
2 SCSI interface
3 Flash memory
4 RAM
5 LED drive circuit
6 CCD drive circuit
7 Signal processing circuit
8 A / D converter
9 Document drive motor drive circuit
11 LED light source
12 lenses
13 CCD
14 Document position sensor
15 cartridges
16 Document drive motor
17 Film manuscript
20 Film scanner
30 PC
31 Monitor
32 Operation unit
P1 vector area
P2 status determination program
P3 flag area
P4 rewriting program
P5 Normal program
P6 Rewrite preliminary program

Claims (4)

プログラム書き換え装置を内蔵する装置の通常プログラムと書き換え予備プログラムとを記憶する通常プログラム記憶部と、
前記通常プログラムと書き換え予備プログラムとを外部装置から受信する受信手順と、受信した前記通常プログラムと前記書き換え予備プログラムとを前記通常プログラム記憶部に上書きする上書き手順と、を示す書き換えプログラムを記憶する書き換えプログラム記憶部と、
第1期間に、書き換えプログラムの受信手順と上書き手順とに基づいて、前記通常プログラム及び書き換え予備プログラムの上書きを実行し、
前記第1期間と異なる第2期間に、前記通常プログラムに基づいて、前記通常プログラム記憶部に上書きされた前記書き換え予備プログラムを前記書き換えプログラム記憶部に複写する制御手段と
を有することを特徴とするプログラム書き換え装置。
A normal program storage unit for storing a normal program and a rewriting spare program of a device incorporating the program rewriting device;
Rewrite storing a rewrite program indicating a reception procedure for receiving the normal program and the rewrite spare program from an external device, and an overwrite procedure for overwriting the received normal program and the rewrite spare program in the normal program storage unit A program storage unit;
In the first period, based on the rewrite program reception procedure and the overwrite procedure, the normal program and the rewrite preliminary program are overwritten,
Control means for copying the rewrite preliminary program overwritten in the normal program storage unit to the rewrite program storage unit based on the normal program in a second period different from the first period. Program rewriting device.
請求項1記載のプログラム書き換え装置において、
プログラムの書き換えの進行状態を判別する状態判別プログラムを記憶する状態判別プログラム記憶部を更に有し、
前記制御手段は、前記第1期間よりも前に、前記通常プログラムが更新されたことを示す通常プログラム更新記録を設定されていない状態にするとともに、前記通常プログラム及び書き換え予備プログラムの上書きが完了することに応答して、前記通常プログラム更新記録をフラグ記憶部に設定し、また
前記状態判別プログラムに基づいて前記通常プログラム更新記録の設定有無を判断し、前記通常プログラム更新記録が設定されていないと判断した場合、前記書き換えプログラムの受信手順と上書き手順とに基づいて、前記通常プログラム記憶部の上書きを実行することを特徴とするプログラム書き換え装置。
The program rewriting apparatus according to claim 1,
A state determination program storage unit for storing a state determination program for determining a progress state of rewriting of the program;
The control unit sets the normal program update record indicating that the normal program has been updated before the first period is not set, and completes the overwriting of the normal program and the rewrite preliminary program. In response, the normal program update record is set in the flag storage unit, and the presence / absence of the normal program update record is determined based on the state determination program, and the normal program update record is not set. When it is determined, the program rewriting apparatus performs overwriting of the normal program storage unit based on a receiving procedure and an overwriting procedure of the rewriting program.
請求項2記載のプログラム書き換え装置において、
前記制御手段は、前記プログラム書き換え装置を内蔵する装置の電源投入時に、通常プログラム更新記録の設定有無を判断することを特徴とするプログラム書き換え装置。
The program rewriting apparatus according to claim 2, wherein
The control means determines whether or not normal program update recording is set when a device incorporating the program rewriting device is turned on.
請求項2または請求項3記載のプログラム書き換え装置において、
記制御手段は、前記第2期間よりも前に、前記書き換え予備プログラムが更新されたことを示す書き換えプログラム更新記録を設定されていない状態にするとともに、前記書き換え予備プログラムの前記書き換えプログラム記憶部への複写が完了することに応答して、前記書き換えプログラム更新記録をフラグ記憶部に設定し、また
前記通常プログラム更新記録が設定されていると判断した後、または前記通常プログラム更新記録が設定されていないと判断して前記通常プログラム記憶部の上書きが実行された後に、前記状態判別プログラムに基づいて前記書き換えプログラム更新記録の設定有無を判断し、前記書き換えプログラム更新記録が設定されていないと判断した場合、前記通常プログラムに基づいて、前記通常プログラム記憶部に上書きされた前記書き換え予備プログラムを前記書き換えプログラム記憶部に複写することを特徴とするプログラム書き換え装置
The program rewriting device according to claim 2 or 3 ,
Before SL control means prior to the second period, the rewrite with a state in which the preliminary program is not set to the rewriting program update records indicating that it has been updated, the rewriting program storage unit of the rewriting preliminary program In response to the completion of copying, the rewrite program update record is set in the flag storage unit, and
After determining that the normal program update record is set, or after determining that the normal program update record is not set and executing overwriting of the normal program storage unit , based on the state determination program It is determined whether or not the rewrite program update record is set. If it is determined that the rewrite program update record is not set, the rewrite spare program overwritten in the normal program storage unit is rewritten based on the normal program. A program rewriting apparatus for copying to a program storage unit .
JP05667498A 1998-03-09 1998-03-09 Program rewriting device Expired - Lifetime JP4652492B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP05667498A JP4652492B2 (en) 1998-03-09 1998-03-09 Program rewriting device
US09/263,195 US6311322B1 (en) 1998-03-09 1999-03-05 Program rewriting apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP05667498A JP4652492B2 (en) 1998-03-09 1998-03-09 Program rewriting device

Publications (2)

Publication Number Publication Date
JPH11259287A JPH11259287A (en) 1999-09-24
JP4652492B2 true JP4652492B2 (en) 2011-03-16

Family

ID=13033980

Family Applications (1)

Application Number Title Priority Date Filing Date
JP05667498A Expired - Lifetime JP4652492B2 (en) 1998-03-09 1998-03-09 Program rewriting device

Country Status (1)

Country Link
JP (1) JP4652492B2 (en)

Also Published As

Publication number Publication date
JPH11259287A (en) 1999-09-24

Similar Documents

Publication Publication Date Title
US6311322B1 (en) Program rewriting apparatus
US8112617B2 (en) Information processing device, and method of starting information processing device
US20050270551A1 (en) External storage device, image acquisition device, and method and system to control a driver
JP2002175194A (en) Program downloading system, program downloading device, image forming device, program downloading method, and computer-readable recording medium with program for executing the method recorded thereon
JP4258579B2 (en) Program rewriting device
JP4946141B2 (en) Configuration change program and information processing apparatus
JP2000245681A (en) Version updating method for firmware for electronic endoscope device and electronic endoscope device
US20040006766A1 (en) Method and apparatus for installing device driver
JP3012842B1 (en) Facsimile machine
JP4652492B2 (en) Program rewriting device
JPH1021060A (en) Communication system with automatic program update processing function, and recording medium equipped with program performing program update processing
JP2023068538A (en) Information processing apparatus, method for controlling the same, and program
JP5803598B2 (en) Image forming apparatus
JP2002007152A (en) Download method and download device
JP4076113B2 (en) Electronic control unit
JP3659399B2 (en) Programmable logic controller
JP2003084982A (en) Method and system for installing program in image processor, image processor having program rewrite function and program rewrite method for image processor
JP2001344156A (en) Device with flash memory and data rewriting method
JP3308920B2 (en) Information processing device
JP3678402B2 (en) Facsimile device
JP2000245682A (en) Electronic endoscope device
JPH05274157A (en) Image generating device
JP2011145810A (en) Method for rewriting program data and equipment control system
JPH0981396A (en) Digital controller
JP2003223327A (en) Portable terminal device and its program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050221

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20051130

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070417

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070618

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070717

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070914

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20071016

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20071214

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20101112

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20101216

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131224

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131224

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term