CN109634534B - Method for quickly judging capacity of memory chip - Google Patents
Method for quickly judging capacity of memory chip Download PDFInfo
- Publication number
- CN109634534B CN109634534B CN201910002221.5A CN201910002221A CN109634534B CN 109634534 B CN109634534 B CN 109634534B CN 201910002221 A CN201910002221 A CN 201910002221A CN 109634534 B CN109634534 B CN 109634534B
- Authority
- CN
- China
- Prior art keywords
- memory chip
- capacity
- address
- chip
- byte
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/062—Securing storage systems
- G06F3/0623—Securing storage systems in relation to content
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0679—Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Read Only Memory (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
The invention discloses a method for rapidly judging the capacity of a memory chip, which comprises the steps of determining the target capacity of the required memory chip; writing 1-byte special marking character into the byte at the position of half of the storage capacity of the storage chip when the electronic equipment is powered on and initialized for the first time; the content of the 0 address byte of the memory chip is read to judge the capacity of the memory chip. According to the method for rapidly judging the capacity of the storage chip, whether the capacity of the storage chip of the electronic equipment is correct or not can be judged only by executing once read-write operation; therefore, the method can be used for rapidly, accurately and conveniently qualitatively judging the capacity of the storage chip of the electronic equipment, and is high in reliability, low in cost, convenient and rapid.
Description
Technical Field
The invention particularly relates to a method for rapidly judging the capacity of a memory chip.
Background
The memory chip is widely applied to various types of electronic equipment, and plays an important role in storing the working data of the electronic equipment. With the rapid development of the big data era and intelligent algorithms, data becomes the most core resource in the future. Therefore, a memory chip for storing data becomes an extremely important component.
The appearance of the memory chips of different manufacturers, different models and different capacities is approximate and difficult TO distinguish, and the memory chips are basically compatible with PIN TO PIN, namely compatible with encapsulation; meanwhile, for the same type of storage equipment, the storage chips produced by various manufacturers are executed according to international industrial standards, namely, the same type of chips with the same capacity and size of different manufacturers can be replaced at will, and a plurality of electronic equipment manufacturers can introduce a plurality of storage chip manufacturers simultaneously based on the aspects of purchasing safety and reliability or cost, so that the mixing condition occurs in the production process, namely the electronic equipment uses wrong storage chips, and the mistake mainly refers to the use of wrong storage chips which do not meet the design requirement. For example, in the production process, a large-capacity memory chip is used in a place where a small-capacity memory chip is required to meet the requirement, and this situation may lead to a drastic increase in the cost of the electronic device. If a small-capacity memory chip is used in a place where a large-capacity memory chip is required, various problems may occur in the operation of the device by a user; especially when the memory chip is used for storing data of a user during operation of the device, the problem is generally discovered only after the user is delivered to operate, and the user data is tampered when the problem is discovered, which is definitely disastrous for core resources such as user data.
Currently, a common method for determining the capacity of a memory chip is to read a Device ID, i.e., a Device ID. The Device Id is different for memory chips of different manufacturers and different capacities, and even for memory chips of different manufacturers and different capacities, the Device Id is different. The electronic equipment reads the Device Id of the storage chip when being started, judges whether the Device Id is the Device Id set by the product, if yes, the judgment is successful, if not, the judgment is wrong, and the storage chip is reported to be wrong.
The defects of the judging method are as follows: when the memory chip is upgraded and updated, the product modifies the software to support the Device Id of the new memory chip as soon as the new memory chip is used, otherwise the original software cannot identify the new memory chip (because the past program cannot predict and assume the Device Id of the memory chip which may appear later), although the new memory chip is completely consistent with the old memory chip in terms of storage capacity and technical performance parameters (i.e. if the Device Id is not considered, the new memory chip and the original memory chip are completely the same in driving software, the software can support the new memory chip without any modification, and if the software depends on the Device Id, the software code is modified once to newly support a new Device Id); at present, electronic information technology is developed day by day, the matters of replacing electronic components with the same functions of other models are frequently generated when electronic equipment is produced, and similarly, electronic equipment manufacturers continuously introduce new memory chips for different reasons, and software upgrading cannot be carried out once when a completely compatible electronic component is replaced; moreover, software upgrading involves multiple enterprise links such as software development design, coding, debugging, testing, software release updating and the like, and the cost of human resources is high.
It is noted above that this method is expensive in terms of human resource cost, and another cost is generated in this method, namely, physical resource utilization cost. For the memory chip, the driver software only needs to realize a memory chip read interface and a memory chip write interface, and one more interface needs to be realized by reading the Device ID, namely the interface for reading the Device ID of the memory chip, and the interface occupies certain MCU program space resources.
Disclosure of Invention
The invention aims to provide a method for quickly judging the capacity of a chip storage, which has high reliability, low cost, convenience and quickness.
The method for rapidly judging the capacity of the memory chip comprises the following steps:
s1, determining the target capacity of a required storage chip as X byte;
s2, writing 1 byte of special marking characters into X/2byte bytes of the storage chip when the electronic equipment is electrified and initialized for the first time;
s3, reading the content of the 0 address byte of the storage chip;
s4, judging the capacity of the storage chip according to the content read in the step S3:
if the read content is the special mark character written in the step S2, the capacity of the memory chip is determined to be wrong; otherwise, the capacity of the memory chip is determined to be correct.
The special indicator character in step S2 is 0 xAB.
The memory chip is an EEPROM or FLASH memory chip.
According to the method for rapidly judging the capacity of the storage chip, whether the capacity of the storage chip of the electronic equipment is correct or not can be judged only by executing once read-write operation; therefore, the method can be used for rapidly, accurately and conveniently qualitatively judging the capacity of the storage chip of the electronic equipment, and is high in reliability, low in cost, convenient and rapid.
Drawings
FIG. 1 is a process flow diagram of the process of the present invention.
Detailed Description
FIG. 1 shows a flow chart of the method of the present invention: the capacity quick judging method of the memory chip (suitable for EEPROM or FLASH memory chip) provided by the invention comprises the following steps:
s1, determining the target capacity of a required storage chip as X byte;
s2, writing 1 byte of special marking characters, such as 0xAB, into X/2byte bytes of the memory chip when the electronic equipment is powered on and initialized for the first time;
s3, reading the content of the 0 address byte of the storage chip;
s4, judging the capacity of the storage chip according to the content read in the step S3:
if the read content is the special mark character written in the step S2, the capacity of the memory chip is determined to be wrong; otherwise, the capacity of the memory chip is determined to be correct.
The principle of the present invention is explained below:
the capacity characteristics of the memory chip are as follows: the capacity of the memory chip is always 2 bytes to the power of N, and no memory chip with the capacity of odd bytes exists. That is, the capacity of the memory chip is generally 1MB, 2MB, 4MB, 8MB, 16MB, and so on; but not storing the capacity of the memory chip such as 3MB, 5MB and 6 MB; n is an address bit required for addressing all bytes of the memory chip, and for various capacity chips, the N value, namely the required address bit, is respectively as follows:
TABLE 1 memory chip capacity and N-value corresponding indication table
Storage capacity | N value (required address bit) |
1MB | 20 |
2MB | 21 |
4MB | 22 |
8MB | 23 |
16MB | 24 |
The addressing characteristic of the memory chip is that the addressing address range of the memory chip is 0 byte to storage capacity-1 byte (for a memory chip with 8MB capacity, the addressing address range is 0-0 x7FFFFF), when the memory chip is in storage access, the memory chip ignores the high order address bit exceeding the address space, only the address value of the address bit required by addressing is taken as the actual address to perform the read-write access operation of the memory chip, namely, when the memory chip performs the storage read-write access, the memory chip performs the bit sum operation once by subtracting 1 from the nth power of the last 2 from the user request address to obtain the actual access address, and the formula is defined as follows:
real access address & (power N of 2-1) user request address
According to the characteristics, the invention provides a very simple and universal memory chip capacity judging method, namely, 1 byte special identification byte is written in the address position of half the capacity of the target memory chip of the equipment, then the 0 address of the memory chip is read, if the 0 address is written into the special identification byte, the capacity of the memory chip of the equipment does not reach the capacity of the target memory chip, and the actual memory chip capacity is half or less than the capacity of the target memory chip of the equipment; if the 0 address is not written to that particular identification byte, it indicates that the memory chip capacity of the electronic device is correct.
Taking an 8MB Flash chip as an example, the address space of the 8MB Flash is 0x 00000000-0 x7FFFFF, in order to address the whole 8M Flash address space, the required address bit is 23, namely only 23bit address bit is needed, when the 8M Flash is read and written for access, the memory chip only takes the lowest 23bit of the read and write address as an effective address, and ignores a high-order address, namely the memory chip can perform an AND operation on the user access address and the 0x7FFFFF to obtain an actual access address; when a user tries to access the 8M address, the address corresponding to the 8M address is 0x800000, and when the address obtained after performing the AND operation on 0x800000 and 0x7 FFFFFFF is 0x00000, the address which is actually accessed is a zero address;
similarly, when the 8M Flash is wrongly pasted into the 4M Flash in the production process, the address space of the 4M Flash is 0x 00000000-0 x3FFFFF, and in order to address the whole address space of the 4M Flash, the required address bit is 22, namely only the address bit of 22 bits is required, namely the N value is 22. When accessing 4M address bytes (the address of which is 0x400000), the actual access address is 0 address, and the calculation process is as follows:
real access address being user request address&(222-1)
=0x400000&(222-1)
=0x400000&0x3fffff
=0x0
Therefore, when the method writes a byte special identification into the 8M Flash half address space 0x400000, the 8M Flash is mistakenly pasted into the 4M Flash, and the special identification is actually written into the 0 address; therefore, the method can judge whether the capacity of the memory chip is correct or not by reading the address byte of 0 of the memory chip.
Claims (2)
1. A capacity fast judging method of a memory chip comprises the following steps:
s1, determining the target capacity of the required memory chip as X byte;
s2, writing 1 byte special mark character into the X/2byte of the memory chip when the electronic device is first powered on and initialized;
s3, reading the content of 0 address byte of the memory chip;
s4, according to the content read in the step S3, the capacity of the memory chip is judged:
if the read content is the special mark character written in the step S2, the capacity of the memory chip is determined to be wrong; otherwise, the capacity of the memory chip is determined to be correct;
the special mark character is 0 xAB.
2. The method for rapidly determining the capacity of a memory chip according to claim 1, wherein the memory chip is an EEPROM or FLASH memory chip.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910002221.5A CN109634534B (en) | 2019-01-02 | 2019-01-02 | Method for quickly judging capacity of memory chip |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910002221.5A CN109634534B (en) | 2019-01-02 | 2019-01-02 | Method for quickly judging capacity of memory chip |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109634534A CN109634534A (en) | 2019-04-16 |
CN109634534B true CN109634534B (en) | 2022-04-01 |
Family
ID=66056595
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910002221.5A Active CN109634534B (en) | 2019-01-02 | 2019-01-02 | Method for quickly judging capacity of memory chip |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109634534B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111061651B (en) * | 2019-12-06 | 2022-04-22 | 广州瑞普医疗科技有限公司 | Method and device for identifying serial EEPROM (electrically erasable programmable read-Only memory) model and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101950368A (en) * | 2010-09-20 | 2011-01-19 | 珠海天威技术开发有限公司 | Recognition method of storage capacity of 24C series chip |
CN102306503A (en) * | 2010-07-30 | 2012-01-04 | 深圳市江波龙电子有限公司 | Method and system for detecting false capacity memory |
CN103116536A (en) * | 2013-02-25 | 2013-05-22 | 杭州华澜微科技有限公司 | Method for detecting capacity of storage device |
CN103777907A (en) * | 2014-02-25 | 2014-05-07 | 四川长虹空调有限公司 | Method for automatically obtaining EEPROM (Electrically Erasable Programmable Read-Only Memory) storage capacity |
CN105280240A (en) * | 2015-11-18 | 2016-01-27 | 致象尔微电子科技(上海)有限公司 | Nand Flash parameter reading method |
CN106024067A (en) * | 2016-05-27 | 2016-10-12 | 上海贝岭股份有限公司 | EEPROM testing method |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20100097456A (en) * | 2009-02-26 | 2010-09-03 | 삼성전자주식회사 | Memory system and address allocating method of flash translation layer thereof |
KR20120080360A (en) * | 2011-01-07 | 2012-07-17 | 에스케이하이닉스 주식회사 | Semiconductor memory apparatus and memory system including the same |
US20140281148A1 (en) * | 2013-03-15 | 2014-09-18 | Kabushiki Kaisha Toshiba | Memory system |
JP6067541B2 (en) * | 2013-11-08 | 2017-01-25 | 株式会社東芝 | Memory system and memory system assembly method |
CN105843749B (en) * | 2016-03-24 | 2019-01-25 | 浙江大学 | A kind of NAND Flash fault-tolerance approach based on FPGA |
CN107870736B (en) * | 2016-09-28 | 2021-08-10 | 龙芯中科技术股份有限公司 | Method and device for supporting non-linear flash memory larger than 4GB |
-
2019
- 2019-01-02 CN CN201910002221.5A patent/CN109634534B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102306503A (en) * | 2010-07-30 | 2012-01-04 | 深圳市江波龙电子有限公司 | Method and system for detecting false capacity memory |
CN101950368A (en) * | 2010-09-20 | 2011-01-19 | 珠海天威技术开发有限公司 | Recognition method of storage capacity of 24C series chip |
CN103116536A (en) * | 2013-02-25 | 2013-05-22 | 杭州华澜微科技有限公司 | Method for detecting capacity of storage device |
CN103777907A (en) * | 2014-02-25 | 2014-05-07 | 四川长虹空调有限公司 | Method for automatically obtaining EEPROM (Electrically Erasable Programmable Read-Only Memory) storage capacity |
CN105280240A (en) * | 2015-11-18 | 2016-01-27 | 致象尔微电子科技(上海)有限公司 | Nand Flash parameter reading method |
CN106024067A (en) * | 2016-05-27 | 2016-10-12 | 上海贝岭股份有限公司 | EEPROM testing method |
Also Published As
Publication number | Publication date |
---|---|
CN109634534A (en) | 2019-04-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Breeuwsma et al. | Forensic data recovery from flash memory | |
CN108563401B (en) | SSD performance acceleration method | |
CN109426619A (en) | Method for accessing flash memory module, related flash memory controller and electronic device | |
CN111444030B (en) | Data storage device and method for avoiding firmware failure | |
US20090037646A1 (en) | Method of using a flash memory for a circular buffer | |
US9552287B2 (en) | Data management method, memory controller and embedded memory storage apparatus using the same | |
US5864661A (en) | IC memory card having flash memory | |
TW201526007A (en) | Method, device and operating system for processing, using a NAND flash memory burn data | |
CN109634534B (en) | Method for quickly judging capacity of memory chip | |
US20110004719A1 (en) | Memory Element | |
CN117785723A (en) | Dynamic interface parameter association method and device and electronic equipment | |
US8762685B2 (en) | Data writing method, memory controller and memory storage apparatus | |
CN102629212A (en) | Method for indirectly programming to NANDFLASH based on J-LINK | |
CN101131649A (en) | Updating speed improving method for read-only memory of device with flash memory | |
TWI749279B (en) | A data storage device and a data processing method | |
CN107168650B (en) | Method and device for processing data in memory of BIOS | |
US10922023B2 (en) | Method for accessing code SRAM and electronic device | |
US20130246687A1 (en) | Data writing method, memory controller and memory storage apparatus | |
CN109783024B (en) | Data storage processing method and device | |
CN112331252A (en) | Method and device for automatically marking bad blocks of Nand flash memory, storage medium and terminal | |
CN111627491A (en) | Flash memory testing module based on USB3.0 and testing method thereof | |
CN108614664A (en) | Read error treating method and apparatus based on NANDflash | |
CN117420965B (en) | Memory and control method thereof | |
US11829329B2 (en) | Device, method and non-transitory computer readable medium for writing image files into memories | |
CN109558092A (en) | A kind of chip interior flash storage method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |