Hello, my name is Dak.
I have written many articles on the C language.
In an embedded system, Flash memory is the place where the code written in C is compiled and written.
What kind of memory is Flash memory?
Types of Memory
Let's take a look at how Flash memory is positioned.
Memory is classified into the following categories
|
RAM
|
DRAM / SRAM / MRAM, etc.
|
|
ROM
|
EEPROM / Flash / CDROM, etc.
|
Originally,
・RAM: Volatile memory that operates quickly but leaves no data when the power is turned off
・ROM: Nonvolatile memory that operates slowly but leaves data
In recent years, however, non-volatile RAM such as MRAM has been introduced.
Flash memory, which is the subject of this report, is nonvolatile memory.
Data can be easily changed, and a familiar example is USB memory, which uses Flash memory.
Features of Flash Memory
While I was thinking that USB memory is convenient because it can be overwritten at will, the lecturer of the in-house training program made a shocking comment to me.
The lecturer said, "Do you know that Flash memory cannot be rewritten?"
Me: "・・・・・ what?"
What does this mean?
Flash Memory Operation 1 - Writing Data
The initial state of Flash memory is that all bits are set to 1.
The only write operation in Flash memory is to set data from 1 to 0.
The reverse operation, from 0 to 1, is not possible. The writing unit varies from device to device, but generally it is 1 byte or Word (2 bytes).
Flash Memory Write Operation
However, this means that once data has been written, it cannot be changed. What should we do?
Flash Memory Operation 2 - Erasing Data
Another operation that Flash memory can perform is data erase.
This erase operation, however, sets each block of data that has been set to 0 to 1.
The block size varies from device to device, but can be very large for writes, e.g., 64 KB.
Erase operation for Flash memory
These are the only two ways to change data in Flash memory.
Therefore, overwriting requires some effort.
As an example, let's use a PC as a host and try to change the part of the data in Flash memory that is colored yellow.
How to overwrite Flash memory
Once the data is saved to a buffer, it is modified and written to Flash memory.
If the Flash memory automatically writes all zeros to the Flash memory, there is no need to be aware of this process.
Thus, in Flash, many steps are required just to change one bit.
Important to keep in mind +α
Since FPGAs are generally volatile, they must be used with a set of nonvolatile memory called configuration ROM to store design data, mainly Flash memory.
Intel offers the EPCQ and EPCQA as serial Flash memory dedicated to configuration.
Also, I did some research and found that Intel has recently released the MAX® 10 device, which is an FPGA with built-in configuration ROM.
New Engineer's Blush Blog Article List