JP2008225763A - Update method for firmware, program and electronic equipment - Google Patents

Update method for firmware, program and electronic equipment Download PDF

Info

Publication number
JP2008225763A
JP2008225763A JP2007062092A JP2007062092A JP2008225763A JP 2008225763 A JP2008225763 A JP 2008225763A JP 2007062092 A JP2007062092 A JP 2007062092A JP 2007062092 A JP2007062092 A JP 2007062092A JP 2008225763 A JP2008225763 A JP 2008225763A
Authority
JP
Japan
Prior art keywords
firmware
recorded
new firmware
new
nonvolatile memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2007062092A
Other languages
Japanese (ja)
Inventor
Tomomitsu Muta
友光 牟田
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.)
Fujifilm Corp
Original Assignee
Fujifilm 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 Fujifilm Corp filed Critical Fujifilm Corp
Priority to JP2007062092A priority Critical patent/JP2008225763A/en
Publication of JP2008225763A publication Critical patent/JP2008225763A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1433Saving, restoring, recovering or retrying at system level during software upgrading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an update method of firmware for easily updating the firmware without using any memory exclusive for the firmware, and for, when there is any problem in the new firmware, easily returning the new firmware to old firmware, and to provide a program and electronic equipment. <P>SOLUTION: New firmware acquired from the outside is recorded in the continuous free clusters of a flash ROM in a state where firmware is recorded in the flash ROM beforehand. Thus, it is possible to easily update the firmware by changing the leading cluster of the memory area of the firmware. Also, when the update of the firmware fails, it is possible to return to the old firmware by returning the leading cluster of the memory area of the firmware to the original state. In any case, it is consequently possible to start electronic equipment, and to prevent the equipment from being operated. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は電子機器に係り、特にファームウェアが更新可能な電子機器に関する。   The present invention relates to an electronic device, and more particularly to an electronic device whose firmware can be updated.

デジタルカメラ、携帯電話、ポータブルコンピュータ、携帯音楽プレーヤー、PDA等の電子機器では、機器の機能を向上させるために、ファームウェアを更新することが一般的に行われている。ここで、ファームウェアとは、電子機器を制御するためのプログラムであり、一般には電子機器内の不揮発性メモリに記録されている。   In an electronic device such as a digital camera, a mobile phone, a portable computer, a portable music player, and a PDA, the firmware is generally updated in order to improve the function of the device. Here, the firmware is a program for controlling the electronic device, and is generally recorded in a non-volatile memory in the electronic device.

ファームウェアの更新方法として、特許文献1には、電子機器に装填されたメモリカードからアップデート用のファームウェアを自動的に検出し、電子機器内に記録されたファームウェアをその検出されたファームウェアに書き換えることで、ファームウェアを更新する方法が提案されている。この特許文献1に記載されたファームウェアの更新方法では、電子機器内のファームウェア専用のメモリに記録されたファームウェアと電子機器に装填されたメモリカードに記録されたアップデート用のファームウェアの新旧を比較し、アップデート用のファームウェアが電子機器内に記録されたファームウェアより新しい場合には、電子機器内に記録されたファームウェアを消した後で、アップデート用のファームウェアを電子機器内の専用のメモリに記録して、ファームウェアの更新を行う。
特開2005―115505号公報
As a method for updating firmware, Patent Document 1 discloses that firmware for update is automatically detected from a memory card loaded in an electronic device, and the firmware recorded in the electronic device is rewritten with the detected firmware. A method for updating firmware has been proposed. In the firmware update method described in Patent Document 1, the firmware recorded in the memory dedicated to the firmware in the electronic device is compared with the old and new firmware for update recorded in the memory card loaded in the electronic device. If the firmware for update is newer than the firmware recorded in the electronic device, erase the firmware recorded in the electronic device, then record the update firmware in the dedicated memory in the electronic device, Update the firmware.
JP-A-2005-115505

しかしながら、上記特許文献1の方法では以下のような欠点があった。すなわち、特許文献1の方法では、ファームウェア専用のメモリにファームウェアを記録しているために、そのファームウェア専用のメモリに記録されているファームウェアをあらかじめ消した後で新しいファームウェアを書き込む必要がある。そのため、あらかじめ新しいファームウェアの一部が破損している等で新しいファームウェアを用いて電子機器が起動できなかった場合には、あらかじめ記録されていたファームウェアが消されてしまっているために、その電子機器が使用できなくなるという問題がある。   However, the method of Patent Document 1 has the following drawbacks. That is, in the method of Patent Document 1, since firmware is recorded in a memory dedicated to firmware, it is necessary to write new firmware after deleting the firmware recorded in the memory dedicated to the firmware in advance. Therefore, if the electronic device cannot be started up using the new firmware because part of the new firmware has been damaged in advance, the pre-recorded firmware has been erased. There is a problem that cannot be used.

また、ファームウェアを専用のメモリに記録しているため、画像、音等の各種データを機器内部に記録するには、ファームウェアを記録させるメモリとは別のメモリを機器内部に用意しなくてはいけないという問題がある。   Also, since the firmware is recorded in the dedicated memory, in order to record various data such as images and sounds inside the device, it is necessary to prepare a memory inside the device that is different from the memory that records the firmware. There is a problem.

本発明はこのような事情に鑑みてなされたもので、ファームウェア専用のメモリを使用せず、ファームウェアを容易に更新することができ、かつ、新しいファームウェアに問題があった場合には以前のファームウェアに容易に戻すことができるファームウェアの更新方法、プログラム及び電子機器を提供することを目的とする。   The present invention has been made in view of such circumstances, and it is possible to easily update the firmware without using firmware dedicated memory, and to replace the previous firmware when there is a problem with the new firmware. It is an object to provide a firmware update method, a program, and an electronic device that can be easily returned.

請求項1に記載の電池駆動機器は、前記目的を達成するために、各種データが読み書きされる不揮発性メモリにファームウェアが記録された電子機器のファームウェア更新方法において、更新する新しいファームウェアを取得するステップと、前記不揮発性メモリにあらかじめ記録されているファームウェアが前記不揮発性メモリに記録された状態で、前記新しいファームウェアを前記不揮発性メモリの連続した空き領域に記録するステップと、を含むことを特徴とする。   The battery-operated device according to claim 1, in order to achieve the object, a step of acquiring new firmware to be updated in a firmware update method for an electronic device in which firmware is recorded in a nonvolatile memory in which various data are read and written. And recording the new firmware in a continuous free area of the non-volatile memory in a state in which the firmware pre-recorded in the non-volatile memory is recorded in the non-volatile memory. To do.

請求項1に記載のファームウェアの更新方法によれば、不揮発性メモリに各種データ及びファームウェアを記録する電子機器において、不揮発性メモリにあらかじめ記録されているファームウェアが不揮発性メモリに記録された状態で、電子機器の外部から取得した新しいファームウェアを不揮発性メモリの連続した空き領域に記録する。これにより、旧ファームウェアから新しいファームウェアに更新する場合には、ファームウェアのメモリ領域の先頭クラスタを変更させればよいため、ファームウェアを容易に更新することができる。また、新しいファームウェアに問題があった場合には以前のファームウェアに容易に戻すことができる。   According to the firmware update method of claim 1, in the electronic apparatus that records various data and firmware in the nonvolatile memory, the firmware recorded in advance in the nonvolatile memory is recorded in the nonvolatile memory, New firmware obtained from outside the electronic device is recorded in a continuous free area of the nonvolatile memory. As a result, when the old firmware is updated to the new firmware, it is only necessary to change the top cluster in the firmware memory area, so that the firmware can be easily updated. Also, if there is a problem with the new firmware, it can be easily restored to the previous firmware.

請求項2に記載のファームウェア更新方法は、前記目的を達成するために、請求項1に記載のファームウェア更新方法において、前記新しいファームウェアを前記不揮発性メモリの連続した空き領域に記録するステップでは、前記不揮発性メモリをデフラグした後で前記新しいファームウェアを前記不揮発性メモリの連続した空き領域に保存することを特徴とする。   In order to achieve the object, the firmware update method according to claim 2 is the firmware update method according to claim 1, wherein the new firmware is recorded in a continuous free area of the nonvolatile memory. After the non-volatile memory is defragmented, the new firmware is stored in a continuous free area of the non-volatile memory.

請求項2に記載のファームウェア更新方法によれば、不揮発性メモリをデフラグした後で新しいファームウェアを不揮発性メモリの連続した空き領域に保存することで、電子機器の外部から受信した新しいファームウェアを、ファームウェアがあらかじめ記録されている不揮発性メモリの連続した空き領域に記録する。これにより、不揮発性メモリに新しいファームウェアを記録するための連続した空き領域がない場合においても、新しいファームウェアを不揮発性メモリに記録することができる。また、新しいファームウェアに問題があった場合には以前のファームウェアに容易に戻すことができる。   According to the firmware update method of claim 2, the new firmware received from the outside of the electronic device is stored in the firmware by storing the new firmware in a continuous free area of the nonvolatile memory after defragmenting the nonvolatile memory. Is recorded in a continuous free area of a non-volatile memory recorded in advance. Thus, even when there is no continuous free space for recording new firmware in the nonvolatile memory, the new firmware can be recorded in the nonvolatile memory. Also, if there is a problem with the new firmware, it can be easily restored to the previous firmware.

請求項3に記載のファームウェア更新方法は、前記目的を達成するために、各種データが読み書きされる不揮発性メモリにファームウェアが記録された電子機器のファームウェア更新方法において、更新する新しいファームウェアを取得するステップと、前記不揮発性メモリにあらかじめ記録されているファームウェアが前記不揮発性メモリに記録された状態で、前記新しいファームウェアを前記不揮発性メモリに保存するステップと、前記不揮発性メモリをデフラグするステップと、を含むことを特徴とする。   The firmware update method according to claim 3, wherein, in order to achieve the above object, in the firmware update method for an electronic device in which firmware is recorded in a nonvolatile memory in which various data are read and written, a step of acquiring new firmware to be updated And storing the new firmware in the non-volatile memory in a state where the firmware pre-recorded in the non-volatile memory is recorded in the non-volatile memory, and defragmenting the non-volatile memory. It is characterized by including.

請求項3に記載のファームウェア更新方法によれば、不揮発性メモリに各種データ及びファームウェアを記録する電子機器において、新しいファームウェアを不揮発性メモリに保存した後で不揮発性メモリをデフラグすることで、電子機器の外部から受信した新しいファームウェアを、ファームウェアがあらかじめ記録されている不揮発性メモリに連続して記録する。これにより、旧ファームウェアから新しいファームウェアに更新する場合には、ファームウェアのメモリ領域の先頭クラスタを変更させればよいため、ファームウェアを容易に更新することができる。また、新しいファームウェアに問題があった場合には以前のファームウェアに容易に戻すことができる。また、不揮発性メモリに新しいファームウェアを記録するための連続した空き領域がない場合においても、新しいファームウェアを不揮発性メモリに記録することができる。   According to the firmware update method of claim 3, in the electronic device that records various data and firmware in the nonvolatile memory, the electronic device is configured to defragment the nonvolatile memory after storing the new firmware in the nonvolatile memory. The new firmware received from the outside is continuously recorded in the nonvolatile memory in which the firmware is recorded in advance. As a result, when the old firmware is updated to the new firmware, it is only necessary to change the top cluster in the firmware memory area, so that the firmware can be easily updated. Also, if there is a problem with the new firmware, it can be easily restored to the previous firmware. Further, even when there is no continuous free space for recording new firmware in the nonvolatile memory, the new firmware can be recorded in the nonvolatile memory.

請求項4に記載のファームウェア更新方法は、前記目的を達成するために、請求項1に記載のファームウェア更新方法において、前記新しいファームウェアを起動ファームウェアに設定するステップと、前記電子機器を前記新しいファームウェアで起動するステップと、前記新しいファームウェアが正常に動作するか判定するステップと、を更に含み、前記新しいファームウェアが正常に動作するか判定するステップにおいて、前記新しいファームウェアが正常に動作した場合には、前記不揮発性メモリにおける前記あらかじめ記録されているファームウェアが保存されている領域を各種データを記録する領域として開放し、前記新しいファームウェアが正常に動作しなかった場合には、前記あらかじめ記録されているファームウェアを起動ファームウェアに再設定することを特徴とする。   In order to achieve the above object, a firmware update method according to claim 4 is the firmware update method according to claim 1, wherein the new firmware is set as a startup firmware, and the electronic device is replaced with the new firmware. A step of determining whether or not the new firmware operates normally. In the step of determining whether or not the new firmware operates normally, when the new firmware operates normally, The area where the pre-recorded firmware is stored in the nonvolatile memory is released as an area for recording various data. If the new firmware does not operate normally, the pre-recorded firmware is Start-up Characterized by resetting the firmware.

請求項4に記載のファームウェア更新方法によれば、不揮発性メモリに新しいファームウェアを記録した後で、新しいファームウェアを起動ファームウェアに設定して、電子機器を起動させる。そして、電子機器が正常に起動した場合には、新しいファームウェアが正常と判断し、古いファームウェアを消して、その領域を各種データを記録する領域として開放する。また、電子機器が正常に起動しなかった場合には、新しいファームウェアが正常でないと判断し、古いファームウェアを起動ファームウェアに再設定する。これにより、電子機器が正常に起動した場合には、ファームウェア専用のメモリを使用しないために、古いファームウェアを消すことにより古いファームウェアが記録されていた領域を各種データを記録する領域として開放することができる。そのため、メモリを有効に使うことができる。また、電子機器が正常に起動しなかった場合には、ファームウェアのメモリ領域の先頭クラスタを元に戻せばよい、すなわち、以前のファームウェアに容易に戻すことができる。そのため、どのような場合においても、電子機器を起動させることができ、機器が動作しなくなることを防ぐことができる。   According to the firmware update method of the fourth aspect, after the new firmware is recorded in the non-volatile memory, the new firmware is set as the startup firmware and the electronic device is started. When the electronic device starts up normally, it is determined that the new firmware is normal, the old firmware is erased, and the area is released as an area for recording various data. If the electronic device does not start up normally, it is determined that the new firmware is not normal, and the old firmware is reset as the startup firmware. As a result, when the electronic device starts up normally, the memory dedicated to the firmware is not used, so the area where the old firmware was recorded can be released as an area for recording various data by deleting the old firmware. it can. Therefore, the memory can be used effectively. If the electronic device does not start normally, the first cluster in the firmware memory area may be restored, that is, it can be easily restored to the previous firmware. Therefore, in any case, the electronic device can be activated and the device can be prevented from becoming inoperable.

請求項5に記載のファームウェア更新方法は、前記目的を達成するために、請求項4に記載のファームウェア更新方法において、前記電子機器を前記新しいファームウェアを起動ファームウェアに設定して起動させるステップでは、ウオッチドッグタイマーを起動してから前記新しいファームウェアを起動ファームウェアに設定し、前記新しいファームウェアが正常に動作するか判定するステップでは、前記ウオッチドッグタイマーがタイムアップしなかった場合には前記新しいファームウェアが正常に動作したと判断し、前記ウオッチドッグタイマーがタイムアップした場合には前記新しいファームウェアが正常に動作しなかったと判断することを特徴とする。   In order to achieve the above object, a firmware update method according to claim 5 is a firmware update method according to claim 4, wherein the electronic device is started by setting the new firmware as a startup firmware and starting the electronic device. In the step of setting the new firmware as the startup firmware after starting the dog timer and determining whether the new firmware operates normally, if the watchdog timer does not time out, the new firmware is normally It is determined that the firmware has been operated, and when the watchdog timer has timed out, it is determined that the new firmware did not operate normally.

請求項5に記載のファームウェア更新方法によれば、ウオッチドッグタイマーを起動させてから新しいファームウェアで電子機器を起動させ、前記ウオッチドッグタイマーがタイムアップしなかった場合には前記新しいファームウェアが正常に動作したと判断し、前記ウオッチドッグタイマーがタイムアップした場合には前記新しいファームウェアが正常に動作しなかったと判断する。これにより、新しいファームウェアが正常に動作するかどうかを自動的に知ることができる。   According to the firmware update method of claim 5, when the watchdog timer is started, the electronic device is started with the new firmware, and when the watchdog timer does not time out, the new firmware operates normally. If the watchdog timer expires, it is determined that the new firmware did not operate normally. Thereby, it is possible to automatically know whether the new firmware operates normally.

請求項6に記載のファームウェア更新方法は、前記目的を達成するために、請求項4に記載のファームウェア更新方法において、前記電子機器を前記新しいファームウェアを起動ファームウェアに設定して起動させるステップでは、所定の信号入力を割り込みに設定してから前記新しいファームウェアを起動ファームウェアに設定し、前記新しいファームウェアが正常に動作するか判定するステップでは、前記新しいファームウェアの動作終了までに前記割り込みが入らない場合には前記新しいファームウェアが正常に動作したと判断し、前記新しいファームウェアの動作中に前記割り込みが入る場合には前記新しいファームウェアが正常に動作しなかったと判断することを特徴とする。   In order to achieve the above object, a firmware update method according to claim 6 is the firmware update method according to claim 4, wherein the electronic device is started by setting the new firmware as a startup firmware and starting the electronic device. In the step of setting the new signal to be the boot firmware after setting the signal input of the interrupt to the boot firmware and determining whether the new firmware operates normally, if the interrupt does not enter before the operation of the new firmware is completed It is determined that the new firmware has operated normally, and if the interrupt is input during the operation of the new firmware, it is determined that the new firmware has not operated normally.

請求項6に記載のファームウェア更新方法によれば、所定の信号入力を割り込みに設定してから新しいファームウェアで電子機器を起動させ、新しいファームウェアの動作終了までに割り込みが入らない場合には新しいファームウェアが正常に動作したと判断し、新しいファームウェアの動作中に割り込みが入る場合には新しいファームウェアが正常に動作しなかったと判断する。これにより、電子機器の操作者がファームウェアの更新の可否を判断し、電子機器に指示をすることができる。   According to the firmware update method of the sixth aspect, the electronic device is started with the new firmware after setting the predetermined signal input to the interrupt, and if the interrupt does not occur before the end of the operation of the new firmware, the new firmware is If it is determined that the firmware operates normally and an interrupt occurs during the operation of the new firmware, it is determined that the new firmware did not operate normally. Thus, the operator of the electronic device can determine whether the firmware can be updated and can instruct the electronic device.

請求項7に記載のプログラムは、前記目的を達成するために、請求項1乃至6のいずれかに記載のファームウェアの更新方法を演算装置に実行させることを特徴とする。   According to a seventh aspect of the present invention, there is provided a program for causing a computing device to execute the firmware update method according to any one of the first to sixth aspects in order to achieve the object.

請求項8に記載の電子機器は、前記目的を達成するために、各種データが読み書きされる不揮発性メモリにファームウェアが記録された電子機器において、前記不揮発性メモリに記録された請求項7に記載のプログラムを前記不揮発性メモリから前記プログラムを読み出して実行する演算装置を備えたことを特徴とする。   The electronic device according to claim 8 is recorded in the non-volatile memory in an electronic device in which firmware is recorded in a non-volatile memory from which various data are read and written in order to achieve the object. And an arithmetic unit that reads the program from the nonvolatile memory and executes the program.

本発明によれば、ファームウェア用のメモリを使用せず、ファームウェアを容易に更新することができ、かつ、新しいファームウェアに問題があった場合には以前のファームウェアに容易に戻すことができる。   According to the present invention, the firmware can be easily updated without using the firmware memory, and if there is a problem with the new firmware, the previous firmware can be easily restored.

以下、添付図面に従って本発明に係るカメラを実施するための最良の形態について詳細に説明する。   The best mode for carrying out a camera according to the present invention will be described below in detail with reference to the accompanying drawings.

<第1の実施の形態>
図1は本発明に係る電子機器の一実施形態を示す正面斜視図であり、図2はその背面斜視図である。この電子機器は、レンズを通った光を撮像素子で受け、デジタル信号に変換して記録メディアに記録するデジタルカメラである。
<First Embodiment>
FIG. 1 is a front perspective view showing an embodiment of an electronic apparatus according to the present invention, and FIG. 2 is a rear perspective view thereof. This electronic device is a digital camera that receives light passing through a lens with an imaging device, converts the light into a digital signal, and records the signal on a recording medium.

デジタルカメラ10のカメラボディ12は、横長の四角い箱状に形成されており、その正面には、図1に示すように、撮影レンズ13、フラッシュ16、AF補助光ランプ18等が設けられており、上面には、シャッターボタン22、モードレバー24、電源ボタン26等が設けられている。また、側面には、USB用コネクタ15と開閉自在なスロットカバー11が設けられている。スロットカバー11の内側には、メモリカードを装着するためのメモリカードスロット14が設けられている。   The camera body 12 of the digital camera 10 is formed in a horizontally-long rectangular box shape, and as shown in FIG. 1, a photographing lens 13, a flash 16, an AF auxiliary light lamp 18 and the like are provided on the front surface. On the top surface, a shutter button 22, a mode lever 24, a power button 26, and the like are provided. Further, a USB connector 15 and a slot cover 11 that can be freely opened and closed are provided on the side surface. Inside the slot cover 11, a memory card slot 14 for mounting a memory card is provided.

一方、カメラボディ12の背面には、図2に示すように、モニタ28、ズームボタン30、再生ボタン32、ファンクションボタン34、十字ボタン36、MENU/OKボタン38、DISP/BACKボタン40等が設けられている。   On the other hand, as shown in FIG. 2, a monitor 28, a zoom button 30, a playback button 32, a function button 34, a cross button 36, a MENU / OK button 38, a DISP / BACK button 40, etc. are provided on the back of the camera body 12. It has been.

なお、図示しない底面には、三脚ネジ穴と内側にバッテリを収納するための開閉自在なバッテリカバーとが設けられている。   Note that a bottom surface (not shown) is provided with a tripod screw hole and an openable / closable battery cover for housing the battery inside.

レンズ13は、沈胴式のズームレンズで構成されており、電源ボタン26によってデジタルカメラ10の電源をONすることにより、カメラボディ12から繰り出される。なお、レンズ13のズーム機構や沈胴機構については、公知の技術なので、ここでは、その具体的な構成についての説明は省略する。   The lens 13 is constituted by a retractable zoom lens, and is extended from the camera body 12 when the power of the digital camera 10 is turned on by the power button 26. In addition, since the zoom mechanism and the retracting mechanism of the lens 13 are well-known techniques, description of the specific configuration is omitted here.

メモリカードスロット14は、撮影した被写体の画像データ、音声データ等の各種データ、ファームウェアが記録されているメモリカードを装着するための接続部である。   The memory card slot 14 is a connection unit for mounting a memory card in which various data such as image data of captured subjects, audio data, and firmware are recorded.

USB用コネクタ15は、パーソナルコンピュータ、プリンタ等の外部機器との間での信号伝達をするためUSB用ケーブルを接続するための接続部である。   The USB connector 15 is a connection unit for connecting a USB cable in order to transmit a signal to / from an external device such as a personal computer or a printer.

フラッシュ16は、たとえばキセノン管を光源として構成されており、その発光量を調整可能に形成されている。なお、キセノン管の他、高輝度のLEDを光源としたフラッシュを用いることもできる。   The flash 16 is configured using, for example, a xenon tube as a light source, and is formed so that the amount of light emission can be adjusted. In addition to a xenon tube, a flash using a high-luminance LED as a light source can also be used.

AF補助光ランプ18は、たとえば高輝度LEDで構成されており、AF時に必要に応じて発光される。   The AF auxiliary light lamp 18 is composed of, for example, a high-intensity LED, and emits light as necessary during AF.

シャッターボタン22は、いわゆる「半押し」と「全押し」とからなる二段ストローク式のスイッチで構成されている。デジタルカメラ10は、このシャッターボタン22を半押しすると撮影準備処理、すなわち、AE(Automatic Exposure:自動露出)、AF(Auto Focus:自動焦点合わせ)、AWB(Automatic White Balance:自動ホワイトバランス)の各処理を行い、全押しすると、画像の撮影・記録処理を行う。   The shutter button 22 is composed of a two-stroke switch composed of so-called “half press” and “full press”. When the shutter release button 22 is half-pressed, the digital camera 10 performs shooting preparation processing, that is, each of AE (Automatic Exposure), AF (Auto Focus), and AWB (Automatic White Balance). When the image is processed and fully pressed, the image is captured and recorded.

モードレバー24は、デジタルカメラ10の撮影モードを設定する撮影モード設定手段として機能し、このモードダイヤルの設定位置により、デジタルカメラ10の撮影モードが様々なモードに設定される。例えば、絞り、シャッタースピード等がデジタルカメラ10によって自動的に設定される「オート撮影モード」、動画撮影を行う「動画撮影モード」、人物撮影に適した「人物撮影モード」、動体撮影に適した「スポーツ撮影モード」、風景の撮影に適した「風景撮影モード」、夕景及び夜景の撮影に適した「夜景撮影モード」、絞りの目盛りを撮影者が設定し、シャッタースピードをデジタルカメラ10が自動的に設定する「絞り優先撮影モード」、シャッタースピードを撮影者が設定し、絞りの目盛りをデジタルカメラ10が自動的に設定する「シャッタースピード優先撮影モード」、絞り、シャッタースピード等を撮影者が設定する「マニュアル撮影モード」等である。   The mode lever 24 functions as a shooting mode setting means for setting the shooting mode of the digital camera 10, and the shooting mode of the digital camera 10 is set to various modes according to the setting position of the mode dial. For example, an “auto shooting mode” in which an aperture, a shutter speed, etc. are automatically set by the digital camera 10, a “movie shooting mode” for moving image shooting, a “person shooting mode” suitable for portrait shooting, and a moving subject shooting “Sports shooting mode”, “Scenery shooting mode” suitable for landscape shooting, “Night scene shooting mode” suitable for sunset and night scene shooting, the scale of the aperture is set by the photographer, and the shutter speed is automatically set by the digital camera 10 The photographer sets the “aperture priority shooting mode” to be set automatically, the shutter speed is set by the photographer, and the “shutter speed priority shooting mode” in which the digital camera 10 automatically sets the aperture scale, the aperture, the shutter speed, etc. “Manual shooting mode” to be set.

電源ボタン26は、デジタルカメラ10の電源をON/OFFするのに用いられ、所定時間(たとえば、2秒)押下されることにより、デジタルカメラ10の電源がON/OFFされる。   The power button 26 is used to turn on / off the power of the digital camera 10, and is turned on / off when pressed for a predetermined time (for example, 2 seconds).

モニタ28は、カラー表示が可能な液晶ディスプレイで構成されている。このモニタ28は、再生モード時に撮影済み画像を表示するための画像表示パネルとして利用されるとともに、各種設定操作を行なう際のユーザインターフェース表示パネルとして利用される。また、撮影モード時には、必要に応じてスルー画像が表示されて、画角確認用の電子ファインダとして利用される。   The monitor 28 is composed of a liquid crystal display capable of color display. The monitor 28 is used as an image display panel for displaying a photographed image in the reproduction mode, and is used as a user interface display panel for performing various setting operations. In the photographing mode, a through image is displayed as necessary, and is used as an electronic viewfinder for checking the angle of view.

ズームボタン30は、撮影レンズ13のズーム操作に用いられ、望遠側へのズームを指示するズームテレボタンと、広角側へのズームを指示するズームワイドボタンとで構成されている。   The zoom button 30 is used for a zoom operation of the photographic lens 13 and includes a zoom tele button for instructing zooming to the telephoto side and a zoom wide button for instructing zooming to the wide-angle side.

再生ボタン32は、再生モードへの切り替え指示に用いられる。すなわち、デジタルカメラ10は、撮影中、この再生ボタン32が押されると、再生モードに切り替えられる。また、電源OFFの状態でこの再生ボタン32が押されると、再生モードの状態でデジタルカメラ10が起動する。   The playback button 32 is used for an instruction to switch to the playback mode. That is, the digital camera 10 is switched to the playback mode when the playback button 32 is pressed during shooting. When the playback button 32 is pressed with the power off, the digital camera 10 is activated in the playback mode.

ファンクションボタン34は、撮影及び再生機能の各種設定画面の呼び出しに用いられる。すなわち、撮影時にこのファンクションボタン34が押されると、モニタ28に画像サイズ(記録画素数)、感度等の設定画面が表示され、再生時にこのファンクションボタン34が押されると、モニタ28に画像の消去、プリント予約(DPOF)の設定画面等が表示される。   The function button 34 is used to call up various setting screens for shooting and playback functions. That is, when this function button 34 is pressed during shooting, a setting screen for image size (number of recorded pixels), sensitivity, etc. is displayed on the monitor 28. When this function button 34 is pressed during playback, the image is erased on the monitor 28. A print reservation (DPOF) setting screen is displayed.

十字ボタン36は、上下左右4方向の指示を入力する方向指示手段として機能し、たとえば、メニュー画面でメニュー項目の選択などに使用される。   The cross button 36 functions as direction instruction means for inputting instructions in four directions, up, down, left, and right, and is used, for example, for selecting a menu item on a menu screen.

MENU/OKボタン38は、各モードの通常画面からメニュー画面への遷移を指示するボタン(MENUボタン)として機能するととともに、選択内容の確定、処理の実行等を指示するボタン(OKボタン)として機能する。   The MENU / OK button 38 functions as a button (MENU button) for instructing transition from the normal screen to the menu screen in each mode, and functions as a button (OK button) for instructing selection confirmation, execution of processing, and the like. To do.

DISP/BACKボタン40は、モニタ28の表示内容の切り替え指示(DISP機能)に用いられるとともに、入力操作のキャンセル等の指示(BACK機能)に用いられ、デジタルカメラ10の設定状態に応じて割り当てられる機能が切り替えられる。   The DISP / BACK button 40 is used for a display content switching instruction (DISP function) of the monitor 28 and an instruction for canceling an input operation (BACK function), and is assigned according to the setting state of the digital camera 10. The function is switched.

図3は、本実施の形態のデジタルカメラ10の電気的構成を示すブロック図である。   FIG. 3 is a block diagram showing an electrical configuration of the digital camera 10 of the present embodiment.

同図に示すように、デジタルカメラ10は、CPU110、操作部(シャッターボタン22、モードレバー24、電源ボタン26、ズームボタン30、再生ボタン32、ファンクションボタン34、十字ボタン36、MENU/OKボタン38、DISP/BACKボタン40等)112、フラッシュROM114、RAM116、VRAM120、撮影光学系124、撮影光学系駆動制御部126、撮像素子128、タイミングジェネレータ130、アナログ信号処理部132、A/Dコンバータ134、画像入力コントローラ136、画像信号処理部138、圧縮伸張処理部140、USBI/F142、メディアコントローラ146、表示制御部148、AE/AWB検出部152、AF検出部154、フラッシュ制御部156、AF補助光ランプ制御部158等で構成されている。   As shown in the figure, the digital camera 10 includes a CPU 110, an operation unit (shutter button 22, mode lever 24, power button 26, zoom button 30, play button 32, function button 34, cross button 36, MENU / OK button 38. , DISP / BACK button 40, etc.) 112, flash ROM 114, RAM 116, VRAM 120, imaging optical system 124, imaging optical system drive control unit 126, imaging device 128, timing generator 130, analog signal processing unit 132, A / D converter 134, Image input controller 136, image signal processing unit 138, compression / decompression processing unit 140, USB I / F 142, media controller 146, display control unit 148, AE / AWB detection unit 152, AF detection unit 154, flash control unit 156, AF It is composed of Johikari lamp controller 158 or the like.

CPU110は、デジタルカメラ10の全体の動作を統括制御する制御手段として機能するとともに、各種の演算処理を行う演算手段として機能し、操作部112からの入力に基づき所定の制御プログラムに従ってデジタルカメラ10の各部を制御する。   The CPU 110 functions as a control unit that performs overall control of the overall operation of the digital camera 10, and also functions as a calculation unit that performs various types of calculation processing. The CPU 110 is configured according to a predetermined control program based on an input from the operation unit 112. Control each part.

フラッシュROM114には、このCPU110が実行する制御プログラムであるファームウェア、制御に必要な各種データ、カメラ設定値、撮影された画像データ等が記録されている。なお、後述するように、撮影された画像データは、通常メモリカードに記録されるが、ユーザーが選択した場合、メモリカードが装填されていない場合、メモリカードの容量が不足した場合等にはフラッシュROM114に記録される。   The flash ROM 114 stores firmware, which is a control program executed by the CPU 110, various data necessary for control, camera setting values, captured image data, and the like. As will be described later, the captured image data is normally recorded on the memory card, but if the user selects it, the memory card is not loaded, or if the memory card capacity is insufficient, etc. Recorded in the ROM 114.

RAM116は、CPU110の作業用領域として利用されるとともに、画像データの一時記憶領域として利用され、VRAM120は、表示用の画像データ専用の一時記憶領域として利用される。   The RAM 116 is used as a work area for the CPU 110 and is used as a temporary storage area for image data, and the VRAM 120 is used as a temporary storage area dedicated for display image data.

撮影光学系124は、撮影レンズ13、絞り、シャッタを含み、各構成要素は、モータ等のアクチュエータで構成される駆動部124Aに駆動されて動作する。たとえば、撮影レンズ13を構成するフォーカスレンズ群は、フォーカスモータに駆動されて前後方向に移動し、ズームレンズ群は、ズームモータに駆動されて前後方向に移動する。また、絞りは、絞りモータに駆動されて拡縮し、シャッタは、シャッタモータに駆動されて開閉する。   The photographic optical system 124 includes the photographic lens 13, a diaphragm, and a shutter, and each component operates by being driven by a drive unit 124A configured by an actuator such as a motor. For example, the focus lens group constituting the photographing lens 13 is driven by a focus motor to move in the front-rear direction, and the zoom lens group is driven by the zoom motor to move in the front-rear direction. The diaphragm is driven by a diaphragm motor to expand and contract, and the shutter is driven by a shutter motor to open and close.

撮影光学系駆動制御部126は、CPU110からの指令に応じて撮影光学系124の駆動部124Aを制御し、撮影レンズ13、絞り、シャッタの動作を制御する。   The photographing optical system drive control unit 126 controls the driving unit 124A of the photographing optical system 124 in accordance with a command from the CPU 110, and controls the operations of the photographing lens 13, the diaphragm, and the shutter.

撮像素子128は、たとえば、所定のカラーフィルタ配列のカラーCCDで構成されており、撮影光学系124によって結像された被写体の画像を電子的に撮像する。   The imaging device 128 is configured by, for example, a color CCD having a predetermined color filter array, and electronically captures an image of a subject formed by the photographing optical system 124.

タイミングジェネレータ(TG)130は、CPU110からの指令に応じて、この撮像素子128を駆動するためのタイミング信号を出力する。   A timing generator (TG) 130 outputs a timing signal for driving the image sensor 128 in response to a command from the CPU 110.

アナログ信号処理部132は、撮像素子128から出力された画像信号に対して相関二重サンプリング処理(撮像素子の出力信号に含まれるノイズ(特に熱雑音)等を軽減することを目的として、撮像素子の1画素毎の出力信号に含まれるフィードスルー成分レベルと画素信号成分レベルとの差をとることにより正確な画素データを得る処理)を行い、増幅して出力する。   The analog signal processing unit 132 is for the purpose of reducing correlated double sampling processing (noise (particularly thermal noise) included in the output signal of the image sensor) and the like for the image signal output from the image sensor 128. The process of obtaining accurate pixel data by taking the difference between the feed-through component level and the pixel signal component level included in the output signal for each pixel is amplified, and output.

A/Dコンバータ134は、アナログ信号処理部132から出力されたR、G、Bのアナログの画像信号をデジタルの画像信号に変換する。   The A / D converter 134 converts the R, G, and B analog image signals output from the analog signal processing unit 132 into digital image signals.

画像入力コントローラ136は、所定容量のラインバッファを内蔵しており、CPU110からの指令に従い、A/Dコンバータ134から出力された1画像分の画像信号を蓄積して、RAM116に記録する。   The image input controller 136 has a built-in line buffer of a predetermined capacity, accumulates an image signal for one image output from the A / D converter 134 in accordance with a command from the CPU 110, and records it in the RAM 116.

画像信号処理部138は、同時化回路(単板CCDのカラーフィルタ配列に伴う色信号の空間的なズレを補間して色信号を同時式に変換する処理回路)、ホワイトバランス補正回路、ガンマ補正回路、輪郭補正回路、輝度・色差信号生成回路等を含み、CPU110からの指令に従い、入力された画像信号に所要の信号処理を施して、輝度データ(Yデータ)と色差データ(Cr,Cbデータ)とからなる画像データ(YUVデータ)を生成する。   The image signal processing unit 138 includes a synchronization circuit (a processing circuit that interpolates a spatial shift of the color signal associated with the color filter array of the single CCD and converts the color signal into a simultaneous expression), a white balance correction circuit, and a gamma correction. Circuit, contour correction circuit, luminance / color difference signal generation circuit, etc., and according to a command from the CPU 110, the input image signal is subjected to necessary signal processing to obtain luminance data (Y data) and color difference data (Cr, Cb data). ) Is generated.

圧縮伸張処理部140は、CPU110からの指令に従い、入力された画像データに所定形式の圧縮処理を施し、圧縮画像データを生成する。また、CPU110からの指令に従い、入力された圧縮画像データに所定形式の伸張処理を施し、非圧縮の画像データを生成する。   The compression / decompression processing unit 140 performs compression processing in a predetermined format on the input image data in accordance with a command from the CPU 110 to generate compressed image data. Further, in accordance with a command from the CPU 110, the input compressed image data is subjected to a decompression process in a predetermined format to generate uncompressed image data.

USBI/F142は、CPU110からの指令に従い、USBコネクタ15を介して接続されている外部機器から転送されたコマンドの検出、外部機器に対してデータの読み/書きの制御を行なう。なお、USBI/F142で検出されたコマンドはCPU110に供給される。   The USB I / F 142 detects a command transferred from an external device connected via the USB connector 15 and controls reading / writing of data with respect to the external device in accordance with a command from the CPU 110. Note that the command detected by the USB I / F 142 is supplied to the CPU 110.

メディアコントローラ146は、CPU110からの指令に従い、メモリカードスロット14に装填されたメモリカード144に対してデータの読み/書きを制御する。   The media controller 146 controls reading / writing of data with respect to the memory card 144 loaded in the memory card slot 14 in accordance with a command from the CPU 110.

表示制御部148は、CPU110からの指令に従い、モニタ28への表示を制御する。すなわち、CPU110からの指令に従い、入力された画像信号をモニタ28に表示するための映像信号(たとえば、NTSC信号やPAL信号、SCAM信号)に変換してモニタ28に出力するとともに、所定の文字、図形情報をモニタ28に出力する。   The display control unit 148 controls display on the monitor 28 in accordance with a command from the CPU 110. That is, in accordance with a command from the CPU 110, the input image signal is converted into a video signal (for example, NTSC signal, PAL signal, SCAM signal) for display on the monitor 28 and output to the monitor 28. The graphic information is output to the monitor 28.

AE/AWB検出回路152は、CPU110からの指令に従い、入力された画像信号からAE制御及びAWB制御に必要な物理量を算出する。たとえば、AE制御に必要な物理量として、1画面を複数のエリア(たとえば16×16)に分割し、分割したエリアごとにR、G、Bの画像信号の積算値を算出する。CPU110は、このAE/AWB検出回路152から得た積算値に基づいて被写体の明るさ(被写体輝度)を検出し、撮影に適した露出値(撮影EV値)を算出する。そして、算出した撮影EV値と所定のプログラム線図から絞り値とシャッタ速度を決定する。また、AWB制御に必要な物理量として、1画面を複数のエリア(例えば、16×16)に分割し、分割したエリアごとにR、G、Bの画像信号の色別の平均積算値を算出する。CPU110は、得られたRの積算値、Bの積算値、Gの積算値から分割エリアごとにR/G及びB/Gの比を求め、求めたR/G、B/Gの値のR/G、B/Gの色空間における分布等に基づいて光源種判別を行う。そして、判別された光源種に適したホワイトバランス調整値に従って、たとえば各比の値がおよそ1(つまり、1画面においてRGBの積算比率がR:G:B≒1:1:1)になるように、ホワイトバランス調整回路のR、G、B信号に対するゲイン値(ホワイトバランス補正値)を決定する。   The AE / AWB detection circuit 152 calculates a physical quantity necessary for AE control and AWB control from the input image signal in accordance with a command from the CPU 110. For example, as a physical quantity required for AE control, one screen is divided into a plurality of areas (for example, 16 × 16), and an integrated value of R, G, and B image signals is calculated for each divided area. The CPU 110 detects the brightness of the subject (subject brightness) based on the integrated value obtained from the AE / AWB detection circuit 152, and calculates an exposure value (shooting EV value) suitable for shooting. Then, an aperture value and a shutter speed are determined from the calculated shooting EV value and a predetermined program diagram. Further, as a physical quantity necessary for AWB control, one screen is divided into a plurality of areas (for example, 16 × 16), and an average integrated value for each color of R, G, and B image signals is calculated for each divided area. . The CPU 110 obtains the ratio of R / G and B / G for each divided area from the obtained R accumulated value, B accumulated value, and G accumulated value, and R of the obtained R / G and B / G values. The light source type is discriminated based on the distribution in the color space of / G and B / G. Then, according to the white balance adjustment value suitable for the determined light source type, for example, the value of each ratio is approximately 1 (that is, the RGB integration ratio is R: G: B≈1: 1: 1 in one screen). Then, a gain value (white balance correction value) for the R, G, and B signals of the white balance adjustment circuit is determined.

AF検出回路154は、CPU110からの指令に従い、入力された画像信号からAF制御に必要な物理量を算出する。本実施の形態のデジタルカメラ10では、撮像素子128から得られる画像のコントラストによりAF制御が行われ(いわゆるコントラストAF)、AF検出回路154は、入力された画像信号から画像の鮮鋭度を示す焦点評価値を算出する。CPU110は、このAF検出回路154で算出される焦点評価値が極大となる位置を検出し、その位置にフォーカスレンズ群を移動させる。すなわち、フォーカスレンズ群を至近から無限遠まで所定のステップで移動させ、各位置で焦点評価値を取得し、得られた焦点評価値が最大の位置を合焦位置として、その位置にフォーカスレンズ群を移動させる。   The AF detection circuit 154 calculates a physical quantity necessary for AF control from the input image signal in accordance with a command from the CPU 110. In the digital camera 10 of the present embodiment, AF control is performed based on the contrast of the image obtained from the image sensor 128 (so-called contrast AF), and the AF detection circuit 154 has a focus indicating the sharpness of the image from the input image signal. An evaluation value is calculated. The CPU 110 detects a position where the focus evaluation value calculated by the AF detection circuit 154 is maximized, and moves the focus lens group to that position. That is, the focus lens group is moved from the closest distance to infinity in a predetermined step, the focus evaluation value is obtained at each position, and the position where the obtained focus evaluation value is the maximum is set as the in-focus position, and the focus lens group is at that position. Move.

フラッシュ制御部156は、CPU110からの指令に従い、フラッシュ16の発光を制御する。   The flash control unit 156 controls the light emission of the flash 16 in accordance with a command from the CPU 110.

AF補助光ランプ制御部158は、CPU110からの指令に従い、AF補助光ランプ18の発光を制御する。すなわち、CPU110は、AF時に被写体が暗いと判断すると、あるいは、被写体のコントラストが低いと判断すると、AF補助光ランプ制御部158を介してAF補助光ランプ18を発光させ、被写体にAF補助光を照射させてAF制御を実行する。   The AF auxiliary light lamp control unit 158 controls the light emission of the AF auxiliary light lamp 18 in accordance with a command from the CPU 110. That is, if the CPU 110 determines that the subject is dark during AF or determines that the subject has a low contrast, the CPU 110 causes the AF auxiliary light lamp 18 to emit light via the AF auxiliary light lamp control unit 158 and emits AF auxiliary light to the subject. Irradiate and execute AF control.

次に、以上のように構成された本実施の形態のデジタルカメラ10の作用について説明する。   Next, the operation of the digital camera 10 of the present embodiment configured as described above will be described.

まず、デジタルカメラ10の撮影、記録動作及び再生動作について説明する。   First, photographing, recording operation, and reproduction operation of the digital camera 10 will be described.

電源ボタン26を押下し、デジタルカメラ10の電源を投入すると、デジタルカメラ10は、撮影モードの下で起動する。   When the power button 26 is pressed and the power of the digital camera 10 is turned on, the digital camera 10 is activated under the shooting mode.

まず、撮影光学系駆動制御部126を介して撮影光学系124の駆動部124Aが駆動され、撮影レンズ13が所定位置まで繰り出される。そして、撮影レンズ13が所定位置まで繰り出されると、撮像素子128によってスルー画像用の撮影が行われ、モニタ28にスルー画像が表示される。すなわち、撮像素子128で連続的に画像が撮像され、その画像信号が連続的に処理されて、スルー画像用の画像データが生成される。生成された画像データは、VRAM120を介して順次表示制御部148に加えられ、表示用の信号形式に変換されて、モニタ28に出力される。これにより、撮像素子128で捉えた画像がモニタ28にスルー表示される。撮影者は、このモニタ28に表示されたスルー画像を見て構図を決定し、シャッターボタン22を半押しする。   First, the driving unit 124A of the photographing optical system 124 is driven via the photographing optical system drive control unit 126, and the photographing lens 13 is extended to a predetermined position. Then, when the photographing lens 13 is extended to a predetermined position, the imaging element 128 performs photographing for a through image, and the through image is displayed on the monitor 28. That is, images are continuously picked up by the image pickup device 128 and the image signals are continuously processed to generate image data for a through image. The generated image data is sequentially added to the display control unit 148 via the VRAM 120, converted into a signal format for display, and output to the monitor 28. As a result, the image captured by the image sensor 128 is displayed through on the monitor 28. The photographer determines the composition by looking at the through image displayed on the monitor 28 and presses the shutter button 22 halfway.

シャッターボタン22が半押しされると、CPU110にS1ON信号が入力される。CPU110は、このS1ON信号に応動して、撮影準備処理、すなわち、AE、AF、AWBの各処理を実行する。   When the shutter button 22 is half-pressed, an S1 ON signal is input to the CPU 110. In response to the S1 ON signal, the CPU 110 executes shooting preparation processing, that is, AE, AF, and AWB processing.

まず、撮像素子128から出力された画像信号をアナログ信号処理部132、A/Dコンバータ134、画像入力コントローラ136を介してRAM116に取り込み、AE/AWB検出部152及びAF検出部154に加える。   First, the image signal output from the image sensor 128 is taken into the RAM 116 via the analog signal processing unit 132, the A / D converter 134, and the image input controller 136, and added to the AE / AWB detection unit 152 and the AF detection unit 154.

AE/AWB検出部152は、入力された画像信号からAE制御及びAWB制御に必要な物理量を算出し、CPU110に出力する。CPU110は、このAE/AWB検出部152からの出力に基づき、絞り値とシャッタースピードを決定するとともに、ホワイトバランス補正値を決定する。同時に、検出された被写体輝度より、フラッシュの発光が必要かどうかを判断する。フラッシュ16の発光が必要と判断された場合には、フラッシュ16をプリ発光させ、その反射光に基づいて本撮影時のフラッシュ16の発光量を決定する。   The AE / AWB detection unit 152 calculates a physical quantity necessary for AE control and AWB control from the input image signal, and outputs it to the CPU 110. Based on the output from the AE / AWB detection unit 152, the CPU 110 determines an aperture value and a shutter speed, and also determines a white balance correction value. At the same time, it is determined from the detected subject brightness whether flash emission is necessary. When it is determined that the flash 16 needs to emit light, the flash 16 is pre-lighted, and the light emission amount of the flash 16 at the time of actual photographing is determined based on the reflected light.

また、AF検出部154は、入力された画像信号からAF制御に必要な物理量を算出し、CPU110に出力する。CPU110は、このAF検出部154からの出力に基づき撮影光学系駆動制御部126を介して撮影光学系124の駆動部124Aの駆動を制御し、フォーカスレンズの移動を制御して、撮影レンズ13のピントを主要被写体に合わせる。この際、CPU110は、必要に応じてAF補助光ランプ20を発光させて、AF制御を実行する。   Further, the AF detection unit 154 calculates a physical quantity necessary for AF control from the input image signal, and outputs it to the CPU 110. The CPU 110 controls the driving of the driving unit 124A of the photographing optical system 124 via the photographing optical system drive control unit 126 based on the output from the AF detection unit 154, controls the movement of the focus lens, and controls the movement of the photographing lens 13. Focus on the main subject. At this time, the CPU 110 causes the AF auxiliary light lamp 20 to emit light as necessary, and executes AF control.

撮影者は、モニタ28に表示されるスルー画像を見て撮影レンズ13のピント状態等を確認し、撮影を実行する。すなわち、シャッターボタン22を全押しする。   The photographer confirms the focus state of the photographing lens 13 by looking at the through image displayed on the monitor 28 and executes photographing. That is, the shutter button 22 is fully pressed.

シャッターボタン22が全押しされると、CPU110にS2ON信号が入力される。CPU110は、このS2ON信号に応動して、撮影、記録処理を実行する。   When the shutter button 22 is fully pressed, an S2 ON signal is input to the CPU 110. The CPU 110 executes photographing and recording processing in response to the S2ON signal.

まず、上記のAE処理で求めた絞り値、シャッタースピードで撮像素子128を露光し、記録用の画像を撮像する。この際、フラッシュ16を発光させる場合は、フラッシュ発光制御部156を介して、プリ発光の結果から求めたフラッシュ16の発光量に基づいてフラッシュ16を発光させる。   First, the image sensor 128 is exposed at the aperture value and shutter speed obtained in the above AE process, and a recording image is captured. At this time, when the flash 16 is caused to emit light, the flash 16 is caused to emit light based on the light emission amount of the flash 16 obtained from the result of the pre-emission via the flash emission control unit 156.

撮像素子128から出力された記録用の画像信号は、アナログ信号処理部132、A/Dコンバータ134を介して画像入力コントローラ136に取り込まれ、RAM116に格納される。RAM116に格納された画像信号は、CPU110の制御の下、画像信号処理部138に加えられる。画像信号処理部138は、入力された画像信号に所定の信号処理を施して、輝度データと色差データとからなる画像データ(YUVデータ)を生成する。   The recording image signal output from the image sensor 128 is taken into the image input controller 136 via the analog signal processing unit 132 and the A / D converter 134 and stored in the RAM 116. The image signal stored in the RAM 116 is added to the image signal processing unit 138 under the control of the CPU 110. The image signal processing unit 138 performs predetermined signal processing on the input image signal to generate image data (YUV data) including luminance data and color difference data.

画像信号処理部138で生成された画像データは、一旦RAM116に格納されたのち、圧縮伸張処理部140に加えられる。圧縮伸張処理部140は、入力された画像データに対して所定の圧縮処理を施し、圧縮画像データを生成する。   The image data generated by the image signal processing unit 138 is temporarily stored in the RAM 116 and then added to the compression / decompression processing unit 140. The compression / decompression processing unit 140 performs a predetermined compression process on the input image data to generate compressed image data.

圧縮された画像データは、RAM116に格納され、所定フォーマットの静止画像ファイル(たとえば、Exif)として、メディアコントローラ146を介してメモリカード144に記録される。なお、メモリカード144に画像ファイルが保存可能な空き領域が無い場合や、操作者が選択した場合等には、RAM116に格納された画像データは、所定フォーマットの静止画像ファイル(たとえば、Exif)としてフラッシュROM114に保存される。なお、フラッシュROM114に画像データを保存する場合には、画像データは複数のクラスタ、通常は連続した複数のクラスタに保存される。   The compressed image data is stored in the RAM 116 and is recorded on the memory card 144 via the media controller 146 as a still image file (for example, Exif) in a predetermined format. If there is no free space in the memory card 144 where the image file can be stored, or if the operator selects it, the image data stored in the RAM 116 is a still image file (eg, Exif) in a predetermined format. It is stored in the flash ROM 114. When image data is stored in the flash ROM 114, the image data is stored in a plurality of clusters, usually a plurality of consecutive clusters.

このようにしてメモリカード144又はフラッシュROM114に記録された画像データは、デジタルカメラ10のモードを再生モードに設定することにより、モニタ28に再生表示される。再生モードへの移行は、再生ボタン32を押下することにより行われる。   The image data recorded in the memory card 144 or the flash ROM 114 in this manner is reproduced and displayed on the monitor 28 by setting the mode of the digital camera 10 to the reproduction mode. Transition to the playback mode is performed by pressing the playback button 32.

再生ボタン32が押下されると、CPU110は最後に記録された画像ファイルの圧縮画像データを読み出す。最後に記録された画像ファイルがメモリカード144に記録されている場合には、CPU110は、メディアコントローラ146を介してメモリカード144に最後に記録された画像ファイルの圧縮画像データを読み出す。最後に記録された画像ファイルがフラッシュROM114に記録されている場合には、CPU110は直接フラッシュROM114から画像ファイルの圧縮画像データが読み取り可能である。   When the play button 32 is pressed, the CPU 110 reads the compressed image data of the last recorded image file. When the last recorded image file is recorded on the memory card 144, the CPU 110 reads the compressed image data of the image file recorded last on the memory card 144 via the media controller 146. When the last recorded image file is recorded in the flash ROM 114, the CPU 110 can directly read the compressed image data of the image file from the flash ROM 114.

メモリカード144又はフラッシュROM114から読み出された圧縮画像データは、圧縮伸張処理部140に加えられ、非圧縮の画像データとされたのちVRAM120に加えられる。そして、VRAM120から表示制御部148を介してモニタ28に出力される。これにより、メモリカード144又はフラッシュROM114に記録されている画像が、モニタ28に再生表示される。   The compressed image data read from the memory card 144 or the flash ROM 114 is added to the compression / decompression processing unit 140, converted into uncompressed image data, and then added to the VRAM 120. Then, the data is output from the VRAM 120 to the monitor 28 via the display control unit 148. As a result, the image recorded in the memory card 144 or the flash ROM 114 is reproduced and displayed on the monitor 28.

画像のコマ送りは、十字ボタン36の左右のキー操作で行なわれ、右キーが操作されると、次の画像ファイルがメモリカード160から読み出され、モニタ28に再生表示される。また、十字ボタン36の左キーが操作されると、一つ前の画像ファイルがメモリカード144又はフラッシュROM114から読み出され、モニタ28に再生表示される。   Image frame advance is performed by operating the left and right keys of the cross button 36. When the right key is operated, the next image file is read from the memory card 160 and reproduced and displayed on the monitor 28. When the left key of the cross button 36 is operated, the previous image file is read from the memory card 144 or the flash ROM 114, and is reproduced and displayed on the monitor 28.

モニタ28に再生表示された画像を確認しながら、必要に応じて、メモリカード144又はフラッシュROM114に記録された画像を消去することができる。画像の消去は、画像がモニタ28に再生表示された状態でファンクションボタン34が押下されることによって行われる。   While confirming the image reproduced and displayed on the monitor 28, the image recorded on the memory card 144 or the flash ROM 114 can be erased as necessary. The image is erased by pressing the function button 34 while the image is reproduced and displayed on the monitor 28.

ファンクションボタン34が押下されると、CPU110は表示制御部148を介して、モニタ28に「この写真を消去してよろしいですか」等の画像消去を伝えるメッセージを画像に重ねて表示する。MENU/OKボタン38が押下されると、その画像の消去が行われる。画像データがメモリカード144に記録されている場合には、CPU110はメディアコントローラ146を介してメモリカード144に記録された画像ファイルを消去する。画像データがフラッシュROM114に記録されている場合には、CPU110は直接フラッシュROM114から画像ファイルが消去可能である。   When the function button 34 is pressed, the CPU 110 displays, via the display control unit 148, a message on the monitor 28 that indicates image deletion such as “Are you sure you want to delete this photo” superimposed on the image. When the MENU / OK button 38 is pressed, the image is erased. When image data is recorded on the memory card 144, the CPU 110 erases the image file recorded on the memory card 144 via the media controller 146. When image data is recorded in the flash ROM 114, the CPU 110 can directly delete the image file from the flash ROM 114.

以上のように、デジタルカメラ10は画像の撮影、記録及び再生を行う。   As described above, the digital camera 10 captures, records, and reproduces images.

さて、本実施の形態のデジタルカメラ10では、ファームウェアのアップデートを行うことができるようにされており、これにより機能の追加、向上が図れるようにしている。このファームウェアのアップデート処理は、デジタルカメラ10を所定のアップデートモードに設定することで実行される。なお、アップデートモードの設定は、例えば、DISP/BACKボタン40を押しながら電源ボタン26を押すことで行われる。   Now, in the digital camera 10 of the present embodiment, the firmware can be updated, so that functions can be added and improved. This firmware update process is executed by setting the digital camera 10 to a predetermined update mode. The update mode is set by, for example, pressing the power button 26 while pressing the DISP / BACK button 40.

以下、このファームウェアのアップデート処理における処理手順について説明する。   Hereinafter, a processing procedure in the firmware update process will be described.

図4は、ファームウェアのアップデート処理での処理の流れを示すフローチャートである。なお、以下の処理はCPU110によって行われる。   FIG. 4 is a flowchart showing a process flow in the firmware update process. The following processing is performed by the CPU 110.

メモリカードスロット14に更新用のファームウェアが記録されたメモリカード144を装填した状態で上記アップデートモードの設定を行うと、デジタルカメラ10の電源が入り、フラッシュROM114に記録されている起動プログラムが実行される(ステップS10)。   When the update mode is set with the memory card 144 in which the update firmware is recorded in the memory card slot 14, the digital camera 10 is turned on and the activation program recorded in the flash ROM 114 is executed. (Step S10).

起動プログラムが実行されると、メディアコントローラ146によってメモリカード144のアクセステストが行われ、メモリカード144が装填されているか否かが確認される(ステップS12)。   When the activation program is executed, the media controller 146 performs an access test of the memory card 144 to check whether or not the memory card 144 is loaded (step S12).

メモリカード144が検出されなかった場合には、処理が終了される。   If the memory card 144 is not detected, the process is terminated.

一方、メモリカード144が検出された場合には、メモリカード144にファームウェアが記録されているかどうかが確認される(ステップS14)。   On the other hand, if the memory card 144 is detected, it is confirmed whether firmware is recorded on the memory card 144 (step S14).

メモリカード144にファームウェアが記録されていない場合には、処理が終了される。   If no firmware is recorded on the memory card 144, the process is terminated.

一方、メモリカード144にファームウェアが記録されている場合には、メモリカード144に記録されたファームウェアのバージョン情報が読み出され、フラッシュROM114に記録されたファームウェアのバージョン情報に基づいて、ファームウェアの新旧が比較判定される(ステップS16)。   On the other hand, when the firmware is recorded on the memory card 144, the firmware version information recorded on the memory card 144 is read, and the firmware version information is updated based on the firmware version information recorded on the flash ROM 114. A comparison is made (step S16).

メモリカード144に記録されたファームウェアのバージョンがフラッシュROM114に記録されたファームウェアのバージョンより古い場合には、処理が終了される。   If the firmware version recorded on the memory card 144 is older than the firmware version recorded on the flash ROM 114, the processing is terminated.

一方、メモリカード144に記録されたファームウェアのバージョンがフラッシュROM114に記録されたファームウェアのバージョンより新しい場合には、フラッシュROM114に、メモリカード144に記録された更新用のファームウェア(新ファームウェア)を書き込むのに十分な連続した空き領域(空きクラスタ)があるかどうかが判断される(ステップS18)。   On the other hand, when the firmware version recorded on the memory card 144 is newer than the firmware version recorded on the flash ROM 114, the update firmware (new firmware) recorded on the memory card 144 is written to the flash ROM 114. It is determined whether or not there is a sufficient continuous free area (free cluster) (step S18).

新ファームウェアを書き込むのに十分な連続した空きクラスタがない場合には、表示制御部148によって、「アップロードできません。画像データを削除してからもう一度アップデートしてください。」等のエラー表示がモニタ28に表示される(ステップS22)。   If there are not enough consecutive free clusters to write the new firmware, the display control unit 148 displays an error message on the monitor 28 such as “Cannot upload. Please delete the image data and update again.” It is displayed (step S22).

一方、新ファームウェアを書き込むのに十分な連続した空きクラスタがある場合(図5(a)参照)には、フラッシュROM114の連続した空きクラスタに新ファームウェアが書き込まれる(ステップS20)。そして、新ファームウェアの書き込みが完了したと判断されるまで、上記処理が継続される(ステップS24)。フラッシュROM114に新ファームウェアの書き込みが終了した場合には、図5(b)に示すように、フラッシュROM114にあらかじめ記録されているファームウェア(旧ファームウェア)と新ファームウェアとが、連続したクラスタにそれぞれ記録されている。   On the other hand, when there are continuous free clusters sufficient to write new firmware (see FIG. 5A), the new firmware is written into the continuous free clusters in the flash ROM 114 (step S20). Then, the above process is continued until it is determined that the writing of the new firmware has been completed (step S24). When the writing of the new firmware to the flash ROM 114 is completed, as shown in FIG. 5B, the firmware (old firmware) recorded in advance in the flash ROM 114 and the new firmware are recorded in successive clusters. ing.

フラッシュROM114にファームウェアの書き込みが終了したら、ファームウェアの開始アドレスが旧ファームウェアの開始アドレス(図5(b)m)から新ファームウェアの開始アドレス(図5(b)n)へ変更される(ステップS26)。そして、ウオッチドッグタイマーが10秒で設定された(ステップS28)状態で、デジタルカメラ10が再起動される(ステップS30)。   When the writing of the firmware to the flash ROM 114 is completed, the start address of the firmware is changed from the start address of the old firmware (FIG. 5B) to the start address of the new firmware (FIG. 5B) (step S26). . Then, the digital camera 10 is restarted (step S30) with the watchdog timer set in 10 seconds (step S28).

ここで、ファームウェアの開始アドレスはフラッシュROM114内のカメラ設定値に書き込まれており、CPU110は、カメラ設定値に書き込まれている開始アドレスを取得してからデジタルカメラ10を起動する。そのため、ファームウェアの開始アドレスを変更すると、起動ファームウェアが旧ファームウェアから新ファームウェアに変更され、デジタルカメラ10が新ファームウェアを起動ファームウェアに設定した状態で再起動される。   Here, the start address of the firmware is written in the camera setting value in the flash ROM 114, and the CPU 110 activates the digital camera 10 after obtaining the start address written in the camera setting value. Therefore, when the start address of the firmware is changed, the startup firmware is changed from the old firmware to the new firmware, and the digital camera 10 is restarted with the new firmware set as the startup firmware.

なお、本実施例ではウオッチドッグタイマーを10秒で設定しているが、これに限らない。   In this embodiment, the watchdog timer is set to 10 seconds, but the present invention is not limited to this.

デジタルカメラ10を再起動した後で、ウオッチドッグタイマーがタイムアップしたかどうかが判断される(ステップS32)。新ファームウェアが正常に動作している場合には、ウオッチドッグタイマーがタイムアップする前に新ファームウェアがウオッチドッグタイマーをリセットするため、ウオッチドッグタイマーがタイムアップすることはないが、新ファームウェアが正常に動作していない場合には、新ファームウェアがウオッチドッグタイマーをリセットしないため、ウオッチドッグタイマーがオーバーフローして、タイムアップする。   After restarting the digital camera 10, it is determined whether or not the watchdog timer has expired (step S32). If the new firmware is operating normally, the new firmware will reset the watchdog timer before the watchdog timer expires, so the watchdog timer will not time out, but the new firmware will If not, the new firmware does not reset the watchdog timer, so the watchdog timer overflows and times up.

ウオッチドッグタイマーがタイムアップした場合、すなわち新ファームウェアでデジタルカメラ10が起動できない場合には、ファームウェアの開始アドレスが元に戻されて、旧ファームウェアが起動ファームウェアに再設定された状態で、デジタルカメラ10が再起動される(ステップS34)。これにより、新ファームウェアに問題があった場合においても、機器が動作しなくなることを防ぐことができる。   When the watchdog timer expires, that is, when the digital camera 10 cannot be activated with the new firmware, the digital camera 10 is restored with the firmware start address restored and the old firmware reset to the activated firmware. Is restarted (step S34). Thereby, even when there is a problem with the new firmware, it is possible to prevent the device from becoming inoperable.

ウオッチドッグタイマーがタイムアップしなかった場合には、以下の方法で自己診断をすることにより、新ファームウェアによってデジタルカメラ10が正常に起動したかどうかが判断される(ステップS36〜S37)。すなわち、ファームウェアのハッシュ値が算出され(ステップS36)、この算出値がファームウェアのハッシュ値と一致するかどうかが判断される(ステップS37)。   If the watchdog timer has not expired, a self-diagnosis is performed by the following method to determine whether or not the digital camera 10 has been normally activated by the new firmware (steps S36 to S37). That is, the firmware hash value is calculated (step S36), and it is determined whether the calculated value matches the firmware hash value (step S37).

ステップS36で算出された算出値とファームウェアのハッシュ値とが一致しない場合(ステップS37でNO)、すなわちデジタルカメラ10が正常に起動しなかった場合には、ウオッチドッグタイマーがタイムアップしたがどうかを判断するステップ(ステップS32)へ戻る。   If the calculated value calculated in step S36 does not match the hash value of the firmware (NO in step S37), that is, if the digital camera 10 has not started normally, it is determined whether the watchdog timer has timed up. The process returns to the determining step (step S32).

一方、ステップS36で算出された算出値とファームウェアのハッシュ値とが一致した場合(ステップS37でYES)、すなわちデジタルカメラ10が正常に起動した場合には、デジタルカメラ10が再起動される前に設定したウオッチドッグタイマーが停止される(ステップS38)。そして、図5(c)に示すように、フラッシュROM114の旧ファームウェアが消去され、旧ファームウェアが記録されていた領域が各種データ保存用の空きクラスタとして開放される(ステップS40)。これにより、メモリを有効に使うことができる。   On the other hand, if the calculated value calculated in step S36 matches the hash value of the firmware (YES in step S37), that is, if the digital camera 10 has started normally, before the digital camera 10 is restarted. The set watchdog timer is stopped (step S38). Then, as shown in FIG. 5C, the old firmware of the flash ROM 114 is erased, and the area where the old firmware is recorded is released as a free cluster for storing various data (step S40). As a result, the memory can be used effectively.

なお、ステップS34において、起動ファームウェアを旧ファームウェアに戻した後で、不具合があった新ファームウェアを消去し、フラッシュROM114の新ファームウェアが記録されていた領域を各種データ保存用の空きクラスタとして開放するようにしてもよい(図5(d)参照)。   In step S34, after the boot firmware is returned to the old firmware, the defective new firmware is erased, and the area where the new firmware is recorded in the flash ROM 114 is released as an empty cluster for storing various data. It may also be used (see FIG. 5D).

本実施の形態によれば、旧ファームウェアから新ファームウェアに更新する場合には、ファームウェアのメモリ領域の先頭クラスタを変更させればよいため、ファームウェアを容易に更新することができる。また、デジタルカメラが正常に起動した場合において、ファームウェア専用のメモリを使用しないために、旧ファームウェアを消すことにより旧ファームウェアが記録されていた領域を各種データ用の空きクラスタとして開放することができる。そのために、メモリを有効に使うことができる。また、デジタルカメラが正常に起動しなかった場合において、ファームウェアのメモリ領域の先頭クラスタを新ファームウェアから旧ファームウェアに再設定することで、起動ファームウェアを旧ファームウェアに容易に戻すことができるため、どのような場合においてもデジタルカメラを起動させることができ、機器が動作しなくなることを防ぐことができる。また、再起動前にウオッチドッグタイマーを設定することで、新しいファームウェアが正常に動作するかどうかを自動的に知ることができる。   According to the present embodiment, when updating from old firmware to new firmware, it is only necessary to change the top cluster in the memory area of the firmware, so that the firmware can be easily updated. In addition, when the digital camera is normally activated, the memory dedicated to the firmware is not used, so that the area where the old firmware is recorded can be released as an empty cluster for various data by deleting the old firmware. Therefore, the memory can be used effectively. In addition, if the digital camera does not start normally, the startup firmware can be easily returned to the old firmware by resetting the first cluster in the firmware memory area from the new firmware to the old firmware. Even in such a case, the digital camera can be activated, and the device can be prevented from not operating. In addition, by setting the watchdog timer before restarting, it is possible to automatically know whether the new firmware operates normally.

なお、本実施の形態では、メモリカードに記録されている新ファームウェアをフラッシュROMに記録することでファームウェアの更新を行ったが、PC等の外部機器とUBS(Universal Serial Bus)ケーブルで接続し、そのケーブルを経由して、外部機器に記録されている新ファームウェアをフラッシュROMに記録することでファームウェアの更新を行ってもよい。この場合は、本実施の形態のステップS12〜S18の処理の代わりに、以下の処理が行われる。   In this embodiment, the firmware is updated by recording the new firmware recorded on the memory card in the flash ROM, but it is connected to an external device such as a PC by a UBS (Universal Serial Bus) cable, The firmware may be updated by recording new firmware recorded in the external device in the flash ROM via the cable. In this case, the following processing is performed instead of the processing in steps S12 to S18 of the present embodiment.

外部機器からUSBケーブル及びUSBコネクタ15を介してファームウェア転送のコマンドを受けると、USBI/F142にてそのコマンドを検出してCPU110に供給する。コマンドが供給されると、CPU110は、ファームウェアのバージョンとフラッシュROM114の状態を調べ、条件を満たす(送信されるファームウェアのバージョンが新しく、かつフラッシュROM114にそのファームウェアが記録できる連続した空きクラスタがある)場合には、送信される新ファームウェアをフラッシュROM114の連続した空きクラスタに記録する。なお、上記条件を満たさない場合における処理は、ファームウェアがメモリカード144に記録されている場合と同様である。   When a firmware transfer command is received from an external device via the USB cable and the USB connector 15, the USB I / F 142 detects the command and supplies it to the CPU 110. When the command is supplied, the CPU 110 checks the firmware version and the state of the flash ROM 114 and satisfies the conditions (the firmware version to be transmitted is new and there is a continuous free cluster in which the firmware can be recorded in the flash ROM 114). In this case, the new firmware to be transmitted is recorded in continuous free clusters in the flash ROM 114. Note that the processing in the case where the above condition is not satisfied is the same as the case where the firmware is recorded on the memory card 144.

<第2の実施の形態>
上記第1の実施の形態のデジタルカメラでは、フラッシュROMにファームウェアが連続して記録可能な空きクラスタがある場合に、ファームウェアをフラッシュROMの空きクラスタに連続して記録するが、ファームウェアをフラッシュROMへ記録する方法は、これに限定されるものではない。
<Second Embodiment>
In the digital camera according to the first embodiment, when there is an empty cluster in which the firmware can be continuously recorded in the flash ROM, the firmware is continuously recorded in the empty cluster of the flash ROM. However, the firmware is stored in the flash ROM. The recording method is not limited to this.

本実施の形態のデジタルカメラは、フラッシュROMをデフラグしてから連続した空きクラスタにファームウェアを記録するものである。図6は、本実施の形態におけるファームウェアアップデートモードでの処理の流れを示すフローチャートである。   The digital camera of the present embodiment records firmware in a continuous free cluster after defragmenting the flash ROM. FIG. 6 is a flowchart showing the flow of processing in the firmware update mode in the present embodiment.

メモリカードスロット14に更新用のファームウェアが記録されたメモリカード144を装填した状態で上記アップデートモードの設定を行うと、デジタルカメラ10aの電源が入り、フラッシュROM114に記録されている起動プログラムが実行される(ステップS10)。   When the update mode is set with the memory card 144 having the update firmware recorded in the memory card slot 14, the digital camera 10a is turned on, and the activation program recorded in the flash ROM 114 is executed. (Step S10).

起動プログラムが実行されると、メディアコントローラ146によってメモリカード144のアクセステストが行われ、メモリカード144が装填されているか否かが確認される(ステップS12)。   When the activation program is executed, the media controller 146 performs an access test of the memory card 144 to check whether or not the memory card 144 is loaded (step S12).

メモリカード144が検出されなかった場合には、処理が終了される。   If the memory card 144 is not detected, the process is terminated.

一方、メモリカード144が検出された場合には、メモリカード144にファームウェアが記録されているかどうかが確認される(ステップS14)。   On the other hand, if the memory card 144 is detected, it is confirmed whether firmware is recorded on the memory card 144 (step S14).

メモリカード144にファームウェアが記録されていない場合には、処理が終了される。   If no firmware is recorded on the memory card 144, the process is terminated.

一方、メモリカード144にファームウェアが記録されている場合には、メモリカード144に記録されたファームウェアのバージョン情報が読み出され、フラッシュROM114に記録されたファームウェアのバージョン情報に基づいて、ファームウェアの新旧が比較判定される(ステップS16)。   On the other hand, when the firmware is recorded on the memory card 144, the firmware version information recorded on the memory card 144 is read, and the firmware version information is updated based on the firmware version information recorded on the flash ROM 114. A comparison is made (step S16).

メモリカード144に記録されたファームウェアのバージョンがフラッシュROM114に記録されたファームウェアのバージョンより古い場合には、処理が終了される。   If the firmware version recorded on the memory card 144 is older than the firmware version recorded on the flash ROM 114, the processing is terminated.

一方、メモリカード144に記録されたファームウェアのバージョンがフラッシュROM114に記録されたファームウェアのバージョンより新しい場合には、フラッシュROM114がデフラグされる(ステップS42)。前述のように、フラッシュROM114に画像データを保存する場合には、画像データは複数のクラスタ、通常は連続した複数のクラスタに保存される。しかし、連続して画像データが保存されていたとしても、ある画像が消去された場合には、連続して保存された一部のみが消去されるため、空きクラスタが連続せず分割された状態になる。そのため、フラッシュROM114をデフラグして、図7(a)’に示すように、クラスタを綺麗に並べ替える。   On the other hand, if the firmware version recorded on the memory card 144 is newer than the firmware version recorded on the flash ROM 114, the flash ROM 114 is defragmented (step S42). As described above, when image data is stored in the flash ROM 114, the image data is stored in a plurality of clusters, usually a plurality of consecutive clusters. However, even if image data is stored continuously, if a certain image is deleted, only a part of the stored data is deleted, so that the empty cluster is not continuous and divided. become. Therefore, the flash ROM 114 is defragmented and the clusters are rearranged neatly as shown in FIG.

デフラグ終了後に、フラッシュROM114に、メモリカード144に記録された更新用のファームウェア(新ファームウェア)を書き込むのに十分な連続した空きクラスタがあるかどうかが判断される(ステップS18)。   After the completion of the defragmentation, it is determined whether there are enough continuous free clusters to write the update firmware (new firmware) recorded in the memory card 144 in the flash ROM 114 (step S18).

新ファームウェアを書き込むのに十分な連続した空きクラスタがない場合には、表示制御部148によって、「アップロードできません。画像データを削除してからもう一度アップデートしてください。」等のエラー表示がモニタ28に表示される(ステップS22)。   If there are not enough consecutive free clusters to write the new firmware, the display control unit 148 displays an error message on the monitor 28 such as “Cannot upload. Please delete the image data and update again.” It is displayed (step S22).

一方、新ファームウェアを書き込むのに十分な連続した空きクラスタがある場合(図7(a)’参照)には、フラッシュROM114の連続した空きクラスタに新ファームウェアが書き込まれる(ステップS20)。そして、新ファームウェアの書き込みが完了したと判断されるまで、上記処理が継続される(ステップS24)。フラッシュROM114に新ファームウェアの書き込みが終了した場合には、図7(b)に示すように、フラッシュROM114にあらかじめ記録されているファームウェア(旧ファームウェア)と新ファームウェアとが、連続したクラスタにそれぞれ記録されている。   On the other hand, when there are enough continuous free clusters to write new firmware (see FIG. 7A '), the new firmware is written into the continuous free clusters in the flash ROM 114 (step S20). Then, the above process is continued until it is determined that the writing of the new firmware has been completed (step S24). When the writing of the new firmware to the flash ROM 114 is completed, as shown in FIG. 7B, the firmware (old firmware) recorded in advance in the flash ROM 114 and the new firmware are recorded in successive clusters. ing.

フラッシュROM114にファームウェアの書き込みが終了したら、ファームウェアの開始アドレスが旧ファームウェアの開始アドレス(図7(b)m)から新ファームウェアの開始アドレス(図7(b)n)へ変更される(ステップS26)。そして、ウオッチドッグタイマーが10秒で設定された(ステップS28)状態で、デジタルカメラ10aが再起動される(ステップS30)。   When the writing of the firmware to the flash ROM 114 is completed, the start address of the firmware is changed from the start address of the old firmware (FIG. 7B) to the start address of the new firmware (FIG. 7B) (step S26). . Then, the digital camera 10a is restarted (step S30) with the watchdog timer set in 10 seconds (step S28).

ここで、ファームウェアの開始アドレスはフラッシュROM114内のカメラ設定値に書き込まれており、CPU110は、カメラ設定値に書き込まれている開始アドレスを取得してからデジタルカメラ10aを起動する。そのため、ファームウェアの開始アドレスを変更すると、起動ファームウェアが旧ファームウェアから新ファームウェアに変更され、デジタルカメラ10aが新ファームウェアを起動ファームウェアに設定した状態で再起動される。   Here, the start address of the firmware is written in the camera setting value in the flash ROM 114, and the CPU 110 activates the digital camera 10a after obtaining the start address written in the camera setting value. Therefore, when the start address of the firmware is changed, the startup firmware is changed from the old firmware to the new firmware, and the digital camera 10a is restarted with the new firmware set as the startup firmware.

なお、本実施例ではウオッチドッグタイマーを10秒で設定しているが、これに限らない。   In this embodiment, the watchdog timer is set to 10 seconds, but the present invention is not limited to this.

デジタルカメラ10aを再起動した後で、ウオッチドッグタイマーがタイムアップしたかどうかが判断される(ステップS32)。新ファームウェアが正常に動作している場合には、ウオッチドッグタイマーがタイムアップする前に新ファームウェアがウオッチドッグタイマーをリセットするため、ウオッチドッグタイマーがタイムアップすることはないが、新ファームウェアが正常に動作していない場合には、新ファームウェアがウオッチドッグタイマーをリセットしないため、ウオッチドッグタイマーがオーバーフローして、タイムアップする。   After restarting the digital camera 10a, it is determined whether or not the watchdog timer has expired (step S32). If the new firmware is operating normally, the new firmware will reset the watchdog timer before the watchdog timer expires, so the watchdog timer will not time out, but the new firmware will If not, the new firmware does not reset the watchdog timer, so the watchdog timer overflows and times up.

ウオッチドッグタイマーがタイムアップした場合、すなわち新ファームウェアでデジタルカメラ10aが起動できない場合には、ファームウェアの開始アドレスが元に戻されて、旧ファームウェアが起動ファームウェアに再設定された状態で、デジタルカメラ10aが再起動される(ステップS34)。これにより、新ファームウェアに問題があった場合においても、機器が動作しなくなることを防ぐことができる。   When the watchdog timer expires, that is, when the digital camera 10a cannot be activated with the new firmware, the digital camera 10a is restored with the start address of the firmware restored and the old firmware reset to the activated firmware. Is restarted (step S34). Thereby, even when there is a problem with the new firmware, it is possible to prevent the device from becoming inoperable.

ウオッチドッグタイマーがタイムアップしなかった場合には、自己診断をすることで、新ファームウェアによってデジタルカメラ10aが正常に起動したかどうかが判断される(ステップS36)。   If the watchdog timer does not expire, it is determined whether the digital camera 10a has been normally activated by the new firmware by performing a self-diagnosis (step S36).

デジタルカメラ10aが正常に起動しなかった場合には、ウオッチドッグタイマーがタイムアップしたがどうかを判断するステップ(ステップS32)へ戻る。   If the digital camera 10a does not start up normally, the process returns to the step of determining whether the watchdog timer has timed up (step S32).

一方、デジタルカメラ10aが正常に起動した場合には、デジタルカメラ10aが再起動される前に設定したウオッチドッグタイマーが停止される(ステップS38)。そして、図7(c)に示すように、フラッシュROM114の旧ファームウェアが消去され、旧ファームウェアが記録されていた領域が各種データ保存用の空きクラスタとして開放される(ステップS40)。これにより、メモリを有効に使うことができる。   On the other hand, when the digital camera 10a is normally started, the watch dog timer set before the digital camera 10a is restarted is stopped (step S38). Then, as shown in FIG. 7C, the old firmware in the flash ROM 114 is erased, and the area where the old firmware is recorded is released as a free cluster for storing various data (step S40). As a result, the memory can be used effectively.

なお、ステップS34において、起動ファームウェアを旧ファームウェアに戻した後で、不具合があった新ファームウェアを消去し、フラッシュROM114の新ファームウェアが記録されていた領域を各種データ保存用の空きクラスタとして開放するようにしてもよい(図7(d)参照)。   In step S34, after the boot firmware is returned to the old firmware, the defective new firmware is erased, and the area where the new firmware is recorded in the flash ROM 114 is released as an empty cluster for storing various data. (Refer to FIG. 7 (d)).

本実施の形態によれば、新ファームウェアをフラッシュROMに書き込む前にデフラグをすることで、フラッシュROMに新ファームウェアを記録するための連続した空きクラスタがない場合においても、新ファームウェアをフラッシュROMに記録することができる。   According to the present embodiment, by defragmenting the new firmware before writing it into the flash ROM, the new firmware is recorded in the flash ROM even when there is no continuous free cluster for recording the new firmware in the flash ROM. can do.

<第3の実施の形態>
上記第1の実施の形態のデジタルカメラでは、フラッシュROMにファームウェアが連続して記録可能な空き領域がある場合に、ファームウェアをフラッシュROMの空きクラスタに連続して記録するものであり、上記第2の実施の形態のデジタルカメラでは、フラッシュROMをデフラグしてから、連続した空きクラスタにファームウェアを記録するものであるが、ファームウェアをフラッシュROMへ記録する方法は、これらに限定されるものではない。
<Third Embodiment>
In the digital camera according to the first embodiment, when there is an empty area in which the firmware can be continuously recorded in the flash ROM, the firmware is continuously recorded in the empty cluster of the flash ROM. In the digital camera according to the embodiment, the flash ROM is defragmented and then the firmware is recorded in continuous empty clusters. However, the method of recording the firmware in the flash ROM is not limited to these.

本実施の形態のデジタルカメラは、フラッシュROMにファームウェアを記録してからデフラグするものである。図8は、本実施の形態におけるファームウェアアップデートモードでの処理の流れを示すフローチャートである。   The digital camera of the present embodiment records the firmware in the flash ROM and defragments it. FIG. 8 is a flowchart showing a flow of processing in the firmware update mode according to the present embodiment.

メモリカードスロット14に更新用のファームウェアが記録されたメモリカード144を装填した状態で上記アップデートモードの設定を行うと、デジタルカメラ10bの電源が入り、フラッシュROM114に記録されている起動プログラムが実行される(ステップS10)。   When the update mode is set with the memory card 144 in which the update firmware is recorded in the memory card slot 14, the digital camera 10b is turned on and the activation program recorded in the flash ROM 114 is executed. (Step S10).

起動プログラムが実行されると、メディアコントローラ146によってメモリカード144のアクセステストが行われ、メモリカード144が装填されているか否かが確認される(ステップS12)。   When the activation program is executed, the media controller 146 performs an access test of the memory card 144 to check whether or not the memory card 144 is loaded (step S12).

メモリカード144が検出されなかった場合には、処理が終了される。   If the memory card 144 is not detected, the process is terminated.

一方、メモリカード144が検出された場合には、メモリカード144にファームウェアが記録されているかどうかを確認する(ステップS14)。   On the other hand, when the memory card 144 is detected, it is confirmed whether firmware is recorded on the memory card 144 (step S14).

メモリカード144にファームウェアが記録されていない場合には、処理が終了される。   If no firmware is recorded on the memory card 144, the process is terminated.

一方、メモリカード144にファームウェアが記録されている場合には、メモリカード144に記録されたファームウェアのバージョン情報が読み出され、フラッシュROM114に記録されたファームウェアのバージョン情報に基づいて、ファームウェアの新旧が比較判定される(ステップS16)。   On the other hand, when the firmware is recorded on the memory card 144, the firmware version information recorded on the memory card 144 is read, and the firmware version information is updated based on the firmware version information recorded on the flash ROM 114. A comparison is made (step S16).

メモリカード144に記録されたファームウェアのバージョンがフラッシュROM114に記録されたファームウェアのバージョンより古い場合には、処理が終了される。   If the firmware version recorded on the memory card 144 is older than the firmware version recorded on the flash ROM 114, the processing is terminated.

一方、メモリカード144に記録されたファームウェアのバージョンがフラッシュROM114に記録されたファームウェアのバージョンより新しい場合には、フラッシュROM114にファームウェアが全て記録できる分の空きクラスタがあるかどうかが判断される(ステップS19)。   On the other hand, if the firmware version recorded on the memory card 144 is newer than the firmware version recorded on the flash ROM 114, it is determined whether or not there is an empty cluster in the flash ROM 114 that can record all the firmware (step). S19).

ファームウェアが全て記録できる分の空きクラスタが無い場合には、表示制御部148によって、「アップロードできません。画像データを削除してからもう一度アップデートしてください。」等のエラー表示がモニタ28に表示される(ステップS22)。   If there are no free clusters that can be recorded by the firmware, the display control unit 148 displays an error message such as “Cannot upload. Please delete the image data and update again” on the monitor 28. (Step S22).

一方、ファームウェアが全て記録できる分の空きクラスタがある場合には、フラッシュROM114の空きクラスタに新ファームウェアが書き込まれる(ステップ44)。そして、新ファームウェアの書き込みが完了したと判断されるまで、上記処理が継続される(ステップS46)。   On the other hand, if there is an empty cluster that can record all the firmware, the new firmware is written to the empty cluster in the flash ROM 114 (step 44). Then, the above process is continued until it is determined that the writing of the new firmware has been completed (step S46).

新ファームウェアの書き込みが完了した後(図9(b)参照)で、新ファームウェアがフラッシュROM114の連続したクラスタに記録されているかどうかが判断される(ステップS48)。   After the writing of the new firmware is completed (see FIG. 9B), it is determined whether or not the new firmware is recorded in the continuous cluster of the flash ROM 114 (step S48).

新ファームウェアがフラッシュROM114の連続したクラスタに記録されている場合は、ファームウェアの開始アドレスが旧ファームウェアの開始アドレス(図9(b)’m)から新ファームウェアの開始アドレス(図9(b)’n)へ変更される(ステップS26)。   When the new firmware is recorded in the continuous cluster of the flash ROM 114, the start address of the firmware is changed from the start address of the old firmware (FIG. 9 (b) 'm) to the start address of the new firmware (FIG. 9 (b)' n. (Step S26).

一方、新ファームウェアがフラッシュROM114の連続したクラスタに記録されていない場合(図9(b)参照)は、新ファームウェアがフラッシュROM114の連続したクラスタに記録された状態(図9(b)’参照)になるように、フラッシュROM114がデフラグされる(ステップS50)。その後、ファームウェアの開始アドレスが旧ファームウェアの開始アドレス(図9(b)’m)から新ファームウェアの開始アドレス(図9(b)’n)へ変更される(ステップS26)。   On the other hand, when the new firmware is not recorded in the continuous cluster of the flash ROM 114 (see FIG. 9B), the new firmware is recorded in the continuous cluster of the flash ROM 114 (see FIG. 9B ′). Thus, the flash ROM 114 is defragmented (step S50). Thereafter, the start address of the firmware is changed from the start address of the old firmware (FIG. 9 (b) 'm) to the start address of the new firmware (FIG. 9 (b)' n) (step S26).

そして、ウオッチドッグタイマーが10秒で設定された(ステップS28)状態で、デジタルカメラ10bが再起動される(ステップS30)。ここで、ファームウェアの開始アドレスはフラッシュROM114内のカメラ設定値に書き込まれており、CPU110は、カメラ設定値に書き込まれている開始アドレスを取得してからデジタルカメラ10bを起動する。そのため、ファームウェアの開始アドレスを変更すると、起動ファームウェアが旧ファームウェアから新ファームウェアに変更され、デジタルカメラ10bが新ファームウェアを起動ファームウェアに設定した状態で再起動される。   Then, the digital camera 10b is restarted (step S30) with the watchdog timer set in 10 seconds (step S28). Here, the start address of the firmware is written in the camera setting value in the flash ROM 114, and the CPU 110 activates the digital camera 10b after obtaining the start address written in the camera setting value. Therefore, when the start address of the firmware is changed, the startup firmware is changed from the old firmware to the new firmware, and the digital camera 10b is restarted with the new firmware set as the startup firmware.

なお、本実施例ではウオッチドッグタイマーを10秒で設定しているが、これに限らない。   In this embodiment, the watchdog timer is set to 10 seconds, but the present invention is not limited to this.

デジタルカメラ10bを再起動した後で、ウオッチドッグタイマーがタイムアップしたかどうかが判断される(ステップS32)。新ファームウェアが正常に動作している場合には、ウオッチドッグタイマーがタイムアップする前に新ファームウェアがウオッチドッグタイマーをリセットするため、ウオッチドッグタイマーがタイムアップすることはないが、新ファームウェアが正常に動作していない場合には、新ファームウェアがウオッチドッグタイマーをリセットしないため、ウオッチドッグタイマーがオーバーフローして、タイムアップする。   After restarting the digital camera 10b, it is determined whether or not the watchdog timer has expired (step S32). If the new firmware is operating normally, the new firmware resets the watchdog timer before the watchdog timer times out, so the watchdog timer will not time out, but the new firmware If not, the new firmware does not reset the watchdog timer, so the watchdog timer overflows and times up.

ウオッチドッグタイマーがタイムアップした場合、すなわち新ファームウェアでデジタルカメラ10bが起動できない場合には、ファームウェアの開始アドレスが元に戻されて、旧ファームウェアが起動ファームウェアに再設定された状態で、デジタルカメラ10bが再起動される(ステップS34)。これにより、新ファームウェアに問題があった場合においても、機器が動作しなくなることを防ぐことができる。   When the watchdog timer expires, that is, when the digital camera 10b cannot be started with the new firmware, the digital camera 10b is restored with the start address of the firmware restored and the old firmware reset to the startup firmware. Is restarted (step S34). Thereby, even when there is a problem with the new firmware, it is possible to prevent the device from becoming inoperable.

ウオッチドッグタイマーがタイムアップしなかった場合には、自己診断をすることで、新ファームウェアによってデジタルカメラ10bが正常に起動したかどうかが判断される(ステップS36)。   If the watchdog timer has not expired, it is determined whether the digital camera 10b has been normally activated by the new firmware by performing a self-diagnosis (step S36).

デジタルカメラ10bが正常に起動しなかった場合には、ウオッチドッグタイマーがタイムアップしたがどうかを判断するステップ(ステップS32)へ戻る。   If the digital camera 10b does not start up normally, the process returns to the step of determining whether the watchdog timer has timed up (step S32).

一方、デジタルカメラ10bが正常に起動した場合には、デジタルカメラ10bが再起動される前に設定したウオッチドッグタイマーが停止される(ステップS38)。そして、図9(c)に示すように、フラッシュROM114の旧ファームウェアが消去され、旧ファームウェアが記録されていた領域が各種データ保存用の空きクラスタとして開放される(ステップS40)。これにより、メモリを有効に使うことができる。   On the other hand, when the digital camera 10b is normally started, the watch dog timer set before the digital camera 10b is restarted is stopped (step S38). Then, as shown in FIG. 9C, the old firmware in the flash ROM 114 is erased, and the area where the old firmware is recorded is released as an empty cluster for storing various data (step S40). As a result, the memory can be used effectively.

なお、ステップS34において、起動ファームウェアを旧ファームウェアに戻した後で、不具合があった新ファームウェアを消去し、フラッシュROM114の新ファームウェアが記録されていた領域を各種データ保存用の空きクラスタとして開放するようにしてもよい(図9(d)参照)。   In step S34, after the boot firmware is returned to the old firmware, the defective new firmware is deleted, and the area where the new firmware in the flash ROM 114 is recorded is released as an empty cluster for storing various data. Alternatively, refer to FIG. 9D.

本実施の形態によれば、まず、新ファームウェアをフラッシュROMに記録するため、フラッシュROMに新ファームウェアを記録するための連続した空きクラスタがない場合においても、新ファームウェアをフラッシュROMに記録することができる。また、新ファームウェアの書き込みが完了した後で、新ファームウェアがフラッシュROMの連続したクラスタに記録されているかどうか調べるため、新ファームウェアがフラッシュROMの連続したクラスタに記録されている場合にはフラッシュROMをデフラグする必要がないため、ファームウェアのアップデートに必要な時間を短縮することができる。   According to the present embodiment, since new firmware is first recorded in the flash ROM, the new firmware can be recorded in the flash ROM even when there is no continuous free cluster for recording the new firmware in the flash ROM. it can. Also, after the new firmware has been written, in order to check whether the new firmware is recorded in a continuous cluster of flash ROMs, if the new firmware is recorded in a continuous cluster of flash ROMs, Since there is no need to defragment, the time required for firmware update can be shortened.

<第4の実施の形態>
上記第1の実施の形態のデジタルカメラでは、ウオッチドッグタイマーを設定することで、新ファームウェアで起動させたときに不具合がないかどうか判断したが、新ファームウェアで再起動させたときに不具合がないかどうか判断する方法は、これに限定されるものではない。たとえば、操作者が判断、指示するようにしてもよい。
<Fourth embodiment>
In the digital camera of the first embodiment, the watchdog timer is set to determine whether or not there is a problem when the new firmware is started. However, there is no problem when the new firmware is restarted. The method of determining whether or not is not limited to this. For example, the operator may determine and give instructions.

本実施の形態のデジタルカメラは、操作者が特定の操作をすることで、新ファームウェアで起動させたときに不具合がないかどうか判断するものである。図10は、本実施の形態におけるファームウェアアップデートモードでの処理の流れを示すフローチャートである。   The digital camera according to the present embodiment is configured to determine whether or not there is a problem when the operator performs a specific operation to start up with the new firmware. FIG. 10 is a flowchart showing the flow of processing in the firmware update mode in the present embodiment.

メモリカードスロット14に更新用のファームウェアが記録されたメモリカード144を装填した状態で上記アップデートモードの設定を行うと、デジタルカメラ10cの電源が入り、フラッシュROM114に記録されている起動プログラムが実行される(ステップS10)。   When the update mode is set with the memory card 144 having the update firmware recorded in the memory card slot 14, the digital camera 10c is turned on, and the activation program recorded in the flash ROM 114 is executed. (Step S10).

起動プログラムが実行されると、メディアコントローラ146によってメモリカード144のアクセステストが行われ、メモリカード144が装填されているか否かが確認される(ステップS12)。   When the activation program is executed, the media controller 146 performs an access test of the memory card 144 to check whether or not the memory card 144 is loaded (step S12).

メモリカード144が検出されなかった場合には、処理が終了される。   If the memory card 144 is not detected, the process is terminated.

一方、メモリカード144が検出された場合には、メモリカード144にファームウェアが記録されているかどうかが確認される(ステップS14)。   On the other hand, if the memory card 144 is detected, it is confirmed whether firmware is recorded on the memory card 144 (step S14).

メモリカード144にファームウェアが記録されていない場合には、処理が終了される。   If no firmware is recorded on the memory card 144, the process is terminated.

一方、メモリカード144にファームウェアが記録されている場合には、メモリカード144に記録されたファームウェアのバージョン情報が読み出され、フラッシュROM114に記録されたファームウェアのバージョン情報に基づいて、ファームウェアの新旧が比較判定される(ステップS16)。   On the other hand, when the firmware is recorded on the memory card 144, the firmware version information recorded on the memory card 144 is read out, and the firmware version is updated based on the firmware version information recorded on the flash ROM 114. A comparison is made (step S16).

メモリカード144に記録されたファームウェアのバージョンがフラッシュROM114に記録されたファームウェアのバージョンより古い場合には、処理が終了される。   If the firmware version recorded on the memory card 144 is older than the firmware version recorded on the flash ROM 114, the processing is terminated.

一方、メモリカード144に記録されたファームウェアのバージョンがフラッシュROM114に記録されたファームウェアのバージョンより新しい場合には、フラッシュROM114に、メモリカード144に記録された更新用のファームウェア(新ファームウェア)を書き込むのに十分な連続した空き領域(空きクラスタ)があるかどうかが判断される(ステップS18)。   On the other hand, when the firmware version recorded on the memory card 144 is newer than the firmware version recorded on the flash ROM 114, the update firmware (new firmware) recorded on the memory card 144 is written to the flash ROM 114. It is determined whether or not there is a sufficient continuous free area (free cluster) (step S18).

新ファームウェアを書き込むのに十分な連続した空きクラスタがない場合には、表示制御部148によって、「アップロードできません。画像データを削除してからもう一度アップデートしてください。」等のエラー表示がモニタ28に表示される(ステップS22)。   If there are not enough consecutive free clusters to write the new firmware, the display control unit 148 displays an error message on the monitor 28 such as “Cannot upload. Please delete the image data and update again.” It is displayed (step S22).

一方、新ファームウェアを書き込むのに十分な連続した空きクラスタがある場合(図5(a)参照)には、フラッシュROM114の連続した空きクラスタに新ファームウェアが書き込まれる(ステップS20)。そして、新ファームウェアの書き込みが完了したと判断されるまで、上記処理が継続される(ステップS24)。フラッシュROM114に新ファームウェアの書き込みが終了した場合には、図5(b)に示すように、フラッシュROM114にあらかじめ記録されているファームウェア(旧ファームウェア)と新ファームウェアとが、連続したクラスタにそれぞれ記録されている。   On the other hand, when there are continuous free clusters sufficient to write new firmware (see FIG. 5A), the new firmware is written into the continuous free clusters in the flash ROM 114 (step S20). Then, the above process is continued until it is determined that the writing of the new firmware has been completed (step S24). When the writing of the new firmware to the flash ROM 114 is completed, as shown in FIG. 5B, the firmware (old firmware) recorded in advance in the flash ROM 114 and the new firmware are recorded in successive clusters. ing.

フラッシュROM114にファームウェアの書き込みが終了したら、ファームウェアの開始アドレスが旧ファームウェアの開始アドレス(図5(b)m)から新ファームウェアの開始アドレス(図5(b)n)へ変更される(ステップS26)。   When the writing of the firmware to the flash ROM 114 is completed, the start address of the firmware is changed from the start address of the old firmware (FIG. 5B) to the start address of the new firmware (FIG. 5B) (step S26). .

その後、DISP/BACKボタン40が接続されたポートが割り込みに設定され(ステップS52)、表示制御部148を介して、モニタ28に「正常に動作しない場合はDISP/Backボタンを押してください」等のメッセージが表示される(ステップS54)。これにより、正常に動作しない場合にDISP/Backボタンを押すことを操作者に伝えることができる。   Thereafter, the port to which the DISP / BACK button 40 is connected is set as an interrupt (step S52), and the display control unit 148 displays on the monitor 28 such as “Press the DISP / Back button if it does not operate normally”. A message is displayed (step S54). As a result, it is possible to inform the operator that the DISP / Back button is to be pressed when it does not operate normally.

その後、デジタルカメラ10cが再起動される(ステップS30)。ここで、ファームウェアの開始アドレスはフラッシュROM114内のカメラ設定値に書き込まれており、CPU110は、カメラ設定値に書き込まれている開始アドレスを取得して起動する。そのため、ファームウェアの開始アドレスを変更すると、起動ファームウェアが旧ファームウェアから新ファームウェアに変更され、デジタルカメラ10cが新ファームウェアを起動ファームウェアに設定した状態で再起動される。   Thereafter, the digital camera 10c is restarted (step S30). Here, the start address of the firmware is written in the camera setting value in the flash ROM 114, and the CPU 110 acquires and starts the start address written in the camera setting value. Therefore, when the start address of the firmware is changed, the startup firmware is changed from the old firmware to the new firmware, and the digital camera 10c is restarted with the new firmware set as the startup firmware.

デジタルカメラ10cを再起動した後で、DISP/Backボタン40が押されたかどうかが判断される(ステップS56)。   After the digital camera 10c is restarted, it is determined whether or not the DISP / Back button 40 has been pressed (step S56).

DISP/Backボタン40が押された場合には、新ファームウェアではデジタルカメラ10cが起動できないと判断される。そのため、ファームウェアの開始アドレスが元に戻されて、旧ファームウェアが起動ファームウェアに再設定された状態で、デジタルカメラ10cが再起動される(ステップS34)。これにより、新ファームウェアに問題があった場合においても、機器が動作しなくなることを防ぐことができる。   When the DISP / Back button 40 is pressed, it is determined that the digital camera 10c cannot be activated with the new firmware. Therefore, the digital camera 10c is restarted in a state where the start address of the firmware is restored and the old firmware is reset to the startup firmware (step S34). Thereby, even when there is a problem with the new firmware, it is possible to prevent the device from becoming inoperable.

一方、DISP/Backボタン40が押されなかった場合には、自己診断をすることで、新ファームウェアによりデジタルカメラ10cが正常に起動したかどうかが判断される(ステップS36)。   On the other hand, if the DISP / Back button 40 has not been pressed, it is determined whether the digital camera 10c has been normally activated by the new firmware by performing a self-diagnosis (step S36).

デジタルカメラ10cが正常に起動しなかった場合には、DISP/Backボタン40が押されたかどうかを判断するステップ(ステップS56)へ戻る。   If the digital camera 10c does not start normally, the process returns to the step of determining whether the DISP / Back button 40 has been pressed (step S56).

一方、デジタルカメラ10cが正常に起動した場合には、デジタルカメラ10cを再起動させる前に設定したDISP/BACKボタン40が接続されたポートの割り込みが停止される(ステップS58)。そして、図5(c)に示すように、フラッシュROM114の旧ファームウェアが消去され、旧ファームウェアが記録されていた領域が各種データ保存用の空きクラスタとして開放される(ステップS40)。これにより、メモリを有効に使うことができる。   On the other hand, when the digital camera 10c is normally activated, the interrupt of the port to which the DISP / BACK button 40 set before the digital camera 10c is restarted is stopped (step S58). Then, as shown in FIG. 5C, the old firmware of the flash ROM 114 is erased, and the area where the old firmware is recorded is released as a free cluster for storing various data (step S40). As a result, the memory can be used effectively.

なお、ステップS34において、起動ファームウェアを旧ファームウェアに戻した後で、不具合があった新ファームウェアを消去し、フラッシュROM114の新ファームウェアが記録されていた領域を各種データ保存用の空きクラスタとして開放するようにしてもよい(図5(d)参照)。   In step S34, after the boot firmware is returned to the old firmware, the defective new firmware is deleted, and the area where the new firmware in the flash ROM 114 is recorded is released as an empty cluster for storing various data. (Refer to FIG. 5D).

本実施の形態によれば、新ファームウェアが正常に動作しているかどうかを操作者が判断し、不具合があった場合にはデジタルカメラに指示をすることで、不具合があった場合にもデジタルカメラを起動させることができ、機器が動作しなくなることを防ぐことができる。   According to the present embodiment, the operator determines whether or not the new firmware is operating normally, and instructs the digital camera if there is a malfunction. Can be activated, and the device can be prevented from becoming inoperable.

なお、本発明の適用は、デジタルカメラに限定されるものではなく、カメラつき携帯電話機やビデオカメラ等の撮像装置、携帯音楽プレーヤー、PDA等のファームウェアがアップデート可能な電子機器にも同様に適用することができる。   Note that the application of the present invention is not limited to a digital camera, and is similarly applied to an electronic device capable of updating firmware such as an imaging device such as a mobile phone with a camera or a video camera, a portable music player, or a PDA. be able to.

本発明が適用された電子機器(デジタルカメラ)の第1の実施の形態の外観構成を示す正面斜視図である。1 is a front perspective view showing an external configuration of a first embodiment of an electronic apparatus (digital camera) to which the present invention is applied. 上記デジタルカメラの第1の実施の形態の外観構成を示す背面斜視図である。It is a back perspective view which shows the external appearance structure of 1st Embodiment of the said digital camera. 上記デジタルカメラの第1の実施の形態の電気的構成を示すブロック図である。It is a block diagram which shows the electric constitution of 1st Embodiment of the said digital camera. 上記デジタルカメラの第1の実施の形態のフローチャートである。It is a flowchart of 1st Embodiment of the said digital camera. 上記デジタルカメラの第1の実施の形態のフラッシュROMのクラスタ配置を示す説明図であり、(a)は新ファームウェア記録前のクラスタの状態を示し、(b)は新ファームウェアを記録した後のクラスタの状態を示し、(c)は新ファームウェアで電子機器が正常に起動した場合のクラスタの状態を示し、(d)は新ファームウェアで電子機器が正常に起動しなかった場合のクラスタの状態を示す。It is explanatory drawing which shows the cluster arrangement | positioning of flash ROM of 1st Embodiment of the said digital camera, (a) shows the state of the cluster before new firmware recording, (b) is the cluster after recording new firmware (C) shows the state of the cluster when the electronic device starts normally with the new firmware, and (d) shows the state of the cluster when the electronic device does not start normally with the new firmware. . 本発明が適用されたデジタルカメラの第2の実施の形態のフローチャートである。It is a flowchart of 2nd Embodiment of the digital camera to which this invention was applied. 上記デジタルカメラの第2の実施の形態のフラッシュROMのクラスタ配置を示す説明図であり、(a)は新ファームウェア記録前のクラスタの状態を示し、(a)’はデフラグ後のクラスタの状態を示し、(b)は新ファームウェアを記録した後のクラスタの状態を示し、(c)は新ファームウェアで電子機器が正常に起動した場合のクラスタの状態を示し、(d)は新ファームウェアで電子機器が正常に起動しなかった場合のクラスタの状態を示す。It is explanatory drawing which shows cluster arrangement | positioning of the flash ROM of 2nd Embodiment of the said digital camera, (a) shows the state of the cluster before new firmware recording, (a) 'shows the state of the cluster after defragmentation. (B) shows the state of the cluster after recording the new firmware, (c) shows the state of the cluster when the electronic device has started up normally with the new firmware, and (d) shows the electronic device with the new firmware. Indicates the state of the cluster when does not start normally. 本発明が適用されたデジタルカメラの第3の実施の形態のフローチャートである。It is a flowchart of 3rd Embodiment of the digital camera to which this invention was applied. 上記デジタルカメラの第3の実施の形態のフラッシュROMのクラスタ配置を示す説明図であり、(a)は新ファームウェア記録前のクラスタの状態を示し、(b)は新ファームウェアを記録した後のクラスタの状態を示し、(b)’はデフラグ後のクラスタの状態を示し、(c)は新ファームウェアで電子機器が正常に起動した場合のクラスタの状態を示し、(d)は新ファームウェアで電子機器が正常に起動しなかった場合のクラスタの状態を示す。It is explanatory drawing which shows the cluster arrangement | positioning of flash ROM of 3rd Embodiment of the said digital camera, (a) shows the state of the cluster before new firmware recording, (b) is the cluster after recording new firmware (B) ′ shows the state of the cluster after defragmentation, (c) shows the state of the cluster when the electronic device has started normally with the new firmware, and (d) shows the electronic device with the new firmware. Indicates the state of the cluster when does not start normally. 本発明が適用されたデジタルカメラの第4の実施の形態のフローチャートである。It is a flowchart of 4th Embodiment of the digital camera to which this invention was applied.

符号の説明Explanation of symbols

10、10a、10b、10c…デジタルカメラ、12…カメラボディ、14…メモリカードスロット、15…USB用コネクタ、26…電源ボタン、28…モニタ、40…DISP/BACKボタン、110…CPU、114…フラッシュROM、116…RAM、142…USBI/F、144…メモリカード、146…メディアコントローラ、148…表示制御部 DESCRIPTION OF SYMBOLS 10, 10a, 10b, 10c ... Digital camera, 12 ... Camera body, 14 ... Memory card slot, 15 ... Connector for USB, 26 ... Power button, 28 ... Monitor, 40 ... DISP / BACK button, 110 ... CPU, 114 ... Flash ROM, 116, RAM, 142, USB I / F, 144, memory card, 146, media controller, 148, display control unit

Claims (8)

各種データが読み書きされる不揮発性メモリにファームウェアが記録された電子機器のファームウェア更新方法において、
更新する新しいファームウェアを取得するステップと、
前記不揮発性メモリにあらかじめ記録されているファームウェアが前記不揮発性メモリに記録された状態で、前記新しいファームウェアを前記不揮発性メモリの連続した空き領域に記録するステップと、
を含むことを特徴とするファームウェアの更新方法。
In the firmware update method for electronic devices in which firmware is recorded in a nonvolatile memory from which various data are read and written,
Obtaining new firmware to update; and
Recording the new firmware in a continuous free area of the non-volatile memory, with the firmware pre-recorded in the non-volatile memory being recorded in the non-volatile memory;
A method for updating firmware, comprising:
前記新しいファームウェアを前記不揮発性メモリの連続した空き領域に記録するステップでは、前記不揮発性メモリをデフラグした後で前記新しいファームウェアを前記不揮発性メモリの連続した空き領域に保存することを特徴とする請求項1に記載のファームウェアの更新方法。   The step of recording the new firmware in a continuous free area of the nonvolatile memory includes storing the new firmware in a continuous free area of the nonvolatile memory after defragmenting the nonvolatile memory. The firmware update method according to Item 1. 各種データが読み書きされる不揮発性メモリにファームウェアが記録された電子機器のファームウェア更新方法において、
更新する新しいファームウェアを取得するステップと、
前記不揮発性メモリにあらかじめ記録されているファームウェアが前記不揮発性メモリに記録された状態で、前記新しいファームウェアを前記不揮発性メモリに保存するステップと、
前記不揮発性メモリに保存された前記新しいファームウェアが前記不揮発性メモリに連続して保存されているか判定するステップと、
前記新しいファームウェアが前記不揮発性メモリに連続して保存されているか判定するステップにおいて、前記新しいファームウェアが前記不揮発性メモリに連続して保存されていないと判定された場合には、前記不揮発性メモリをデフラグするステップと、
を含むことを特徴とするファームウェアの更新方法。
In the firmware update method for electronic devices in which firmware is recorded in a nonvolatile memory from which various data are read and written,
Obtaining new firmware to update; and
Storing the new firmware in the non-volatile memory in a state where the firmware pre-recorded in the non-volatile memory is recorded in the non-volatile memory;
Determining whether the new firmware stored in the non-volatile memory is continuously stored in the non-volatile memory;
In the step of determining whether or not the new firmware is continuously stored in the nonvolatile memory, if it is determined that the new firmware is not continuously stored in the nonvolatile memory, the nonvolatile memory is stored in the nonvolatile memory. Defragmenting, and
A method for updating firmware, comprising:
前記新しいファームウェアを起動ファームウェアに設定するステップと、
前記電子機器を前記新しいファームウェアで起動するステップと、
前記新しいファームウェアが正常に動作するか判定するステップと、
を更に含み、
前記新しいファームウェアが正常に動作するか判定するステップにおいて、前記新しいファームウェアが正常に動作した場合には、前記不揮発性メモリにおける前記あらかじめ記録されているファームウェアが保存されている領域を各種データを記録する領域として開放し、前記新しいファームウェアが正常に動作しなかった場合には、前記あらかじめ記録されているファームウェアを起動ファームウェアに再設定することを特徴とする請求項1、2又は3に記載のファームウェアの更新方法。
Setting the new firmware as boot firmware;
Activating the electronic device with the new firmware;
Determining whether the new firmware operates normally;
Further including
In the step of determining whether or not the new firmware operates normally, if the new firmware operates normally, various data are recorded in an area where the previously recorded firmware is stored in the nonvolatile memory. The firmware of claim 1, 2 or 3, wherein the firmware is released as an area, and when the new firmware does not operate normally, the pre-recorded firmware is reset as startup firmware. Update method.
前記電子機器を前記新しいファームウェアを起動ファームウェアに設定して起動させるステップでは、ウオッチドッグタイマーを起動してから前記新しいファームウェアを起動ファームウェアに設定し、
前記新しいファームウェアが正常に動作するか判定するステップでは、前記ウオッチドッグタイマーがタイムアップしなかった場合には前記新しいファームウェアが正常に動作したと判断し、前記ウオッチドッグタイマーがタイムアップした場合には前記新しいファームウェアが正常に動作しなかったと判断することを特徴とする請求項4に記載のファームウェアの更新方法。
In the step of starting the electronic device by setting the new firmware as the startup firmware, starting the watch dog timer and then setting the new firmware as the startup firmware,
In the step of determining whether or not the new firmware operates normally, it is determined that the new firmware has operated normally when the watchdog timer has not timed up, and when the watchdog timer has timed out The firmware update method according to claim 4, wherein the new firmware is determined not to operate normally.
前記電子機器を前記新しいファームウェアを起動ファームウェアに設定して起動させるステップでは、所定の信号入力を割り込みに設定してから前記新しいファームウェアを起動ファームウェアに設定し、
前記新しいファームウェアが正常に動作するか判定するステップでは、前記新しいファームウェアの動作終了までに前記割り込みが入らない場合には前記新しいファームウェアが正常に動作したと判断し、前記新しいファームウェアの動作中に前記割り込みが入る場合には前記新しいファームウェアが正常に動作しなかったと判断することを特徴とする請求項4に記載のファームウェアの更新方法。
In the step of starting the electronic device by setting the new firmware as a startup firmware, a predetermined signal input is set as an interrupt, and then the new firmware is set as a startup firmware.
In the step of determining whether or not the new firmware operates normally, it is determined that the new firmware has operated normally if the interrupt is not received by the end of the operation of the new firmware, and the new firmware operates during the operation of the new firmware. 5. The firmware update method according to claim 4, wherein when an interrupt is input, it is determined that the new firmware does not operate normally.
請求項1乃至6のいずれかに記載のファームウェアの更新方法を演算装置に実行させることを特徴とするプログラム。   A program for causing a computing device to execute the firmware update method according to claim 1. 各種データが読み書きされる不揮発性メモリにファームウェアが記録された電子機器において、前記不揮発性メモリに記録された請求項7に記載のプログラムを前記不揮発性メモリから前記プログラムを読み出して実行する演算装置を備えたことを特徴とする電子機器。   In an electronic device in which firmware is recorded in a nonvolatile memory from which various data is read and written, an arithmetic device that reads the program from the nonvolatile memory and executes the program recorded in the nonvolatile memory Electronic equipment characterized by comprising.
JP2007062092A 2007-03-12 2007-03-12 Update method for firmware, program and electronic equipment Pending JP2008225763A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007062092A JP2008225763A (en) 2007-03-12 2007-03-12 Update method for firmware, program and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007062092A JP2008225763A (en) 2007-03-12 2007-03-12 Update method for firmware, program and electronic equipment

Publications (1)

Publication Number Publication Date
JP2008225763A true JP2008225763A (en) 2008-09-25

Family

ID=39844325

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007062092A Pending JP2008225763A (en) 2007-03-12 2007-03-12 Update method for firmware, program and electronic equipment

Country Status (1)

Country Link
JP (1) JP2008225763A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010128885A (en) * 2008-11-28 2010-06-10 Fujitsu Ltd Update processing program for storage system, update processing method, and storage system
EP2315117A1 (en) 2009-10-16 2011-04-27 Fujitsu Limited Information processing apparatus and firmware updating method
JP2017078940A (en) * 2015-10-20 2017-04-27 セイコーエプソン株式会社 Electronic equipment and method for controlling the same
JP2017228077A (en) * 2016-06-22 2017-12-28 富士通株式会社 Electronic equipment, firmware update method, and computer program
WO2018150820A1 (en) * 2017-02-17 2018-08-23 日立オートモティブシステムズ株式会社 Information processing device
JP2020038395A (en) * 2019-12-03 2020-03-12 株式会社 ミックウェア Map information system, map information processing device, map information processing method, and program
WO2023008161A1 (en) * 2021-07-27 2023-02-02 パナソニックIpマネジメント株式会社 Air conditioner firmware updating method, air conditioner equipped with firmware updating method, and program

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010128885A (en) * 2008-11-28 2010-06-10 Fujitsu Ltd Update processing program for storage system, update processing method, and storage system
EP2315117A1 (en) 2009-10-16 2011-04-27 Fujitsu Limited Information processing apparatus and firmware updating method
US8631399B2 (en) 2009-10-16 2014-01-14 Fujitsu Limited Information processing apparatus and firmware updating method
JP2017078940A (en) * 2015-10-20 2017-04-27 セイコーエプソン株式会社 Electronic equipment and method for controlling the same
JP2017228077A (en) * 2016-06-22 2017-12-28 富士通株式会社 Electronic equipment, firmware update method, and computer program
WO2018150820A1 (en) * 2017-02-17 2018-08-23 日立オートモティブシステムズ株式会社 Information processing device
JPWO2018150820A1 (en) * 2017-02-17 2019-07-18 日立オートモティブシステムズ株式会社 Information processing device
JP2020038395A (en) * 2019-12-03 2020-03-12 株式会社 ミックウェア Map information system, map information processing device, map information processing method, and program
WO2023008161A1 (en) * 2021-07-27 2023-02-02 パナソニックIpマネジメント株式会社 Air conditioner firmware updating method, air conditioner equipped with firmware updating method, and program

Similar Documents

Publication Publication Date Title
JP4481842B2 (en) Imaging apparatus and control method thereof
JP4999306B2 (en) Imaging apparatus, imaging method, and program
JP2008225763A (en) Update method for firmware, program and electronic equipment
JP4333394B2 (en) Camera device, imaging method and program thereof
JP2006345402A (en) Image file information display device with date sorting function, image file information display method and imaging apparatus
JP2009033223A (en) Imaging apparatus
JP4498169B2 (en) Image processing apparatus and control method thereof
JP2004165780A (en) Electronic camera
JP2008035243A (en) Imaging device
JP5522214B2 (en) Camera device and through image display method
JP2002051238A (en) Electronic camera
JP4948011B2 (en) Imaging apparatus, control method therefor, computer program, and storage medium
JP4860495B2 (en) Imaging device
JP4401974B2 (en) Imaging apparatus and control method thereof
JP5109996B2 (en) Camera device, through image display method and program thereof
JP2004242093A (en) Digital camera
JP2005311493A (en) Camera
JP2007219822A (en) Imaging apparatus
KR101314827B1 (en) Method for controlling digital photographing apparatus, and digital photographing apparatus adopting the method
JP4865202B2 (en) File transfer apparatus, program, and computer-readable recording medium
JP2007213231A (en) Image processor
JP2009141978A (en) Camera apparatus, through-image display method ,and program therefor
JP2004193642A (en) Digital camera
JP2017085338A (en) Imaging apparatus, control method, and program
JP2005101951A (en) Digital camera with display section