JP6898186B2 - How to write control devices for automobiles and non-volatile memory - Google Patents

How to write control devices for automobiles and non-volatile memory Download PDF

Info

Publication number
JP6898186B2
JP6898186B2 JP2017175706A JP2017175706A JP6898186B2 JP 6898186 B2 JP6898186 B2 JP 6898186B2 JP 2017175706 A JP2017175706 A JP 2017175706A JP 2017175706 A JP2017175706 A JP 2017175706A JP 6898186 B2 JP6898186 B2 JP 6898186B2
Authority
JP
Japan
Prior art keywords
data
operating state
pkb
storage block
writing
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.)
Active
Application number
JP2017175706A
Other languages
Japanese (ja)
Other versions
JP2019053396A (en
Inventor
亮治 渡邉
亮治 渡邉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Astemo Ltd
Original Assignee
Hitachi Astemo 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 Hitachi Astemo Ltd filed Critical Hitachi Astemo Ltd
Priority to JP2017175706A priority Critical patent/JP6898186B2/en
Publication of JP2019053396A publication Critical patent/JP2019053396A/en
Application granted granted Critical
Publication of JP6898186B2 publication Critical patent/JP6898186B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、データを冗長に格納するための複数の記憶ブロックを備えた不揮発性メモリを有する自動車用制御装置及び不揮発性メモリの書き込み方法に関する。 The present invention relates to an automobile control device having a non-volatile memory provided with a plurality of storage blocks for redundantly storing data, and a method for writing the non-volatile memory.

特許文献1には、制御対象機器の動作状況に関するデータを不揮発性メモリに書き込み、制御対象機器が障害によって停止した場合に、不揮発性メモリに記憶されているデータから停止前の動作状況を確認して正しく回復するための処理を実行することが開示されている。 In Patent Document 1, data relating to the operating status of the controlled device is written to the non-volatile memory, and when the controlled device is stopped due to a failure, the operating status before the stop is confirmed from the data stored in the non-volatile memory. It is disclosed to perform the process for correct recovery.

特開2000−035922号公報Japanese Unexamined Patent Publication No. 2000-0359222

ところで、不揮発性メモリのデータを冗長に格納するための複数の記憶ブロックに、制御対象機器の作動状態などを示すデータを書き込む処理において、書き込み前に空き領域が無いと判断したときに記憶ブロック単位で消去を行い、消去終了後に書き込み待ちのデータを記憶ブロックに書き込む構成とした場合、制御装置が消去中の一時的なシャットダウンから再起動したときに、格納データが不整合になる可能性があった。 By the way, in the process of writing data indicating the operating state of the controlled device to a plurality of storage blocks for redundantly storing data in the non-volatile memory, when it is determined that there is no free area before writing, the storage block unit. If the data is erased with and the data waiting to be written is written to the storage block after the erase is completed, the stored data may become inconsistent when the control device is restarted from a temporary shutdown during erasure. It was.

本発明は、従来の実情に鑑みてなされたものであり、その目的は、データの書き込み待ちが発生することで格納データが不整合になることを抑制できる、自動車用制御装置及び不揮発性メモリの書き込み方法を提供することを目的とする。 The present invention has been made in view of the conventional circumstances, and an object of the present invention is to provide an automobile control device and a non-volatile memory capable of suppressing inconsistency of stored data due to waiting for data to be written. The purpose is to provide a writing method.

本発明によれば、その1つの態様において、データを冗長に格納するための複数の記憶ブロックを備えた不揮発性メモリと、前記不揮発性メモリへのアクセスを行う制御部と、を有する、自動車用制御装置であって、前記制御部は、規定のデータを複数の記憶ブロックそれぞれに書き込んだ後に、空き領域数が設定数を下回る記憶ブロックについて消去を実行し、前記規定データ以外のデータを複数の記憶ブロックそれぞれに書き込んだ後は記憶ブロックの消去を行わない。 According to the present invention, in one aspect thereof , for automobiles, the non-volatile memory having a plurality of storage blocks for storing data redundantly and a control unit for accessing the non-volatile memory. In the control device, the control unit writes the specified data to each of the plurality of storage blocks, then erases the storage blocks whose number of free areas is less than the set number, and performs a plurality of data other than the specified data. After writing to each storage block, the storage block is not erased.

本発明によれば、データの書き込み待ちが発生することを抑制できるため、書き込み待ちによって格納データが不整合になることを抑制できる。 According to the present invention, it is possible to suppress the occurrence of waiting for writing of data, so that it is possible to suppress the inconsistency of stored data due to waiting for writing.

車両のブレーキシステムを示す構成図である。It is a block diagram which shows the brake system of a vehicle. 電動パーキングECUの構成を示すブロック図である。It is a block diagram which shows the structure of the electric parking ECU. フラッシュEEPROMのデータ構成を示す図である。It is a figure which shows the data structure of a flash EEPROM. PKB作動状態を示すデータの構成を示す図である。It is a figure which shows the structure of the data which shows the PKB operation state. PKB作動状態の出力パターンを示す図である。It is a figure which shows the output pattern of the PKB operating state. 空き領域が無くなってから消去を実行する場合におけるPKB作動状態のデータの格納状態を例示する図である。It is a figure which illustrates the storage state of the data of the PKB operation state in the case of executing the erasure after the free area is exhausted. 次のデータの書き込みが可能な状態で記憶ブロック毎に消去する場合におけるPKB作動状態のデータの格納状態を例示する図である。It is a figure which illustrates the storage state of the data of the PKB operation state in the case of erasing each storage block in the state where the next data can be written. PKB作動状態の書き込み処理及び消去処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the writing process and the erasing process of the PKB operating state. PKB作動状態の書き込み処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the writing process of the PKB operation state. 記憶ブロックの消去処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the erasing process of a storage block.

以下、本発明に係る自動車用制御装置及び不揮発性メモリの書き込み方法の実施形態を図面に基づいて説明する。
図1は、自動車1のブレーキシステムの一態様を示す構成図である。
油圧ユニット10は、油圧ユニット10用の電子制御装置(以下、油圧ユニットECU11と称する。)からの指令に応じて、各輪FL,FR,RL,RRのホイルシリンダ圧を調整し、ブレーキキャリパ3FL,3FR,3RL,3RRの作動を制御する。
Hereinafter, embodiments of a control device for an automobile and a method of writing a non-volatile memory according to the present invention will be described with reference to the drawings.
FIG. 1 is a configuration diagram showing one aspect of the brake system of the automobile 1.
The hydraulic unit 10 adjusts the wheel cylinder pressures of each wheel FL, FR, RL, and RR in response to a command from the electronic control device for the hydraulic unit 10 (hereinafter, referred to as the hydraulic unit ECU 11), and the brake caliper 3FL. , 3FR, 3RL, 3RR operation is controlled.

油圧ユニットECU11は、CPU(Central Processing Unit)、RAM(Random Access Memory)、ROM(Read-Only Memory)などを含んで構成されるマイクロコンピュータを有して構成される。
また、油圧ユニットECU11には、車輪速センサ12により検出された各車輪速、加速度・角速度センサ13により検出された車両の横方向加速度、前後方向加速度及びヨーレイト、マスタシリンダ圧センサ14により検出されたマスタシリンダ圧の信号などが入力される。
The hydraulic unit ECU 11 includes a microcomputer including a CPU (Central Processing Unit), a RAM (Random Access Memory), a ROM (Read-Only Memory), and the like.
Further, in the hydraulic unit ECU 11, each wheel speed detected by the wheel speed sensor 12, lateral acceleration of the vehicle detected by the acceleration / angular speed sensor 13, longitudinal acceleration and yaw rate, and master cylinder pressure sensor 14 are detected. A signal such as the master cylinder pressure is input.

また、油圧ユニットECU11には、通信ライン15を介してブレーキストロークセンサ16により検出されたブレーキストロークの信号などが入力される。
また、油圧ユニットECU11とともに、電制ブースタ20用の電子制御装置(以下、電制ブースタECU21と称する。)、電動式パーキングブレーキ装置30用の電子制御装置(以下、電動パーキングECU31と称する。)などが自動車1に備えられている。
Further, a brake stroke signal or the like detected by the brake stroke sensor 16 is input to the hydraulic unit ECU 11 via the communication line 15.
Further, together with the hydraulic unit ECU 11, an electronic control device for the electronically controlled booster 20 (hereinafter referred to as the electronically controlled booster ECU 21), an electronic control device for the electric parking brake device 30 (hereinafter referred to as the electric parking ECU 31), and the like. Is provided in the car 1.

そして、油圧ユニットECU11、電制ブースタECU21、及び電動パーキングECU31は、通信ライン15を介して相互通信を行う。
電制ブースタECU21は、ブレーキストロークセンサ16により検出されたブレーキストロークの信号などを入力して、係る入力信号に基づき電制ブースタ20を制御し、ブレーキ操作をアシストする力を発生させる。
Then, the hydraulic unit ECU 11, the electronically controlled booster ECU 21, and the electric parking ECU 31 communicate with each other via the communication line 15.
The electronically controlled booster ECU 21 inputs a brake stroke signal or the like detected by the brake stroke sensor 16 and controls the electronically controlled booster 20 based on the input signal to generate a force for assisting the brake operation.

左右の後輪RL,RRには、リアキャリパ3RL,3RRを作動させる電動モータ32RL,32RRが設けられていて、リアキャリパ3RL,3RRと、アクチュエータとしての電動モータ32RL,32RRとによって電動式パーキングブレーキ装置30の駆動機構が構成される。
電動パーキングECU31は、自動車1の運転者によりパーキングブレーキスイッチ33がオン側に操作されたとき、又は、油圧ユニットECU11からの作動要求に応じて、電動モータ32RL,32RRを駆動し、電動式パーキングブレーキ装置30を締結状態とする。
The left and right rear wheels RL and RR are provided with electric motors 32RL and 32RR for operating the rear calipers 3RL and 3RR, and the electric parking brake device 30 is provided by the rear calipers 3RL and 3RR and the electric motors 32RL and 32RR as actuators. Drive mechanism is configured.
The electric parking brake 31 drives the electric motors 32RL and 32RR when the parking brake switch 33 is operated to the on side by the driver of the automobile 1 or in response to an operation request from the hydraulic unit ECU 11. The device 30 is in the fastened state.

図2は、自動車用制御装置である電動パーキングECU31の構成を示すブロック図である。
電動パーキングECU31は、マイクロコンピュータ34を含んで構成され、マイクロコンピュータ34は、CPU(Central Processing Unit)35、不揮発性メモリであるフラッシュEEPROM(Electrically Erasable Programmable Read-Only Memory)36、揮発性メモリであるRAM(Random Access Memory)37を有する。
FIG. 2 is a block diagram showing a configuration of an electric parking ECU 31 which is a control device for an automobile.
The electric parking ECU 31 includes a microcomputer 34, and the microcomputer 34 is a CPU (Central Processing Unit) 35, a flash EEPROM (Electrically Erasable Programmable Read-Only Memory) 36 which is a non-volatile memory, and a volatile memory. It has a RAM (Random Access Memory) 37.

CPU35においては、ベーシックソフトウェア35aによってパーキングブレーキスイッチ33の指示状態及び油圧ユニットECU11の指示状態などをアプリケーションプログラム35bに渡す。
そして、アプリケーションプログラム35bは、パーキングブレーキ指示に応じて電動モータ32RL,32RRの制御指示をベーシックソフトウェア35aに通知し、RAM37上のパーキングブレーキ(電動モータ32RL,32RR)の作動状態(以下、PKB作動状態と称する。)を示すデータを更新させる。
In the CPU 35, the instruction state of the parking brake switch 33, the instruction state of the hydraulic unit ECU 11, and the like are passed to the application program 35b by the basic software 35a.
Then, the application program 35b notifies the basic software 35a of the control instruction of the electric motors 32RL and 32RR in response to the parking brake instruction, and the operating state of the parking brake (electric motors 32RL and 32RR) on the RAM 37 (hereinafter, PKB operating state). The data indicating) is updated.

更に、CPU35において、ベーシックソフトウェア35aはRAM37上のPKB作動状態を示すデータの更新を検出すると、フラッシュEEPROM36に対しPKB作動状態の書き込み処理を実施する。
このように、CPU35は、不揮発性メモリであるフラッシュEEPROM36へのアクセスを行う制御部としての機能を備える。
Further, when the CPU 35 detects the update of the data indicating the PKB operating state on the RAM 37, the basic software 35a executes a writing process of the PKB operating state on the flash EEPROM 36.
As described above, the CPU 35 has a function as a control unit for accessing the flash EEPROM 36 which is a non-volatile memory.

図3は、フラッシュEEPROM36のデータ構成の一態様を示す。
フラッシュEEPROM36は、図3(A)に示すように、複数の記憶ブロックに分割され、プログラムなどが格納される記憶ブロックの他、PKB作動状態を示すデータを冗長に格納するための2つの記憶ブロックA,Bを備えている。
つまり、CPU35は、PKB作動状態を示すデータを、記憶ブロックA、記憶ブロックBの双方に書き込むよう構成されている。
なお、フラッシュEEPROM36における消去は、記憶ブロックA,Bの単位で実施される。
FIG. 3 shows an aspect of the data structure of the flash EEPROM 36.
As shown in FIG. 3A, the flash EEPROM 36 is divided into a plurality of storage blocks, and in addition to a storage block for storing programs and the like, two storage blocks for redundantly storing data indicating a PKB operating state. It has A and B.
That is, the CPU 35 is configured to write data indicating the PKB operating state to both the storage block A and the storage block B.
The erasing in the flash EEPROM 36 is performed in units of the storage blocks A and B.

図3(B)は、記憶ブロックA,Bに共通するデータ構成の一態様を示す。
記憶ブロックA,Bは、電動パーキングECU31のセルフシャットオフ時に故障情報、診断情報、学習情報などを書き込む領域と、PKB作動状態を記録する領域とに分けられる。
FIG. 3B shows an aspect of the data structure common to the storage blocks A and B.
The storage blocks A and B are divided into an area for writing failure information, diagnostic information, learning information, etc. at the time of self-shut-off of the electric parking ECU 31, and an area for recording the PKB operating state.

更に、記憶ブロックA,BのPKB作動状態を記録する領域は、複数領域(PKB作動状態(1)〜PKB作動状態(256))に分けられている。
そして、CPU35は、PKB作動状態が変化する毎に、記憶ブロックA,Bの空き領域にPKB作動状態を示すデータをそれぞれ書き込む。
Further, the areas for recording the PKB operating states of the storage blocks A and B are divided into a plurality of areas (PKB operating states (1) to PKB operating states (256)).
Then, each time the PKB operating state changes, the CPU 35 writes data indicating the PKB operating state in the free areas of the storage blocks A and B, respectively.

図4は、フラッシュEEPROM36の記憶ブロックA,BのPKB作動状態を記録する領域に書き込まれるデータの一態様を示す。
記憶ブロックA,BのPKB作動状態を記録する領域には、PKB作動状態を示すデータである、左後輪RLのリアキャリパ3RLの状態を示すデータ、右後輪RRのリアキャリパ3RRの状態を示すデータとともに、各種制御データ(1)〜(4)や誤り検出のためのチェックサムなどが書き込まれる。
FIG. 4 shows an aspect of the data written in the area for recording the PKB operating state of the storage blocks A and B of the flash EEPROM 36.
In the area for recording the PKB operating state of the storage blocks A and B, data indicating the PKB operating state, data indicating the state of the rear caliper 3RL of the left rear wheel RL, and data indicating the state of the rear caliper 3RR of the right rear wheel RR. At the same time, various control data (1) to (4) and a checksum for error detection are written.

PKB作動状態を示すデータは、リアキャリパ3RL,3RRがブレーキパッドをブレーキローターに抑え付け制動力を発生させている状態に対応する「保持(締結)」のデータ(第1データ)と、リアキャリパ3RL,3RRがブレーキパッドをブレーキローターから離間させ制動力を発生させていない状態に対応する「非保持(解放)」のデータ(第2データ)と、締結状態(締結位置)と解放状態(解放位置)との間の動作状態(保持、非保持のいずれでもない不定状態)に対応する「動作中(不定)」のデータ(第3データ)とを含む。 The data indicating the PKB operating state includes the "holding (fastening)" data (first data) corresponding to the state in which the rear calipers 3RL and 3RR hold the brake pads against the brake rotor to generate braking force, and the rear calipers 3RL, "Non-holding (release)" data (second data) corresponding to the state in which 3RR separates the brake pads from the brake rotor and does not generate braking force, and the tightened state (fastened position) and released state (release position). Includes "operating (indefinite)" data (third data) corresponding to the operating state (indefinite state that is neither held nor non-held) between and.

つまり、CPU35は、PKB作動状態を「保持(締結)」「非保持(解放)」「動作中(不定)」の3種類に区別して、フラッシュEEPROM36の記憶ブロックA,Bに冗長に書き込むよう構成される。
CPU35は、締結から解放に向けての動作開始前及び解放から締結に向けての動作開始前にフラッシュEEPROM36の記憶ブロックA,Bに「動作中(不定)」のデータを書き込み、動作終了時には動作方向に応じてフラッシュEEPROM36の記憶ブロックA,Bに「保持(締結)」又は「非保持(解放)」のデータを書き込む。
That is, the CPU 35 is configured to distinguish the PKB operating state into three types of "holding (fastening)", "non-holding (release)", and "operating (indefinite)", and redundantly write to the storage blocks A and B of the flash EEPROM 36. Will be done.
The CPU 35 writes "operating (undefined)" data to the storage blocks A and B of the flash EEPROM 36 before the start of the operation from the conclusion to the release and before the start of the operation from the release to the conclusion, and operates at the end of the operation. “Holding (fastening)” or “non-holding (release)” data is written in the storage blocks A and B of the flash EEPROM 36 according to the direction.

図5は、電動パーキングECU31が起動時に実施するPKB作動状態の出力処理パターン(RAM37への展開パターン)を例示する。
電動パーキングECU31の電源遮断状態においてPKB作動状態を示すデータがフラッシュEEPROM36に保存され、電動パーキングECU31は、起動時に、フラッシュEEPROM36に格納されているデータから図5に示すパターンでPKB作動状態を認識して電動式パーキングブレーキ装置30の制御を開始し、制御開始後は、PKB作動状態が更新される毎にPKB作動状態を示すデータをフラッシュEEPROM36に冗長に書き込み、電源遮断に備える。
FIG. 5 illustrates an output processing pattern (expansion pattern to the RAM 37) of the PKB operating state executed by the electric parking ECU 31 at the time of activation.
Data indicating the PKB operating state is stored in the flash EEPROM 36 when the power of the electric parking ECU 31 is cut off, and the electric parking ECU 31 recognizes the PKB operating state from the data stored in the flash EEPROM 36 at the time of startup in the pattern shown in FIG. The control of the electric parking brake device 30 is started, and after the control is started, data indicating the PKB operating state is redundantly written to the flash EEPROM 36 every time the PKB operating state is updated to prepare for power failure.

図5に示すように、記憶ブロックA,BにおけるPKB作動状態の書き込み状態は、ブランク(消去中を含む)、サム値異常、サム値正常に区別され、CPU35は、これらの組み合わせに基づき、電動式パーキングブレーキ装置30の制御に用いるPKB作動状態を決定する。
以下では、ブランク、サム値異常、サム値正常の組み合わせに応じた出力パターンを詳述する。
記憶ブロックAのPKB作動状態の記憶領域がブランクで、記憶ブロックBのPKB作動状態の記憶領域が同じくブランクである場合、CPU35は、PKB作動状態を示すデータをとして「動作中(不定)」のデータを出力する。
As shown in FIG. 5, the writing state of the PKB operating state in the storage blocks A and B is distinguished from blank (including during erasing), abnormal sum value, and normal sum value, and the CPU 35 is electrically driven based on these combinations. The PKB operating state used for controlling the parking brake device 30 is determined.
In the following, the output pattern according to the combination of blank, abnormal thumb value, and normal thumb value will be described in detail.
When the storage area of the storage block A in the PKB operating state is blank and the storage area of the storage block B in the PKB operating state is also blank, the CPU 35 is "operating (indefinite)" with the data indicating the PKB operating state as the data indicating the PKB operating state. Output data.

また、記憶ブロックAのPKB作動状態の記憶領域がブランクで、記憶ブロックBの記録データのサム値が異常である場合、CPU35は、PKB作動状態を示すデータとして「動作中(不定)」のデータを出力する。
また、記憶ブロックAのPKB作動状態の記憶領域がブランクで、記憶ブロックBの記録データのサム値が正常である場合、CPU35は、記憶ブロックBに格納されているPKB作動状態を示すデータ(「保持(締結)」「非保持(解放)」「動作中(不定)」のいずれか)を出力する。
Further, when the storage area of the storage block A in the PKB operating state is blank and the sum value of the recorded data in the storage block B is abnormal, the CPU 35 is "operating (indefinite)" data indicating the PKB operating state. Is output.
Further, when the storage area of the storage block A in the PKB operating state is blank and the sum value of the recorded data in the storage block B is normal, the CPU 35 performs data indicating the PKB operating state stored in the storage block B (““ One of "holding (fastening)", "non-holding (release)", and "operating (indefinite)") is output.

一方、記憶ブロックAの記憶データのサム値が異常で、記憶ブロックBのPKB作動状態の記憶領域がブランクである場合、CPU35は、PKB作動状態を示すデータとして「動作中(不定)」のデータを出力する。
また、記憶ブロックAの記憶データのサム値が異常で、記憶ブロックBの記憶データのサム値も異常である場合、CPU35は、PKB作動状態を示すデータとして「動作中(不定)」のデータを出力する。
On the other hand, when the sum value of the stored data of the storage block A is abnormal and the storage area of the storage block B in the PKB operating state is blank, the CPU 35 is "operating (indefinite)" data indicating the PKB operating state. Is output.
Further, when the sum value of the stored data of the storage block A is abnormal and the sum value of the stored data of the storage block B is also abnormal, the CPU 35 uses the data "operating (indefinite)" as the data indicating the PKB operating state. Output.

また、記憶ブロックAの記憶データのサム値が異常で、記憶ブロックBの記憶データのサム値が正常である場合、CPU35は、記憶ブロックBに格納されているPKB作動状態を示すデータ(「保持(締結)」「非保持(解放)」「動作中(不定)」のいずれか)を出力する。
一方、記憶ブロックAの記憶データのサム値が正常で、記憶ブロックBのPKB作動状態の記憶領域がブランクである場合、CPU35は、記憶ブロックAに格納されているPKB作動状態を示すデータ(「保持(締結)」「非保持(解放)」「動作中(不定)」のいずれか)を出力する。
Further, when the sum value of the stored data in the storage block A is abnormal and the sum value of the stored data in the storage block B is normal, the CPU 35 receives data indicating the PKB operating state stored in the storage block B (“holding”). (Fixed), "Not held (released)", "Operating (indefinite)") is output.
On the other hand, when the sum value of the stored data of the storage block A is normal and the storage area of the PKB operating state of the storage block B is blank, the CPU 35 performs data indicating the PKB operating state stored in the storage block A (““ One of "holding (fastening)", "non-holding (release)", and "operating (indefinite)") is output.

また、記憶ブロックAの記憶データのサム値が正常で、記憶ブロックBの記憶データのサム値が異常である場合、CPU35は、記憶ブロックAに格納されているPKB作動状態を示すデータ(「保持(締結)」「非保持(解放)」「動作中(不定)」のいずれか)を出力する。
また、記憶ブロックAの記憶データのサム値が正常で、記憶ブロックBの記憶データのサム値も正常である場合、CPU35は、記憶ブロックAに格納されているPKB作動状態を示すデータと記憶ブロックBに格納されているPKB作動状態を示すデータとが同じ値であればその値を出力し、記憶ブロックAに格納されているPKB作動状態を示すデータと記憶ブロックBに格納されているPKB作動状態を示すデータとが異なればPKB作動状態を示すデータとして「動作中(不定)」のデータを出力する。
なお、起動時に「動作中(不定)」のデータを出力した場合、CPU35は、パーキングブレーキスイッチ33の操作位置に応じて締結位置又は解放位置に向けて電動モータ32RL,32RRを駆動制御する。
Further, when the sum value of the stored data in the storage block A is normal and the sum value of the stored data in the storage block B is abnormal, the CPU 35 receives data indicating the PKB operating state stored in the storage block A (“holding”). (Fixed), "Not held (released)", "Operating (indefinite)") is output.
Further, when the sum value of the stored data of the storage block A is normal and the sum value of the stored data of the storage block B is also normal, the CPU 35 is stored in the storage block A and the data indicating the PKB operating state and the storage block. If the data indicating the PKB operating state stored in B is the same value, that value is output, and the data indicating the PKB operating state stored in the storage block A and the PKB operation stored in the storage block B are output. If the data indicating the state is different, the "operating (indefinite)" data is output as the data indicating the PKB operating state.
When the data of "operating (indefinite)" is output at the time of starting, the CPU 35 drives and controls the electric motors 32RL and 32RR toward the fastening position or the releasing position according to the operating position of the parking brake switch 33.

ところで、CPU35は、PKB作動状態を示すデータの更新要求に基づき記憶ブロックA,Bへの書き込みを行うときに、記憶ブロックA,Bに空き領域がないと、記憶ブロック単位での消去を行ってから書き込みを行うことになるが、消去に時間を要するために書き込み待ち時間が長くなってしまう。
係る書き込み待ちの状態で、電動パーキングECU31のオフ指令が発生しても、電動パーキングECU31は、書き込み完了までセルフシャットダウンを遅らせることで、制御停止時の作動状態をフラッシュEEPROM36に保存することができる。
By the way, when writing to the storage blocks A and B based on the update request of the data indicating the PKB operating state, the CPU 35 erases the storage blocks A and B in units of the storage blocks if there is no free area. However, since it takes time to erase the data, the writing waiting time becomes long.
Even if an off command of the electric parking ECU 31 is generated in the state of waiting for writing, the electric parking ECU 31 can save the operating state at the time of control stop in the flash EEPROM 36 by delaying the self-shutdown until the writing is completed.

しかし、書き込み待ちの間に電動パーキングECU31における電源瞬停などが発生し、電動パーキングECU31が一時的なシャットダウン状態になった場合は、フラッシュEEPROM36への書き込みが未完であり、RAM37上のデータは消えてしまうため、電動パーキングECU31が再起動したときには、フラッシュEEPROM36の格納データに基づき認識されるPKB作動状態と実際のPKB作動状態とが整合しないことになり、電動パーキングECU31は、不適切な制御を実施してしまう可能性がある。
ここで、CPU35が、例えばPKB作動状態が「動作中(不定)」に変化するときに、記憶ブロックA,Bの消去完了まで電動モータ32RL,32RRの動作開始を遅らせれば、実際の作動状態と記憶ブロックA,Bに格納されているPKB作動状態とを一致させることができるが、この場合、電動式パーキングブレーキ装置30の操作性、応答性が低下することになる。
However, if a momentary power failure occurs in the electric parking ECU 31 while waiting for writing and the electric parking ECU 31 is temporarily shut down, the writing to the flash EEPROM 36 is incomplete and the data on the RAM 37 disappears. Therefore, when the electric parking ECU 31 is restarted, the PKB operating state recognized based on the stored data of the flash EEPROM 36 and the actual PKB operating state do not match, and the electric parking ECU 31 controls inappropriately. There is a possibility that it will be implemented.
Here, if the CPU 35 delays the start of operation of the electric motors 32RL and 32RR until the erasure of the storage blocks A and B is completed when, for example, the PKB operating state changes to "operating (indefinite)", the actual operating state Can be matched with the PKB operating state stored in the storage blocks A and B, but in this case, the operability and responsiveness of the electric parking brake device 30 are deteriorated.

図6は、PKB作動状態の誤判断が生じる様子を説明するための図である。
図6(A)は、CPU35が、「非保持(解放)」から「保持(締結)」に向けた動作が終了し(電動式パーキングブレーキ装置30が締結位置になり)、動作終了時に「保持(締結)」のデータを記憶ブロックA,Bにそれぞれ書き込もうとしたときに、記憶ブロックA,Bに空き領域(書き込み可能領域)が無かった状態を例示する。
FIG. 6 is a diagram for explaining how an erroneous determination of the PKB operating state occurs.
In FIG. 6A, the CPU 35 completes the operation from “non-holding (release)” to “holding (fastening)” (the electric parking brake device 30 is in the fastening position), and “holds” at the end of the operation. An example shows a state in which there is no free area (writable area) in the storage blocks A and B when the data of "(conclusion)" is to be written to the storage blocks A and B, respectively.

この場合、CPU35は、まず記憶ブロックAを消去して、消去終了後に「保持(締結)」のデータを記憶ブロックAに書き込もうとするが、係る消去処理の途中で電源瞬停などによる一時的なシャットダウンで処理が中断され、その後に電動パーキングECU31が再起動された場合、各記憶ブロックA,Bには図6(B)に示すようにPKB作動状態が格納されていることになる。
ここで、記憶ブロックBの記録データのサム値が正常であれば、記憶ブロックA,Bからの出力パターンは、図5に示した、記憶ブロックAのPKB作動状態の記憶領域がブランクで、記憶ブロックBの記録データのサム値が正常である場合に相当し、CPU35は、記憶ブロックBに格納されている「動作中(不定)」のデータを出力する(RAM37に展開する)ことになる。
In this case, the CPU 35 first erases the storage block A, and after the erasure is completed, tries to write the data of "holding (conclusion)" to the storage block A, but is temporarily stopped due to a power supply momentary power failure or the like during the erasing process. When the processing is interrupted by shutdown and the electric parking ECU 31 is restarted after that, the PKB operating state is stored in each of the storage blocks A and B as shown in FIG. 6 (B).
Here, if the sum value of the recorded data of the storage block B is normal, the output patterns from the storage blocks A and B are stored because the storage area of the storage block A in the PKB operating state shown in FIG. 5 is blank. Corresponding to the case where the sum value of the recorded data in the block B is normal, the CPU 35 outputs (expands to the RAM 37) the “operating (indefinite)” data stored in the storage block B.

つまり、CPU35は、動作終了時で「保持(締結)」のデータを記憶ブロックA,Bにそれぞれ書き込もうとしていたのに、再起動されたときには記憶ブロックBの格納データに基づき「動作中(不定)」であると誤判断する。
上記例は、CPU35が、動作終了時で「保持(締結)」のデータを記憶ブロックA,Bにそれぞれ書き込もうとしたときに空き領域が無かった場合の例であるが、CPU35が、動作開始前に「動作中(不定)」のデータを記憶ブロックA,Bにそれぞれ書き込もうとしたときに空き領域が無かった場合の消去途中で、電源瞬停などが発生して電動パーキングECU31が再起動された場合、CPU35は、実際には「動作中(不定)」であるのに「保持(締結)」又は「非保持(解放)」であると誤判断することになる。
That is, the CPU 35 tried to write the "hold (conclude)" data to the storage blocks A and B at the end of the operation, but when it was restarted, it was "operating (undefined)" based on the stored data of the storage block B. ) ”.
The above example is an example in which there is no free area when the CPU 35 tries to write the “hold (conclude)” data to the storage blocks A and B at the end of the operation, but the CPU 35 has not started the operation. When there was no free space when trying to write "operating (indefinite)" data to the storage blocks A and B, a momentary power failure occurred and the electric parking ECU 31 was restarted. In this case, the CPU 35 erroneously determines that it is "holding (fastening)" or "non-holding (released)" even though it is actually "operating (indefinite)".

例えば、電動式パーキングブレーキ装置30が締結状態から解放状態に向けて動作している途中で電動パーキングECU31が再起動される場合、CPU35は、再起動後に途中の状態から解放方向に電動モータ32RL,32RRを動作させる必要があるが、記憶ブロックAが消去中で記憶ブロックBに動作開始前の「保持(締結)」が記憶されていると、CPU35は、締結状態からの操作量で解放制御を再実行してしまう。
この場合、実際には電動式パーキングブレーキ装置30が解放位置に達しているのに、CPU35は、更に解放方向に向けて電動モータ32RL,32RRを制御することになり、これによって、電動モータ32RL,32RR(駆動機構)に大きな負荷が加わって故障が生じる惧れがある。
For example, when the electric parking ECU 31 is restarted while the electric parking brake device 30 is operating from the engaged state to the released state, the CPU 35 performs the electric motor 32RL in the releasing direction from the intermediate state after the restart. It is necessary to operate the 32RR, but if the storage block A is being erased and the storage block B stores the "holding (fastening)" before the start of the operation, the CPU 35 controls the release by the operation amount from the fastened state. It will be re-executed.
In this case, although the electric parking brake device 30 has actually reached the release position, the CPU 35 further controls the electric motors 32RL and 32RR in the release direction, whereby the electric motors 32RL and 32RL, There is a risk that a large load will be applied to the 32RR (drive mechanism) and a failure will occur.

つまり、ブレーキが解放された状態では電動モータ32RL,32RRの駆動トルク変化が小さいため、CPU35は駆動トルク変化による解放位置の検出を行えず、実際には解放位置に制御されているのに解放位置が検出されないことで更に解放方向に向けて駆動力を発生させ、これによって電動モータ32RL,32RRを故障させてしまう惧れがある。
また、PKB作動状態をランプの点灯/消灯などによって運転者に知らせるシステムの場合、消去中の再起動に伴い、実際にはPKB作動状態が「動作中(不定)」であって、規定の締結トルク(制動力)が確保されておらず車両が動ける状態であるのに、運転者に締結状態である(規定の締結トルク(制動力)が確保されている)と誤って知らせてしまう惧れがある。
That is, since the change in the drive torque of the electric motors 32RL and 32RR is small when the brake is released, the CPU 35 cannot detect the release position due to the change in the drive torque, and the release position is actually controlled to the release position. Is not detected, a driving force is further generated in the release direction, which may cause the electric motors 32RL and 32RR to fail.
Further, in the case of a system that notifies the driver of the PKB operating state by turning on / off the lamp, the PKB operating state is actually "operating (indefinite)" due to the restart during erasing, and the specified conclusion is concluded. There is a risk that the driver will be erroneously notified that the vehicle is in a fastened state (the specified fastening torque (braking force) is secured) even though the torque (braking force) is not secured and the vehicle can move. There is.

係る不具合の発生を抑制するため、CPU35は、PKB作動状態を示すデータを記憶ブロックA,Bそれぞれに書き込んだ後、次のデータの書き込みが可能な状態で記憶ブロックA,B毎に消去を実行することで、常に空き領域が確保されるようにする。
つまり、CPU35は、常に空き領域が確保されるようにすることで、PKB作動状態の更新要求が発生したときに、記憶ブロックA,BにPKB作動状態のデータを直ちに(消去動作を待たずに)書き込めるようにし、消去が必要になる場合でも、一方の消去中に他方に最新のPKB作動状態が保存されるようにする。
In order to suppress the occurrence of such a problem, the CPU 35 writes data indicating the PKB operating state to each of the storage blocks A and B, and then executes erasing for each of the storage blocks A and B in a state in which the next data can be written. By doing so, free space is always secured.
That is, by ensuring that the free area is always secured, the CPU 35 immediately (without waiting for the erasure operation) stores the data of the PKB operating state in the storage blocks A and B when the update request of the PKB operating state occurs. ) Make it writable so that the latest PKB operating state is saved in the other while erasing one, even if it needs to be erased.

図7は、上記の消去処理を実施するときの記憶ブロックA,Bにおけるデータ構成を例示する。
CPU35は、図7(A)に示すように記憶ブロックA,Bに「保持(締結)」を書き込んだ後に「非保持(解放)」に向けて動作を開始させる場合、図7(B)に示すように記憶ブロックA,Bそれぞれの空き領域に「動作中(不定)」のデータを書き込む。
FIG. 7 illustrates the data structure in the storage blocks A and B when the above erasing process is performed.
When the CPU 35 starts the operation toward "non-holding (release)" after writing "holding (fastening)" in the storage blocks A and B as shown in FIG. 7 (A), it is shown in FIG. 7 (B). As shown, "operating (indefinite)" data is written in the free areas of each of the storage blocks A and B.

そして、データ書き込み後に、CPU35は、記憶ブロックA,Bにおける空き領域数が設定数(設定数>1)よりも少なくなっているか否かを判断し、空き領域数が設定数よりも少なければ、ブロック単位の消去を実行する。換言すれば、CPU35は、書き込み後に次回のデータを書き込める空き領域が少なくとも残っている状態で、記憶ブロックA,Bの消去を実行する。
ここで、例えば記憶ブロックAの消去中に電源瞬停などによる一時的なシャットダウンで処理が中断された後、電動パーキングECU31が再起動されたときには、記憶ブロックA,Bは図7(C)に示すデータ構成になる。
Then, after writing the data, the CPU 35 determines whether or not the number of free areas in the storage blocks A and B is less than the set number (set number> 1), and if the number of free areas is less than the set number, Perform block-by-block erasure. In other words, the CPU 35 erases the storage blocks A and B with at least a free area for writing the next data after writing.
Here, for example, when the electric parking ECU 31 is restarted after the processing is interrupted by a temporary shutdown due to a momentary power failure or the like while erasing the storage block A, the storage blocks A and B are shown in FIGS. 7 (C). It becomes the data structure shown.

つまり、記憶ブロックBに「動作中(不定)」のデータが保存されているから、CPU35は「動作中(不定)」であることを正しく認識して、パーキングブレーキの解放制御を途中から再開させることができ、また、PKB作動状態の表示を「動作中(不定)」に対応する表示(例えば、ランプ点滅)に制御することができる。
なお、CPU35は、記憶ブロックAの消去が完了すると、消去前に書き込んだPKB作動状態を再度記憶ブロックAに書き込み、記憶ブロックBについても消去が必要であれば、記憶ブロックBについての消去を行う。
That is, since the data of "operating (indefinite)" is stored in the storage block B, the CPU 35 correctly recognizes that it is "operating (indefinite)" and restarts the parking brake release control from the middle. In addition, the display of the PKB operating state can be controlled to a display corresponding to "operating (indefinite)" (for example, the lamp blinks).
When the erasure of the storage block A is completed, the CPU 35 writes the PKB operating state written before the erasure to the storage block A again, and if the storage block B also needs to be erased, the storage block B is erased. ..

そして、記憶ブロックBの消去中に電動パーキングECU31が一時的にシャットダウンされた場合には、記憶ブロックAに格納されているPKB作動状態が出力されることになる。
これに対し、空き領域が無くなってから消去を行い、消去終了後に書き込みを行う構成では、書き込み前の消去中に電源瞬停などにより処理が中断されると、変化後のPKB作動状態(「動作中(不定)」)のデータが保存されず、CPU35は、再起動時に変化前のPKB作動状態(「保持(締結)」)であると誤判断して、締結状態から解放させる処理を最初から実行したり、また、運転者に対しPKB作動状態を誤って知らせてしまう惧れがある。
Then, when the electric parking ECU 31 is temporarily shut down while the storage block B is being erased, the PKB operating state stored in the storage block A is output.
On the other hand, in the configuration in which erasing is performed after the free area is exhausted and writing is performed after erasing is completed, if the processing is interrupted due to a momentary power failure during erasing before writing, the PKB operating state after the change (“operation”). Medium (indefinite) ”) data is not saved, and the CPU 35 mistakenly determines that it is in the PKB operating state (“holding (fastening)”) before the change when restarting, and releases the data from the fastened state from the beginning. There is a risk that it will be executed or that the driver will be erroneously notified of the PKB operating state.

図8−図10は、CPU35による記憶ブロックA,Bの消去処理及びPKB作動状態を示すデータの書き込み処理を詳細に示すフローチャートである。
図8のフローチャートにおいて、CPU35は、ステップS101でフラッシュEEPROM36上のPKB作動状態を示すデータの更新要求が発生したか否かを判断する。
8 to 10 are flowcharts showing in detail the erasing process of the storage blocks A and B and the writing process of the data indicating the PKB operating state by the CPU 35.
In the flowchart of FIG. 8, the CPU 35 determines in step S101 whether or not a request for updating data indicating the PKB operating state on the flash EEPROM 36 has occurred.

PKB作動状態を示すデータの更新要求がない場合、CPU35は、図8のフローチャートに示す処理を終了させる。
一方、PKB作動状態を示すデータの更新要求が発生すると、CPU35は、ステップS102に進み、フラッシュEEPROM36の記憶ブロックAの空き領域に、変化後のPKB作動状態を示すデータ(「保持(締結)」「非保持(解放)」「動作中(不定)」のいずれか)を書き込む。
When there is no request to update the data indicating the PKB operating state, the CPU 35 ends the process shown in the flowchart of FIG.
On the other hand, when a request for updating the data indicating the PKB operating state is generated, the CPU 35 proceeds to step S102 and fills the free area of the storage block A of the flash EEPROM 36 with the data indicating the changed PKB operating state (“holding (conclusion)”). Write either "non-holding (release)" or "operating (indefinite)").

更に、CPU35は、ステップS103に進み、フラッシュEEPROM36の記憶ブロックBの空き領域に、ステップS102で記憶ブロックAに書き込んだデータと同じPKB作動状態を示すデータ(「保持(締結)」「非保持(解放)」「動作中(不定)」のいずれか)を書き込む。 Further, the CPU 35 proceeds to step S103, and in the free area of the storage block B of the flash EEPROM 36, data indicating the same PKB operating state as the data written in the storage block A in step S102 (“hold (conclusion)” and “non-hold ("hold (conclusion)") Write either "release)" or "in operation (indefinite)").

図9のフローチャートは、ステップS102、ステップS103におけるPKB作動状態を示すデータの書き込み処理の詳細を示す。
まず、CPU35は、ステップS201で、記憶ブロックA,BにおいてPKB作動状態を記録する複数領域(PKB作動状態(1)〜PKB作動状態(256))について順に書き込み可能であるか否かを判断するために、PKB作動状態(1)〜PKB作動状態(256)の1つを指定するための書き込みインデックスIDxを零に初期化する。
The flowchart of FIG. 9 shows the details of the data writing process indicating the PKB operating state in steps S102 and S103.
First, in step S201, the CPU 35 determines whether or not the plurality of areas (PKB operating states (1) to PKB operating states (256)) for recording the PKB operating states in the storage blocks A and B can be written in order. Therefore, the write index IDx for designating one of the PKB operating states (1) to the PKB operating states (256) is initialized to zero.

次いで、CPU35は、ステップS202に進み、書き込みインデックスIDxが最大値を超えたか否かを判断することで、記憶ブロックA,BにおいてPKB作動状態を記録する複数領域の全てについて書き込みの可否を判断したかを検出する。
そして、書き込みインデックスIDxが最大値を超えておらず、書き込みの可否を判断する領域が残っている場合、CPU35は、ステップS203に進み、書き込みインデックスIDxで指定される領域が、書き込み可能な空き領域であるか否かを判断する。
Next, the CPU 35 proceeds to step S202 and determines whether or not the write index IDx exceeds the maximum value, thereby determining whether or not all of the plurality of areas for recording the PKB operating state in the storage blocks A and B can be written. Is detected.
Then, when the write index IDx does not exceed the maximum value and there is an area for determining whether or not to write, the CPU 35 proceeds to step S203, and the area specified by the write index IDx is a writable free area. Judge whether or not.

書き込みインデックスIDxで指定される領域が書き込み可能な空き領域である場合、CPU35は、ステップS204に進み、書き込みインデックスIDxで指定される領域にPKB作動状態を示すデータ(「保持(締結)」「非保持(解放)」「動作中(不定)」のいずれか)を書き込む。
PKB作動状態を示すデータの書き込みを行うと、CPU35は、ステップS205で書き込みが正常に行われたか書き込み異常が発生したかの判別結果を保存した後に、本ルーチンを終了させる。
When the area specified by the write index IDx is a writable free area, the CPU 35 proceeds to step S204 and data indicating the PKB operating state in the area specified by the write index IDx (“holding (conclusion)” “non-holding)”. Write either "hold (release)" or "operating (indefinite)").
When the data indicating the PKB operating state is written, the CPU 35 terminates this routine after saving the determination result of whether the writing was normally performed or the writing abnormality has occurred in step S205.

一方、書き込みインデックスIDxで指定される領域が書き込み可能な空き領域でなくデータ書き込み済の領域である場合、CPU35は、ステップS203からステップS206に進み、書き込みインデックスIDxを、次の領域を指定させるように更新(インクリメント)した後、ステップS202に戻る。
上記のように、CPU35は、記憶ブロックA,Bに書き込み可能な空き領域があるか否かを探索し、空き領域があればPKB作動状態を示すデータの書き込みを行う。
On the other hand, when the area specified by the write index IDx is not a writable free area but an area in which data has been written, the CPU 35 proceeds from step S203 to step S206 so that the write index IDx specifies the next area. After updating (incrementing) to, the process returns to step S202.
As described above, the CPU 35 searches for whether or not there is a writable free area in the storage blocks A and B, and if there is a free area, writes data indicating the PKB operating state.

ここで、記憶ブロックA,Bに書き込み可能な空き領域がない場合、CPU35は、ステップS202、ステップS203、ステップS206の処理を繰り返し、書き込みインデックスIDxを最大値にまで増加させても書き込みが行えないことになる。
この場合、CPU35は、ステップS202で書き込みインデックスIDxが最大値を超えている、換言すれば、PKB作動状態を示すデータが全ての領域に書き込まれていて新たにデータを書き込める空き領域がないと判断するようになり、ステップS202からステップS207に進む。
Here, if there is no writable free area in the storage blocks A and B, the CPU 35 cannot write even if the process of step S202, step S203, and step S206 is repeated and the write index IDx is increased to the maximum value. It will be.
In this case, the CPU 35 determines in step S202 that the write index IDx exceeds the maximum value, in other words, the data indicating the PKB operating state is written in all the areas and there is no free area in which new data can be written. Then, the process proceeds from step S202 to step S207.

CPU35は、ステップS207で、PKB作動状態を示すデータが全ての領域に書き込まれていて新たにデータを書き込める空き領域がないという判断結果を保存し、本ルーチンを終了させる。
このようにして、CPU35は、図8のフローチャートのステップS102、ステップ103でPKB作動状態を示すデータを記憶ブロックA及び記憶ブロックBに書き込むこで、PKB作動状態を示すデータは、フラッシュEEPROM36に冗長に格納されることになる。
In step S207, the CPU 35 saves the determination result that the data indicating the PKB operating state is written in all the areas and there is no free area in which new data can be written, and terminates this routine.
In this way, the CPU 35 writes the data indicating the PKB operating state to the storage block A and the storage block B in steps S102 and 103 of the flowchart of FIG. 8, and the data indicating the PKB operating state is redundant in the flash EEPROM 36. Will be stored in.

そして、CPU35は、PKB作動状態を示すデータの記憶ブロックA,Bへの書き込み処理を終えると、まず、記憶ブロックAに関する処理を実施するためにステップS104に進む。
なお、ステップS104−ステップS107が記憶ブロックAに関する処理で、ステップS108−ステップS111が記憶ブロックBに関する処理で、CPU35は、記憶ブロックAについての処理を行った後、記憶ブロックBについても同様の処理を実施する。
Then, when the CPU 35 finishes the process of writing the data indicating the PKB operating state to the storage blocks A and B, the CPU 35 first proceeds to step S104 to execute the process related to the storage block A.
It should be noted that step S104-step S107 is the processing related to the storage block A, step S108-step S111 is the processing related to the storage block B, and the CPU 35 performs the processing for the storage block A and then the same processing for the storage block B. To carry out.

ステップS104で、CPU35は、PKB作動状態を示すデータの記憶ブロックAへの書き込み結果が正常であるか異常であるかを判断する。
ここで、書き込み結果の異常には、書き込み異常とともに、記憶ブロックAに空き領域が無くPKB作動状態を示すデータの書き込みを行えなかった異常が含まれる。
In step S104, the CPU 35 determines whether the result of writing the data indicating the PKB operating state to the storage block A is normal or abnormal.
Here, the abnormality of the writing result includes not only the writing abnormality but also the abnormality that the storage block A has no free area and the data indicating the PKB operating state cannot be written.

PKB作動状態を示すデータの記憶ブロックAへの書き込みが正常に行われた場合、CPU35は、ステップS105に進み、今回記憶ブロックAに書き込んだPKB作動状態を示すデータが、規定データである「動作中(不定)」を示すデータであるか否かを判断する。
そして、今回記憶ブロックAに書き込んだPKB作動状態を示すデータが、「保持(締結)」又は「非保持(解放)」を示すデータであって「動作中(不定)」を示すデータではなかった場合、CPU35は、後述する空き領域数の判定に基づく記憶ブロックAの消去処理を行うことなく、ステップS108以降の記憶ブロックBの処理に進む。
When the data indicating the PKB operating state is normally written to the storage block A, the CPU 35 proceeds to step S105, and the data indicating the PKB operating state written in the storage block A this time is the specified data "operation". It is judged whether or not the data indicates "medium (indefinite)".
The data indicating the PKB operating state written in the storage block A this time is data indicating "holding (conclusion)" or "non-holding (release)", not data indicating "operating (indefinite)". In this case, the CPU 35 proceeds to the processing of the storage block B after step S108 without performing the erasing processing of the storage block A based on the determination of the number of free areas described later.

記憶ブロックAに書き込まれたPKB作動状態を示すデータが「保持(締結)」又は「非保持(解放)」を示すデータである場合は、電動式パーキングブレーキ装置30の動作確定状態であり、係る書き込み後に記憶ブロックAの消去を実行している間に、パーキングブレーキスイッチ33が操作されて動作開始要求(締結から解放、又は、解放から締結への切換え要求)が発生する可能性がある。
係る動作開始要求が発生すると、CPU35は動作要求に応じて電動モータ32RL,32RRの駆動制御を開始するが、消去中の記憶ブロックAには書き込みを行えず、「動作中(不定)」の書き込みが遅れる(書き込み待ちが生じる)ことになり、実際のPKB作動状態と記憶ブロックAに格納されているPKB作動状態とが整合しない状態になってしまう。
When the data indicating the PKB operating state written in the storage block A is the data indicating "holding (fastening)" or "non-holding (release)", it means that the operation of the electric parking brake device 30 is confirmed. While the storage block A is being erased after writing, the parking brake switch 33 may be operated to generate an operation start request (a request for switching from engagement to release or release to engagement).
When the operation start request is generated, the CPU 35 starts the drive control of the electric motors 32RL and 32RR in response to the operation request, but cannot write to the memory block A being erased and writes "in operation (undefined)". Will be delayed (waiting for writing will occur), and the actual PKB operating state and the PKB operating state stored in the storage block A will be inconsistent.

そこで、CPU35は、「保持(締結)」又は「非保持(解放)」を記憶ブロックAに書き込んだ後は、記憶ブロックAの消去を実行せず、消去中に動作開始要求が発生することによる書き込み遅れ(書き込み待ち)の発生を抑制する。
一方、記憶ブロックAに書き込まれたPKB作動状態を示すデータが「動作中(不定)」である場合、動作中に記憶ブロックAの消去を進めることができる。
Therefore, after the CPU 35 writes "hold (conclusion)" or "non-hold (release)" to the storage block A, the storage block A is not erased, and an operation start request is generated during the erase. Suppresses the occurrence of write delay (waiting for writing).
On the other hand, when the data indicating the PKB operating state written in the storage block A is "operating (indefinite)", the erasing of the storage block A can proceed during the operation.

このため、締結から解放又は解放から締結への切換えに要する時間が記憶ブロックAの消去に要する時間よりも長ければ、動作中に記憶ブロックAの消去を完了させることができ、消去中に「保持(締結)」又は「非保持(解放)」の書き込み要求が発生して書き込み遅れ(書き込み待ち)が生じることが抑制される。
また、締結から解放又は解放から締結への切換えに要する時間が記憶ブロックAの消去に要する時間よりも短く、動作終了までに記憶ブロックAの消去が終了しなかった場合でも、書き込み遅れ(書き込み待ち)を充分に短くできる。
Therefore, if the time required for switching from fastening to releasing or from releasing to fastening is longer than the time required for erasing the storage block A, the erasing of the storage block A can be completed during operation, and "holding" during erasing. It is possible to prevent a write delay (waiting for writing) from occurring due to a writing request of "(conclusion)" or "non-holding (release)".
Further, the time required for switching from fastening to releasing or releasing to fastening is shorter than the time required for erasing the storage block A, and even if the erasing of the storage block A is not completed by the end of the operation, the writing delay (waiting for writing). ) Can be shortened sufficiently.

また、動作開始後の記憶ブロックAの消去中にパーキングブレーキスイッチ33が動作方向とは逆となる方向に操作された場合も、消去中に「保持(締結)」又は「非保持(解放)」の書き込み要求が発生して書き込み遅れ(書き込み待ち)が生じることを抑制できる。
そこで、CPU35は、PKB作動状態として「動作中(不定)」を記憶ブロックAに書き込んだときに記憶ブロックAの消去を実行し、PKB作動状態として「保持(締結)」又は「非保持(解放)」を記憶ブロックAに書き込んだときには記憶ブロックAの消去を実行しないよう構成されている。
Further, even if the parking brake switch 33 is operated in the direction opposite to the operating direction while erasing the storage block A after the start of operation, "holding (fastening)" or "non-holding (release)" is performed during erasing. It is possible to suppress the occurrence of a write request and a write delay (waiting for writing).
Therefore, when the CPU 35 writes "operating (indefinite)" to the storage block A as the PKB operating state, the storage block A is erased, and the PKB operating state is "held (concluded)" or "non-held (released)". ) ”Is written in the storage block A so that the storage block A is not erased.

そして、CPU35は、PKB作動状態として「動作中(不定)」を記憶ブロックAに書き込んだとき、ステップS106に進み、今回の「動作中(不定)」の書き込み処理前での記憶ブロックAにおけるPKB作動状態の書き込み領域の空き数NVが設定数NTH(例えば、設定数=8)以下であるか否かを判断する。
上記の設定数NTHは、データの書き込みが可能な空き領域数の確保数を規定するもので、例えば、締結、解放動作が左右でタイミングをずらして実行される場合は、「保持(締結)」又は「非保持(解放)」の書き込みが連続して実施される場合があり、係る連続した書き込みでも消去を行うことなく書き込みを行えるように、最大連続書き込み回数に余裕分を付加した値として上記の設定数NTHは決められる。
Then, when the CPU 35 writes "operating (indefinite)" to the storage block A as the PKB operating state, the process proceeds to step S106, and the PKB in the storage block A before the writing process of this "operating (indefinite)" It is determined whether or not the number of free NVs in the writing area in the operating state is equal to or less than the set number NTH (for example, the set number = 8).
The above-mentioned set number NTH defines the number of secured free areas in which data can be written. For example, when the fastening and releasing operations are executed at different timings on the left and right, "holding (fastening)" is performed. Alternatively, "non-holding (release)" writing may be continuously performed, and the above is set as a value obtained by adding a margin to the maximum number of continuous writings so that writing can be performed without erasing even in such continuous writing. The set number NTH of is determined.

書き込み領域の空き数NVが設定数NTHを超えている場合、CPU35は、記憶ブロックAの消去を実行することなく、ステップS108以降に進む。
一方、書き込み領域の空き数が設定数以下であって、PKB作動状態を示すデータの更新要求が発生したときに空き領域がなく、記憶ブロックAを消去して書き込みを行う必要が生じる可能性がある場合、CPU35は、ステップS107に進む。
When the number of free spaces NV in the write area exceeds the set number NTH, the CPU 35 proceeds to step S108 and subsequent steps without executing the erasure of the storage block A.
On the other hand, when the number of free writing areas is less than or equal to the set number and a request to update the data indicating the PKB operating state occurs, there is no free space, and it may be necessary to erase the storage block A and perform writing. If so, the CPU 35 proceeds to step S107.

また、CPU35は、ステップS104で、記憶ブロックAへの書き込み異常、若しくは、記憶ブロックAに空き領域が無いと判断した場合も、ステップS107に進む。
CPU35は、ステップS107で、記憶ブロックAを消去し、消去後にステップS102で書き込んだデータと同じデータを再度記憶ブロックAに書き込む処理を実施する。
Further, when the CPU 35 determines in step S104 that there is no writing abnormality in the storage block A or that there is no free area in the storage block A, the CPU 35 proceeds to step S107.
In step S107, the CPU 35 erases the storage block A, and after erasing, performs a process of writing the same data as the data written in step S102 to the storage block A again.

つまり、CPU35は、空き数NVが設定数NTH以下になるまでは、PKB作動状態のデータを新たに書き込める空き領域が記憶ブロックAに確保されているとして記憶ブロックAを消去せず、空き数NVが設定数NTH以下になると、PKB作動状態を示すデータの書き込みに先立って消去動作が必要になる可能性があると判断して、予め記憶ブロックAの消去を実行し、書き込みに先立つ消去動作が必要になることを抑制する。
これにより、記憶ブロックAへの「動作中(不定)」の書き込み回数に対し消去動作の頻度を必要最小限とし、CPU35の処理負担を軽減できる。
That is, the CPU 35 does not erase the storage block A because the storage block A has a free area in which the data of the PKB operating state can be newly written until the number of free spaces NV becomes the set number NTH or less, and the number of free spaces NV When is less than the set number NTH, it is determined that an erasing operation may be required prior to writing the data indicating the PKB operating state, and the storage block A is erased in advance, and the erasing operation prior to writing is performed. Suppress what is needed.
As a result, the frequency of the erasing operation can be minimized with respect to the number of "operating (indefinite)" writings to the storage block A, and the processing load of the CPU 35 can be reduced.

また、空き数NVが設定数NTH以下になったときに、換言すれば、次のPKB作動状態を示すデータの書き込みが可能な状態で記憶ブロックAを消去するから、PKB作動状態を示すデータの更新要求が発生したときに、書き込みに先立って消去処理が必要になることを抑制でき、書き込み遅れ(書き込み待ち)が発生して記憶ブロックAの格納データと実際のPKB作動状態とが不整合になることを抑制できる。 Further, when the number of free spaces NV becomes the set number NTH or less, in other words, the storage block A is erased in a state in which the data indicating the next PKB operating state can be written, so that the data indicating the PKB operating state can be written. When an update request occurs, it is possible to suppress the need for erasing processing prior to writing, and a write delay (waiting for writing) occurs, causing inconsistency between the stored data in storage block A and the actual PKB operating state. It can be suppressed.

また、記憶ブロックAの消去中は記憶ブロックBの消去が実行されず、記憶ブロックBにPKB作動状態を示すデータとして最新の「動作中(不定)」が保存されているので、記憶ブロックAの消去中に電源瞬停などによる一時的シャットダウンが生じても、CPU35は再起動時に記憶ブロックBの保存データに基づき「動作中(不定)」であることを認識できる。 Further, while the storage block A is being erased, the storage block B is not erased, and the latest "operating (indefinite)" is stored in the storage block B as data indicating the PKB operating state. Even if a temporary shutdown occurs due to a momentary power failure during erasing, the CPU 35 can recognize that it is "operating (indefinite)" based on the stored data of the storage block B at the time of restarting.

したがって、CPU35は、電動式パーキングブレーキ装置30が「動作中(不定)」であることを運転者に通知することで、パーキングブレーキスイッチ33の再操作を促したり、電動式パーキングブレーキ装置30を初期位置となる締結位置に駆動させたりすることが可能になる。
これにより、解放位置に向けた動作中に一時的シャットダウンが生じても、CPU35は、電動モータ32RL,32RRを一旦締結位置に駆動してから解放位置に向けて駆動できるので、駆動トルク変化に基づく適正な操作量で電動モータ32RL,32RRを駆動でき、電動モータ32RL,32RRに過度な負荷が加わって故障することを抑制できる。
Therefore, the CPU 35 notifies the driver that the electric parking brake device 30 is "operating (indefinite)" to prompt the driver to re-operate the parking brake switch 33, or to initialize the electric parking brake device 30. It is possible to drive the vehicle to the fastening position, which is the position.
As a result, even if a temporary shutdown occurs during the operation toward the release position, the CPU 35 can drive the electric motors 32RL and 32RR to the fastening position and then toward the release position, and is based on the change in drive torque. The electric motors 32RL and 32RR can be driven with an appropriate amount of operation, and it is possible to prevent the electric motors 32RL and 32RR from being damaged due to an excessive load.

図10のフローチャートは、上記ステップS107及び後述するステップS111におけるCPU35の処理内容を詳細に示すものであり、記憶ブロックAと記憶ブロックBとに共通する処理である。
CPU35は、ステップS301で、記憶ブロックAの強制消去の指示があるか否かを判断する。
The flowchart of FIG. 10 shows in detail the processing contents of the CPU 35 in the step S107 and the step S111 described later, and is a processing common to the storage block A and the storage block B.
In step S301, the CPU 35 determines whether or not there is an instruction to forcibly erase the storage block A.

CPU35は、図8のフローチャートのステップS107に進んだ場合、記憶ブロックAの強制消去を指定するので、ステップS107に進んで図10のフローチャートに示すルーチンが実行される場合は、記憶ブロックAについての強制消去の指示があると判断し、ステップS302に進む。
つまり、セルフシャットオフ時の故障情報を書き込むときで、強制消去の指示が無い場合、CPU35は、ステップS302−ステップS304を迂回してステップS305に進み、記憶ブロックAの消去は実施しない。
When the CPU 35 proceeds to step S107 of the flowchart of FIG. 8, it specifies forced erasure of the storage block A. Therefore, when the routine shown in the flowchart of FIG. 10 is executed by proceeding to step S107, the storage block A is specified. It is determined that there is an instruction for forced erasure, and the process proceeds to step S302.
That is, when writing the failure information at the time of self-shut-off, if there is no instruction for forced erasure, the CPU 35 bypasses step S302-step S304 and proceeds to step S305, and the storage block A is not erased.

CPU35は、ステップS302で記憶ブロックAの消去を実行し、次のステップS303では、記憶ブロックAの累計消去回数を更新する。
なお、ステップS302で記憶ブロックA(記憶ブロックB)の消去を実行している間は、消去中でない側の記憶ブロックB(記憶ブロックA)についてはPKB作動状態を示すデータの書き込みが停止される構成としてある。これにより、記憶ブロックA,B間で、PKB作動状態のデータの最新値が不整合になることが抑制される。
The CPU 35 executes the erasure of the storage block A in step S302, and updates the cumulative number of erasures of the storage block A in the next step S303.
While the storage block A (storage block B) is being erased in step S302, the writing of data indicating the PKB operating state is stopped for the storage block B (storage block A) on the side that is not being erased. It is a configuration. As a result, it is possible to prevent the latest values of the PKB operating state data from becoming inconsistent between the storage blocks A and B.

CPU35は、記憶ブロックAの消去終了後に、ステップS304で、PKB作動状態を示すデータを改めて書き込む。
つまり、CPU35は、図8のフローチャートのステップS102で、PKB作動状態を示すデータを記憶ブロックAに正常に書き込むことができた場合でも、書き込み領域の空き数が設定数以下になっていれば、それまでに書き込んだPKB作動状態を示すデータやセルフシャットオフ時に書き込んだ故障情報などを全て消去し、消去後に、ステップS102で記憶ブロックAに書き込んだデータと同じPKB作動状態を示すデータを記憶ブロックAに書き込む。
After the erasure of the storage block A is completed, the CPU 35 writes the data indicating the PKB operating state again in step S304.
That is, even if the CPU 35 can normally write the data indicating the PKB operating state to the storage block A in step S102 of the flowchart of FIG. 8, if the number of free writing areas is equal to or less than the set number, All the data indicating the PKB operating state written up to that point and the failure information written at the time of self-shutoff are erased, and after erasing, the data indicating the same PKB operating state as the data written in the storage block A in step S102 is stored in the storage block. Write in A.

記憶ブロックAを消去してPKB作動状態を示す最新データを改めて書き込めば、書き込み領域の空き数NVが設定数NTHを超える数に復帰するため、PKB作動状態を示すデータの更新要求が発生したときに係る更新データを書き込める空き領域が確保される。したがって、CPU35は、PKB作動状態を示すデータを、消去処理を待たずに直ちに書き込むことができるようになる。
ここで、記憶ブロックAの消去が行われているときに、電源瞬停による一時的なシャットダウンが発生しても、記憶ブロックBには、「動作中(不定)」を示すデータが最新データとして保存されているから、CPU35は、再起動したときに、記憶ブロックBに保存されている「動作中(不定)」を示すデータに基づき、動作途中であったことを正しく認識できる。
If the storage block A is erased and the latest data indicating the PKB operating state is written again, the number of free NVs in the writing area returns to the number exceeding the set number NTH. Therefore, when a request to update the data indicating the PKB operating state occurs. Free space is secured for writing the update data related to. Therefore, the CPU 35 can immediately write the data indicating the PKB operating state without waiting for the erasing process.
Here, even if a temporary shutdown occurs due to a momentary power failure while the storage block A is being erased, the data indicating "operating (indefinite)" is the latest data in the storage block B. Since it is saved, the CPU 35 can correctly recognize that it was in the middle of operation based on the data indicating "in operation (indefinite)" stored in the storage block B when it is restarted.

したがって、CPU35は、電動モータ32RL,32RR(駆動機構)に大きな負荷が加わる操作量の出力を抑制でき、また、電動式パーキングブレーキ装置30の作動状態が動作中であるのに、CPU35が、規定の締結トルク(制動力)が確保されている「保持(締結)」状態であると車両の運転者に誤って知らせてしまうことを抑止できる。
CPU35は、消去後の記憶ブロックAにPKB作動状態のデータを書き込んだ後、ステップS305に進み、RAM37に展開させていた故障情報などを記憶ブロックAに書き込んで保存されるようにする。
Therefore, the CPU 35 can suppress the output of the operation amount in which a large load is applied to the electric motors 32RL and 32RR (drive mechanism), and the CPU 35 defines the operating state of the electric parking brake device 30. It is possible to prevent the driver of the vehicle from being erroneously notified that the fastening torque (braking force) of the vehicle is secured in the "holding (fastening)" state.
After writing the data of the PKB operating state to the erased storage block A, the CPU 35 proceeds to step S305 to write the failure information and the like expanded in the RAM 37 to the storage block A and save the data.

上記のように、CPU35は、PKB作動状態のデータを記憶ブロックA及び記憶ブロックBに更新要求発生時に直ちに書き込んだ後、記憶ブロックAについて書き込み結果を検証し、記憶ブロックAに「動作中(不定)」を示すデータを書き込み、かつ、記憶ブロックAにおける書き込み領域の空き数NVが設定数NTH以下になっている場合には、記憶ブロックAを消去して、「動作中(不定)」を示すデータを改めて記憶ブロックAに書き込む。 As described above, the CPU 35 immediately writes the data of the PKB operating state to the storage block A and the storage block B when the update request is generated, then verifies the writing result for the storage block A, and "operates (indefinite)" to the storage block A. ) ”, And when the free space NV of the write area in the storage block A is less than or equal to the set number NTH, the storage block A is deleted and“ operating (undefined) ”is indicated. The data is written to the storage block A again.

係る記憶ブロックAについての書き込み結果の検証処理が終了すると、CPU35は、ステップS108以降に進んで、記憶ブロックBについても同様な検証処理を実施する。
つまり、CPU35は、ステップS108で、記憶ブロックBへのPKB作動状態のデータの書き込みが正常に行われたか否かを判断する。
When the verification process of the writing result for the storage block A is completed, the CPU 35 proceeds to step S108 and subsequent steps to perform the same verification process for the storage block B as well.
That is, in step S108, the CPU 35 determines whether or not the data in the PKB operating state has been normally written to the storage block B.

そして、正常に書き込みが行われた場合、CPU35は、ステップS109に進んで、記憶ブロックBに書き込んだデータが「動作中(不定)」を示すデータであったか否かを判別する。
記憶ブロックBに「動作中(不定)」のデータを書き込んだ場合、CPU35は、ステップS110に進み、記憶ブロックBにおける書き込み領域の空き数NVが設定数NTH以下になっているか否かを判断する。
Then, when the writing is normally performed, the CPU 35 proceeds to step S109 and determines whether or not the data written in the storage block B is the data indicating "operating (indefinite)".
When "operating (indefinite)" data is written to the storage block B, the CPU 35 proceeds to step S110 and determines whether or not the free space NV of the write area in the storage block B is equal to or less than the set number NTH. ..

書き込み領域の空き数NVが設定数NTH以下になっている場合、CPU35は、ステップS111に進んで記憶ブロックBを消去し、消去後に「動作中(不定)」のデータを記憶ブロックBに再度書き込む。
この記憶ブロックBの消去中に電源瞬停などによって処理が中断された場合、再起動時には記憶ブロックAに「動作中(不定)」のデータが保存されていて、CPU35は、「動作中(不定)」であることを正しく認識できる。
When the free space NV of the writing area is less than or equal to the set number NTH, the CPU 35 proceeds to step S111 to erase the storage block B, and after erasing, writes the “operating (undefined)” data to the storage block B again. ..
If the process is interrupted due to a momentary power failure or the like while erasing the storage block B, the data of "operating (undefined)" is saved in the storage block A at the time of restarting, and the CPU 35 is "operating (undefined)". ) ”Can be correctly recognized.

上記実施形態で説明した各技術的思想は、矛盾が生じない限りにおいて、適宜組み合わせて使用することができる。
また、好ましい実施形態を参照して本発明の内容を具体的に説明したが、本発明の基本的技術思想及び教示に基づいて、当業者であれば、種々の変形態様を採り得ることは自明である。
例えば、前述の一態様において、CPU35は、「動作中(不定)」のデータを書き込んだときに書き込み領域の空き数が設定数以下であれば、記憶ブロックA,B毎に消去を実行するが、「保持(締結)」又は「非保持(解放)」を書き込んだときにも、書き込み領域の空き数が設定数以下であれば、記憶ブロックA,B毎に消去を実行する構成とすることができる。
The technical ideas described in the above embodiments can be used in combination as appropriate as long as there is no contradiction.
In addition, although the contents of the present invention have been specifically described with reference to preferred embodiments, it is obvious that those skilled in the art can adopt various modifications based on the basic technical idea and teaching of the present invention. Is.
For example, in the above-described embodiment, the CPU 35 executes erasing for each of the storage blocks A and B if the number of free writing areas is equal to or less than the set number when the “operating (indefinite)” data is written. , Even when "hold (conclude)" or "non-hold (release)" is written, if the number of free writing areas is less than or equal to the set number, the configuration shall be such that erasing is executed for each storage block A or B. Can be done.

また、前述の一態様において、自動車の駆動機構として電動式パーキングブレーキ装置30を例示したが、電動式パーキングブレーキ装置30に限定されず、書き込み後に次のデータの書き込みが可能な状態で記憶ブロック毎に消去を実行させる技術は、作動状態を記憶させる公知の駆動機構に適用することができる。
また、前述の一態様において、不揮発性メモリであるフラッシュEEPROM36は、データを冗長に格納するための2つの記憶ブロックA,Bを備えるが、3つ以上の記憶ブロックを備えてそれぞれにデータを格納させる構成においても、書き込み後に次のデータの書き込みが可能な状態で記憶ブロック毎に消去を実行させる技術を適用できる。
Further, in the above-described aspect, the electric parking brake device 30 has been illustrated as the drive mechanism of the automobile, but the present invention is not limited to the electric parking brake device 30, and the next data can be written to each storage block after writing. The technique of causing the erasure to be executed can be applied to a known drive mechanism that stores the operating state.
Further, in the above-described aspect, the flash EEPROM 36, which is a non-volatile memory, includes two storage blocks A and B for redundantly storing data, but includes three or more storage blocks and stores data in each. Even in the configuration of writing, a technique of executing erasing for each storage block in a state where the next data can be written after writing can be applied.

また、前述の一態様において、フラッシュEEPROM36は、マイクロコンピュータ34内蔵の不揮発性メモリであるが、マイクロコンピュータ34の外部に備えられたフラッシュEEPROMなどの不揮発性メモリが、データを冗長に格納するための複数の記憶ブロックを備える構成において、データの書き込み後に次のデータの書き込みが可能な状態で記憶ブロック毎に消去を実行させる技術を適用できる。 Further, in the above-described aspect, the flash EEPROM 36 is a non-volatile memory built in the microcomputer 34, but the non-volatile memory such as the flash EEPROM provided outside the microcomputer 34 redundantly stores the data. In a configuration including a plurality of storage blocks, a technique of executing erasure for each storage block in a state in which the next data can be written after the data is written can be applied.

ここで、上述した実施形態から把握し得る技術的思想について、以下に記載する。
自動車用制御装置は、その一態様において、自動車の電動式パーキングブレーキ装置を制御する制御装置であって、前記電動式パーキングブレーキ装置の作動状態を示すデータを冗長に格納するための2つの記憶ブロックを備えた不揮発性メモリと、前記2つの不揮発性メモリへのアクセスを行う制御部と、を有し、前記制御部が前記2つの記憶ブロックに書き込む作動状態のデータは、締結状態を示す第1データと、解放状態を示す第2データと、締結状態と解放状態との間の動作状態を示す第3データとのいずれかであり、前記制御部は、前記第3データを前記2つの記憶ブロックそれぞれに書き込んだ後に、空き領域が設定値を下回る記憶ブロックについて消去を実行してデータの再書き込みを行う、自動車用制御装置。
Here, the technical ideas that can be grasped from the above-described embodiments will be described below.
In one aspect, the automobile control device is a control device that controls an electric parking brake device of an automobile, and is two storage blocks for redundantly storing data indicating an operating state of the electric parking brake device. The data of the operating state, which includes a non-volatile memory provided with the above and a control unit for accessing the two non-volatile memories, and the control unit writes to the two storage blocks, is a first state indicating a fastening state. The data, the second data indicating the released state, and the third data indicating the operating state between the fastened state and the released state, and the control unit stores the third data in the two storage blocks. A control device for automobiles that erases and rewrites data for storage blocks whose free space is less than the set value after writing to each.

31…電動パーキングECU(自動車用制御装置)、35…CPU(制御部)、36…フラッシュEEPROM(不揮発性メモリ) 31 ... Electric parking ECU (automobile control unit), 35 ... CPU (control unit), 36 ... Flash EEPROM (nonvolatile memory)

Claims (4)

データを冗長に格納するための複数の記憶ブロックを備えた不揮発性メモリと、
前記不揮発性メモリへのアクセスを行う制御部と、
を有する、自動車用制御装置であって、
前記制御部は、
規定のデータを複数の記憶ブロックそれぞれに書き込んだ後に、空き領域数が設定数を下回る記憶ブロックについて消去を実行し、前記規定データ以外のデータを複数の記憶ブロックそれぞれに書き込んだ後は記憶ブロックの消去を行わない、
自動車用制御装置。
Non-volatile memory with multiple storage blocks for redundant data storage,
A control unit that accesses the non-volatile memory and
To have a, a motor vehicle control device,
The control unit
After writing the specified data to each of the plurality of storage blocks, erasing is executed for the storage blocks whose number of free areas is less than the set number, and after writing the data other than the specified data to each of the plurality of storage blocks, the storage blocks Do not erase,
Control device for automobiles.
データを冗長に格納するための複数の記憶ブロックを備えた不揮発性メモリと、
前記不揮発性メモリへのアクセスを行う制御部と、
を有し、自動車の駆動機構を制御する自動車用制御装置であって、
前記制御部は、
前記駆動機構の作動状態を示すデータのうちの規定のデータを複数の記憶ブロックそれぞれに書き込んだ後に、空き領域数が設定数を下回る記憶ブロックについて消去を実行し、前記規定データ以外のデータを複数の記憶ブロックそれぞれに書き込んだ後は記憶ブロックの消去を行わない、
自動車用制御装置。
Non-volatile memory with multiple storage blocks for redundant data storage,
A control unit that accesses the non-volatile memory and
It is a control device for automobiles that controls the drive mechanism of the automobile.
The control unit
After writing the specified data among the data indicating the operating state of the drive mechanism to each of the plurality of storage blocks, the storage blocks whose number of free areas is less than the set number are erased, and a plurality of data other than the specified data are stored. After writing to each of the storage blocks, the storage blocks are not erased.
Control device for automobiles.
データを冗長に格納するための複数の記憶ブロックを備えた不揮発性メモリと、
前記不揮発性メモリへのアクセスを行う制御部と、
を有し、自動車の電動式パーキングブレーキ装置を制御する自動車用制御装置であって、
前記制御部は、
前記電動式パーキングブレーキ装置の作動状態を示すデータのうちの規定のデータを複数の記憶ブロックそれぞれに書き込んだ後に、空き領域数が設定数を下回る記憶ブロックについて消去を実行し、前記規定データ以外のデータを複数の記憶ブロックそれぞれに書き込んだ後は記憶ブロックの消去を行わない、
自動車用制御装置。
Non-volatile memory with multiple storage blocks for redundant data storage,
A control unit that accesses the non-volatile memory and
It is an automobile control device that controls an electric parking brake device of an automobile.
The control unit
After writing the specified data among the data indicating the operating state of the electric parking brake device to each of the plurality of storage blocks, the storage blocks whose number of free areas is less than the set number are erased, and the data other than the specified data are deleted. After writing data to each of multiple storage blocks, do not erase the storage blocks,
Control device for automobiles.
データを冗長に格納するための複数の記憶ブロックを備えた不揮発性メモリに、自動車の電動式パーキングブレーキ装置の作動状態を示すデータを書き込むための不揮発性メモリの書き込み方法であって、
前記電動式パーキングブレーキ装置の作動状態を示すデータは、締結状態を示す第1データと、解放状態を示す第2データと、締結状態と解放状態との間の動作状態を示す第3データとのいずれかであり、
前記電動式パーキングブレーキ装置の作動状態を示すデータを複数の記憶ブロックそれぞれに書き込み、
前記第3データを各記憶ブロックに書き込んだときにデータ書き込み後の記憶ブロックの空き領域数と設定数とを比較し、
空き領域数が設定数を下回る記憶ブロックについて消去を実行する、
不揮発性メモリの書き込み方法。
A method of writing a non-volatile memory for writing data indicating an operating state of an electric parking brake device of an automobile to a non-volatile memory provided with a plurality of storage blocks for redundantly storing data.
The data indicating the operating state of the electric parking brake device includes the first data indicating the engaged state, the second data indicating the released state, and the third data indicating the operating state between the engaged state and the released state. Is either
Data indicating the operating state of the electric parking brake device is written in each of the plurality of storage blocks, and the data is written in each of the plurality of storage blocks.
When the third data is written to each storage block, the number of free areas in the storage block after the data is written is compared with the set number.
Erases storage blocks whose free space is less than the set number.
How to write non-volatile memory.
JP2017175706A 2017-09-13 2017-09-13 How to write control devices for automobiles and non-volatile memory Active JP6898186B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017175706A JP6898186B2 (en) 2017-09-13 2017-09-13 How to write control devices for automobiles and non-volatile memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017175706A JP6898186B2 (en) 2017-09-13 2017-09-13 How to write control devices for automobiles and non-volatile memory

Publications (2)

Publication Number Publication Date
JP2019053396A JP2019053396A (en) 2019-04-04
JP6898186B2 true JP6898186B2 (en) 2021-07-07

Family

ID=66013391

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017175706A Active JP6898186B2 (en) 2017-09-13 2017-09-13 How to write control devices for automobiles and non-volatile memory

Country Status (1)

Country Link
JP (1) JP6898186B2 (en)

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3268130B2 (en) * 1994-07-20 2002-03-25 株式会社東芝 Data processing device using flash EEPROM
JP2002073425A (en) * 2000-08-31 2002-03-12 Hitachi Ltd Reproducing unit for medium
JP4143952B2 (en) * 2001-03-12 2008-09-03 オムロン株式会社 Memory backup method and apparatus
JP4662743B2 (en) * 2004-09-13 2011-03-30 Necインフロンティア株式会社 Data duplex system
JP4466582B2 (en) * 2006-02-17 2010-05-26 トヨタ自動車株式会社 Electric parking brake device
JP2008225922A (en) * 2007-03-13 2008-09-25 Rinnai Corp Nonvolatile storage device
JP6244780B2 (en) * 2013-09-27 2017-12-13 日産自動車株式会社 Engine start control device and engine start control method for hybrid vehicle

Also Published As

Publication number Publication date
JP2019053396A (en) 2019-04-04

Similar Documents

Publication Publication Date Title
JP4227149B2 (en) Information storage method for electronic control unit
US6430662B1 (en) Method and device for changing memory contents in a control unit, especially of a motor vehicle
JPH11107846A (en) Vehicular controller
CN105700419A (en) Control method and device of whole vehicle controller and whole vehicle control method and system
JP4789420B2 (en) Data processing apparatus for vehicle control system
JP6898186B2 (en) How to write control devices for automobiles and non-volatile memory
JP4001088B2 (en) Electronic control unit
JP6512065B2 (en) Electronic control unit
JP2002041367A (en) Vehicle controller
JP4281808B2 (en) VEHICLE CONTROL DEVICE AND ITS CONTROL METHOD
WO2018079537A1 (en) Electronic control unit and data protection method therefor
JP2007316800A (en) Onboard program rewriting controller
JP2004151944A (en) Method for writing data in non-volatile storage device, its program and device, and onboard electronic controller
JP4707411B2 (en) Electronic control device for vehicle
JPH0793006A (en) Electronic control unit for vehicle
JP5516509B2 (en) Program writing system
JP2006193017A (en) Vehicle information recording device and vehicle information recording method
JP2006134016A (en) Installation method for firmware of firmware built-in equipment, and boot program
JPH09171459A (en) Electronic control equipment
JP6699591B2 (en) Engine controller
WO2022215402A1 (en) Vehicle electronic control device and program rewriting method
KR101284657B1 (en) method for storing diagnosis data in electric brake system
JP2006018594A (en) Information processor
JP3947643B2 (en) Data control device
JP2001229014A (en) Non-volatile memory rewriting device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20191121

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200911

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20201013

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20201211

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20210511

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210610

R150 Certificate of patent or registration of utility model

Ref document number: 6898186

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150