JP2020052181A - Microcomputer - Google Patents

Microcomputer Download PDF

Info

Publication number
JP2020052181A
JP2020052181A JP2018180326A JP2018180326A JP2020052181A JP 2020052181 A JP2020052181 A JP 2020052181A JP 2018180326 A JP2018180326 A JP 2018180326A JP 2018180326 A JP2018180326 A JP 2018180326A JP 2020052181 A JP2020052181 A JP 2020052181A
Authority
JP
Japan
Prior art keywords
data
storage
value
value information
microcomputer
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
JP2018180326A
Other languages
Japanese (ja)
Inventor
洋平 藤田
Yohei Fujita
洋平 藤田
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.)
Denso Corp
Original Assignee
Denso Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Corp filed Critical Denso Corp
Priority to JP2018180326A priority Critical patent/JP2020052181A/en
Publication of JP2020052181A publication Critical patent/JP2020052181A/en
Pending legal-status Critical Current

Links

Abstract

To suppress the unauthorized acquisition of data and shorten data write and read processing time.SOLUTION: A microcomputer 1 comprises a flash memory 3, a flash controller 6, and a CPU 2. The flash memory 3 is a nonvolatile memory the storage content of which is rewritable and is constituted so that information which is not a data value and indicates whether being a blank state or not can be set and stored as non-value information for each of a plurality of stored storage data. The flash controller 6 specifies the non-value information that is set to the storage data, for each of the plurality of storage data stored in the flash memory 3. The CPU 2 converts each of the plurality of specified non-value information to a 0 when the non-value information is a "blank state" and to a 1 when the non-value information is not the "blank state."SELECTED DRAWING: Figure 1

Description

本開示は、データ書き換え可能な不揮発性メモリを有するマイクロコンピュータに関する。   The present disclosure relates to a microcomputer having a data rewritable nonvolatile memory.

特許文献1には、メモリに格納された秘密データの漏洩を抑制するために、メモリに格納されたデータを暗号化することが記載されている。
電子制御装置に不正機器が接続されると、電子制御装置に搭載されたフラッシュメモリに記憶されているデータが不正に取得されてしまうおそれがある。このようなデータ不正取得を抑制するために、一般に、特許文献1に記載のようにデータを暗号化する技術が利用されている。
Patent Literature 1 discloses that data stored in a memory is encrypted in order to suppress leakage of secret data stored in the memory.
If an unauthorized device is connected to the electronic control unit, data stored in the flash memory mounted on the electronic control unit may be obtained illegally. In order to suppress such illegal data acquisition, generally, a technique for encrypting data as described in Patent Document 1 is used.

特開2016−224829号公報JP-A-2006-224829

しかし、電子制御装置に搭載されたフラッシュメモリに記憶されるデータを暗号化するためには、フラッシュメモリにデータを書き込む度に暗号処理を実行し、フラッシュメモリからデータを読み出す度に復号処理を実行する必要がある。このため、データの書き込みと読み込みにおいて、処理時間が長くなってしまうという問題があった。   However, in order to encrypt data stored in the flash memory mounted on the electronic control unit, an encryption process is executed each time data is written to the flash memory, and a decryption process is executed each time data is read from the flash memory. There is a need to. For this reason, there has been a problem that the processing time becomes longer in writing and reading data.

本開示は、データの不正取得を抑制するとともに、データの書き込みと読み込みの処理時間を短縮することを目的とする。   An object of the present disclosure is to suppress unauthorized acquisition of data and to shorten the processing time for writing and reading data.

本開示の一態様は、データ記憶部(3)と、特定部(6)と、変換部(S250〜S270)とを備えるマイクロコンピュータ(1)である。
データ記憶部は、記憶内容の書き換えが可能な不揮発性メモリであり、且つ、記憶された複数の記憶データのそれぞれに対して、データ値ではない情報である非値情報を設定して記憶可能に構成される。
One embodiment of the present disclosure is a microcomputer (1) including a data storage unit (3), a specification unit (6), and a conversion unit (S250 to S270).
The data storage unit is a rewritable non-volatile memory, and can store and store non-value information, which is information other than a data value, for each of a plurality of stored storage data. Be composed.

特定部は、データ記憶部に記憶された複数の記憶データのそれぞれについて、記憶データに設定されている非値情報を特定するように構成される。
変換部は、特定部により特定された複数の非値情報のそれぞれについて、非値情報を、非値情報に応じて予め設定された変換値に変換するように構成される。
The specifying unit is configured to specify, for each of the plurality of storage data stored in the data storage unit, non-value information set in the storage data.
The conversion unit is configured to convert the non-value information for each of the plurality of non-value information specified by the specifying unit into a conversion value set in advance according to the non-value information.

このように構成された本開示のマイクロコンピュータは、データ値ではない情報である非値情報を、非値情報に応じて予め設定された変換値に変換することにより、データ記憶部に隠蔽された隠蔽データを復元することができる。そして、本開示のマイクロコンピュータは、隠蔽データを復元するための情報を、データ値ではない情報で記憶する。このため、本開示のマイクロコンピュータに不正機器が接続された場合に、不正機器は、データ記憶部に記憶された複数の記憶データを取得することができても、データ値ではない情報である非値情報を取得することができない。これにより、本開示のマイクロコンピュータは、データの不正取得を抑制することができる。   The microcomputer of the present disclosure configured as described above converts the non-value information, which is information that is not a data value, into a conversion value that is set in advance according to the non-value information, thereby being hidden in the data storage unit. The hidden data can be restored. Then, the microcomputer of the present disclosure stores information for restoring hidden data as information that is not a data value. For this reason, when an unauthorized device is connected to the microcomputer of the present disclosure, even if the unauthorized device can acquire a plurality of stored data stored in the data storage unit, the unauthorized device is information that is not a data value. Value information cannot be obtained. Thereby, the microcomputer of the present disclosure can suppress unauthorized acquisition of data.

さらに、本開示のマイクロコンピュータは、非値情報を変換値に変換することにより隠蔽データを復元することができるため、暗号処理および復号処理を実行する必要がない。これにより、本開示のマイクロコンピュータは、隠蔽データをデータ記憶部に隠蔽するために行われるデータの書き込みと読み込みの処理時間を短縮することができる。
なお、暗号・復号方式では、元データを計算して暗号データを作るため、時間をかければ、不正取得したデータから解読が可能である。これに対し、本開示のマイクロコンピュータでは、不正取得したデータと、隠蔽したデータとの間に関係がないため、不正取得したデータから解読が不可能である。
Furthermore, since the microcomputer of the present disclosure can restore the hidden data by converting the non-value information into the converted value, there is no need to execute the encryption processing and the decryption processing. Accordingly, the microcomputer of the present disclosure can reduce the processing time for writing and reading data that is performed to hide the hidden data in the data storage unit.
In the encryption / decryption method, since the original data is calculated to generate the encrypted data, it is possible to decrypt the illegally acquired data if it takes time. On the other hand, in the microcomputer of the present disclosure, since there is no relation between the illegally acquired data and the concealed data, it is impossible to decrypt the illegally acquired data.

マイコンの構成を示すブロック図である。FIG. 2 is a block diagram illustrating a configuration of a microcomputer. ブランクチェックの原理を説明する図である。It is a figure explaining the principle of a blank check. データ書込処理を示すフローチャートである。It is a flowchart which shows a data write process. 隠蔽データの書き込みを説明する図である。FIG. 4 is a diagram illustrating writing of concealment data. データ読出処理を示すフローチャートである。It is a flowchart which shows a data reading process. 隠蔽データの読み出しを説明する図である。It is a figure explaining reading of concealment data.

以下に本開示の実施形態を図面とともに説明する。
本実施形態のマイクロコンピュータ1(以下、マイコン1)は、図1に示すように、CPU2と、フラッシュメモリ3と、RAM4と、入出力インターフェース5(以下、I/O5)と、フラッシュコントローラ6と、これらの構成を接続するバスライン7とを備える。
Hereinafter, embodiments of the present disclosure will be described with reference to the drawings.
As shown in FIG. 1, a microcomputer 1 (hereinafter, a microcomputer 1) of the present embodiment includes a CPU 2, a flash memory 3, a RAM 4, an input / output interface 5 (hereinafter, an I / O 5), a flash controller 6, And a bus line 7 for connecting these components.

マイクロコンピュータの各種機能は、CPU2が非遷移的実体的記録媒体に格納されたプログラムを実行することにより実現される。この例では、フラッシュメモリ3が、プログラムを格納した非遷移的実体的記録媒体に該当する。また、このプログラムの実行により、プログラムに対応する方法が実行される。なお、CPU2が実行する機能の一部または全部を、一つあるいは複数のIC等によりハードウェア的に構成してもよい。   Various functions of the microcomputer are realized by the CPU 2 executing a program stored in a non-transitional substantial recording medium. In this example, the flash memory 3 corresponds to a non-transitional substantive recording medium storing a program. In addition, by executing this program, a method corresponding to the program is executed. Note that part or all of the functions executed by the CPU 2 may be configured in hardware by one or a plurality of ICs or the like.

フラッシュメモリ3は、データ書き換え可能な不揮発性メモリである。フラッシュメモリ3の記憶領域は、所定データサイズ(例えば4K〜64Kバイト程度)を有する複数のブロックに分割されており、ブロック毎にデータの書き換えと消去とを実行するように構成されている。以下、このブロックをセクタという。   The flash memory 3 is a data rewritable nonvolatile memory. The storage area of the flash memory 3 is divided into a plurality of blocks having a predetermined data size (for example, about 4K to 64K bytes), and is configured to execute data rewriting and erasing for each block. Hereinafter, this block is called a sector.

RAM4は、揮発性メモリであり、CPU2の演算結果等を一時的に記憶する。またRAM4は、フラッシュメモリ3から読み出されたデータと、フラッシュメモリ3に書き込むデータとを一時的に記憶する。   The RAM 4 is a volatile memory, and temporarily stores calculation results of the CPU 2 and the like. The RAM 4 temporarily stores data read from the flash memory 3 and data to be written to the flash memory 3.

I/O5は、マイコン1の外部とマイコン1との間で信号の入出力を行わせるための回路である。
フラッシュコントローラ6は、CPU2から与えられる指令に基づいて、フラッシュメモリ3にデータを書き込む処理と、フラッシュメモリ3に記憶されているデータを消去する処理と、後述のブランクチェックとを実行する。
The I / O 5 is a circuit for inputting and outputting signals between the outside of the microcomputer 1 and the microcomputer 1.
The flash controller 6 executes a process of writing data to the flash memory 3, a process of erasing data stored in the flash memory 3, and a blank check described later, based on a command given from the CPU 2.

フラッシュメモリ3は、複数のメモリセルを備え、1ビットのデータの記憶のために、2個のメモリセルを用いる。以下、1ビットのデータを構成する2個のメモリセルのうち、一方のメモリセルを第1メモリセル、他方のメモリセルを第2メモリセルという。   The flash memory 3 includes a plurality of memory cells, and uses two memory cells for storing 1-bit data. Hereinafter, of the two memory cells forming 1-bit data, one memory cell is referred to as a first memory cell, and the other memory cell is referred to as a second memory cell.

各メモリセルは、フローティングゲートを備える。そしてフラッシュメモリ3は、フローティングゲートに電子を注入したり、フローティングゲートから電子を抜き取ったりすることにより、メモリセルの電位を、電位Vと電位Vの間で変化させる。 Each memory cell has a floating gate. The flash memory 3, or by injecting electrons into the floating gate, by or withdrawn electrons from the floating gate, the potential of the memory cell is varied between the potential V L and the potential V H.

図2に示すように、1を記憶させる場合には、第1メモリセルの電位V1(以下、第1セル電位V1)を、電位V付近に設定し、第2メモリセルの電位V2(以下、第2セル電位V2)を、電位V付近に設定する。この場合には、第1セル電位V1が第2セル電位V2よりも高くなるため、1が記憶されていると判断することができる。 As shown in FIG. 2, the case of storing the 1, the first potential of the memory cell V1 (hereinafter, the first cell potential V1), and is set in the vicinity of potential V H, the potential of the second memory cell V2 (hereinafter , The second cell potential V2) is set near the potential VL . In this case, since the first cell potential V1 becomes higher than the second cell potential V2, it can be determined that 1 is stored.

また、0を記憶させる場合には、第1セル電位V1を、電位V付近に設定し、第2セル電位V2を、電位V付近に設定する。この場合には、第2セル電位V2が第1セル電位V1よりも高くなるため、0が記憶されていると判断することができる。 Further, in the case of storing 0, the first cell potential V1, is set in the vicinity of potential V L, the second cell potential V2, set in the vicinity of potential V H. In this case, since the second cell potential V2 is higher than the first cell potential V1, it can be determined that 0 is stored.

また、データを消去する場合には、第1セル電位V1を、電位V付近に設定し、第2メモリセルの電位V2を、電位V付近に設定する。この場合には、第1メモリセルの電位V1と第2メモリセルの電位V2が予め設定されたブランク判定電位VBC未満となるため、データが消去されている状態(以下、ブランク状態)であると判断することができる。ブランク状態である場合において、第1セル電位V1が第2セル電位V2より高い場合には、1が記憶されていると判断することができる。一方、ブランク状態である場合において、第2セル電位V2が第1セル電位V1より高い場合には、0が記憶されていると判断することができる。すなわち、ブランク状態において記憶されている値は、第1セル電位V1および第2セル電位V2に応じて変動し、不定である。 When erasing data, the first cell potential V1 is set near the potential VL , and the potential V2 of the second memory cell is set near the potential VL . In this case, since the potential V1 of the first memory cell and the potential V2 of the second memory cell are lower than a preset blank determination potential VBC , the data is erased (hereinafter, a blank state). Can be determined. In the blank state, when the first cell potential V1 is higher than the second cell potential V2, it can be determined that 1 is stored. On the other hand, in the blank state, if the second cell potential V2 is higher than the first cell potential V1, it can be determined that 0 is stored. That is, the value stored in the blank state varies according to the first cell potential V1 and the second cell potential V2, and is indefinite.

このように、第1セル電位V1と第2セル電位V2とに基づいて、ブランク状態であるか否かを判断するブランクチェックは、CPU2から与えられる指令に基づいてフラッシュコントローラ6が実行することにより実現される。すなわち、マイコン1の外部からマイコン1のフラッシュメモリ3にアクセスしても、ブランク状態であるか否かを検出することはできない。   In this way, the flash controller 6 executes the blank check for determining whether or not a blank state is present based on the first cell potential V1 and the second cell potential V2 based on a command given from the CPU 2. Is achieved. That is, even if the flash memory 3 of the microcomputer 1 is accessed from outside the microcomputer 1, it is not possible to detect whether the flash memory 3 is in a blank state.

次に、CPU2が実行するデータ書込処理の手順を説明する。データ書込処理は、隠蔽する必要があるデータ(以下、隠蔽データ)を書き込むときに実行される。
データ書込処理が実行されると、CPU2は、図3に示すように、まずS10にて、隠蔽データを書き込むセクタ(以下、対象セクタ)に記憶されている全データを消去する。
Next, the procedure of the data writing process executed by the CPU 2 will be described. The data writing process is executed when writing data that needs to be hidden (hereinafter, hidden data).
When the data writing process is performed, as shown in FIG. 3, first, in S10, the CPU 2 erases all data stored in a sector (hereinafter, a target sector) in which hidden data is to be written.

次にS20にて、16進数で表されている隠蔽データを2進数に変換する。例えば、隠蔽データが「AA」である場合には、隠蔽データは、「10101010」に変換される。以下、2進数に変換されたデータを2進数変換データという。また、2進数変換データを構成する複数のビットのそれぞれを1ビット変換データという。例えば、上記の「10101010」は2進数変換データである。また、「10101010」を構成する「1」,「0」,「1」,「0」,「1」,「0」,「1」,「0」はそれぞれ、1ビット変換データである。   Next, in S20, the concealment data represented by a hexadecimal number is converted into a binary number. For example, if the concealment data is “AA”, the concealment data is converted to “10101010”. Hereinafter, the data converted into a binary number is referred to as binary converted data. Each of a plurality of bits forming the binary conversion data is referred to as 1-bit conversion data. For example, the above “10101010” is binary conversion data. “1”, “0”, “1”, “0”, “1”, “0”, “1”, and “0” that constitute “10101010” are 1-bit converted data.

さらにS30にて、対象セクタにおいて、1ビット変換データを最初に書き込む先頭アドレスを設定する。具体的には、RAM4に設けられた書込指示アドレスADwに、上記先頭アドレスに対応する値を格納する。   Further, in S30, the head address for writing the 1-bit conversion data first in the target sector is set. Specifically, a value corresponding to the above-mentioned head address is stored in the write instruction address ADw provided in the RAM 4.

そしてS40にて、S20で2進数に変換された1ビット変換データの全てが対象セクタに書き込まれたか否かを判断する。ここで、全ての1ビット変換データが書き込まれていない場合には、S50にて、対象セクタに書き込まれていない1ビット変換データの中から、最も上位のビットの1ビット変換データを選択する。例えば、上記の「10101010」では、左端の「1」が最も上位のビットであり、右端の「0」が最も下位のビットである。   Then, in S40, it is determined whether or not all of the 1-bit converted data converted into binary numbers in S20 has been written in the target sector. Here, if all the 1-bit converted data has not been written, in S50, the 1-bit converted data of the most significant bit is selected from the 1-bit converted data not written in the target sector. For example, in the above “10101010”, the leftmost “1” is the most significant bit, and the rightmost “0” is the least significant bit.

さらにS60にて、S50で選択された1ビット変換データが「1」であるか否かを判断する。ここで、1ビット変換データが「1」である場合には、S70にて、書込指示アドレスADwが示すアドレスにより特定される2バイト分の記憶領域から2バイトのデータを読み出し、読み出したデータを、読み出した時と同じ記憶領域に書き込み、S80に移行する。一方、S50で選択された1ビット変換データが「0」である場合には、S80に移行する。   Further, in S60, it is determined whether or not the 1-bit conversion data selected in S50 is “1”. If the 1-bit conversion data is “1”, 2-byte data is read from the 2-byte storage area specified by the address indicated by the write instruction address ADw in S70, and the read data is read. Is written in the same storage area as when the data was read out, and the routine goes to S80. On the other hand, if the one-bit conversion data selected in S50 is "0", the flow shifts to S80.

そしてS80に移行すると、書込指示アドレスADwに格納されている値に、2バイトに相当する値を加算して、この加算値を書込指示アドレスADwに格納し、S40に移行する。これにより、書込指示アドレスADwが示すアドレスは、2バイトだけ大きくなるように更新される。   Then, when the flow shifts to S80, a value corresponding to 2 bytes is added to the value stored in the write instruction address ADw, the added value is stored in the write instruction address ADw, and the flow shifts to S40. Thereby, the address indicated by the write instruction address ADw is updated so as to be increased by 2 bytes.

またS40にて、1ビット変換データの全てが対象セクタに書き込まれた場合には、データ書込処理を終了する。
例えば、図4に示すように、対象セクタに記憶されているデータを消去した場合に、対象セクタのデータは、アドレスが小さい順に、16進数で、「0137」,「971F」,「129A」,「87BD」,「8461」,「01AA」,「BA17」,「3C89」,「AADB」,・・・となっているとする。なお、これらの「0137」,「971F」,「129A」,「87BD」,「8461」,「01AA」,「BA17」,「3C89」,「AADB」,・・・のデータに対してブランクチェックを実行すると、全てブランク状態であると判断される。
If all of the 1-bit converted data has been written to the target sector in S40, the data writing process ends.
For example, as shown in FIG. 4, when the data stored in the target sector is erased, the data of the target sector is “0137”, “971F”, “129A”, It is assumed that “87BD”, “8461”, “01AA”, “BA17”, “3C89”, “AADB”,. Note that these "0137", "971F", "129A", "87BD", "8461", "01AA", "BA17", "3C89", "AADB",. Is executed, it is determined that all the blocks are in the blank state.

そして、隠蔽データが「AA」である場合には、隠蔽データは、「10101010」に変換される。このため、「0137」,「129A」,「8461」,「BA17」となっている領域は、同一のデータが書き込まれる。これにより、「0137」,「129A」,「8461」,「BA17」が書き込まれている領域に対してブランクチェックを実行すると、ブランク状態でないと判断される。   If the concealed data is “AA”, the concealed data is converted to “10101010”. Therefore, the same data is written in the areas “0137”, “129A”, “8461”, and “BA17”. As a result, when a blank check is performed on an area in which “0137”, “129A”, “8461”, and “BA17” are written, it is determined that the area is not a blank state.

一方、「971F」,「87BD」,「01AA」,「3C89」となっている領域は、同一データの書き込みが行われない。これにより、「971F」,「87BD」,「01AA」,「3C89」となっている領域に対してブランクチェックを実行すると、ブランク状態であると判断される。   On the other hand, in the areas “971F”, “87BD”, “01AA”, and “3C89”, the same data is not written. As a result, when a blank check is performed on the areas of "971F", "87BD", "01AA", and "3C89", it is determined that the area is in the blank state.

次に、CPU2が実行するデータ読出処理の手順を説明する。データ読出処理は、隠蔽データを読み出すときに実行される。
データ読出処理が実行されると、CPU2は、図5に示すように、まずS210にて、対象セクタにおいて、ブランクチェックを実行する先頭アドレスを設定する。具体的には、RAM4に設けられたチェック指示アドレスADcに、上記先頭アドレスに対応する値を格納する。
Next, a procedure of a data reading process executed by the CPU 2 will be described. The data reading process is executed when the hidden data is read.
When the data reading process is performed, as shown in FIG. 5, first, in S210, the CPU 2 sets a head address for performing a blank check in the target sector. Specifically, a value corresponding to the above-mentioned head address is stored in the check instruction address ADc provided in the RAM 4.

次にS220にて、対象セクタにおいて、読み出す隠蔽データが書き込まれている領域(以下、隠蔽データ書込領域)の全てについてブランクチェックが行われたか否かを判断する。ここで、隠蔽データ書込領域の全てについてブランクチェックが行われていない場合には、S230にて、チェック指示アドレスADcが示すアドレスにより特定される2バイト分の記憶領域を選択する。   Next, in S220, it is determined whether or not a blank check has been performed on all of the area where the hidden data to be read is written in the target sector (hereinafter, the hidden data writing area). If the blank check has not been performed for all of the hidden data writing areas, a storage area of 2 bytes specified by the address indicated by the check instruction address ADc is selected in S230.

次にS240にて、S230で選択した記憶領域に対して、フラッシュコントローラ6にブランクチェックを実行させる。そしてS250にて、S240の判断結果が「ブランク状態」であるか否かを判断する。ここで、「ブランク状態」である場合には、S260にて、RAM4に設けられたブランクチェックバッファに、「0」を格納し、S280に移行する。一方、「ブランク状態」でない場合には、S260にて、RAM4に設けられたブランクチェックバッファに、「1」を格納し、S280に移行する。なお、ブランクチェックバッファは、ブランクチェックバッファに格納された時刻が早い順にデータを格納する。   Next, in step S240, the flash controller 6 executes a blank check on the storage area selected in step S230. Then, in S250, it is determined whether or not the determination result in S240 is “blank state”. Here, in the case of the "blank state", "0" is stored in the blank check buffer provided in the RAM 4 in S260, and the flow shifts to S280. On the other hand, if the state is not “blank state”, “1” is stored in the blank check buffer provided in the RAM 4 in S260, and the flow shifts to S280. It should be noted that the blank check buffer stores data in order of earlier time stored in the blank check buffer.

そしてS280に移行すると、チェック指示アドレスADcに格納されている値に、2バイトに相当する値を加算して、この加算値をチェック指示アドレスADcに格納し、S220に移行する。これにより、チェック指示アドレスADcが示すアドレスは、2バイトだけ大きくなるように更新される。   Then, when the flow shifts to S280, a value corresponding to 2 bytes is added to the value stored in the check instruction address ADc, the added value is stored in the check instruction address ADc, and the flow shifts to S220. Thereby, the address indicated by the check instruction address ADc is updated so as to be increased by 2 bytes.

またS220にて、隠蔽データ書込領域の全てについてブランクチェックが行われた場合には、S290にて、ブランクチェックバッファに格納されている2進数のデータを16進数に変換して、データ読出処理を終了する。   If a blank check has been performed for all of the hidden data writing area in S220, the binary data stored in the blank check buffer is converted to hexadecimal in S290, and the data read processing is performed. To end.

例えば、図6に示すように、データ書込処理が実行された後の対象セクタには、アドレスが小さい順に、16進数で、「0137」,「971F」,「129A」,「87BD」,「8461」,「01AA」,「BA17」,「3C89」,「AADB」,・・・が記憶されているとする。なお、図6に示す対象セクタは、図4においてデータ書込処理が実行された後の対象セクタである。   For example, as shown in FIG. 6, in the target sectors after the data write process has been executed, “0137”, “971F”, “129A”, “87BD”, “87BD”, in hexadecimal notation, in ascending order of address 8461, "01AA", "BA17", "3C89", "AADB",... Note that the target sector shown in FIG. 6 is the target sector after the data writing process is executed in FIG.

その後、データ読出処理を実行すると、まず、「0137」に対してブランクチェックが実行されて、「ブランク状態」でないと判断される。これにより、ブランクチェックバッファに「1」が格納される。次に、「971F」に対してブランクチェックが実行されて、「ブランク状態」であると判断される。これにより、ブランクチェックバッファに「0」が格納される。同様に、「129A」,「87BD」,「8461」,「01AA」,「BA17」,「3C89」に対して順次ブランクチェックが実行されて、ブランクチェックの結果に応じて、ブランクチェックバッファに「1」,「0」,「1」,「0」,「1」,「0」が順次格納される。   Thereafter, when the data reading process is performed, first, a blank check is performed on “0137”, and it is determined that the data is not “blank state”. As a result, “1” is stored in the blank check buffer. Next, a blank check is performed on “971F”, and it is determined that the state is “blank state”. As a result, “0” is stored in the blank check buffer. Similarly, a blank check is sequentially performed on “129A”, “87BD”, “8461”, “01AA”, “BA17”, and “3C89”. "1", "0", "1", "0", "1", "0" are sequentially stored.

これにより、ブランクチェックバッファに格納されている2進数のデータは、「10101010」となる。そして、「10101010」を16進数に変換すると、「AA」が得られる。   As a result, the binary data stored in the blank check buffer becomes “10101010”. Then, when "10101010" is converted into a hexadecimal number, "AA" is obtained.

このように構成されたマイコン1は、フラッシュメモリ3と、フラッシュコントローラ6と、CPU2とを備える。
フラッシュメモリ3は、記憶内容の書き換えが可能な不揮発性メモリであり、且つ、記憶された複数の記憶データのそれぞれに対して、ブランク状態であるか否かを、データ値ではない情報である非値情報として設定して記憶可能に構成される。
The microcomputer 1 configured as described above includes a flash memory 3, a flash controller 6, and a CPU 2.
The flash memory 3 is a rewritable non-volatile memory, and determines whether or not each of a plurality of stored data is in a blank state, as non-data value information. It can be set and stored as value information.

フラッシュコントローラ6は、フラッシュメモリ3に記憶された複数の記憶データのそれぞれについて、記憶データに設定されている非値情報を特定する。
CPU2は、特定された複数の非値情報のそれぞれについて、非値情報が「ブランク状態」である場合には「0」に変換し、非値情報が「ブランク状態」でない場合には「1」に変換する。
The flash controller 6 specifies non-value information set in the storage data for each of the plurality of storage data stored in the flash memory 3.
The CPU 2 converts each of the specified plurality of non-value information into “0” when the non-value information is “blank state” and “1” when the non-value information is not “blank state”. Convert to

このようにマイコン1は、データ値ではない情報である非値情報を、非値情報に応じて「0」または「1」に変換することにより、フラッシュメモリ3に隠蔽された隠蔽データを復元することができる。そしてマイコン1は、隠蔽データを復元するための情報を、「ブランク状態」であるか否かというデータ値ではない情報で記憶する。このため、マイコン1に不正機器が接続された場合に、不正機器は、フラッシュメモリ3に記憶された複数の記憶データを取得することができても、データ値ではない情報である非値情報を取得することができない。これにより、マイコン1は、データの不正取得を抑制することができる。   In this manner, the microcomputer 1 restores the hidden data hidden in the flash memory 3 by converting the non-value information, which is information that is not a data value, into “0” or “1” according to the non-value information. be able to. Then, the microcomputer 1 stores the information for restoring the hidden data as information that is not a data value indicating whether or not the data is in the “blank state”. For this reason, when an unauthorized device is connected to the microcomputer 1, even if the unauthorized device can acquire a plurality of storage data stored in the flash memory 3, the unauthorized device transmits non-value information that is information that is not a data value. Can not get. Thereby, the microcomputer 1 can suppress unauthorized acquisition of data.

さらに、マイコン1は、非値情報を変換値に変換することにより隠蔽データを復元することができるため、暗号処理および復号処理を実行する必要がない。これにより、マイコン1は、隠蔽データをフラッシュメモリ3に隠蔽するために行われるデータの書き込みと読み込みの処理時間を短縮することができる。
なお、暗号・復号方式では、元データを計算して暗号データを作るため、時間をかければ、不正取得したデータから解読が可能である。これに対し、マイコン1では、不正取得したデータと、隠蔽したデータとの間に関係がないため、不正取得したデータから解読が不可能である。
Further, since the microcomputer 1 can restore the hidden data by converting the non-value information into the converted value, there is no need to execute the encryption processing and the decryption processing. As a result, the microcomputer 1 can reduce the processing time for writing and reading data, which is performed to hide the hidden data in the flash memory 3.
In the encryption / decryption method, since the original data is calculated to generate the encrypted data, it is possible to decrypt the illegally acquired data if it takes time. On the other hand, in the microcomputer 1, since there is no relationship between the illegally acquired data and the concealed data, it is impossible to decrypt the illegally acquired data.

またCPU2は、フラッシュメモリ3に記憶されている複数の記憶データを消去して、複数の記憶データのそれぞれをブランク状態にする。そしてCPU2は、消去された複数の記憶データの中から、フラッシュメモリ3に隠蔽する隠蔽データの値に基づいて、ブランク状態ではない状態(以下、非ブランク状態)を示す非値情報を割り当てられた記憶データを読み出し、読み出した記憶データが示す値を、読み出した記憶データを記憶していた領域に再度書き込む。   Further, the CPU 2 erases the plurality of storage data stored in the flash memory 3 and makes each of the plurality of storage data blank. Then, the CPU 2 is assigned non-value information indicating a non-blank state (hereinafter, non-blank state) based on the value of the concealed data to be concealed in the flash memory 3 from among the plurality of erased storage data. The storage data is read, and the value indicated by the read storage data is written again to the area storing the read storage data.

これにより、マイコン1は、新たな隠蔽データをフラッシュメモリ3に隠蔽する前と後とで、フラッシュメモリ3に記憶されている記憶データの値を同一にすることができる。このため、マイコン1は、マイコン1に接続された不正機器が、新たな隠蔽データがフラッシュメモリ3に隠蔽される前と後との両方において、フラッシュメモリ3に記憶されている記憶データを取得したとしても、隠蔽データが更新されたことを不正機器側で認識できないようにすることができる。   Thereby, the microcomputer 1 can make the value of the storage data stored in the flash memory 3 the same before and after the new hidden data is hidden in the flash memory 3. For this reason, the microcomputer 1 acquires the storage data stored in the flash memory 3 both before and after the new hidden data is hidden in the flash memory 3 by the unauthorized device connected to the microcomputer 1. However, it is possible to prevent the unauthorized device from recognizing that the hidden data has been updated.

以上説明した実施形態において、フラッシュメモリ3はデータ記憶部に相当し、ブランク状態であるか否かを示す情報が非値情報に相当し、フラッシュコントローラ6は特定部に相当し、S250〜S270は変換部としての処理に相当する。   In the embodiment described above, the flash memory 3 corresponds to a data storage unit, information indicating whether or not a blank state corresponds to non-value information, the flash controller 6 corresponds to a specifying unit, and S250 to S270 This corresponds to processing as a conversion unit.

また、S10は消去部としての処理に相当し、S60,S70は書込部としての処理に相当する。
以上、本開示の一実施形態について説明したが、本開示は上記実施形態に限定されるものではなく、種々変形して実施することができる。
S10 corresponds to processing as an erasing unit, and S60 and S70 correspond to processing as writing units.
As described above, one embodiment of the present disclosure has been described, but the present disclosure is not limited to the above embodiment, and can be implemented with various modifications.

また、上記実施形態における1つの構成要素が有する機能を複数の構成要素に分担させたり、複数の構成要素が有する機能を1つの構成要素に発揮させたりしてもよい。また、上記実施形態の構成の一部を省略してもよい。また、上記実施形態の構成の少なくとも一部を、他の上記実施形態の構成に対して付加、置換等してもよい。   Further, the function of one component in the above embodiment may be shared between a plurality of components, or the function of a plurality of components may be exhibited by one component. Further, a part of the configuration of the above embodiment may be omitted. Further, at least a part of the configuration of the above-described embodiment may be added to or replaced with the configuration of another above-described embodiment.

上述したマイコン1の他、当該マイコン1を構成要素とするシステム、当該マイコン1としてコンピュータを機能させるためのプログラム、このプログラムを記録した媒体、データ隠蔽方法など、種々の形態で本開示を実現することもできる。   In addition to the microcomputer 1 described above, the present disclosure is realized in various forms, such as a system including the microcomputer 1 as a component, a program for causing a computer to function as the microcomputer 1, a medium on which the program is recorded, and a data hiding method. You can also.

1…マイコン、2…CPU、3…フラッシュメモリ、6…フラッシュコントローラ   1 microcomputer, 2 CPU, 3 flash memory, 6 flash controller

Claims (3)

記憶内容の書き換えが可能な不揮発性メモリであり、且つ、記憶された複数の記憶データのそれぞれに対して、データ値ではない情報である非値情報を設定して記憶可能に構成されたデータ記憶部(3)と、
前記データ記憶部に記憶された複数の前記記憶データのそれぞれについて、前記記憶データに設定されている前記非値情報を特定するように構成された特定部(6)と、
前記特定部により特定された複数の前記非値情報のそれぞれについて、前記非値情報を、前記非値情報に応じて予め設定された変換値に変換するように構成された変換部(S250〜S270)と
を備えるマイクロコンピュータ(1)。
Data storage, which is a non-volatile memory with rewritable storage contents and configured to be able to store by setting non-value information, which is information that is not a data value, for each of a plurality of stored storage data. Part (3),
A specifying unit (6) configured to specify the non-value information set in the storage data for each of the plurality of storage data stored in the data storage unit;
For each of the plurality of non-value information specified by the specifying unit, a conversion unit (S250 to S270) configured to convert the non-value information into a conversion value set in advance according to the non-value information A microcomputer (1) comprising:
請求項1に記載のマイクロコンピュータであって、
前記非値情報は、対応する前記記憶データが消去されているブランク状態であるか、前記ブランク状態ではない非ブランク状態であるかを示す情報であるマイクロコンピュータ。
The microcomputer according to claim 1, wherein
The microcomputer, wherein the non-value information is information indicating whether the corresponding storage data is in a blank state in which the storage data has been erased or in a non-blank state other than the blank state.
請求項2に記載のマイクロコンピュータであって、
前記データ記憶部に記憶されている複数の前記記憶データを消去して、複数の前記記憶データのそれぞれを前記ブランク状態にするように構成された消去部(S10)と、
前記消去部により消去された複数の前記記憶データの中から、前記データ記憶部に隠蔽する隠蔽データの値に基づいて、前記非ブランク状態を示す前記非値情報を割り当てられた前記記憶データを読み出し、読み出した前記記憶データが示す値を、読み出した前記記憶データを記憶していた領域に再度書き込むように構成された書込部(S60,S70)と
を備えるマイクロコンピュータ。
The microcomputer according to claim 2, wherein
An erasing unit (S10) configured to erase the plurality of storage data stored in the data storage unit and set each of the plurality of storage data to the blank state;
From among the plurality of storage data erased by the erasure unit, the storage data to which the non-value information indicating the non-blank state is assigned is read based on a value of concealment data to be concealed in the data storage unit. And a writing unit (S60, S70) configured to rewrite the value indicated by the read storage data into an area storing the read storage data.
JP2018180326A 2018-09-26 2018-09-26 Microcomputer Pending JP2020052181A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018180326A JP2020052181A (en) 2018-09-26 2018-09-26 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018180326A JP2020052181A (en) 2018-09-26 2018-09-26 Microcomputer

Publications (1)

Publication Number Publication Date
JP2020052181A true JP2020052181A (en) 2020-04-02

Family

ID=69996920

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018180326A Pending JP2020052181A (en) 2018-09-26 2018-09-26 Microcomputer

Country Status (1)

Country Link
JP (1) JP2020052181A (en)

Similar Documents

Publication Publication Date Title
TWI360125B (en) Flash memory device, system and method with random
CN105701021B (en) Data storage device and data writing method thereof
JP5662037B2 (en) Data whitening to read and write data to non-volatile memory
US9836392B2 (en) Storage control apparatus to control pre-processing operations
US9058296B2 (en) Data processing method, memory storage device and memory control circuit unit
TWI475385B (en) Method of programming memory cells and reading data, memory controller and memory storage device using the same
US20060149902A1 (en) Apparatus and method for storing data in nonvolatile cache memory considering update ratio
US8015370B2 (en) Memory control method and memory system
US7573754B2 (en) Nonvolatile memory, apparatus and method for determining data validity of the same
TWI554944B (en) Flash memory controlling apparatus, flash memory controlling system and flash memory controlling method
US20020083262A1 (en) Memory device operable with a small-capacity buffer memory and having a flash memory
US8996933B2 (en) Memory management method, controller, and storage system
KR101449673B1 (en) Flash memory device, system and method with randomizing for suppressing error
US20130080787A1 (en) Memory storage apparatus, memory controller and password verification method
JP2015172959A (en) Access method for flash memory
JP2007250101A (en) Nonvolatile memory device and control method therefor
KR20060056440A (en) Data processing device and method for flash memory
KR100631765B1 (en) Apparatus and method for processing data in flash memory
TW201621668A (en) Data storage device and data writing method thereof
JP2008003684A (en) Nonvolatile storage device and system
JP2008020937A (en) Nonvolatile storage device
JP2020052181A (en) Microcomputer
US11782782B2 (en) Memory system and data processing system
TWI747532B (en) Memory apparatus
TWI661300B (en) Data management method for memory and memory apparatus