CN113312273A - NAND FLASH-based serial number and MAC address storage method - Google Patents

NAND FLASH-based serial number and MAC address storage method Download PDF

Info

Publication number
CN113312273A
CN113312273A CN202010118402.7A CN202010118402A CN113312273A CN 113312273 A CN113312273 A CN 113312273A CN 202010118402 A CN202010118402 A CN 202010118402A CN 113312273 A CN113312273 A CN 113312273A
Authority
CN
China
Prior art keywords
mac address
serial number
nand flash
block
storage method
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
CN202010118402.7A
Other languages
Chinese (zh)
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.)
Beijing Ingenic Semiconductor Co Ltd
Original Assignee
Beijing Ingenic Semiconductor Co 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 Beijing Ingenic Semiconductor Co Ltd filed Critical Beijing Ingenic Semiconductor Co Ltd
Priority to CN202010118402.7A priority Critical patent/CN113312273A/en
Publication of CN113312273A publication Critical patent/CN113312273A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory

Abstract

The invention provides a NAND FLASH-based serial number and MAC address storage method, which comprises the following steps: s1, storing the sequence number and MAC address area in the last partition reserved portion of NAND FLASH; s2, marking a bad block when the erasing sequence number and the MAC address area meet the bad block, and finding the next good block position to store data; s3, setting the sequence number and MAC address area as invisible MTD management layer; s4, the serial number and MAC address area must be read and written through a designated interface. The method of the invention overcomes the problems in the prior art, and can not increase additional circuits and chips and occupy the limited EFUSE space.

Description

NAND FLASH-based serial number and MAC address storage method
Technical Field
The invention relates to the technical field of storage, in particular to a serial number and MAC address storage method based on NAND FLASH.
Background
With the continuous development of science and technology, particularly NAND FLASH technology is developed. In the prior art, in order to better manage operations such as upgrading of each device program and user authentication, a product manufacturer needs to verify the legal identity of a product and writes a serial number and a MAC address into a designated partition of an EEPROM, an EFUSE or a FLASH. Dividing FLASH into a plurality of partitions, which basically comprise a bootstrap partition, a kernel partition, a file system partition, a serial number partition, a MAC address partition and the like.
The defects in the prior art are as follows:
1. the EEPROM requires additional circuits and chips, which additionally increases the product cost.
2. EFUSE can only be written once, cannot be modified, and has limited space.
3. The sequence number and MAC address partitions need to be rewritten when erasing FLASH completely.
4. There is no protection and verification mechanism for data reading and writing.
Common terms in the prior art include:
an EEPROM: electrically Erasable Programmable ROM.
EFUSE: similar to EEPROM, belongs to one-time programmable memories.
NAND FLASH: a nonvolatile memory in which power-off data is not lost.
BLOCK (BLOCK): NAND FLASH units of erase operations, typically 128KB in size, contain 64 pages of 2 KB.
And (3) bad block: this indicates that an erase/write disabled region is present at NAND FLASH.
MTD: memory Technology Device, i.e. Memory Technology Device, provides a unified interface for NOR FLASH and NAND FLASH devices in MTD layer in Linux kernel. The MTD isolates the file system from the underlying FLASH memory.
Sequence Number (SN): abbreviation for Serial Number. The serial number is an identifier of a group of numbers and character combinations, generally contains information such as a product model number, a version number, a manufacturer, a date, a serial number and the like, and has uniqueness.
MAC address: the Medium/Media Access Control address is translated into a Media Access Control address, also called a hardware address physical address. With a hexadecimal number, a total of six bytes of identifier indicate a site location on the network. Has global uniqueness.
Disclosure of Invention
In order to solve the above problems, the present invention is directed to: the simple method overcomes the problems in the prior art, does not need to add extra circuits and chips, and does not occupy the limited EFUSE space.
Specifically, the invention provides a NAND FLASH-based serial number and MAC address storage method, which comprises the following steps:
s1, storing the sequence number and MAC address area in the last partition reserved portion of NAND FLASH;
s2, marking a bad block when the erasing sequence number and the MAC address area meet the bad block, and finding the next good block position to store data;
s3, setting the sequence number and MAC address area as invisible MTD management layer;
s4, the serial number and MAC address area must be read and written through a designated interface.
In step S3, the setting of the sequence number and the MAC address area as invisible to the MTD management layer is implemented by subtracting the size of the reserved portion from the FLASH memory space obtained on the MTD management layer.
The step S2 further includes:
s2.1, starting the MAC address corresponding to the Nth block, and respectively storing the MAC address length and the MAC address data according to the MAC size;
s2.2, when erasing and writing are carried out on the Z-th block, and the Z-th block is found to be a bad block, marking the Z-th block as a bad block;
and S2.3, continuing to store from the Z +1 th block, and respectively storing the length of the serial number and the serial number data according to the size of the serial number.
Thus, the present application has the advantages that: by the method:
1. the modification is convenient, and the safety is compatible.
2. When the FLASH is completely erased, the sequence number and the MAC address storage area are not influenced.
3. Convenient operation and high production efficiency.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the principles of the invention.
FIG. 1 is a schematic flow diagram of the process of the present invention.
FIG. 2 is a schematic block diagram of the method of the present invention.
Detailed Description
In order that the technical contents and advantages of the present invention can be more clearly understood, the present invention will now be described in further detail with reference to the accompanying drawings.
As shown in fig. 1, the present invention relates to a NAND FLASH-based serial number and MAC address storage method, which comprises the following steps:
s1, storing the sequence number and MAC address area in the last partition reserved portion of NAND FLASH;
s2, marking a bad block when the erasing sequence number and the MAC address area meet the bad block, and finding the next good block position to store data;
s3, setting the sequence number and MAC address area as invisible MTD management layer;
s4, the serial number and MAC address area must be read and written through a designated interface.
The reserved portion is larger than the sum of the sequence number and the MAC address size.
The reserved part is 2M space, i.e. 8 blocks.
In step S3, the setting of the sequence number and the MAC address area as invisible to the MTD management layer is implemented by subtracting the size of the reserved portion from the FLASH memory space obtained on the MTD management layer.
And the application program and the burning tool read and write the serial number and the MAC address area through a specified interface.
When the FLASH is completely erased, the sequence number and the MAC address storage area are not influenced.
The step S2 further includes:
s2.1, starting the MAC address corresponding to the Nth block, and respectively storing the MAC address length and the MAC address data according to the MAC size;
s2.2, when erasing and writing are carried out on the Z-th block, and the Z-th block is found to be a bad block, marking the Z-th block as a bad block;
and S2.3, continuing to store from the Z +1 th block, and respectively storing the length of the serial number and the serial number data according to the size of the serial number.
The invention may be further explained by the last partition of space at NAND FLASH storing the sequence number and MAC address. Since NAND FLASH process characteristics cannot guarantee that all storage areas are good blocks, 2M space (8 blocks) is reserved for the sequence number and MAC address storage areas, and when the sequence number and MAC address areas are erased and written, bad blocks are marked and the next good block position is found to store data.
As shown in fig. 2, the FLASH memory space obtained on the MTD management layer is reduced by 2MB, that is, the memory area for the serial number and the MAC address is not visible, and the application program and the burning tool must read and write the area through the designated interface.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes may be made to the embodiment of the present invention by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (7)

1. An NAND FLASH-based serial number and MAC address storage method, characterized by comprising the following steps:
s1, storing the sequence number and MAC address area in the last partition reserved portion of NAND FLASH;
s2, marking a bad block when the erasing sequence number and the MAC address area meet the bad block, and finding the next good block position to store data;
s3, setting the sequence number and MAC address area as invisible MTD management layer;
s4, the serial number and MAC address area must be read and written through a designated interface.
2. The NAND FLASH-based sequence number and MAC address storage method according to claim 1, wherein the reserved portion is larger than the sum of the sequence number and the MAC address size.
3. NAND FLASH-based sequence number and MAC address storage method according to claim 2, wherein the reserved portion is 2M space, i.e. 8 blocks.
4. The NAND FLASH-based serial number and MAC address storage method according to claim 1, wherein the step S3, the setting of the serial number and MAC address area as invisible to the MTD management layer is implemented by subtracting the size of the reserved portion from the FLASH memory space obtained on the MTD management layer.
5. The NAND FLASH-based serial number and MAC address storage method according to claim 1, wherein the application and burning tool reads and writes the serial number and MAC address area through a designated interface.
6. The NAND FLASH-based serial number and MAC address storage method according to claim 1, wherein FLASH is erased fully without affecting serial number and MAC address storage areas.
7. The NAND FLASH-based serial number and MAC address storage method according to claim 1, wherein the step S2 further comprises:
s2.1, starting the MAC address corresponding to the Nth block, and respectively storing the MAC address length and the MAC address data according to the MAC size;
s2.2, when erasing and writing are carried out on the Z-th block, and the Z-th block is found to be a bad block, marking the Z-th block as a bad block;
and S2.3, continuing to store from the Z +1 th block, and respectively storing the length of the serial number and the serial number data according to the size of the serial number.
CN202010118402.7A 2020-02-26 2020-02-26 NAND FLASH-based serial number and MAC address storage method Pending CN113312273A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010118402.7A CN113312273A (en) 2020-02-26 2020-02-26 NAND FLASH-based serial number and MAC address storage method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010118402.7A CN113312273A (en) 2020-02-26 2020-02-26 NAND FLASH-based serial number and MAC address storage method

Publications (1)

Publication Number Publication Date
CN113312273A true CN113312273A (en) 2021-08-27

Family

ID=77369941

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010118402.7A Pending CN113312273A (en) 2020-02-26 2020-02-26 NAND FLASH-based serial number and MAC address storage method

Country Status (1)

Country Link
CN (1) CN113312273A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104094214A (en) * 2012-01-31 2014-10-08 京瓷办公信息系统株式会社 Mounting method in electronic device
CN106126113A (en) * 2016-06-14 2016-11-16 烽火通信科技股份有限公司 A kind of method of home gateway service data classification storage management
CN106445398A (en) * 2015-08-04 2017-02-22 深圳市中兴微电子技术有限公司 Novel memory-based embedded file system and realization method thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104094214A (en) * 2012-01-31 2014-10-08 京瓷办公信息系统株式会社 Mounting method in electronic device
CN106445398A (en) * 2015-08-04 2017-02-22 深圳市中兴微电子技术有限公司 Novel memory-based embedded file system and realization method thereof
CN106126113A (en) * 2016-06-14 2016-11-16 烽火通信科技股份有限公司 A kind of method of home gateway service data classification storage management

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄健著: "《嵌入式Linux系统 开发原理与实战,》", 北京理工大学出版社 *

Similar Documents

Publication Publication Date Title
KR100531192B1 (en) Non-volatile memory control method
JP5295778B2 (en) Flash memory management method
US6034897A (en) Space management for managing high capacity nonvolatile memory
US9684568B2 (en) Data storage device and flash memory control method
EP1410399B1 (en) Method and apparatus for decreasing block write operation times performed on nonvolatile memory
US6459644B2 (en) Semiconductor memory device with block alignment function
EP1729304B1 (en) Space management for managing high capacity nonvolatile memory
US7480762B2 (en) Erase block data splitting
JP4058322B2 (en) Memory card
JP4238514B2 (en) Data storage device
US7681008B2 (en) Systems for managing file allocation table information
JP4956068B2 (en) Semiconductor memory device and control method thereof
US7752412B2 (en) Methods of managing file allocation table information
WO2007058624A1 (en) A controller for non-volatile memories, and methods of operating the memory controller
US6839798B1 (en) Flash memory capable of storing frequently rewritten data
KR20090006217A (en) Partial block data programming and reading operations in a non-volatile memory
CN107045423B (en) Memory device and data access method thereof
KR20080078129A (en) Method and storage device of mapping a nonvolatile memory based on map history
CN101295281A (en) Memory device and method for limiting access authority of the same
US20120271988A1 (en) Methods circuits data-structures devices and system for operating a non-volatile memory device
CN113312273A (en) NAND FLASH-based serial number and MAC address storage method
US20140052893A1 (en) File deletion for non-volatile memory
US7773433B2 (en) Method for managing a non-volatile memory in a smart card
US20080109588A1 (en) Memory Card and Method of Driving the Same
JP2008112455A (en) Memory card

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