JP2001056787A - Device and method for write for memory - Google Patents

Device and method for write for memory

Info

Publication number
JP2001056787A
JP2001056787A JP11233519A JP23351999A JP2001056787A JP 2001056787 A JP2001056787 A JP 2001056787A JP 11233519 A JP11233519 A JP 11233519A JP 23351999 A JP23351999 A JP 23351999A JP 2001056787 A JP2001056787 A JP 2001056787A
Authority
JP
Japan
Prior art keywords
memory
program
writing
write
data
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
JP11233519A
Other languages
Japanese (ja)
Inventor
Akifumi Kimura
亮史 木村
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 General Ltd
Original Assignee
Fujitsu General 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 General Ltd filed Critical Fujitsu General Ltd
Priority to JP11233519A priority Critical patent/JP2001056787A/en
Publication of JP2001056787A publication Critical patent/JP2001056787A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a high reliability memory writer for preventing a program from being incompletely written as much as possible and surely performing the version-up or change of the program by discriminating a password and the number of times of write corresponding to a memory write request and discriminating the completion of write from the coincidence of data when running the program after write. SOLUTION: A memory 5 for program storage is provided with an erasure/ write inhibit block B1. The erasure and write inhibit block B1 is provided with a write discriminating processing means 6f having a password verifying means 6g, a write time storage means 6d for storing the number of times of write and a completion time storage means 6e for storing the number of times of write completion. Corresponding to the memory write request from an external controller 7, the password and the number of times of write in the write time storage means 6d are discriminated, and when running a program after write, it is discriminated from the coincidence of data between the write time storage means 6d and the completion time storage means 6e whether write is completed or not.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、CPUやプログラ
ム格納用メモリを内蔵したメモリ書込装置およびその書
込方法に係わり、より具体的には書換えが可能な不揮発
性メモリに記憶されたプログラムの変更を可能とするメ
モリ書込装置およびその書込方法に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a memory writing device having a built-in CPU and a memory for storing a program, and a writing method therefor. More specifically, the present invention relates to a program for storing a program stored in a rewritable nonvolatile memory. 1. Field of the Invention The present invention relates to a memory writing device and a writing method for enabling a change.

【0002】[0002]

【従来の技術】従来のプログラム格納用メモリには、プ
ログラムの変更を行う場合は、ICソケットからメモリ
ーを取り外してプログラムを書き換える必要があるもの
があった。この場合、ICソケットからの抜き差しに手
間がかかるという問題があり、比較的頻繁なバージョン
アップが行われる場合や、世界各国に向けて出荷される
表示装置のように、仕向先毎に信号処理や表示などの仕
様が異なる少量多品種の製品や、開発直後の製品などに
フラッシュメモリのような電気的に消去や書込みが可能
でソケットに実装したままプログラムが変更できる不揮
発性メモリなどが有効に利用されてきている。図7は従
来例を示す図である。図に基づいて以下に、プログラム
の格納用メモリとしてフラッシュメモリを用いた装置の
バージョンアップなどのプログラム変更を行う場合を説
明する。51は表示装置であり、52はCPUであり、
53は通信手段である。通信手段53はRS232Cな
どのプロトコルにより外部の制御装置57との指令やデ
ータの送受信を行っている。54はRAMであり、CP
U52の制御に必要なレジスタやデータのバッファなど
に使用されている。55はプログラム格納用メモリであ
り、例えばRAMや電気的に消去・書込が可能なフラッ
シュメモリなどが使用可能である。フラッシュメモリの
場合、内部がいくつかのブロックあるいはセクタとして
例えばB51からB57のようにに分割されている。5
6は書込制御プログラムであり、前述の例えばブロック
B51に配置され、内部にプログラム格納用メモリの消
去・書込を制御するメモリ制御プログラム56a、外部
の制御装置との通信によるデータの送受信を行う通信制
御プログラム56b、記憶されたプログラムコードをR
AMに転送する転送プログラム56cとが格納されてい
る。以上のような構成で、プログラムの変更が必要な場
合は、外部の制御装置57からの指令により、CPU5
2は通信手段53を介し通信制御プログラム56bによ
り外部の制御装置57からプログラムデータを受信し、
RAM54に一旦バッファし、メモリ制御プログラム5
6aによりプログラム格納用メモリ55にプログラムデ
ータを書込む。書込後、プログラム格納用メモリ55に
配置されたプログラムを実行すればよい。
2. Description of the Related Art Conventionally, some program storage memories require that the memory be removed from an IC socket to rewrite the program when the program is changed. In this case, there is a problem that it takes time to insert / remove from the IC socket, and the signal processing and the signal processing for each destination are performed, such as a case where a relatively frequent version upgrade is performed and a display device which is shipped to countries around the world. Efficient use of non-volatile memory, such as flash memory, which can be electrically erased and written and whose program can be changed while mounted on the socket, such as small-quantity multi-products with different specifications such as display and products just after development Have been. FIG. 7 shows a conventional example. Hereinafter, a case where a program change such as an upgrade of an apparatus using a flash memory as a program storage memory will be described with reference to the drawings. 51 is a display device, 52 is a CPU,
53 is a communication means. The communication unit 53 transmits and receives commands and data to and from the external control device 57 using a protocol such as RS232C. 54 is a RAM, and CP
It is used for registers and data buffers necessary for controlling U52. Reference numeral 55 denotes a program storage memory, for example, a RAM or an electrically erasable / writable flash memory can be used. In the case of a flash memory, the inside is divided into several blocks or sectors, for example, from B51 to B57. 5
Reference numeral 6 denotes a write control program, which is arranged in, for example, the above-described block B51 and has a memory control program 56a for controlling erasing / writing of a program storage memory therein, and performs data transmission / reception by communication with an external control device. The communication control program 56b stores the stored program code in R
A transfer program 56c to be transferred to the AM is stored. In the above configuration, when a program needs to be changed, the CPU 5 receives a command from the external control device 57.
2 receives program data from the external control device 57 by the communication control program 56b through the communication means 53,
Once buffered in the RAM 54, the memory control program 5
The program data is written to the program storage memory 55 by 6a. After writing, the program stored in the program storage memory 55 may be executed.

【0003】しかしながら、フラッシュメモリを用いた
場合でも、従来の制御方法では以下のような解決すべき
課題があった。まず、フラッシュメモリの書換えのプロ
グラムを実行中に、例えば停電や電源電圧の低下などの
障害が発生した場合、転送中のデータが破壊される恐れ
があった。また、フラッシュメモリへの書込に時間がか
かるため、完了する前に完了したと誤って電源を切断し
てしまう恐れもあった。特に取り扱いに不慣れな担当者
が書込操作を行うような場合には前述のような取り扱い
上のミスや、目的とは異なるプログラムや仕向先と仕様
やバージョンの異なるプログラムを書込む恐れもあっ
た。さらに、フラッシュメモリを使用する場合、許容さ
れる消去・書込回数に制限があり、所定の回数を超えて
消去・書込を行うと、データが正しく書込まれない場合
があるという問題もあった。以上のような不完全な状態
でプログラム格納用メモリに格納されたプログラムを実
行すると、不具合が発生するかプログラムが暴走し、最
悪の場合装置の破壊に至るという恐れがあった。その
上、プログラム格納用メモリの内容を書込むためのメモ
リ制御プログラムや通信制御プログラムが、従来行われ
ていたように、メモリ制御プログラムや通信制御プログ
ラムの格納部が消去書込禁止ブロックとされておらず、
しかも書換えようとする部分に含まれる場合、書込が不
完全に終わるとプログラムの転送自体もできなくなる、
という問題もあった。
[0003] However, even when a flash memory is used, the conventional control method has the following problems to be solved. First, if a failure such as a power failure or a drop in power supply voltage occurs during execution of a flash memory rewriting program, data being transferred may be destroyed. In addition, since writing to the flash memory takes a long time, there is a possibility that the power supply may be erroneously cut off before the completion. In particular, when a person unfamiliar with handling performs a writing operation, there is a risk of handling mistakes as described above, and writing a program with a different purpose or a program with a different specification and version from the destination. . Furthermore, when a flash memory is used, there is a limit on the number of times of erasing / writing that is allowed. If erasing / writing is performed more than a predetermined number of times, data may not be written correctly. Was. If the program stored in the program storage memory is executed in an incomplete state as described above, a problem may occur or the program may run away, and in the worst case, the device may be destroyed. In addition, the memory control program and the communication control program for writing the contents of the program storage memory are changed to the erase / write-inhibited block in the storage section of the memory control program and the communication control program as conventionally performed. No
In addition, if it is included in the part to be rewritten, it will not be possible to transfer the program itself if the writing is incomplete.
There was also a problem.

【0004】[0004]

【発明が解決しようとする課題】本発明は、以上の問題
点に鑑み、書込作業中の電源異常や、不慣れな作業者が
不用意な書込操作を行ったり、メモリ素子の書込回数が
制限をオーバーするなどにより、プログラムの書込が不
完全に行われることを極力防止し、プログラムのバージ
ョンアップや変更が確実に行われる信頼性の高いメモリ
書込装置およびその書込方法を提供することを目的とし
ている。
SUMMARY OF THE INVENTION The present invention has been made in consideration of the above problems, and has been described in consideration of a power failure during a writing operation, an inexperienced operator performing an inadvertent writing operation, and a number of writing operations of a memory element. To provide a highly reliable memory writing device and a writing method for the same that can prevent program writing from being performed incompletely due to, for example, exceeding a limit, and can reliably upgrade or change the version of the program. It is intended to be.

【0005】[0005]

【課題を解決するための手段】本発明は上述の課題を解
決するため、CPUと、前記CPUに接続され外部の制
御装置とデータの送受信を行うための通信手段と、前記
CPUに内蔵もしくは接続されたRAMと、複数のブロ
ックからなるプログラム格納用メモリとを備え、前記プ
ログラム格納用メモリには、通信を制御する通信制御プ
ログラムと前記プログラム格納用メモリの消去及び書込
を行うためのメモリ制御プログラムと記憶されたプログ
ラムコードをRAMに転送する転送プログラムとを有
し、書込時は前記転送プログラムにより前記通信制御プ
ログラムと前記メモリ制御プログラムとを前記RAMに
配置し、前記外部の制御装置からのデータを前記プログ
ラム格納用メモリへ転送し書込を行うメモリ書込装置に
おいて、前記プログラム格納用メモリに、前記メモリ制
御プログラムと前記通信制御プログラムと前記転送プロ
グラムと書込判定処理手段と書込回数を記憶する書込回
数記憶手段と書込の完了回数を記憶する完了回数記憶手
段とを備えた少なくとも一つの消去書込禁止ブロックを
設けることで上記目的を達成している。
SUMMARY OF THE INVENTION In order to solve the above-mentioned problems, the present invention provides a CPU, communication means connected to the CPU for transmitting and receiving data to and from an external control device, and built-in or connected to the CPU. And a program storage memory comprising a plurality of blocks, wherein the program storage memory has a communication control program for controlling communication and a memory control for erasing and writing the program storage memory. A transfer program for transferring a program and a stored program code to a RAM, wherein at the time of writing, the communication control program and the memory control program are arranged in the RAM by the transfer program; A memory writing device for transferring and writing data to the program storage memory; A memory for storing the memory control program, the communication control program, the transfer program, a write determination processing unit, a write count storage unit for storing the write count, and a completion count storage unit for storing the write completion count in a memory for storing the program. The above object is achieved by providing at least one erase / write prohibition block having the following.

【0006】また、前記プログラム格納用メモリを、電
気的消去・書込が可能な不揮発性メモリで構成してい
る。
Further, the program storage memory is constituted by an electrically erasable / writable nonvolatile memory.

【0007】また、前記プログラム格納用メモリに書込
まれるプログラムが、消去回数を抑えるため、前記プロ
グラム格納用メモリの各ブロック単位に完結して配置さ
れ、外部のブロックから参照される各ブロック毎に内部
の主要プログラムへのジャンプテーブルを備える構成と
している。
In order to reduce the number of erasures, a program to be written into the program storage memory is completely arranged in each block unit of the program storage memory. It has a jump table to the main internal programs.

【0008】また、CPUと、前記CPUに接続され外
部の制御装置とデータの送受信を行うための通信手段
と、前記CPUに内蔵もしくは接続されたRAMと複数
のブロックからなるプログラム格納用メモリとを備え、
前記プログラム格納用メモリには、通信を制御する通信
制御プログラムと前記プログラム格納用メモリの消去及
び書込を行うためのメモリ制御プログラムと記憶された
プログラムコードをRAMに転送する転送プログラムと
を有し、書込時は前記転送プログラムにより前記通信制
御プログラムと前記メモリ制御プログラムとを前記RA
Mに配置し、前記外部の制御装置からのデータを前記プ
ログラム格納用メモリへ転送し書込を行うメモリ書込装
置において、前記プログラム格納用メモリに、前記メモ
リ制御プログラムと前記通信制御プログラムと前記転送
プログラムと書込判定処理手段と書込回数を記憶する書
込回数記憶手段と書込の完了回数を記憶する完了回数記
憶手段とを備えた少なくとも一つの消去書込禁止ブロッ
クを設け、外部の制御装置からのメモリ書込要求に対
し、前記書込判定処理手段は、前記書込回数が所定の回
数以下でかつ前記書込回数と前記完了回数とが一致する
場合にメモリ書込モードとし、前記書込回数を1回分増
加し、書込処理を実行させるとともに、書込完了後は前
記完了回数を1回分増加するようにしている。
A CPU, communication means connected to the CPU for transmitting and receiving data to and from an external control device, and a RAM built in or connected to the CPU and a program storage memory comprising a plurality of blocks. Prepared,
The program storage memory includes a communication control program for controlling communication, a memory control program for erasing and writing the program storage memory, and a transfer program for transferring stored program codes to the RAM. During writing, the transfer program causes the communication control program and the memory control program to be stored in the RA.
M, and transfers data from the external control device to the program storage memory for writing. In the program storage memory, the memory control program, the communication control program, At least one erase / write-inhibiting block comprising a transfer program, a write determination processing means, a write count storage means for storing a write count, and a completion count storage means for storing a write completion count is provided. In response to a memory write request from a control device, the write determination processing means sets a memory write mode when the number of writes is equal to or less than a predetermined number and the number of writes matches the number of completions, The number of times of writing is increased by one time to execute a writing process, and after completion of writing, the number of times of completion is increased by one time.

【0009】また、前記プログラム格納用メモリに書込
まれたプログラムが、実行時に前記書込回数と前記完了
回数とのデータを比較し、不一致時は書込異常と判断す
るとともに、書込んだプログラムを実行させないように
している。
The program written in the program storage memory compares data of the number of times of writing and the number of times of completion at the time of execution. Is not executed.

【0010】また、前記書込回数記憶手段と前記完了回
数記憶手段での記憶データが、不一致の場合は再送され
るまで前記メモリ書込モードを保持するようにしてい
る。
If the data stored in the number-of-writes storage means does not match the data stored in the number-of-completions storage means, the memory write mode is maintained until the data is retransmitted.

【0011】また、前記書込回数記憶手段と前記完了回
数記憶手段とを、書込回数の増加がビットを消去するよ
うにし、消去したビットの数で回数を記憶するようにし
ている。
[0011] Further, the write count storage means and the completion count storage means are configured such that the increase in the write count erases a bit, and the count is stored by the number of erased bits.

【0012】また、前記メモリ書込モードの期間中は、
識別のための表示を行うようにしている。
Further, during the memory write mode,
The display for identification is performed.

【0013】また、前記書込判定処理手段が、パスワー
ド認証手段を備え、パスワードが一致しないときは前記
メモリ書込モードに入らないようにしている。
Further, the write determination processing means includes a password authentication means, and when the passwords do not match, the apparatus does not enter the memory write mode.

【0014】また、前記パスワード認証手段が、前記外
部の制御装置からの書込要求に対しパスコードを発行
し、前記パスコードを元に所定の演算式により求めたパ
スワードと照合するようにしている。
Further, the password authentication means issues a passcode in response to a write request from the external control device, and compares the password with a password obtained by a predetermined arithmetic expression based on the passcode. .

【0015】また、前記パスワード認証手段での認証
を、前記書込回数記憶手段と前記完了回数記憶手段での
記憶データが一致し、かつ所定の回数以下の場合は無効
とするようにしている。
[0015] The authentication by the password authentication means is invalidated when the data stored in the number-of-writes storage means matches the data stored in the number-of-completions storage means and is equal to or less than a predetermined number.

【0016】また、前記メモリ制御プログラムと前記通
信制御プログラムとが、書込前に前記プログラム格納用
メモリの旧データを前記外部の制御装置に転送し、新デ
ータとの差異を検出し、変化のあるブロックのみに消去
と書込を行う機能を選択できるようにしている。
Further, the memory control program and the communication control program transfer old data in the program storage memory to the external control device before writing, detect a difference from new data, and The function of erasing and writing only to a certain block can be selected.

【0017】また、前記通信制御プログラムが、前記外
部制御装置との書込データの転送時にはデータを一旦R
AMに配置し、水平および垂直方向のサムチェックを行
うようにしている。
Further, when the communication control program transfers write data with the external control device, the communication control program temporarily stores the data in the R.
It is arranged in the AM so that sum checks in the horizontal and vertical directions are performed.

【0018】また、前記通信制御プログラムが、前記外
部制御装置との書込データの転送時にはコマンドの送信
時より通信速度を早めるようにしている。
Further, the communication control program increases the communication speed at the time of transferring write data with the external control device as compared with the case of transmitting a command.

【0019】また、前記書込判定処理手段が、メモリ判
定手段を備え、前記プログラム格納用メモリを構成する
メモリ種類の識別を行うようにしている。
Further, the write determination processing means includes a memory determination means, and identifies a type of a memory constituting the program storage memory.

【0020】[0020]

【発明の実施の形態】図1は本発明の実施の形態を示す
一実施例の制御部のブロック図である。この例はプラズ
マディスプレイのような表示装置の制御プログラムをフ
ラッシュメモリで構成されたプログラム格納用メモリに
書込む例を示している。以下に本発明の実施の形態につ
いて図1に基づいて、プログラムの格納用メモリとして
フラッシュメモリを用いた装置のバージョンアップなど
のプログラム変更を行う場合を説明する。1は表示装置
であり、2はCPUであり、3は通信手段である。通信
手段3はRS232Cによるシリアルインタフェースで
あり、外部の制御装置7との指令やデータの送受信を行
う。4はRAMであり、CPU2の制御に必要なレジス
タやデータのバッファなどに使用されている。5はプロ
グラム格納用メモリであり、電気的に消去・書込が可能
なフラッシュメモリを使用している。フラッシュメモリ
で構成されるプログラム格納用メモリ5は内部を例えば
7つのブロックまたはセクタと呼ばれるB1からB7の
ブロックで分割されており、それぞれブロック単位で一
括消去された後、個別のアドレスにデータが書込まれる
ようになっている。6はプログラム格納用メモリ5のブ
ロックB1の内部に格納される書込制御プログラムを示
したもので、内部にはプログラム格納用メモリ5を構成
するフラッシュメモリの消去・書込を制御するメモリ制
御プログラム6a、外部の制御装置7との通信によるデ
ータの送受信を行う通信制御プログラム6b、書込時に
メモリ制御プログラム6aと通信制御プログラム6bな
どをRAMに転送する転送制御プログラム6c、プログ
ラム格納用メモリ5の書込回数を記憶する書込回数記憶
手段6d、書込が完了した場合に書込の完了回数を記憶
する完了回数記憶手段6e、書込判定処理手段6fが格
納されている。書込判定処理手段6fはパスワードの授
受と一致の判断を行うパスワード認証手段6g、プログ
ラム格納用メモリ5がどの種類のメモリが搭載されてい
るか、即ちROMか、RAMか、フラッシュメモリかの
判定を行うメモリ判定手段6hとで構成されており、書
込回数が許容範囲かなどの書込の判定、許諾と書込時に
はメモリ制御プログラム6aと通信制御プログラム6b
などをRAMに転送し実行させ、書込完了時の書込完了
処理などの統括的な書込処理を行う構成としている。な
お、書込回数記憶手段6d、完了回数記憶手段6e、パ
スワード認証手段6g、メモリ判定手段6hの詳細は後
述する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 1 is a block diagram of a control unit according to an embodiment showing an embodiment of the present invention. This example shows an example in which a control program for a display device such as a plasma display is written in a program storage memory constituted by a flash memory. A case where a program change such as an upgrade of an apparatus using a flash memory as a program storage memory will be described below with reference to FIG. 1 is a display device, 2 is a CPU, and 3 is a communication means. The communication unit 3 is a serial interface based on RS232C, and transmits and receives commands and data to and from the external control device 7. Reference numeral 4 denotes a RAM, which is used as a register and a data buffer necessary for controlling the CPU 2. Reference numeral 5 denotes a program storage memory, which uses a flash memory that can be electrically erased and written. The program storage memory 5 composed of a flash memory is internally divided into, for example, seven blocks or blocks called B1 to B7 called sectors, and after each block is collectively erased, data is written to an individual address. Is to be included. Reference numeral 6 denotes a write control program stored in the block B1 of the program storage memory 5, and a memory control program for controlling erasing / writing of a flash memory constituting the program storage memory 5. 6a, a communication control program 6b for transmitting and receiving data by communication with the external control device 7, a transfer control program 6c for transferring the memory control program 6a and the communication control program 6b and the like to the RAM at the time of writing, and a program storage memory 5 A write count storage unit 6d for storing the number of writes, a completion count storage unit 6e for storing the number of write completions when writing is completed, and a write determination processing unit 6f are stored. The write determination processing means 6f determines the type of memory mounted on the program storage memory 5, that is, the ROM, RAM, or flash memory, by means of a password authentication means 6g for giving and receiving a password and determining whether or not the password matches. The memory control program 6a and the communication control program 6b at the time of writing determination such as whether the number of times of writing is within an allowable range, permission and writing.
And the like are transferred to a RAM and executed, and comprehensive writing processing such as writing completion processing at the time of writing completion is performed. The details of the number-of-writes storage unit 6d, the number-of-completions storage unit 6e, the password authentication unit 6g, and the memory determination unit 6h will be described later.

【0021】また、プログラム格納用メモリ5はフラッ
シュメモリを使用する場合、停電時でも内容が保持され
るが、ブロックB1は特に消去書込禁止としており、従
って前述の6aから6hまでのプログラムを含む書込制
御プログラム6は消去書換えされることのないようにし
ている。ただし、書込回数を記憶する書込回数記憶手段
6dと書込が完了した場合に書込の完了回数を記憶する
完了回数記憶手段6eのみは除外としている。詳細につ
いては後述する。以上のような構成で、プログラムの変
更が必要な場合は、外部の制御装置7からの指令によ
り、CPU2は書込判定処理手段6fにより、パスワー
ドやメモリ種類などの判定と書込回数などの条件を判定
し、書込許可とする場合には、転送制御プログラム6c
で書込制御プログラム6の内容をRAM4の所定のアド
レスに転送し、RAM4上で書込制御プログラム6の内
容を実行する。即ち、CPU2は通信手段3を介し通信
制御プログラム6bによりプログラムデータを受信し、
RAM4に一旦バッファしサムチェックを行い、メモリ
制御プログラム6aによりプログラム格納用メモリ5に
プログラムデータを転送し書込を行う。書込完了後、プ
ログラム格納用メモリ5に配置されたプログラムを実行
すればよい。
When a flash memory is used, the contents of the program storage memory 5 are retained even in the event of a power failure, but the block B1 is particularly prohibited from erasing and writing, and therefore includes the programs 6a to 6h. The write control program 6 is designed to prevent erasure and rewriting. However, only the number-of-writes storage means 6d for storing the number of times of writing and the number-of-completions storage means 6e for storing the number of times of completion of writing when the writing is completed are excluded. Details will be described later. In the above-described configuration, when the program needs to be changed, the CPU 2 determines the password and the memory type and determines the conditions such as the number of writes by the write determination processing unit 6f in response to a command from the external control device 7. Is determined, and if the writing is permitted, the transfer control program 6c
To transfer the contents of the write control program 6 to a predetermined address of the RAM 4, and execute the contents of the write control program 6 on the RAM 4. That is, the CPU 2 receives the program data by the communication control program 6b via the communication means 3,
The data is temporarily buffered in the RAM 4, a sum check is performed, and the program data is transferred and written to the program storage memory 5 by the memory control program 6a. After the writing is completed, the program stored in the program storage memory 5 may be executed.

【0022】図2に本発明のメモリ書込方法の制御フロ
ーを示す。図2(a)は書込制御プログラム6の処理フ
ローを示す。実際にはこのプログラムの主要ルーチンは
RAM4に転送されて実行されるが、転送のフローにつ
いては省略する。RAMに転送するのは、フラッシュメ
モリは書込と読出が同時にはできないため、書込を行う
場合には別のメモリに転送して実行する必要があるため
である。図2(b)はプログラムの転送後、プログラム
格納用メモリ5で実行される表示制御プログラムの初期
フローを示している。図2(a)に基づいて説明する。
外部の制御装置7からのプログラム書込要求があった場
合、まずパスワードを受信し照合を行う(ST1)。パ
スワードの照合を行うのは、作業者を限定し、不用意な
書込や書込ミスを極力防止するためであり、パスワード
が一致しない場合は書込禁止とする(ST2)。パスワ
ードが一致した場合、プログラム格納用メモリ5に設け
られた書込回数記憶手段6dに記憶された書込回数を読
出し、メモリの仕様内であるかどうか確認する。本発明
で使用したフラッシュメモリの書込回数は例えば100
回とされており、100回を超えていないことを確認し
(ST3)、100回以上であれば書込禁止あるいは書
込禁止アラームを発するようにしている(ST18)。
100回を超えていなければ書込を許可し、メモリ書込
モード開始とする(ST5)。
FIG. 2 shows a control flow of the memory writing method of the present invention. FIG. 2A shows a processing flow of the write control program 6. Actually, the main routine of this program is transferred to the RAM 4 and executed, but the flow of the transfer is omitted. The reason for transferring to the RAM is that writing and reading cannot be performed simultaneously in the flash memory, so that when writing, it is necessary to transfer to another memory for execution. FIG. 2B shows an initial flow of a display control program executed in the program storage memory 5 after the transfer of the program. This will be described with reference to FIG.
When there is a program write request from the external control device 7, first, a password is received and collation is performed (ST1). The collation of the password is performed in order to limit the number of workers and to prevent inadvertent writing or writing errors as much as possible. If the passwords do not match, writing is prohibited (ST2). When the passwords match, the number of times of writing stored in the number-of-times-of-writing storage means 6d provided in the program storage memory 5 is read, and it is confirmed whether the number is within the specification of the memory. The number of writing times of the flash memory used in the present invention is, for example, 100
It is confirmed that the number of times has not exceeded 100 times (ST3). If the number of times has exceeded 100 times, a write-protection or a write-protection alarm is issued (ST18).
If it does not exceed 100 times, writing is permitted and the memory writing mode is started (ST5).

【0023】メモリ書込モードでは、まず書込回数を1
回分増加させ、書込回数記憶手段6dに記憶させる(S
T6)。次に書込の変更ブロックを抽出する(ST
7)。フラッシュメモリの場合、消去はブロック単位に
行う必要があり、消去、書込回数に制限がある関係上、
書込データに変化のないブロックの書換えは不要とし、
書換えの必要のあるブロックのみを一括消去する(ST
8)。所定ブロックの消去が完了すると(ST9)デー
タ受信を行う(ST10)。データは256バイト単位
で伝送するが、同時にアドレス情報2バイトとサムチェ
ック用データ32バイトを伝送し、16×16バイトの
マトリクス状に一旦RAM4にバッファし、x方向、y
方向それぞれにサムチェックを行っている。サムチェッ
クが不一致の場合は再送要求とし、ST10に戻るよう
にしている(ST11)。サムチェックがOKならフラ
ッシュメモリへの書込を行う(ST12)。なお、書込
時間を短縮するため、データ転送はRAM4に2つのバ
ッファ領域を確保し、1つのバッファにデータ転送中に
も書込を行うようにしている。伝送単位の書込が終了し
(ST13)、さらに全ブロックの書込が終了すると
(ST14)、書込の完了回数記憶手段6eの完了回数
を1回分増加し、記憶するようにしている(ST1
5)。以上一連の処理が完了してメモリ書込モードは解
除され(ST16)、終了する(ST17)。
In the memory write mode, first, the number of times of writing is 1
The number of times is increased and stored in the number-of-writes storage unit 6d (S
T6). Next, a changed block to be written is extracted (ST
7). In the case of flash memory, erasing must be performed in block units, and the number of times of erasing and writing is limited.
It is not necessary to rewrite blocks whose write data does not change.
Batch erase only blocks that need to be rewritten (ST
8). When the erasure of the predetermined block is completed (ST9), data reception is performed (ST10). The data is transmitted in units of 256 bytes. At the same time, 2 bytes of address information and 32 bytes of sum check data are transmitted and temporarily buffered in the RAM 4 in a matrix of 16 × 16 bytes.
Thumb checks are performed in each direction. If the sum checks do not match, a retransmission request is made, and the process returns to ST10 (ST11). If the sum check is OK, writing to the flash memory is performed (ST12). In order to shorten the writing time, two buffer areas are secured in the RAM 4 for data transfer, and data is written to one buffer even during data transfer. When the writing of the transmission unit is completed (ST13), and when the writing of all the blocks is completed (ST14), the completion number of the writing completion number storage means 6e is increased by one and stored (ST1).
5). After the above series of processing is completed, the memory write mode is released (ST16), and the process ends (ST17).

【0024】次に図2(b)について説明する。図2
(b)はプログラム格納用メモリ5に書込・格納された
表示制御プログラムの初期のスタート部分の処理フロー
を示している。まず、書込回数記憶手段6dに記憶され
た書込回数を読み出す(ST21)。次に完了回数記憶
手段6eに記憶された完了回数を読出し(ST22)、
両者を比較する(ST23)。両者が一致していればプ
ログラムの書込が無事完了していることを意味し、以降
の表示制御プログラムは実行される(ST24)。一致
していなければ、何らかの要因でプログラムの書込が中
断したことと判断できるので、メモリ書込モード状態と
し(ST25)、外部の制御装置7に対しデータの再送
要求を行い(ST26)、データ受信の待機状態を維持
するようにしている(ST27)。
Next, FIG. 2B will be described. FIG.
3B shows a processing flow of an initial start portion of the display control program written and stored in the program storage memory 5. First, the number of times of writing stored in the number-of-times-of-writing storage means 6d is read (ST21). Next, the number of completions stored in the number-of-completions storage means 6e is read (ST22),
The two are compared (ST23). If they match, it means that the writing of the program has been completed successfully, and the subsequent display control program is executed (ST24). If they do not match, it can be determined that the writing of the program has been interrupted for some reason. Therefore, the state is set to the memory writing mode (ST25), and a request for retransmission of data is made to the external control device 7 (ST26). The reception standby state is maintained (ST27).

【0025】図3はプログラム格納用メモリ5の書込回
数を判定する場合の説明図を示す。フラッシュメモリは
ビットデータが0のビットに1を書込むことはできない
が、ビットデータ1のビットに0を書込むことが可能で
あることを利用している。書込回数記憶手段6dと完了
回数記憶手段6eとは、具体的にはレジスタであり、カ
ウント機能を持たせたものであり、フラッシュメモリの
消去禁止ブロックに配置している。従って、製造当初か
らの書込回数が確実に管理できるようにしている。書込
回数の記憶は所定のメモリの1ビットを1回の回数とし
て下位ビットLSBからそれぞれの回数を管理してい
る。100回分を記憶するにはそれぞれ100ビット、
計32バイトを要するが、プログラム格納用メモリ5の
ブロックB1は特殊用途で空きもあり、1Kバイト程度
の十分な空き領域を確保している。図3の(1)は書込
前の書込回数記憶手段6dに記憶された書込回数と完了
回数記憶手段6eに記憶された書込の完了回数とを示し
ており、図の例ではそれぞれ3回の書込履歴があること
を示している。図3の(2)はメモリ書込モード中、即
ち書込中の状態を示し、書込回数が 4回で、完了回数が
3回のままであることを示している。従って、このよう
な状態で書込が中断すると、書込回数と完了回数とが異
なり、従って、プログラムの書込が不完全であることが
判定でき、不良プログラムの実行を防止し、暴走を防ぐ
ことができる。図3(3)は書込が完了した状態を示
し、それぞれ4回と一致しているので、正常に書込が完
了していると判断され、書込んだプログラムが実行可能
なことを意味している。
FIG. 3 is an explanatory diagram in the case where the number of times of writing in the program storage memory 5 is determined. The flash memory utilizes the fact that it is not possible to write 1 to a bit of bit data 0, but it is possible to write 0 to a bit of bit data 1. The number-of-writes storage means 6d and the number-of-completions storage means 6e are specifically registers and have a counting function, and are arranged in erasure-inhibited blocks of the flash memory. Therefore, the number of writings from the beginning of manufacturing can be reliably managed. For the storage of the number of times of writing, one bit of a predetermined memory is regarded as one time and each number is managed from the lower bit LSB. To store 100 times, 100 bits each,
Although a total of 32 bytes are required, the block B1 of the program storage memory 5 has a free space for special use, and a sufficient free space of about 1 Kbyte is secured. FIG. 3A shows the number of times of writing stored in the number-of-writings storage means 6d before writing and the number of times of completion of writing stored in the number-of-completions storage means 6e. In the example of FIG. This indicates that there are three write histories. FIG. 3B shows the state during the memory write mode, that is, the state during the write, and shows that the number of times of writing is four and the number of times of completion is three. Therefore, if the writing is interrupted in such a state, the number of times of writing and the number of times of completion are different, so that it can be determined that the writing of the program is incomplete, and the execution of the defective program is prevented, and the runaway is prevented. be able to. FIG. 3C shows a state in which the writing has been completed. Since each of these matches four times, it is determined that the writing has been completed normally, meaning that the written program can be executed. ing.

【0026】なお、メモリ書込モード中は表示装置の電
源ランプの緑、赤をそれぞれ異なる周期で連続的に点滅
を繰り返すようにして他のモードと明確に区別するよう
にしているので、作業者に対して注意を喚起することが
できる。この様な表示の場合、作業者は何らかの書込異
常と判断し、不具合の調査、確認後、書込作業のやり直
しを行うようにしている。
In the memory writing mode, the green and red power lamps of the display device are repeatedly blinked continuously at different periods so as to be clearly distinguished from other modes. You can call attention. In the case of such a display, the operator determines that there is some kind of writing error, and investigates and confirms a defect, and then performs the writing operation again.

【0027】図4は表示装置1と外部の制御装置7との
パスワードの授受を行うパスワード認定手段6gの制御
方法を説明する制御フローである。図4に基づいて説明
する。一般的なパスワードの授受は特定のパスワードを
決めておき、送信側と受信側とが一致するかどうかを判
定しているが、本発明のメモリ書込装置およびその書込
方法では以下に述べる方法としている。まず、外部の制
御装置7が表示装置に対しメモリの書込要求を行う(S
T31)。表示装置1では書込要求を受信すると(ST
32)、まず内部でパスコードを抽出し、送信する(S
T33)。パスコードはランダム関数発生装置から抽出
しており、操作の都度異なるものとしている。外部の制
御装置7ではパスコードを受信すると(ST34)パス
コードに基づき一定の手順と演算式によりパスワードを
算出し(ST36)、算出したパスワードを表示装置1
に送信する(ST37)。このパスワードの算出プログ
ラムは同一のものが表示装置1にも内蔵されており、表
示装置1でもパスワードを算出し(ST35)、受信し
たパスワードと照合し(ST38)、パスワード照合結
果を外部の制御装置7に送信する(ST39)。外部の
制御装置7では受信したパスワード照合結果によりパス
ワードが一致しているとされた場合はデータ送信処理の
ステップ(ST41)に進み、不一致の場合はST31
に戻り、必要に応じて再度書込要求を行うようにしてい
る。表示装置1では、パスワードが一致した場合(ST
42)、データ受信のステップ(ST43)に進み、不
一致の場合はST32の待機状態に戻るようにしてい
る。
FIG. 4 is a control flow for explaining a control method of the password authentication means 6g for exchanging passwords between the display device 1 and the external control device 7. A description will be given based on FIG. For general password transfer, a specific password is determined in advance, and it is determined whether or not the transmitting side and the receiving side match. In the memory writing device and the writing method of the present invention, the following method is used. And First, the external control device 7 issues a memory write request to the display device (S
T31). When the display device 1 receives the write request (ST
32) First, a passcode is internally extracted and transmitted (S)
T33). The passcode is extracted from the random function generator and is different each time the operation is performed. When the external control device 7 receives the passcode (ST34), it calculates a password based on the passcode by a certain procedure and an arithmetic expression (ST36), and displays the calculated password on the display device 1.
(ST37). The same program for calculating the password is also incorporated in the display device 1, and the display device 1 also calculates the password (ST35), collates the received password with the received password (ST38), and outputs the password collation result to an external control device. 7 (ST39). The external control device 7 proceeds to the data transmission process step (ST41) if the passwords match according to the received password collation result, and ST31 if the passwords do not match.
And a write request is made again if necessary. In the display device 1, when the passwords match (ST
42), the process proceeds to the data receiving step (ST43), and if there is no match, the process returns to the standby state of ST32.

【0028】以上のようなパスワードの認証方法をとる
ことにより、プログラム変更などの版数管理をより確実
なものとしている。従来の単なるパスワードのみの管理
方法ではパスワードのみの流出により不特定の作業者が
プログラムの書換えを実行する恐れがあった。本発明に
よれば、表示装置内のプログラムと全く同一のプログラ
ムを内蔵した書込プログラムを所有している特定の担当
者によってのみ書込作業を可能とするようにしている。
また、バージョン毎や、OEMなど販売先毎に書込プロ
グラムを換えたり、通常のパスワードと組み合わせるこ
とでより厳重な版数管理を行うこともできる。
By adopting the password authentication method as described above, version number management such as program change can be made more reliable. In the conventional management method using only a password, there is a risk that an unspecified operator may rewrite a program due to leakage of only the password. According to the present invention, the writing operation can be performed only by a specific person who owns a writing program containing the same program as the program in the display device.
In addition, more strict version number management can be performed by changing the writing program for each version or each sales destination such as an OEM, or by combining with a normal password.

【0029】なお、本発明によるメモリ書込方法では、
書込回数が 3回より少ない場合、パスワードの認証ステ
ップをパスし、パスワードがなくても書込が行えるよう
にしている。これは、工場での工程での調整時と最終出
荷時のプログラムデータとが異なる場合があることと、
工場では作業者や手順は限定しており、パスワード入力
などの余分な労力を軽減するためである。従って、出荷
時には書込回数および完了回数は3以上の数値になるよ
うにしている。
In the memory writing method according to the present invention,
If the number of times of writing is less than three, the password authentication step is passed so that writing can be performed without a password. This is because the program data at the time of adjustment in the factory process and the final shipment may be different,
In a factory, workers and procedures are limited, so that unnecessary labor such as inputting a password is reduced. Therefore, at the time of shipment, the number of times of writing and the number of times of completion are set to numerical values of 3 or more.

【0030】なお、プログラムデータを書換える場合、
書込処理の前にプログラム格納用メモリ5に格納された
旧データのバージョンを読出し、外部の制御装置7に転
送し、書換えようとする新データとのバージョンとの比
較を行っているが、それに加えて、プログラム格納用メ
モリ5に格納された旧データそのものを読出し、外部の
制御装置7に転送し、書換えようとする新データの内容
との比較を行う機能を選択できるようにしている。比較
の結果、変更のあるブロックのみを書換え対象とするよ
うにしている。このようにすることで、同一データを重
ねて書込むミスを防止することができ、書込ブロックを
必要最小限に抑えることで寿命的にも延命をはかること
ができる。
When rewriting the program data,
Prior to the writing process, the version of the old data stored in the program storage memory 5 is read, transferred to the external control device 7, and compared with the version of the new data to be rewritten. In addition, it is possible to select a function of reading the old data itself stored in the program storage memory 5, transferring the old data to the external control device 7, and comparing it with the contents of the new data to be rewritten. As a result of the comparison, only the blocks that have changed are targeted for rewriting. By doing so, it is possible to prevent mistakes in writing the same data repeatedly, and it is possible to extend the service life by minimizing the number of write blocks to a necessary minimum.

【0031】図5はプログラムデータの転送時のサムチ
ェックを説明する図である。転送されるプログラムデー
タは一旦、RAM4の所定のバッファ領域にマトリクス
状に格納される。バッファ領域はメモリへの書込中も同
時に転送するように2系統用意しているが、図では1系
統を示している。図5の中の数値は転送されたデータの
格納される順番を示している。図のように256バイト
のデータを16バイト×16バイトのマトリクス状に配
置している。転送されるデータには256バイトのデー
タの転送後に水平方向がx1からx16までの16バイ
ト、垂直方向がy1からy16までの16バイトのチェ
ックサムが転送され、それぞれサムチェックを行うよう
にしている。サムチェックを水平方向x、垂直方向yで
行うことでより信頼性を高めるようにしている。なお、
データ転送中のチェックを厳重に行うことにより、RA
M4へのデータの転送中はコマンドの送受信に比較して
2倍に通信速度を上げており、転送時間を短縮するよう
にしている。
FIG. 5 is a diagram for explaining a sum check when transferring program data. The transferred program data is temporarily stored in a predetermined buffer area of the RAM 4 in a matrix. Although two systems are prepared for the buffer area so that they can be transferred simultaneously during writing to the memory, only one system is shown in the figure. Numerical values in FIG. 5 indicate the order in which the transferred data is stored. As shown in the figure, 256 bytes of data are arranged in a matrix of 16 bytes × 16 bytes. After the transfer of 256 bytes of data, a 16-byte checksum of x1 to x16 in the horizontal direction and a 16-byte checksum of y1 to y16 in the vertical direction are transferred to the transferred data, and each checksum is performed. . The reliability is further improved by performing the sum check in the horizontal direction x and the vertical direction y. In addition,
By performing strict checks during data transfer, RA
During the transfer of data to M4, the communication speed is doubled as compared with the transmission and reception of the command, so that the transfer time is shortened.

【0032】図6はプログラム格納用メモリ5のメモリ
の種類を判定するメモリ判定手段6hでの判定方法を説
明する図である。書込を行うプログラム格納用メモリ5
の特定の1および0を含むアドレスにデータ内容のビッ
トを反転するように書込を実行し、その結果によりメモ
リの種類を判定するようにしている。プログラム格納用
メモリ5はROM、RAMやフラッシュメモリのような
電気的に書込が可能なメモリのいずれでも使用が可能で
あり、それらが混在する場合もあり、あるいは、開発当
初はROMで行い、フラッシュメモリに移行する場合や
その逆の場合も考えられる。以下に説明する方法はメモ
リが混在する場合でも判定可能な方法の一例を示してい
る。図6(1)はROMの場合を示しており、書込前の
データに対し、反転データを書込もうとしても不可能で
あり、書込前と書込後は同じデータとなる。図6(2)
はフラッシュメモリの場合を示しており、ビットデータ
1は0に書込可能であるが、ビットデータ0を1にする
ことはできない。ビットデータを1にするのは消去コマ
ンドのみであるからである。従って、ビットデータ1が
0に変化するかどうかで識別が可能となる。図6(3)
はRAMの場合であり、反転書込は可能であることから
RAMと判定することができる。以上のような判定方法
を採用することで、書込制御プログラム6は共通とした
まま、プログラム格納用メモリ5に使用するメモリの選
定が自由となり、また、ROMにデータを書込むような
不要な作業を省略でき、必要なメモリ部分にのみ書込を
行うようにすることができる。
FIG. 6 is a view for explaining a determination method by the memory determination means 6h for determining the type of the memory of the program storage memory 5. Program storage memory 5 for writing
Is written so as to invert the bit of the data content to the address including the specific 1 and 0, and the type of the memory is determined based on the result. The program storage memory 5 may be any of electrically writable memories such as a ROM, a RAM, and a flash memory. In some cases, these may be mixed, or at the beginning of development, the ROM may be used. The case of shifting to a flash memory and vice versa may be considered. The method described below shows an example of a method that can be determined even when memories are mixed. FIG. 6A shows a case of a ROM. It is impossible to write inverted data with respect to data before writing, and the same data is obtained before and after writing. Fig. 6 (2)
Shows the case of a flash memory. Bit data 1 can be written to 0, but bit data 0 cannot be set to 1. The bit data is set to 1 because only the erase command is used. Therefore, it is possible to identify whether bit data 1 changes to 0. FIG. 6 (3)
Is the case of a RAM, and can be determined as a RAM since reverse writing is possible. By employing the above-described determination method, it is possible to freely select a memory to be used for the program storage memory 5 while keeping the write control program 6 common, and it is not necessary to write data into the ROM. The operation can be omitted, and writing can be performed only in a necessary memory portion.

【0033】また、プログラム格納用メモリ5に書込ま
れるプログラムは、例えばたった1カ所のプログラムコ
ードの増減があっても、構成によってはその変更箇所以
降のプログラムの配置がずれ、全ブロックが書換えの対
象となってしまう場合や、変更の対象となるプログラム
を直接参照するプログラムを含む全てのブロックが書換
えの対象となってしまう。これらの要因による消去・書
換え回数を抑えるため、プログラム格納用メモリ5に配
置させるプログラムは各ブロック単位に完結して配置さ
れ、かつ、外部のブロックから参照される各ブロック毎
の内部の主要プログラムへは特定の場所に配置したジャ
ンプテーブルを経由して参照するようにしている。ジャ
ンプテーブルの内容は変更があってもジャンプテーブル
自体に変更がなければ変更は対象のブロック内のみに限
定され、消去・書換え回数を抑えることができる。以
上、本発明の一実施例について説明したが、本発明はこ
の実施の形態に限られるものではなく、その要旨を逸脱
しない範囲でさらに種々の形態を採用することができる
のはいうまでもない。
In the program written in the program storage memory 5, even if only one program code is increased or decreased, for example, depending on the configuration, the arrangement of the program after the changed part is shifted, and all blocks are rewritten. All blocks including a program that directly becomes a target or a program that directly refers to a program to be changed become a target of rewriting. In order to reduce the number of times of erasing and rewriting due to these factors, the program to be arranged in the program storage memory 5 is completely arranged in units of blocks, and is transferred from the external block to the internal main program of each block. Is referred to via a jump table arranged at a specific location. Even if the content of the jump table is changed, if the jump table itself is not changed, the change is limited to only the target block, and the number of erasures / rewrites can be reduced. As mentioned above, although one Example of this invention was described, this invention is not limited to this Embodiment, It cannot be overemphasized that various forms can be employ | adopted in the range which does not deviate from the summary. .

【0034】[0034]

【発明の効果】以上説明したように、本発明によるメモ
リ書込装置およびその書込方法によれば、プログラム格
納用メモリに、少なくとも一つの消去書込禁止ブロック
を設け、該消去書込禁止ブロックに、メモリ制御プログ
ラムと通信制御プログラムとを配置しパスワード認証手
段を有する書込判定処理手段と書込回数を記憶する書込
回数記憶手段と書込完了回数を記憶する完了回数記憶手
段とを設け、外部の制御装置からのメモリ書込要求に対
し、パスワードと書込回数記憶手段の書込回数を判定す
るようにし、書込後のプログラムの実行時には書込回数
記憶手段と完了回数記憶手段とのデータの一致により書
込が完了したかを判定するようしたことで、不慣れな作
業者が不用意な書込操作を行ったり、書込作業中の電源
異常や、メモリ素子の書込回数が制限をオーバーするな
どにより、プログラムの書込が不完全に行われることを
極力防止し、プログラムのバージョンアップや変更が容
易で信頼性の高いメモリ書込装置およびその書込方法を
提供することができる。
As described above, according to the memory writing device and the writing method thereof according to the present invention, at least one erase / write inhibit block is provided in the program storage memory, and the erase / write inhibit block is provided. A memory control program, a communication control program, and a write determination processing unit having a password authentication unit; a write count storage unit for storing the write count; and a completion count storage unit for storing the write completion count. In response to a memory write request from an external control device, the password and the number of times of writing in the number-of-writes storing means are determined. By judging whether or not writing has been completed by matching of the data, an inexperienced operator may perform an inadvertent writing operation, a power supply error during writing, or a memory element failure. Incomplete writing of a program due to, for example, the number of times of writing exceeding the limit is prevented as much as possible, and it is easy to upgrade and change the program, and a highly reliable memory writing device and its writing method are provided. Can be provided.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明によるメモリ書込装置およびその書込方
法の一実施例を示すブロック図である。
FIG. 1 is a block diagram showing one embodiment of a memory writing device and a writing method according to the present invention.

【図2】本発明によるメモリ書込装置およびその書込方
法の一実施例の制御フローである。
FIG. 2 is a control flow of an embodiment of a memory writing device and a writing method according to the present invention.

【図3】本発明によるメモリ書込装置およびその書込方
法の書込み回数の説明図である。
FIG. 3 is an explanatory diagram of the number of times of writing in the memory writing device and the writing method according to the present invention.

【図4】本発明によるメモリ書込装置およびその書込方
法のパスワードの送受信を説明するための説明図であ
る。
FIG. 4 is an explanatory diagram for explaining transmission and reception of a password in the memory writing device and the writing method according to the present invention;

【図5】本発明によるメモリ書込装置およびその書込方
法のデータのチェック方法を説明するための説明図であ
る。
FIG. 5 is an explanatory diagram for explaining a memory writing device and a data checking method of the writing method according to the present invention;

【図6】本発明によるメモリ書込装置およびその書込方
法のメモリ種類の判定方法を説明するための説明図であ
る。
FIG. 6 is an explanatory diagram for explaining a memory writing device and a method of determining a memory type in the writing method according to the present invention;

【図7】従来の一実施例を示すブロック図である。FIG. 7 is a block diagram showing a conventional example.

【符号の説明】[Explanation of symbols]

1 表示装置 2 CPU 3 通信手段 4 RAM 5 プログラム格納用メモリ 6 書込制御プログラム 6a メモリ制御プログラム 6b 通信制御プログラム 6c 転送制御プログラム 6d 書込回数記憶手段 6e 完了回数記憶手段 6f 書込判定処理手段 6g パスワード認証手段 6h メモリ判定手段 7 制御装置 51 表示装置 52 CPU 53 通信手段 54 RAM 55 プログラム格納用メモリ 56 書込制御プログラム 56a メモリ制御プログラム 56b 通信制御プログラム 56c 転送制御プログラム B1〜B7 ブロック B51〜B57 ブロック DESCRIPTION OF SYMBOLS 1 Display apparatus 2 CPU 3 Communication means 4 RAM 5 Program storage memory 6 Write control program 6a Memory control program 6b Communication control program 6c Transfer control program 6d Number of times of writing storage means 6e Number of times of completion storage means 6f Write determination processing means 6g Password authentication means 6h Memory determination means 7 Control device 51 Display device 52 CPU 53 Communication means 54 RAM 55 Program storage memory 56 Write control program 56a Memory control program 56b Communication control program 56c Transfer control program B1-B7 blocks B51-B57 blocks

Claims (15)

【特許請求の範囲】[Claims] 【請求項1】 CPUと、前記CPUに接続され外部の
制御装置とデータの送受信を行うための通信手段と、前
記CPUに内蔵もしくは接続されたRAMと、複数のブ
ロックからなるプログラム格納用メモリとを備え、前記
プログラム格納用メモリには、通信を制御する通信制御
プログラムと前記プログラム格納用メモリの消去及び書
込を行うためのメモリ制御プログラムと記憶されたプロ
グラムコードをRAMに転送する転送プログラムとを有
し、書込時は前記転送プログラムにより前記通信制御プ
ログラムと前記メモリ制御プログラムとを前記RAMに
配置し、前記外部の制御装置からのデータを前記プログ
ラム格納用メモリへ転送し書込を行うメモリ書込装置に
おいて、前記プログラム格納用メモリに、前記メモリ制
御プログラムと前記通信制御プログラムと前記転送プロ
グラムと書込判定処理手段と書込回数を記憶する書込回
数記憶手段と書込の完了回数を記憶する完了回数記憶手
段とを備えた少なくとも一つの消去書込禁止ブロックを
設けることを特徴とするメモリ書込装置。
1. A CPU, communication means connected to the CPU for transmitting and receiving data to and from an external control device, RAM built in or connected to the CPU, and a program storage memory comprising a plurality of blocks. A communication control program for controlling communication, a memory control program for erasing and writing the program storage memory, and a transfer program for transferring the stored program code to the RAM. When writing, the communication control program and the memory control program are arranged in the RAM by the transfer program, and data from the external control device is transferred to the program storage memory and written. In the memory writing device, the memory for storing the program may be stored in the memory for storing the program. At least one erasure / write-inhibition block comprising a communication control program, the transfer program, write determination processing means, a write count storage means for storing a write count, and a completion count storage means for storing a write completion count. A memory writing device.
【請求項2】 前記プログラム格納用メモリを、電気的
消去・書込が可能な不揮発性メモリで構成することを特
徴とする請求項1記載のメモリ書込装置。
2. The memory writing device according to claim 1, wherein the memory for storing the program is constituted by an electrically erasable / writable nonvolatile memory.
【請求項3】 前記プログラム格納用メモリに書込まれ
るプログラムが、消去回数を抑えるため、前記プログラ
ム格納用メモリの各ブロック単位に完結して配置され、
外部のブロックから参照される各ブロック毎に内部の主
要プログラムへのジャンプテーブルを備えることを特徴
とする請求項1または2記載のメモリ書込装置。
3. The program to be written into the program storage memory is completely arranged in each block unit of the program storage memory in order to reduce the number of erasures.
3. The memory writing device according to claim 1, further comprising a jump table to an internal main program for each block referenced from an external block.
【請求項4】 CPUと、前記CPUに接続され外部の
制御装置とデータの送受信を行うための通信手段と、前
記CPUに内蔵もしくは接続されたRAMと複数のブロ
ックからなるプログラム格納用メモリとを備え、前記プ
ログラム格納用メモリには、通信を制御する通信制御プ
ログラムと前記プログラム格納用メモリの消去及び書込
を行うためのメモリ制御プログラムと記憶されたプログ
ラムコードをRAMに転送する転送プログラムとを有
し、書込時は前記転送プログラムにより前記通信制御プ
ログラムと前記メモリ制御プログラムとを前記RAMに
配置し、前記外部の制御装置からのデータを前記プログ
ラム格納用メモリへ転送し書込を行うメモリ書込装置に
おいて、前記プログラム格納用メモリに、前記メモリ制
御プログラムと前記通信制御プログラムと前記転送プロ
グラムと書込判定処理手段と書込回数を記憶する書込回
数記憶手段と書込の完了回数を記憶する完了回数記憶手
段とを備えた少なくとも一つの消去書込禁止ブロックを
設け、外部の制御装置からのメモリ書込要求に対し、前
記書込判定処理手段は、前記書込回数が所定の回数以下
でかつ前記書込回数と前記完了回数とが一致する場合に
メモリ書込モードとし、前記書込回数を1回分増加し、
書込処理を実行させるとともに、書込完了後は前記完了
回数を1回分増加することを特徴とするメモリ書込方
法。
4. A CPU, communication means connected to the CPU for transmitting and receiving data to and from an external control device, and a RAM built in or connected to the CPU and a program storage memory comprising a plurality of blocks. The program storage memory includes a communication control program for controlling communication, a memory control program for erasing and writing the program storage memory, and a transfer program for transferring stored program codes to the RAM. A memory for arranging the communication control program and the memory control program in the RAM according to the transfer program at the time of writing, and transferring data from the external control device to the program storage memory for writing In the writing device, the memory for storing the program may be stored in the memory for storing the program. At least one erasure write-inhibit block including a communication control program, the transfer program, write determination processing means, a write count storage means for storing a write count, and a completion count storage means for storing a write completion count. In response to a memory write request from an external control device, the write determination processing means sets a memory when the number of writes is equal to or less than a predetermined number and the number of writes matches the number of completions. A writing mode, and increasing the number of writings by one,
A memory writing method for executing a writing process and increasing the number of completions by one after the writing is completed.
【請求項5】 前記プログラム格納用メモリに書込まれ
たプログラムが、実行時に前記書込回数と前記完了回数
とのデータを比較し、不一致時は書込異常と判断すると
ともに、書込んだプログラムを実行させないようにする
ことを特徴とする請求項4記載のメモリ書込方法。
5. The program written in the program storage memory compares data of the number of times of writing and the number of times of completion when executing the program, and when the program does not match, determines that a writing error has occurred and writes the written program. 5. The memory writing method according to claim 4, wherein the method is not executed.
【請求項6】 前記書込回数記憶手段と前記完了回数記
憶手段での記憶データが、不一致の場合は再送されるま
で前記メモリ書込モードを保持することを特徴とする請
求項4または5記載のメモリ書込方法。
6. The memory write mode is held until the data stored in the number-of-writes storage means and the data stored in the number-of-completions storage means do not match, until the data is retransmitted. Memory writing method.
【請求項7】 前記書込回数記憶手段と前記完了回数記
憶手段とを、書込回数の増加がビットを消去するように
し、消去したビットの数で回数を記憶する構成とするこ
とを特徴とする請求項4ないし6記載のメモリ書込方
法。
7. The memory according to claim 1, wherein said number-of-writes storage means and said number-of-completions storage means are configured such that an increase in the number of writes erases a bit, and stores the number of times as the number of erased bits. 7. The memory writing method according to claim 4, wherein:
【請求項8】 前記メモリ書込モードの期間中は、識別
のための表示を行うことを特徴とする請求項4ないし7
記載のメモリ書込方法。
8. A display for identification is performed during the memory writing mode.
The memory writing method described in the above.
【請求項9】 前記書込判定処理手段が、パスワード認
証手段を備え、パスワードが一致しないときは前記メモ
リ書込モードに入らないことを特徴とする請求項4ない
し8記載のメモリ書込方法。
9. The memory writing method according to claim 4, wherein said writing determination processing means includes a password authentication means, and does not enter the memory writing mode when the passwords do not match.
【請求項10】 前記パスワード認証手段が、前記外部
の制御装置からの書込要求に対しパスコードを発行し、
前記パスコードを元に所定の演算式により求めたパスワ
ードと照合するようにしたことを特徴とする請求項9記
載のメモリ書込方法。
10. The password authentication unit issues a passcode in response to a write request from the external control device,
10. The memory writing method according to claim 9, wherein the password is collated with a password obtained by a predetermined arithmetic expression based on the passcode.
【請求項11】 前記パスワード認証手段での認証を、
前記書込回数記憶手段と前記完了回数記憶手段での記憶
データが一致し、かつ所定の回数以下の場合は無効とす
ることを特徴とする請求項9または10記載のメモリ書
込方法。
11. The authentication by the password authentication means,
11. The memory writing method according to claim 9, wherein when the data stored in the number-of-writes storage means matches the data stored in the number-of-completions storage means and is equal to or less than a predetermined number, the memory write method is invalidated.
【請求項12】 前記メモリ制御プログラムと前記通信
制御プログラムとが、書込前に前記プログラム格納用メ
モリの旧データを前記外部の制御装置に転送し、新デー
タとの差異を検出し、変化のあるブロックのみに消去と
書込を行う機能を選択できることを特徴とする請求項4
ないし8記載のメモリ書込方法。
12. The memory control program and the communication control program transfer old data in the program storage memory to the external control device before writing, detect a difference from new data, and 5. The function of erasing and writing only in a certain block can be selected.
9. The memory writing method according to any one of claims 8 to 8.
【請求項13】 前記通信制御プログラムが、前記外部
制御装置との書込データの転送時にはデータを一旦RA
Mに配置し、水平および垂直方向のサムチェックを行う
ことを特徴とする請求項4ないし8記載のメモリ書込方
法。
13. The communication control program according to claim 1, wherein the transfer of the write data to and from the external control device causes the data to be temporarily stored in the RA.
9. The memory writing method according to claim 4, wherein the memory writing method is arranged at M and a sum check in the horizontal and vertical directions is performed.
【請求項14】 前記通信制御プログラムが、前記外部
制御装置との書込データの転送時にはコマンドの送信時
より通信速度を早めることを特徴とする請求項12また
は13記載のメモリ書込方法。
14. The memory writing method according to claim 12, wherein the communication control program increases a communication speed at the time of transfer of write data with the external control device compared with the time of command transmission.
【請求項15】 前記書込判定処理手段が、メモリ判定
手段を備え、前記プログラム格納用メモリを構成するメ
モリ種類の識別を行うことを特徴とする請求項4ないし
8記載のメモリ書込方法。
15. The memory writing method according to claim 4, wherein said write determination processing means includes a memory determination means, and identifies a memory type constituting the program storage memory.
JP11233519A 1999-08-20 1999-08-20 Device and method for write for memory Pending JP2001056787A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11233519A JP2001056787A (en) 1999-08-20 1999-08-20 Device and method for write for memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11233519A JP2001056787A (en) 1999-08-20 1999-08-20 Device and method for write for memory

Publications (1)

Publication Number Publication Date
JP2001056787A true JP2001056787A (en) 2001-02-27

Family

ID=16956313

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11233519A Pending JP2001056787A (en) 1999-08-20 1999-08-20 Device and method for write for memory

Country Status (1)

Country Link
JP (1) JP2001056787A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003068019A (en) * 2001-08-28 2003-03-07 Nec Corp Optical disk device, firmware rewriting method thereof and program thereof
JP2005175739A (en) * 2003-12-10 2005-06-30 Nec Corp Built-in software rewriting method and mobile radio apparatus
JP2007507016A (en) * 2003-06-24 2007-03-22 ローベルト ボッシュ ゲゼルシャフト ミット ベシュレンクテル ハフツング Software update method for electronic control device by flash programming via serial interface and state automatic device corresponding thereto
JP2008047136A (en) * 2007-08-27 2008-02-28 Nikon Corp Information processor
US7600158B2 (en) 2003-08-29 2009-10-06 Canon Kabushiki Kaisha Electronic apparatus for which program is rewritable and program rewriting method
WO2015098894A1 (en) * 2013-12-27 2015-07-02 住友電装株式会社 Data storage device, vehicle-mounted data storage device, and data storage method
WO2019123747A1 (en) * 2017-12-19 2019-06-27 日立オートモティブシステムズ株式会社 Electronic control device for automobile and control method thereof

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003068019A (en) * 2001-08-28 2003-03-07 Nec Corp Optical disk device, firmware rewriting method thereof and program thereof
JP2007507016A (en) * 2003-06-24 2007-03-22 ローベルト ボッシュ ゲゼルシャフト ミット ベシュレンクテル ハフツング Software update method for electronic control device by flash programming via serial interface and state automatic device corresponding thereto
US7600158B2 (en) 2003-08-29 2009-10-06 Canon Kabushiki Kaisha Electronic apparatus for which program is rewritable and program rewriting method
JP2005175739A (en) * 2003-12-10 2005-06-30 Nec Corp Built-in software rewriting method and mobile radio apparatus
JP2008047136A (en) * 2007-08-27 2008-02-28 Nikon Corp Information processor
JP4720804B2 (en) * 2007-08-27 2011-07-13 株式会社ニコン Information processing device
WO2015098894A1 (en) * 2013-12-27 2015-07-02 住友電装株式会社 Data storage device, vehicle-mounted data storage device, and data storage method
WO2019123747A1 (en) * 2017-12-19 2019-06-27 日立オートモティブシステムズ株式会社 Electronic control device for automobile and control method thereof
JP2019109745A (en) * 2017-12-19 2019-07-04 日立オートモティブシステムズ株式会社 Automobile electronic controller

Similar Documents

Publication Publication Date Title
US6601132B2 (en) Nonvolatile memory and method of writing data thereto
EP1548602B1 (en) Non-volatile storage device control method
KR100991718B1 (en) Detecting partially erased units in flash devices
KR100622349B1 (en) Flash Memory for performing Bad Block Management and Method for performing Bad Block Management of Flash Memory
US6883060B1 (en) Microcomputer provided with flash memory and method of storing program into flash memory
US7290097B2 (en) Nonvolatile memory
US20010036114A1 (en) Semiconductor memory device having faulty cells
US7903474B2 (en) Redundant purge for flash storage device
JP4480815B2 (en) Memory rewriting method and computer system
JP4158526B2 (en) Memory card and data writing method to memory
JP2001056787A (en) Device and method for write for memory
JP4776462B2 (en) Portable electronic device and method for controlling portable electronic device
JP2004519057A (en) Method of storing data amount in target memory area and storage system
JP6040895B2 (en) Microcomputer and non-volatile memory block management method
JP4060245B2 (en) MEMORY MANAGEMENT DEVICE AND IC CARD HAVING THE SAME
JP3620478B2 (en) Storage device, data processing system using the storage device, and data read method
JPH0729392A (en) Nonvolatile semiconductor memory and semiconductor disk device using the same
JP4031693B2 (en) Nonvolatile memory and data storage device having the same
JP2001154926A (en) Storage method using flash memory and recording medium recording storage control program
JP2006107363A (en) Portable electronic device and memory access method used in the same
JP4575112B2 (en) Firmware rewriting method, disk drive device, and information processing system
JP2008305263A (en) Nonvolatile semiconductor storage device and memory management method
JP2003108445A (en) Portable electric device and method of checking the device
JPH10177527A (en) Method for writing and reading-out data in and from flash memory, and storage device using the memory
JP2005338924A (en) Nonvolatile memory to be used for portable electronic equipment and portable electronic equipment