JP2006243810A - Microcomputer system - Google Patents

Microcomputer system Download PDF

Info

Publication number
JP2006243810A
JP2006243810A JP2005054630A JP2005054630A JP2006243810A JP 2006243810 A JP2006243810 A JP 2006243810A JP 2005054630 A JP2005054630 A JP 2005054630A JP 2005054630 A JP2005054630 A JP 2005054630A JP 2006243810 A JP2006243810 A JP 2006243810A
Authority
JP
Japan
Prior art keywords
reset
flash memory
signal
cpu
rom
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2005054630A
Other languages
Japanese (ja)
Inventor
Isao Sasazaki
勲 笹▲崎▼
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2005054630A priority Critical patent/JP2006243810A/en
Publication of JP2006243810A publication Critical patent/JP2006243810A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)
  • Microcomputers (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a microcomputer system easily restorable in the event of reset during the updating of a boot program. <P>SOLUTION: The microcomputer system comprises a CPU 10, a flash memory 15, a ROM 14, a reset recording circuit 11 recording reset occurrence in response to reset occurrence during the rewriting of the flash memory 15 and outputting a reset detection signal showing the presence and absence of the recorded reset occurrence, and a switching circuit 13 connected to an output of the reset recording circuit 11 which outputs, in response to the reset detection signal showing the absence of reset occurrence, a signal for selecting the flash memory 15 as the reset-time access destination of the CPU 10, and outputs, in response to the reset detection signal showing the presence of reset occurrence, a signal for selecting the ROM 14 as the reset-time access destination of the CPU 10. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、一般にマイクロコンピュータシステムに関し、詳しくはフラッシュメモリからブートプログラムを読込み起動するマイクロコンピュータシステムに関する。   The present invention generally relates to a microcomputer system, and more particularly to a microcomputer system that reads and starts a boot program from a flash memory.

マイクロコンピュータシステムに搭載されるCPU(Central Processing Unit)は、電源が投入されると、リセットベクタ(リセット時のアクセス先アドレス)からブートプログラム命令を読み出して実行する。このブートプログラムを格納する記憶装置としては、電源が遮断されても記憶内容を保持しておく必要があり、例えばROM(Read Only Memory)を用いればよい。   When power is turned on, a CPU (Central Processing Unit) mounted on the microcomputer system reads and executes a boot program instruction from a reset vector (access destination address at reset). As a storage device for storing the boot program, it is necessary to retain the stored contents even when the power is turned off. For example, a ROM (Read Only Memory) may be used.

しかしながらROMを使用した場合、ブートプログラムを更新することは容易ではない。ブートプログラムを更新するためには、ROMを回路基板から外し、ROMライタ等を用いて新しいブートプログラムを書込んだり、或いは新しいブートプログラムを格納したROMで置き換えたりする必要がある。このようなブートプログラムの更新処理にはかなりの手間と時間とがかかってしまう。   However, when the ROM is used, it is not easy to update the boot program. In order to update the boot program, it is necessary to remove the ROM from the circuit board and write a new boot program using a ROM writer or the like, or replace it with a ROM storing the new boot program. Such a boot program update process takes a lot of time and effort.

ブートプログラムを格納する記憶装置として、ROMの代わりにフラッシュメモリ等の不揮発性メモリを用いれば、ブートプログラムの更新が容易になる。フラッシュメモリは電気的に再書込みが可能であり、システム搭載のCPUにより実行するソフトウェア的な処理により、フラッシュメモリ内のブートプログラムを更新することが可能となる。   If a nonvolatile memory such as a flash memory is used instead of the ROM as a storage device for storing the boot program, the boot program can be easily updated. The flash memory can be electrically rewritten, and the boot program in the flash memory can be updated by software processing executed by the CPU mounted on the system.

特許文献1に記載の発明では、書き込み用プログラムを実行して、読み出し専用メモリとアドレスを共有しているフラッシュメモリの記憶領域にブートプログラムを書き込むようにすることで、ブートプログラムを容易且つ確実にフラッシュメモリに書き込むことができる。また特許文献2の発明では、主領域とバックアップ領域に割り当てられた不揮発性メモリにそれぞれプログラムを格納する多重化の構造によって、一つの不揮発性メモリを用いたシステム起動が不能であっても他の不揮発性メモリのプログラムを用いたシステム起動が行えるようになる。
特開2003−323313号公報 特開2004−013719号公報
In the invention described in Patent Document 1, the boot program can be written easily and reliably by executing the write program and writing the boot program to the storage area of the flash memory sharing the address with the read-only memory. Can be written to flash memory. Further, in the invention of Patent Document 2, by the multiplexing structure in which programs are stored in the non-volatile memories assigned to the main area and the backup area, even if the system activation using one non-volatile memory is impossible, The system can be activated using a program in a nonvolatile memory.
JP 2003-323313 A JP 2004-013719 A

フラッシュメモリに格納されるブートプログラムを更新するためには、まずフラッシュメモリの内容を消去する消去動作を実行し、その後データを書き込む書き込み動作を実行する必要がある。これらの消去動作又は書き込み動作中に、何らかの要因により外部から或いは内部でリセットが発生すると、フラッシュメモリの内容が破壊された状態となる。   In order to update the boot program stored in the flash memory, it is necessary to first execute an erase operation for erasing the contents of the flash memory, and then execute a write operation for writing data. If a reset occurs externally or internally for some reason during these erasing operations or writing operations, the contents of the flash memory are destroyed.

この場合、リセットに応じてCPUがフラッシュメモリにアクセスし、破壊されたブートプログラムを実行しようとすると、CPUが暴走する結果となる。この状態になってしまうと、システムを正常に立ち上げることが不可能となるので、マイコンLSIをプリント基板から外してフラッシュメモリへ再書き込みする以外に復旧の手立てはない。   In this case, if the CPU accesses the flash memory in response to the reset and tries to execute the destroyed boot program, the CPU runs out of control. In this state, the system cannot be started up normally, and there is no means for recovery other than removing the microcomputer LSI from the printed board and rewriting it to the flash memory.

ブートプログラム更新中のリセットは、システムの仕様上禁止しているので、上記のようにブートプログラムが破壊される状況は本来起こり得ないものである。しかしノイズの影響を完全に排除することは不可能であり、ブートプログラム更新中にノイズに起因するリセット動作が発生する場合がある。   Since the reset during the boot program update is prohibited due to the specification of the system, the situation in which the boot program is destroyed as described above cannot occur. However, it is impossible to completely eliminate the influence of noise, and a reset operation due to noise may occur during boot program update.

以上を鑑みて本発明は、ブートプログラム更新中にリセットが発生した場合に容易に回復可能なマイクロコンピュータシステムを提供することを目的とする。   In view of the above, an object of the present invention is to provide a microcomputer system that can be easily recovered when a reset occurs during boot program update.

本発明によるマイクロコンピュータシステムは、CPUと、第1のフラッシュメモリと、ROMと、該第1のフラッシュメモリを書き換え中のリセット発生に応答して該リセット発生を記録し、記録された該リセット発生の有無を示すリセット検出信号を出力するリセット記録回路と、リセット記録回路の出力に結合され該リセット発生無しを示す該リセット検出信号に応答して該CPUのリセット時のアクセス先として該第1のフラッシュメモリを選択する信号を出力し、該リセット発生有りを示す該リセット検出信号に応答して該CPUのリセット時のアクセス先として該ROMを選択する信号を出力する切換え回路
を含むことを特徴とする。
The microcomputer system according to the present invention records the reset occurrence in response to the reset occurrence during rewriting of the CPU, the first flash memory, the ROM, and the first flash memory, and the recorded occurrence of the reset A reset recording circuit for outputting a reset detection signal indicating the presence or absence of the CPU, and the first recording as an access destination at the time of resetting the CPU in response to the reset detection signal coupled to the output of the reset recording circuit and indicating the absence of the reset A switching circuit for outputting a signal for selecting a flash memory and outputting a signal for selecting the ROM as an access destination at the time of resetting of the CPU in response to the reset detection signal indicating that the reset has occurred; To do.

本発明の少なくとも1つの実施例によれば、フラッシュメモリの書き換え中(イレーズ処理中又はライトアクセス中)にリセット信号が発生すると、リセット信号発生を検出してその旨を所定の不揮発性メモリに格納しておく。リセット信号による再起動時において、リセット信号検出が所定の不揮発性メモリに記録されている場合には、リセットベクタの位置がフラッシュメモリから所定のROMに切り替えられ、CPUはこのROMからプログラムを読み込んで起動する。   According to at least one embodiment of the present invention, when a reset signal is generated during rewriting of flash memory (during erase processing or write access), the occurrence of the reset signal is detected and the fact is stored in a predetermined nonvolatile memory. Keep it. When the reset signal detection is recorded in the predetermined nonvolatile memory at the time of restart by the reset signal, the position of the reset vector is switched from the flash memory to the predetermined ROM, and the CPU reads the program from the ROM. to start.

従って、例えば外部記憶装置などに格納されたブートプログラムをダウンロードしてフラッシュメモリに書き込むプログラムをROMに格納しておけば、リセット動作により破壊されたブートプログラムを復旧することが可能となる。このようにして、ブートプログラム更新中にリセットが発生した場合であっても容易に回復可能なマイクロコンピュータシステムを提供することができる。   Therefore, for example, if a boot program stored in an external storage device or the like is downloaded and stored in the ROM, the boot program destroyed by the reset operation can be recovered. In this way, it is possible to provide a microcomputer system that can be easily recovered even when a reset occurs during the boot program update.

以下において、本発明の実施例を添付の図面を用いて詳細に説明する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.

本発明においては、フラッシュメモリにリセットベクタが割当てられている状況において、フラッシュメモリのイレーズ処理中又はライトアクセス中にリセット信号が発生すると、リセット信号発生を検出してその旨を所定の不揮発性メモリに格納しておく。リセット信号による再起動時において、リセット信号検出が所定の不揮発性メモリに記録されている場合には、リセットベクタの位置がフラッシュメモリから所定のROMに切り替えられ、CPUはこのROMからプログラムを読み込んで起動する。このROM内のプログラムは、例えば外部記憶装置などに格納されたブートプログラムをダウンロードして、フラッシュメモリに書き込むことにより、リセット動作により破壊されたブートプログラムを復旧する。   In the present invention, in a situation where a reset vector is assigned to the flash memory, if a reset signal is generated during erase processing or write access of the flash memory, the occurrence of the reset signal is detected and this is indicated in a predetermined nonvolatile memory. Store it in. When the reset signal detection is recorded in the predetermined nonvolatile memory at the time of restart by the reset signal, the position of the reset vector is switched from the flash memory to the predetermined ROM, and the CPU reads the program from the ROM. to start. As the program in the ROM, for example, a boot program stored in an external storage device or the like is downloaded and written in the flash memory, thereby restoring the boot program destroyed by the reset operation.

図1は、本発明の動作を説明するためのメモリマップを示す図である。図1の左側は、通常の動作時のメモリ空間の割り当てを示し、図1の右側は、フラッシュメモリのブートプログラム更新中にリセットが発生した後のメモリ空間の割り当てを示す図である。図1の左側に示すように、例えばアドレス空間FEFFFFからFF0000は所定のROMに割当てられ、アドレス空間FE0001からFFFFFFはフラッシュメモリに割当てられる。このフラッシュメモリのアドレス空間にリセットベクタが割当てられている。従って、通常の動作時には、リセット信号により再起動時には、CPUはフラッシュメモリからブートプログラムを読み出して、システム立ち上げ動作を実行することになる。   FIG. 1 is a diagram showing a memory map for explaining the operation of the present invention. The left side of FIG. 1 shows the allocation of memory space during normal operation, and the right side of FIG. 1 shows the allocation of memory space after a reset occurs during the boot program update of the flash memory. As shown on the left side of FIG. 1, for example, address spaces FEFFFF to FF0000 are assigned to a predetermined ROM, and address spaces FE0001 to FFFFFF are assigned to a flash memory. A reset vector is assigned to the address space of the flash memory. Therefore, during normal operation, when restarted by a reset signal, the CPU reads the boot program from the flash memory and executes the system startup operation.

図1の右側に示すように、フラッシュメモリのブートプログラム更新中にリセットが発生した後には、メモリ空間上で、ROMの位置とフラッシュメモリの位置とが置き換えられる。つまりリセットベクタがROMのアドレス空間に割当てられることになる。従って、ブートプログラムが破壊された場合には、リセット信号により再起動されると、CPUはROMにアクセスし、ROMに格納されるプログラムを実行することになる。そのプログラムはブートプログラムをフラッシュメモリに書き込むものであり、これによりシステムを復旧することが可能となる。   As shown on the right side of FIG. 1, after a reset occurs during the boot program update of the flash memory, the ROM position and the flash memory position are replaced in the memory space. That is, the reset vector is assigned to the ROM address space. Accordingly, when the boot program is destroyed, when the CPU is restarted by a reset signal, the CPU accesses the ROM and executes the program stored in the ROM. The program writes a boot program in the flash memory, and this makes it possible to recover the system.

図2は、本発明によるマイクロコンピュータシステムの構成の一例を示す図である。図2のマイクロコンピュータシステムは、CPU10、リセット記録回路11、デコーダ12、切換え回路13、ROM14、フラッシュメモリ15、及びマクロ16を含む。   FIG. 2 is a diagram showing an example of the configuration of a microcomputer system according to the present invention. The microcomputer system of FIG. 2 includes a CPU 10, a reset recording circuit 11, a decoder 12, a switching circuit 13, a ROM 14, a flash memory 15, and a macro 16.

CPU10は、アドレスバス20、データバス21、及びコントロールバス22を介して、ROM14、フラッシュメモリ15、マクロ16等のマクロと繋がっている。CPU10は、アドレスバス20を介してアドレス信号によりマクロを指定し、データバス21を介してマクロとデータをやり取りし、コントロールバス22を介して制御信号によりマクロの動作を制御する。ROM14及びフラッシュメモリ15については、後述するようにブートプログラム破壊時にアドレス空間内での位置を交換するために、アドレスバス20からデコーダ12及び切換え回路13を介して、ROM14及びフラッシュメモリ15を指定する構成となっている。   The CPU 10 is connected to a macro such as the ROM 14, the flash memory 15, and the macro 16 via the address bus 20, the data bus 21, and the control bus 22. The CPU 10 designates a macro by an address signal via the address bus 20, exchanges data with the macro via the data bus 21, and controls the operation of the macro by a control signal via the control bus 22. As for the ROM 14 and the flash memory 15, as will be described later, the ROM 14 and the flash memory 15 are designated from the address bus 20 through the decoder 12 and the switching circuit 13 in order to exchange the position in the address space when the boot program is destroyed. It has a configuration.

フラッシュメモリ15はブートプログラムを格納しておくメモリであり、通常動作時にリセットベクタはフラッシュメモリ15に割当てられている。従って通常動作時にリセット信号による再起動がかかると、CPU10はフラッシュメモリ15にアクセスし、フラッシュメモリ15に格納されるブートプログラムを起動することにより、システムの立ち上げ動作を実行する。   The flash memory 15 is a memory for storing a boot program, and a reset vector is assigned to the flash memory 15 during normal operation. Accordingly, when restart is performed by a reset signal during normal operation, the CPU 10 accesses the flash memory 15 and starts a boot program stored in the flash memory 15 to execute a system startup operation.

ROM14は、フラッシュメモリ15のイレーズ処理中又はライトアクセス中にリセット信号が発生することによりフラッシュメモリ15の内容が破壊された場合に、フラッシュメモリ15の代わりにシステムの起動元となるメモリである。フラッシュメモリ15の内容が破壊された場合のリセット信号による再起動において、CPU10はリセットベクタが指し示す先としてROM14にアクセスし、ROM14に格納されるプログラムを実行する。このROM14内のプログラムは、例えば外部記憶装置などに格納されたブートプログラムをダウンロードして、フラッシュメモリ15に書き込むことにより、リセット動作により破壊されたブートプログラムを復旧する。   The ROM 14 is a memory serving as a system activation source instead of the flash memory 15 when the contents of the flash memory 15 are destroyed due to a reset signal generated during the erase process or write access of the flash memory 15. In the restart by the reset signal when the contents of the flash memory 15 are destroyed, the CPU 10 accesses the ROM 14 as a destination indicated by the reset vector, and executes the program stored in the ROM 14. The program in the ROM 14 restores the boot program destroyed by the reset operation by downloading a boot program stored in, for example, an external storage device and writing the program in the flash memory 15.

リセット記録回路11は、フラッシュメモリ15のイレーズ処理中又はライトアクセス中にリセット信号INITXが発生すると、リセット信号が発生した旨を内部の不揮発性メモリに記録する。内部の不揮発性メモリにリセット信号発生が記録されると、リセット記録回路11が出力するリセット検出信号RDETECTがアサート状態となる。なおフラッシュメモリ15のイレーズ処理中又はライトアクセス中であることは、フラッシュメモリ15からのイレーズ信号ERASE、並びにアドレスバス20のアドレス信号及びコントロールバス22の制御信号に基づいて判定することができる。   When the reset signal INITX is generated during the erase process or write access of the flash memory 15, the reset recording circuit 11 records that the reset signal has been generated in the internal nonvolatile memory. When the occurrence of the reset signal is recorded in the internal nonvolatile memory, the reset detection signal RDETECT output from the reset recording circuit 11 is asserted. Whether the flash memory 15 is being erased or being accessed for writing can be determined based on the erase signal ERASE from the flash memory 15, the address signal on the address bus 20, and the control signal on the control bus 22.

デコーダ12は、アドレスバス20のアドレス信号をデコードすることで、ROM14がアクセス先であることを示す信号DEC1又はフラッシュメモリ15がアクセス先であることを示す信号DEC2を生成する。切換え回路13は、リセット検出信号RDETECTがネゲート状態であるときに、信号DEC1をROM14に供給し、信号DEC2をフラッシュメモリ15に供給する。リセット検出信号RDETECTがアサート状態であるときには、切換え回路13は信号DEC2をROM14に供給し、信号DEC1をフラッシュメモリ15に供給する。これによりフラッシュメモリ15の内容が破壊された場合のリセット信号による再起動において、CPU10はリセットベクタが指し示す先としてROM14にアクセスすることができる。   The decoder 12 decodes the address signal of the address bus 20 to generate a signal DEC1 indicating that the ROM 14 is an access destination or a signal DEC2 indicating that the flash memory 15 is an access destination. The switching circuit 13 supplies the signal DEC1 to the ROM 14 and supplies the signal DEC2 to the flash memory 15 when the reset detection signal RDETECT is in the negated state. When the reset detection signal RDETECT is in the asserted state, the switching circuit 13 supplies the signal DEC2 to the ROM 14 and supplies the signal DEC1 to the flash memory 15. As a result, the CPU 10 can access the ROM 14 as the destination indicated by the reset vector in the restart by the reset signal when the contents of the flash memory 15 are destroyed.

マクロ16は他のマクロであり、例えばRAM或いは通信インターフェース等であってよい。図2の例では、通信インターフェースとして外部制御装置30と通信する構成が示される。フラッシュメモリ15の内容が破壊された場合に、CPU10はROM14が格納するプログラムを実行することで、例えば外部制御装置30からブートプログラムをダウンロードすることができる。   The macro 16 is another macro, for example, a RAM or a communication interface. In the example of FIG. 2, the structure which communicates with the external control apparatus 30 as a communication interface is shown. When the contents of the flash memory 15 are destroyed, the CPU 10 can download a boot program from, for example, the external control device 30 by executing a program stored in the ROM 14.

図3は、リセット記録回路11の構成の一例を示す図である。図3のリセット記録回路11は、ワンショットマルチバイブレータ41、インバータ42、AND回路43、AND回路44、OR回路45、OR回路46、NOR回路47、セレクタ48、フラッシュメモリ49、及びデコーダ50を含む。   FIG. 3 is a diagram illustrating an example of the configuration of the reset recording circuit 11. The reset recording circuit 11 in FIG. 3 includes a one-shot multivibrator 41, an inverter 42, an AND circuit 43, an AND circuit 44, an OR circuit 45, an OR circuit 46, a NOR circuit 47, a selector 48, a flash memory 49, and a decoder 50. .

マイクロコンピュータ外部から又は内部で発生したリセット信号INITXがアサートされると、これに応答して、ワンショットマルチバイブレータ41が一定の長さのパルス信号(負論理)INITX_DETを生成する。ワンショットマルチバイブレータ41の出力信号INITX_DETは、インバータ42を介してAND回路43の一方の入力に供給される。AND回路43のもう一方の入力には、イレーズ信号ERASEが図2のフラッシュメモリ15から供給される。このイレーズ信号ERASEは、CPU10からのイレーズコマンドに応答してフラッシュメモリ15がイレーズ動作を実行している最中に、フラッシュメモリ15によりアサートされる信号である。   When a reset signal INITX generated from outside or inside the microcomputer is asserted, in response to this, the one-shot multivibrator 41 generates a pulse signal (negative logic) INITX_DET having a certain length. The output signal INITX_DET of the one-shot multivibrator 41 is supplied to one input of the AND circuit 43 via the inverter 42. An erase signal ERASE is supplied from the flash memory 15 of FIG. 2 to the other input of the AND circuit 43. The erase signal ERASE is a signal asserted by the flash memory 15 while the flash memory 15 is executing an erase operation in response to an erase command from the CPU 10.

AND回路43は、イレーズ信号ERASEがアサート状態(HIGH)であると、ワンショットマルチバイブレータ41の出力であるパルス信号を通過させる。このAND回路43の出力は、フラッシュメモリ15のイレーズ動作中にリセット信号INITXが発生したことを示す異常検出パルスとして、OR回路45の一方の入力に供給される。   The AND circuit 43 passes the pulse signal that is the output of the one-shot multivibrator 41 when the erase signal ERASE is in the asserted state (HIGH). The output of the AND circuit 43 is supplied to one input of the OR circuit 45 as an abnormality detection pulse indicating that the reset signal INITX has occurred during the erase operation of the flash memory 15.

デコーダ50は、図2のアドレスバス20のアドレス信号とコントロールバス22の制御信号とを受け取り、アドレス信号と制御信号との論理をとることにより、図2のフラッシュメモリ15に対してCPU10が書き込みアクセスしていることを示す書き込みアクセス信号WRを出力する。書き込みアクセス信号WRは、AND回路44の一方の入力に供給される。AND回路44のもう一方の入力には、ワンショットマルチバイブレータ41の出力信号INITX_DETがインバータ42を介して供給される。   The decoder 50 receives the address signal of the address bus 20 of FIG. 2 and the control signal of the control bus 22, and takes the logic of the address signal and the control signal so that the CPU 10 performs write access to the flash memory 15 of FIG. A write access signal WR indicating that the recording is in progress is output. The write access signal WR is supplied to one input of the AND circuit 44. An output signal INITX_DET of the one-shot multivibrator 41 is supplied to the other input of the AND circuit 44 via the inverter 42.

AND回路44は、書き込みアクセス信号WRがアサート状態(HIGH)であると、ワンショットマルチバイブレータ41の出力であるパルス信号を通過させる。このAND回路44の出力は、フラッシュメモリ15の書き込み動作中にリセット信号INITXが発生したことを示す異常検出パルスとして、OR回路45の一方の入力に供給される。   The AND circuit 44 passes the pulse signal that is the output of the one-shot multivibrator 41 when the write access signal WR is in the asserted state (HIGH). The output of the AND circuit 44 is supplied to one input of the OR circuit 45 as an abnormality detection pulse indicating that the reset signal INITX has occurred during the write operation of the flash memory 15.

OR回路45の出力は、フラッシュメモリ15のイレーズ動作中或いは書き込み動作中にリセットが発生したことを示すHIGHパルスである。このパルスがNOR回路47を介してLOWパルスとして、フラッシュメモリ49のライトイネーブル信号入力XWEに供給される。   The output of the OR circuit 45 is a HIGH pulse indicating that a reset has occurred during the erase operation or write operation of the flash memory 15. This pulse is supplied to the write enable signal input XWE of the flash memory 49 through the NOR circuit 47 as a LOW pulse.

デコーダ50が出力するアクセス信号ACCESSは、CPU10がリセット記録回路11のフラッシュメモリ49をアクセスするときにHIGHになる信号であり、それ以外の状態ではLOWである。従って、フラッシュメモリ49のライトイネーブル信号入力XWEにLOWパルスが供給されるとき、セレクタ48のA入力は0でありB入力は1である。セレクタ48は、“01”のAB入力に応じてデータ“0”を選択してフラッシュメモリ49のデータ信号入力D_INに供給する。   The access signal ACCESS output from the decoder 50 is a signal that becomes HIGH when the CPU 10 accesses the flash memory 49 of the reset recording circuit 11, and is LOW in other states. Accordingly, when a LOW pulse is supplied to the write enable signal input XWE of the flash memory 49, the A input of the selector 48 is 0 and the B input is 1. The selector 48 selects the data “0” according to the AB input of “01” and supplies it to the data signal input D_IN of the flash memory 49.

このようにして、フラッシュメモリ15のイレーズ動作中或いは書き込み動作中にリセットが発生した場合には、フラッシュメモリ49にはデータ“0”が格納される。フラッシュメモリ49の格納するデータ内容“0”は、リセット検出信号RDETECTとして図2の切換え回路13に供給される。この例では、リセット検出信号RDETECTはLOW(“0”)でアサート状態である。   In this way, when a reset occurs during the erase operation or write operation of the flash memory 15, data “0” is stored in the flash memory 49. The data content “0” stored in the flash memory 49 is supplied to the switching circuit 13 in FIG. 2 as the reset detection signal RDEECT. In this example, the reset detection signal RDETECT is asserted at LOW (“0”).

なお図3の構成においては、フラッシュメモリ15のイレーズ動作中のリセット発生及びイレーズ動作中の電源断によるリセット発生、並びにフラッシュメモリ15の書き込み動作中のリセット発生及び書き込み動作中の電源断によるリセット発生を検出することができる。   In the configuration of FIG. 3, a reset occurs during the erase operation of the flash memory 15 and a reset due to a power interruption during the erase operation, and a reset occurs during a write operation of the flash memory 15 and a reset due to a power interruption during the write operation. Can be detected.

図2のROM14のプログラムを実行してフラッシュメモリ15のブートプログラムが回復された後には、内部で再度リセットを発生させて、フラッシュメモリ15のブートプログラム実行によりシステムを立ち上げる必要がある。この際には、図3のフラッシュメモリ49の内容を書き換えて、リセット検出信号RDETECTをネゲート状態にしておかなければ、フラッシュメモリ15からブートすることができない。即ち、フラッシュメモリ15のブートプログラムが回復された後、CPU10は、リセット記録回路11にアクセスしてフラッシュメモリ49に“1”を格納しておく必要がある。   After the program of the ROM 14 in FIG. 2 is executed and the boot program of the flash memory 15 is recovered, it is necessary to generate a reset again and start up the system by executing the boot program of the flash memory 15. At this time, the flash memory 15 cannot be booted unless the contents of the flash memory 49 of FIG. 3 are rewritten and the reset detection signal RDEECT is not negated. That is, after the boot program of the flash memory 15 is recovered, the CPU 10 needs to access the reset recording circuit 11 and store “1” in the flash memory 49.

CPU10からリセット記録回路11へのアクセスは、図3において、アドレス信号及び制御信号のデコードによりデコーダ50から出力されるアクセス信号ACCESSがHIGHとなることで実現される。このHIGH信号が、NOR回路47を介してLOW信号として、フラッシュメモリ49のライトイネーブル信号入力XWEに供給される。このときセレクタ48のAB入力は“10”であり、CPU10からデータバス21を介して供給されるデータ信号が、セレクタ48を介してフラッシュメモリ49に書き込まれる。   In FIG. 3, the access from the CPU 10 to the reset recording circuit 11 is realized when the access signal ACCESS output from the decoder 50 becomes HIGH by decoding the address signal and the control signal. This HIGH signal is supplied to the write enable signal input XWE of the flash memory 49 through the NOR circuit 47 as a LOW signal. At this time, the AB input of the selector 48 is “10”, and the data signal supplied from the CPU 10 via the data bus 21 is written into the flash memory 49 via the selector 48.

これによりフラッシュメモリ49に“1”を格納して、リセット検出信号RDETECTをネゲート状態とすることができる。従って図2のシステムにおいて、リセットベクタが指し示す先はフラッシュメモリ15となり、CPU10がフラッシュメモリ15からブートプログラムを読込むことが可能となる。   As a result, “1” can be stored in the flash memory 49 and the reset detection signal RDEECT can be negated. Therefore, in the system of FIG. 2, the destination indicated by the reset vector is the flash memory 15, and the CPU 10 can read the boot program from the flash memory 15.

なおOR回路46は、リセット信号INITXとワンショットマルチバイブレータ41とのORをとることで、他のマクロをリセットするための信号を生成する。この信号は、例えば図2のマクロ16等に供給される。   The OR circuit 46 generates a signal for resetting other macros by ORing the reset signal INITX and the one-shot multivibrator 41. This signal is supplied to, for example, the macro 16 in FIG.

図4は、図3のリセット記録回路11の動作を説明するための信号タイミング図である。フラッシュメモリ15がイレーズ動作を実行中に、(c)に示すイレーズ信号ERASEがHIGHとなる。このイレーズ信号ERASEがHIGHである状態において、(a)に示すリセット信号INITXがアサート状態(LOW状態)となると、その立下りエッジに応答してワンショットマルチバイブレータ41が固定長の負論理パルス信号INITX_DETを生成する(図4(b))。   FIG. 4 is a signal timing diagram for explaining the operation of the reset recording circuit 11 of FIG. While the flash memory 15 is executing the erase operation, the erase signal ERASE shown in (c) becomes HIGH. When the erase signal ERASE is HIGH and the reset signal INITX shown in (a) is asserted (LOW state), the one-shot multivibrator 41 has a fixed-length negative logic pulse signal in response to the falling edge. INITX_DET is generated (FIG. 4B).

この負論理パルス信号INITX_DETの反転(図3のインバータ42による反転)とイレーズ信号ERASEとのアンドをとることで、(d)に示す異常検出パルスが生成される。この異常検出パルスが反転されて、(e)に示すフラッシュメモリ49のライトイネーブル信号入力となる。このとき、フラッシュメモリ49のデータ信号入力D_INにはデータ“0”が入力されている。これにより、フラッシュメモリ49から出力されるリセット検出信号RDETECT(図2及び図3)は、アサート状態(LOW状態)に設定される。   By taking the AND of the negative logic pulse signal INITX_DET (inversion by the inverter 42 in FIG. 3) and the erase signal ERASE, the abnormality detection pulse shown in (d) is generated. This abnormality detection pulse is inverted and becomes a write enable signal input of the flash memory 49 shown in FIG. At this time, data “0” is input to the data signal input D_IN of the flash memory 49. As a result, the reset detection signal RDETECT (FIGS. 2 and 3) output from the flash memory 49 is set to the asserted state (LOW state).

図5は、図2に示すマイクロコンピュータシステムの動作を示すフローチャートである。まず電源ON又はリセットがかかるとステップS1から処理が開始される。電源ONの後又はリセットの後において、ステップS2に示されるように、フラッシュメモリ15のイレーズ動作又は書き込み動作中にリセットが検出された記録があるか否かに応じて、その後の処理が異なることになる。これは、リセット記録回路11から出力されるリセット検出信号RDETECTに応じて、デコーダ12及び切換え回路13が指し示すリセットベクタの読込先が切り替わるからである。   FIG. 5 is a flowchart showing the operation of the microcomputer system shown in FIG. First, when the power is turned on or reset, the process starts from step S1. After the power is turned on or after resetting, as shown in step S2, the subsequent processing differs depending on whether or not there is a record in which the reset is detected during the erase operation or write operation of the flash memory 15. become. This is because the read destination of the reset vector indicated by the decoder 12 and the switching circuit 13 is switched according to the reset detection signal RDETECT output from the reset recording circuit 11.

例えばフラッシュメモリ15のイレーズ動作又は書き込み動作中にリセットが検出された記録がない場合、処理はステップS3に進み、リセットベクタ先のフラッシュメモリ15からブートプログラムを読込んで実行する。これによりマイクロコンピュータシステムが立ち上がり通常の動作が開始されることになる。   For example, when there is no record in which reset is detected during the erase operation or write operation of the flash memory 15, the process proceeds to step S3, and the boot program is read from the flash memory 15 that is the reset vector destination and executed. As a result, the microcomputer system is started and normal operation is started.

その後、フラッシュメモリ15のブートプログラムの更新を試みた場合が図5に示されている。図5の例では、ステップS4において、フラッシュメモリ15のブートプログラムの更新をしている最中、即ち、フラッシュメモリ15のイレーズ又は書き込み動作を実行している最中に、リセット信号が発生している。   FIG. 5 shows a case where an attempt is made to update the boot program of the flash memory 15 thereafter. In the example of FIG. 5, in step S4, a reset signal is generated while the boot program of the flash memory 15 is being updated, that is, during the erase or write operation of the flash memory 15. Yes.

これに応じて、ステップS5で、リセット記録回路11に所定の値をセットする。即ち、リセット記録回路11のフラッシュメモリ49に、リセット発生を示すデータ値を格納する。ステップS6で、リセット記録回路11から出力されるリセット検出信号RDETECTがアサート状態となることにより、切換え回路13によって、起動時のプログラム読込先がフラッシュメモリ15からROM14に切り換えられる。ステップS4で発生したリセットにより、処理はステップS1から再度実行されることになる。   In response to this, a predetermined value is set in the reset recording circuit 11 in step S5. That is, the data value indicating the occurrence of reset is stored in the flash memory 49 of the reset recording circuit 11. In step S6, when the reset detection signal RDETECT output from the reset recording circuit 11 is asserted, the switching circuit 13 switches the program reading destination at the time of activation from the flash memory 15 to the ROM. Due to the reset generated in step S4, the process is executed again from step S1.

リセットの後、ステップS2での分岐においてフラッシュメモリ15のイレーズ動作又は書き込み動作中にリセットが検出された記録があるので、処理はステップS7に進む。ステップS7では、リセットベクタ先のROM14からプログラムを読込んで実行する。このプログラム実行により、ステップS8において、例えばダウンロード手段によりブートプログラムをダウンロードし、フラッシュメモリ15にダウンロードしたプログラムを書き込む。これによりフラッシュメモリ15を正常な状態に回復することができる。   After the reset, since there is a record in which the reset is detected during the erase operation or the write operation of the flash memory 15 in the branch in step S2, the process proceeds to step S7. In step S7, the program is read from the reset vector destination ROM 14 and executed. By executing this program, in step S8, for example, the boot program is downloaded by the download means, and the downloaded program is written in the flash memory 15. Thereby, the flash memory 15 can be recovered to a normal state.

その後ステップS9において、リセット記録回路11のフラッシュメモリ49をリセットする。即ちフラッシュメモリ49に格納されているリセット発生を示すデータ値を他の値で書き換えることにより、リセット記録回路11から出力されるリセット検出信号RDETECTをネゲート状態とする。その後ステップS10において、内部でソフトウェアを介してリセットを発生する。これにより、ROM14のプログラムを実行してフラッシュメモリ15のブートプログラムを回復した後に、フラッシュメモリ15のブートプログラム実行によりシステムを立ち上げ直すことができる。   Thereafter, in step S9, the flash memory 49 of the reset recording circuit 11 is reset. That is, the reset detection signal RDETECT output from the reset recording circuit 11 is negated by rewriting the data value indicating the occurrence of reset stored in the flash memory 49 with another value. Thereafter, in step S10, a reset is internally generated via software. Thus, after the program in the ROM 14 is executed and the boot program in the flash memory 15 is recovered, the system can be restarted by executing the boot program in the flash memory 15.

図6は、本発明によりROMのプログラムを実行してブートプログラムをダウンロードする構成の一例を示す図である。図6の構成は、本発明によるマイクロコンピュータシステム100、通信回線101、及びパーソナルコンピュータ又はワークステーション等のコンピュータ102を含む。   FIG. 6 is a diagram showing an example of a configuration for executing a ROM program and downloading a boot program according to the present invention. The configuration of FIG. 6 includes a microcomputer system 100 according to the present invention, a communication line 101, and a computer 102 such as a personal computer or workstation.

マイクロコンピュータシステム100は、例えばRS−232等の通信回線101を介してコンピュータ102と接続される。図2と対応させると、外部制御装置30がコンピュータ102に対応し、マクロ16は例えばUART(Universal Asynchronous Receiver Transmitter)等に対応することになる。   The microcomputer system 100 is connected to the computer 102 via a communication line 101 such as RS-232. 2, the external control device 30 corresponds to the computer 102, and the macro 16 corresponds to, for example, a UART (Universal Asynchronous Receiver Transmitter).

マイクロコンピュータシステム100は、ボード110上に図2のシステムが搭載された構成となっている。図6では、便宜上フラッシュメモリ15のみが図示されている。コンピュータ102から通信回線101を介してマイクロコンピュータシステム100を制御することで、フラッシュメモリ15のブートプログラムを更新することができる。この際、ブートプログラム更新中にリセットが発生すると、フラッシュメモリ15の内容が破壊されてしまう。このリセットに応じた起動時に、マイクロコンピュータシステム100は前述した動作を実行することにより、フラッシュメモリ15ではなく所定のROM(図2のROM14)からプログラムを読込んで実行する。   The microcomputer system 100 has a configuration in which the system of FIG. In FIG. 6, only the flash memory 15 is shown for convenience. The boot program in the flash memory 15 can be updated by controlling the microcomputer system 100 from the computer 102 via the communication line 101. At this time, if a reset occurs during the boot program update, the contents of the flash memory 15 are destroyed. At startup in response to the reset, the microcomputer system 100 reads and executes the program from the predetermined ROM (ROM 14 in FIG. 2) instead of the flash memory 15 by executing the above-described operation.

このROM14にはコンピュータ102から通信回線101を介してブートプログラムをダウンロードするプログラムが格納されている。このプログラムが実行されると、マイクロコンピュータシステム100から、ブートプログラムのダウンロード要求が通信回線101を介してコンピュータ102に送信される。ダウンロード要求に応答して、コンピュータ102は通信回線101を介してブートプログラムをマイクロコンピュータシステム100に送出する。   The ROM 14 stores a program for downloading a boot program from the computer 102 via the communication line 101. When this program is executed, the microcomputer system 100 transmits a boot program download request to the computer 102 via the communication line 101. In response to the download request, the computer 102 sends a boot program to the microcomputer system 100 via the communication line 101.

マイクロコンピュータシステム100のCPU10は、コンピュータ102から供給されたブートプログラムをフラッシュメモリ15に書き込む。その後ROM14に格納されるプログラムに基づいて、CPU10はソフトウェア的にリセットを発生させる。これによりマイクロコンピュータシステム100は、ダウンロードされフラッシュメモリ15に格納されたブートプログラムに基づいて再起動される。   The CPU 10 of the microcomputer system 100 writes the boot program supplied from the computer 102 in the flash memory 15. Thereafter, based on the program stored in the ROM 14, the CPU 10 generates a reset in terms of software. As a result, the microcomputer system 100 is restarted based on the boot program downloaded and stored in the flash memory 15.

なお上記実施例はフラッシュメモリを例にして説明したが、フラッシュメモリの代わりに強誘電体メモリ等の他の不揮発性メモリを用いてもよい。   In the above embodiment, the flash memory has been described as an example. However, other nonvolatile memories such as a ferroelectric memory may be used instead of the flash memory.

以上、本発明を実施例に基づいて説明したが、本発明は上記実施例に限定されるものではなく、特許請求の範囲に記載の範囲内で様々な変形が可能である。   As mentioned above, although this invention was demonstrated based on the Example, this invention is not limited to the said Example, A various deformation | transformation is possible within the range as described in a claim.

本発明の動作を説明するためのメモリマップを示す図である。It is a figure which shows the memory map for demonstrating operation | movement of this invention. 本発明によるマイクロコンピュータシステムの構成の一例を示す図である。It is a figure which shows an example of a structure of the microcomputer system by this invention. リセット記録回路の構成の一例を示す図である。It is a figure which shows an example of a structure of a reset recording circuit. 図3のリセット記録回路の動作を説明するための信号タイミング図である。FIG. 4 is a signal timing diagram for explaining the operation of the reset recording circuit of FIG. 3. 図2に示すマイクロコンピュータシステムの動作を示すフローチャートである。It is a flowchart which shows operation | movement of the microcomputer system shown in FIG. 本発明によりROMのプログラムを実行してブートプログラムをダウンロードする構成の一例を示す図である。It is a figure which shows an example of the structure which executes the program of ROM and downloads a boot program by this invention.

符号の説明Explanation of symbols

10 CPU
11 リセット記録回路
12 デコーダ
13 切換え回路
14 ROM
15 フラッシュメモリ
16 マクロ
20 アドレスバス
21 データバス
22 コントロールバス
41 ワンショットマルチバイブレータ
42 インバータ
43、44 AND回路43
45、46 OR回路
47 NOR回路
48 セレクタ
49 フラッシュメモリ
50 デコーダ
100 マイクロコンピュータシステム
101 通信回線
102 コンピュータ
10 CPU
11 Reset recording circuit 12 Decoder 13 Switching circuit 14 ROM
15 Flash memory 16 Macro 20 Address bus 21 Data bus 22 Control bus 41 One-shot multivibrator 42 Inverters 43 and 44 AND circuit 43
45, 46 OR circuit 47 NOR circuit 48 selector 49 flash memory 50 decoder 100 microcomputer system 101 communication line 102 computer

Claims (5)

CPUと、
第1の不揮発性メモリと、
ROMと、
該第1の不揮発性メモリを書き換え中のリセット発生に応答して該リセット発生を記録し、記録された該リセット発生の有無を示すリセット検出信号を出力するリセット記録回路と、
リセット記録回路の出力に結合され該リセット発生無しを示す該リセット検出信号に応答して該CPUのリセット時のアクセス先として該第1の不揮発性メモリを選択する信号を出力し、該リセット発生有りを示す該リセット検出信号に応答して該CPUのリセット時のアクセス先として該ROMを選択する信号を出力する切換え回路
を含むことを特徴とするマイクロコンピュータシステム。
CPU,
A first non-volatile memory;
ROM,
A reset recording circuit that records the occurrence of the reset in response to the occurrence of a reset during rewriting of the first nonvolatile memory, and outputs a reset detection signal that indicates the presence or absence of the recorded occurrence of the reset;
A signal for selecting the first nonvolatile memory as an access destination at the time of reset of the CPU is output in response to the reset detection signal coupled to the output of the reset recording circuit and indicating that the reset has not occurred, and the reset has occurred And a switching circuit for outputting a signal for selecting the ROM as an access destination at the time of resetting the CPU in response to the reset detection signal.
該第1の不揮発性メモリにブートプログラムを書き込む動作を該CPUに実行させるプログラムを格納するよう該ROMは構成されることを特徴とする請求項1記載のマイクロコンピュータシステム。   2. The microcomputer system according to claim 1, wherein the ROM is configured to store a program for causing the CPU to execute an operation of writing a boot program in the first nonvolatile memory. 該マイクロコンピュータシステムの外部と通信する通信回路を更に含み、該ROMに格納されたプログラムを実行することにより該CPUは該通信回路を介して外部から該第1の不揮発性メモリに該ブートプログラムをダウンロードするよう構成されることを特徴とする請求項2記載のマイクロコンピュータシステム。   The CPU further includes a communication circuit that communicates with the outside of the microcomputer system, and the CPU stores the boot program in the first nonvolatile memory from the outside via the communication circuit by executing a program stored in the ROM. 3. The microcomputer system according to claim 2, wherein the microcomputer system is configured to be downloaded. 該リセット記録回路は該リセット発生を記録する第2の不揮発性メモリを含み、該第2の不揮発性メモリの該リセット発生の記録を消去する動作を該CPUに実行させるプログラムを格納するよう該ROMは構成されることを特徴とする請求項2記載のマイクロコンピュータシステム。   The reset recording circuit includes a second non-volatile memory that records the occurrence of the reset, and the ROM stores a program that causes the CPU to execute an operation of erasing the record of the occurrence of the reset in the second non-volatile memory. The microcomputer system according to claim 2, wherein the microcomputer system is configured. 該リセット記録回路は、該第1の不揮発性メモリのイレーズ動作中又は該第1の不揮発性メモリの書き込み動作中のリセット発生に応答して該リセット発生を記録するよう構成されることを特徴とする請求項1記載のマイクロコンピュータシステム。
The reset recording circuit is configured to record the reset occurrence in response to a reset occurrence during an erase operation of the first nonvolatile memory or a write operation of the first nonvolatile memory. The microcomputer system according to claim 1.
JP2005054630A 2005-02-28 2005-02-28 Microcomputer system Withdrawn JP2006243810A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005054630A JP2006243810A (en) 2005-02-28 2005-02-28 Microcomputer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005054630A JP2006243810A (en) 2005-02-28 2005-02-28 Microcomputer system

Publications (1)

Publication Number Publication Date
JP2006243810A true JP2006243810A (en) 2006-09-14

Family

ID=37050201

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005054630A Withdrawn JP2006243810A (en) 2005-02-28 2005-02-28 Microcomputer system

Country Status (1)

Country Link
JP (1) JP2006243810A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010072798A (en) * 2008-09-17 2010-04-02 Ricoh Co Ltd Control section of electronic device, electronic device, image-forming device, method of controlling electronic device, program, and recording medium
JP2011198274A (en) * 2010-03-23 2011-10-06 Yamaha Corp Information processor and karaoke system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010072798A (en) * 2008-09-17 2010-04-02 Ricoh Co Ltd Control section of electronic device, electronic device, image-forming device, method of controlling electronic device, program, and recording medium
JP2011198274A (en) * 2010-03-23 2011-10-06 Yamaha Corp Information processor and karaoke system

Similar Documents

Publication Publication Date Title
KR101602360B1 (en) System fast booting apparatus and method
JP4422136B2 (en) Storage device and activation method
JP4810172B2 (en) Control device, version upgrade method, and program
JP2007122627A (en) Information processor and memory initialization method
JP3830867B2 (en) Single-chip microcomputer and its boot area switching method
JP2005071303A (en) Program starting device
JP2005157528A (en) Memory device
JP4177360B2 (en) Memory controller, flash memory system, and flash memory control method
JP2011164827A (en) Electronic apparatus including flash memory and method for updating program stored in flash memory
JP2006243810A (en) Microcomputer system
JP5084853B2 (en) Firmware update device, communication device, electronic device, firmware update system, firmware update method, and program
JP2002175193A (en) Device and method for rewriting program
JP4334312B2 (en) Start-up time reduction computing device and data loading method
JP4235624B2 (en) Memory controller, flash memory system, and flash memory control method
JP2005050079A (en) Server device, bios updating program, bootstrap program, and bios updating method
KR101031417B1 (en) Micro Processor Unit with non-volatile memory register and control method therefor
JP2005107608A (en) Electronic device, nonvolatile memory, and method for rewriting data of nonvolatile memory
JP2003122575A (en) Information processing unit
JP3498028B2 (en) Boot program rewriting system
JP2004355310A (en) Image processing device
JP2006127554A (en) Information processing device and image formation device
JPH08101794A (en) Rewriting system for firmware program
JP2006313421A (en) Microcomputer and debug method
JP2009301479A (en) Microcomputer
JP2007128204A (en) Computer system and its starting method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20071211

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20080728

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20101125

A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20101126