[go: up one dir, main page]

CN117369905B - Starting method and system of flash memory platform, electronic equipment and storage medium - Google Patents

Starting method and system of flash memory platform, electronic equipment and storage medium Download PDF

Info

Publication number
CN117369905B
CN117369905B CN202311669841.7A CN202311669841A CN117369905B CN 117369905 B CN117369905 B CN 117369905B CN 202311669841 A CN202311669841 A CN 202311669841A CN 117369905 B CN117369905 B CN 117369905B
Authority
CN
China
Prior art keywords
bad block
platform
block information
flash
accumulated
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
CN202311669841.7A
Other languages
Chinese (zh)
Other versions
CN117369905A (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.)
Guangdong Jiangxin Chuang Technology Co ltd
Original Assignee
Guangdong Jiangxin Chuang Technology 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 Guangdong Jiangxin Chuang Technology Co ltd filed Critical Guangdong Jiangxin Chuang Technology Co ltd
Priority to CN202311669841.7A priority Critical patent/CN117369905B/en
Publication of CN117369905A publication Critical patent/CN117369905A/en
Application granted granted Critical
Publication of CN117369905B publication Critical patent/CN117369905B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1417Boot up procedures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C29/00Checking stores for correct operation ; Subsequent repair; Testing stores during standby or offline operation
    • G11C29/56External testing equipment for static stores, e.g. automatic test equipment [ATE]; Interfaces therefor
    • G11C29/56008Error analysis, representation of errors
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The application discloses a starting-up method, a starting-up system, electronic equipment and a storage medium of a flash memory platform, wherein the flash memory platform comprises a flash memory chip and a cache memory, and the starting-up method comprises the following steps: partitioning the flash memory chip to obtain a bad block management area; recording the information of bad blocks of the flash memory chip for each time of writing data to obtain bad block information; updating the bad block management area according to the bad block information; reading accumulated bad block information in a bad block management area, and carrying out integrity check on the accumulated bad block information; when the accumulated bad block information passes the integrity check, storing the accumulated bad block information into a cache; when the flash platform is started, the accumulated bad block information is read from the cache memory. In the embodiment of the application, all bad block information can be read at one time, the time required for reading the bad block information is shortened, and the starting-up speed of the platform is improved.

Description

Starting method and system of flash memory platform, electronic equipment and storage medium
Technical Field
The application belongs to the technical field of computers, and particularly relates to a starting method and system of a flash memory platform, electronic equipment and a storage medium.
Background
SPI NAND (Serial Peripheral Interface NAND) is a flash memory device that uses the SPI (Serial Peripheral Interface ) bus protocol to communicate with a host. It is a non-volatile memory that can be used for data storage and transmission. SPI NAND flash is a variant based on NAND flash technology, which is a common type of flash memory that is widely used in various electronic devices, such as memory cards, USB flash drives, embedded systems, and the like. Compared with the traditional parallel NAND flash memory, the SPI NAND uses a serial interface, and data transmission is carried out through an SPI protocol. This allows SPI NAND to have a simpler physical interface and lower pin count, with less capacity and slower data transfer speeds.
However, in the embedded field, the starting-up speed is an important sign for measuring the performance of a product. Because NAND Flash easily produces Bad block (Bad block), user's procedure need manage Bad block, under SPI NAND exists Bad block's condition, need read 1024 times for every acquisition Bad block information, this has just led to system each time to start, and it is longer to read Bad block information, influences SPI NAND platform's start-up speed.
Disclosure of Invention
The method, the system, the electronic equipment and the storage medium for starting the flash memory platform are capable of reading all bad block information at one time, shortening the time required for reading the bad block information and improving the starting speed of the platform.
In a first aspect, the present application provides a method for booting a flash platform, where the flash platform includes a flash chip and a cache memory, the method including:
partitioning the flash memory chip to obtain a bad block management area;
recording the information of the bad blocks of the flash memory chip for each time of writing data to obtain the bad block information;
updating the bad block management area according to the bad block information;
reading accumulated bad block information in the bad block management area, and carrying out integrity check on the accumulated bad block information;
storing the accumulated bad block information to a cache memory when the accumulated bad block information passes the integrity check;
and when the flash memory platform is started, reading accumulated bad block information from the cache memory.
The starting method of the flash memory platform provided by the embodiment of the application has at least the following beneficial effects: firstly, partitioning a flash memory chip to obtain a bad block management area so as to facilitate the subsequent independent storage of the bad block information, recording the bad block information in the flash memory chip for each writing data, recording the bad block information in the data writing process to obtain the bad block information, updating the bad block management area according to the bad block information, thereby realizing the real-time updating of the bad block information, storing the bad block information generated each time in the bad block management area, then reading the accumulated bad block information in the bad block management area to determine the bad block information generated in a flash memory platform, and carrying out integrity check on the accumulated bad block information, thereby avoiding the problem that the bad block information in the bad block management area is incomplete, ensuring the accuracy and reliability of the bad block management process.
According to some embodiments of the present application, the method further comprises:
carrying out region division on pages of the flash memory chip to obtain a plurality of data regions;
detecting bad blocks of the data area;
and when all the data areas do not have bad blocks, switching the flash memory platform to a continuous reading mode.
According to some embodiments of the present application, the method further comprises:
when the flash memory platform is switched to a mounting mode, a mounting root file system of the flash memory platform is switched to a FAT (File Allocation Table ) file system;
and configuring the FAT file system based on preset configuration information.
According to some embodiments of the present application, the method further comprises:
performing functional configuration on the environment variable file of the flash memory platform to obtain an environment variable value;
when the environment variable value meets a preset partition value, determining a falcon partition corresponding to the partition value, wherein the falcon partition is a partition for storing a device tree in the flash memory platform;
when the flash memory platform is started, loading a device tree through the falcon partition to obtain a device tree address, and compiling a kernel mirror image to obtain a mirror image address;
And starting the kernel of the flash memory platform according to the mirror image address and the equipment tree address.
According to some embodiments of the present application, the reading the accumulated bad block information in the bad block management area and performing integrity check on the accumulated bad block information includes:
carrying out partition format verification on the bad block management area;
when the bad block management area passes the partition format verification, reading accumulated bad block information in the bad block management area;
determining a start mark value, an end mark value, address information and a data length value of the accumulated bad block information;
accumulating the data length values based on the address information to obtain length accumulated values;
and comparing the starting mark value, the ending mark value and the length accumulated value with preset integrity conditions to carry out integrity check on the accumulated bad block information.
According to some embodiments of the present application, after the switching the flash platform to the continuous read mode, the method further comprises:
receiving a read instruction, and determining the read data length and the read data address in the read instruction;
performing data reading on the flash memory chip according to the read data length and the read data address to obtain target data;
And transmitting the target data based on a preset burst length and a data bit width.
According to some embodiments of the present application, the configuring the FAT file system based on preset configuration information includes:
acquiring the system capacity of the FAT file system;
determining cluster units in the configuration information according to the system capacity;
and dividing the FAT file system according to the cluster units.
In a second aspect, the present application provides a boot system of a flash platform, where the flash platform includes a flash chip and a cache memory, the boot system comprising:
the chip partitioning module is used for partitioning the flash memory chip to obtain a bad block management area;
the bad block recording module is used for recording the information of the bad blocks of the flash memory chip for each writing of data to obtain bad block information;
the management area updating module is used for updating the bad block management area according to the bad block information;
the integrity checking module is used for reading the accumulated bad block information in the bad block management area and carrying out integrity checking on the accumulated bad block information;
the information accumulation module is used for storing the accumulated bad block information into the cache memory when the accumulated bad block information passes the integrity check;
And the information reading module is used for reading the accumulated bad block information from the cache memory when the flash memory platform is started.
In a third aspect, the present application provides an electronic device, where the electronic device includes a memory and a processor, where the memory stores a computer program, and where the processor implements the method for booting the flash platform according to the first aspect when executing the computer program.
In a fourth aspect, the present application provides a computer readable storage medium storing computer executable instructions for performing the method for booting a flash memory platform according to the first aspect.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the technical aspects of the present application, and are incorporated in and constitute a part of this specification, illustrate the technical aspects of the present application and together with the examples of the present application, and not constitute a limitation of the technical aspects of the present application.
FIG. 1 is a flowchart of a method for booting a flash platform according to one embodiment of the present disclosure;
FIG. 2 is a flowchart of a method for booting a flash platform according to another embodiment of the present disclosure;
FIG. 3 is a flowchart of a method for booting a flash platform according to another embodiment of the present disclosure;
FIG. 4 is a flowchart of a method for booting a flash platform according to another embodiment of the present disclosure;
FIG. 5 is a flowchart of a specific method of step S104 in FIG. 1;
FIG. 6 is a flowchart of a method for booting a flash platform according to another embodiment of the present disclosure;
FIG. 7 is a flowchart of a specific method of step S302 in FIG. 3;
FIG. 8 is a schematic diagram illustrating a boot system of a flash platform according to one embodiment of the present disclosure;
fig. 9 is a schematic hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
It should be noted that although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order different from that in the flowchart. The terms first, second and the like in the description and in the claims and in the above-described figures, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
SPI NAND (Serial Peripheral Interface NAND) is a flash memory device that uses the SPI (Serial Peripheral Interface ) bus protocol to communicate with a host. It is a non-volatile memory that can be used for data storage and transmission. SPI NAND flash is a variant based on NAND flash technology, which is a common type of flash memory that is widely used in various electronic devices, such as memory cards, USB flash drives, embedded systems, and the like. Compared with the traditional parallel NAND flash memory, the SPI NAND uses a serial interface, and data transmission is carried out through an SPI protocol. This allows SPI NAND to have a simpler physical interface and lower pin count, with less capacity and slower data transfer speeds.
However, in the embedded field, the starting-up speed is an important sign for measuring the performance of a product. Because NAND Flash easily produces Bad block (Bad block), user's procedure need manage Bad block, under SPI NAND exists Bad block's condition, need read 1024 times for every acquisition Bad block information, this has just led to system each time to start, and it is longer to read Bad block information, influences SPI NAND platform's start-up speed.
In order to solve the above problems, the present embodiment provides a method, a system, an electronic device and a storage medium for starting up a flash memory platform, wherein first, a flash memory chip is partitioned to obtain a bad block management area so as to facilitate the subsequent separate storage of bad block information, for each write-in data, the bad block information of the flash memory chip is recorded, the bad block information can be obtained by recording the bad block information in each write-in data process, and then the bad block management area is updated according to the bad block information, thereby realizing the real-time update of the bad block information, the bad block information generated each time can be stored in the bad block management area, then, the accumulated bad block information in the bad block management area is read to determine the bad block information generated in the flash memory platform, and the integrity check is performed on the accumulated bad block information, thereby avoiding the problem that the bad block information in the bad block management area is incomplete, ensuring the accuracy and reliability of the bad block management process.
Embodiments of the present application are further described below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flowchart of a method for booting a flash platform according to an embodiment of the present application, where the method for booting a flash platform includes, but is not limited to, steps S101 to S106.
It should be noted that, the flash platform includes a flash chip and a cache memory, where the flash platform is a system platform integrated with SPI NAND, and the flash platform further includes SPL (Secondary Program Loader, auxiliary program loader), U-Boot, QSPI (Quad Serial Peripheral Interface, high-speed serial peripheral interface standard), and so on, where SPL is a program for booting an embedded system, and is usually used to Boot hardware and then load a more complex Boot program, U-Boot is a commonly used open-source Boot loader, and is used for booting and starting the embedded system, and has rich functions and extensive hardware support, and QSPI is a serial peripheral interface, and is used to connect external memory devices such as flash memory in the embedded system.
Step S101: partitioning the flash memory chip to obtain a bad block management area;
in some embodiments, the flash memory chip is partitioned, and a new partition is added to obtain a bad block management area, where the bad block management area is used to store bad block information, so as to implement separate storage of the bad block information.
It should be noted that, when the bad block management area is divided, only a small portion of the flash memory space is required to store the bad block information. Compared with the method without dividing the partition, the method has the advantages that the whole flash memory block is used for storing bad block information, the space waste can be reduced to a certain extent by dividing the bad block management area, and the available capacity of the flash memory is improved.
Step S102: recording the information of bad blocks of the flash memory chip for each time of writing data to obtain bad block information;
in some embodiments, for each case of writing data, for example, a case of U-Boot writing, upgrading a program, writing data by a flash platform, and the like, a new bad block may be generated during the process of writing data, so after the writing of the data is finished, the information of the bad block appearing on the flash chip is recorded to obtain bad block information, thereby realizing the recording of the information of the bad block appearing on each case of writing the data, and improving the data reliability.
Step S103: updating the bad block management area according to the bad block information;
in some embodiments, the bad block management area is updated according to the bad block information, so that all the bad block information is stored in the bad block management area for management, thereby being capable of effectively managing and recording the position and state of the bad block corresponding to the bad block information, efficiently managing the bad block, improving the data reliability, simplifying the bad block processing, avoiding the problem of untimely updating of the bad block information, and reducing the space waste.
Step S104: reading accumulated bad block information in a bad block management area, and carrying out integrity check on the accumulated bad block information;
in some embodiments, when executing the bad block management area, reading accumulated bad block information in the bad block management area, where the accumulated bad block information is bad block information accumulated before the bad block management area is read this time, and performing integrity check on the accumulated bad block information to ensure that the bad block information is not modified or damaged accidentally, improve the trust degree of the system on the bad block information, and ensure that the integrity of the bad block information helps to improve the stability of the system, and avoid abnormal or erroneous behavior of the system caused by incomplete or erroneous bad block information.
Step S105: when the accumulated bad block information passes the integrity check, storing the accumulated bad block information into a cache;
in some embodiments, when the accumulated bad block information passes the integrity check, it indicates that the information in the bad block management area is complete, all the bad block information (accumulated bad block information) can be directly read from the bad block management area at a time, and the accumulated bad block information is stored in the cache memory, so that all the bad block information can be conveniently read from the cache memory directly later, and the bad block information does not need to be read repeatedly, thereby realizing efficient reading of the bad block information.
It should be noted that, when the accumulated bad block information fails the integrity check, it is indicated that the accumulated bad block information in the bad block management area is incomplete or has a problem, and corresponding measures need to be taken, for example, attempting to repair the bad block management area, recreating the partition, generating an error prompt, etc., which are not limited in this embodiment.
Step S106: when the flash platform is started, the accumulated bad block information is read from the cache memory.
In some embodiments, when the flash memory platform is started, accumulated bad block information is directly read from the cache memory, so that all bad block information can be read out once during starting, the time required for reading the bad block information is shortened, and the starting speed of the platform is improved.
It can be appreciated that bad block information is distributed in a scattered manner on the flash memory, and when the bad block information is read, data needs to be repeatedly loaded onto the SPINAND cache (cache memory), so that the time for reading the bad block information is too long. In the prior art, all bad block information needs to be read 1024 times, only once is needed, and the bad block information needs to be obtained in the prior art approximately 250ms, and the current time is not more than 1ms, so that the reading time of the bad block information is greatly shortened.
Referring to fig. 2, fig. 2 is a flowchart of a method for booting a flash platform according to another embodiment of the present application, where the method for booting a flash platform includes, but is not limited to, steps S201 to S203.
Step S201: carrying out region division on pages of the flash memory chip to obtain a plurality of data regions;
step S202: detecting bad blocks of the data area;
step S203: and when no bad blocks exist in all the data areas, switching the flash memory platform to a continuous reading mode.
In steps S201 to S203 of some embodiments, the page of the flash memory chip is divided into a plurality of data areas, and then bad block detection is performed on each data area to determine whether there are bad blocks in different areas, so as to ensure accuracy and reliability of the read data.
It should be noted that in the conventional read mode, each time a page is read, a read command and a page address need to be sent to the SPINAND memory, and the memory waits for data to be returned, which generates a certain communication overhead and delay time. While in the continuous read mode, the read command and the starting page address may be sent to the SPINAND memory at once, and then the memory is waited to buffer the continuous page data into the SPINAND buffer. Once the data is cached in the SPINAND cache, the subsequent page data can be directly obtained from the cache without repeatedly loading page addresses and waiting for memory responses, and the communication overhead and waiting time can be greatly reduced in the mode, so that the efficiency of continuously reading the multi-page data is improved, the data reading speed is increased, and the reading command and the address are not required to be repeatedly sent.
Referring to fig. 3, fig. 3 is a flowchart of a method for booting a flash platform according to another embodiment of the present application, where the method for booting a flash platform includes, but is not limited to, steps S301 to S302.
Step S301: when the flash memory platform is switched to a mounting mode, switching a mounting root file system of the flash memory platform to a FAT file system;
step S302: and configuring the FAT file system based on the preset configuration information.
In steps S301 to S302 of some embodiments, when the flash platform is switched to the mount mode, the mount root file system of the flash platform is switched to the FAT file system, and then the FAT file system is configured based on the preset configuration information, so that files and directories on the SPINAND can be accessed through a mechanism of the FAT file system. And the root file system mounted by the SPINAAND is switched into the FAT file system, the FAT file system stores data in a continuous mode, a continuous reading mode can be used, and the reading speed can reach 30MB/s at the highest.
It should be noted that, the root file system mounted by SPINAND at present mainly includes a UBIFS (Unsorted Block Image File System, unordered block image file system) and Squashfs, initramfs (Initial RAM File System ), where UBIFS is a log file system optimized for flash memory devices, and has good crash recovery capability and space utilization efficiency, and is suitable for special features of flash memory devices; the squarhfs is a read-only compressed file system, and can compress and store the file system in a read-only manner in equipment such as a flash memory and the like, so that the occupied storage space is effectively reduced; initramfs is a temporary root file system that is used in the system boot process to provide the necessary infrastructure and tools before the actual root file system is loaded. It typically contains some necessary drivers, tools, initialization scripts, etc.
In the test, the problem that the decompression time is too long exists in the Squashfs and the Initramfs during mounting. Although the UBIFS may be configured in a non-compressed format, the start-up time is optimized, but the UBI (Unsorted Block Images, unordered block image) layer needs to be initialized to obtain UBI header information of all blocks, which consumes about 180ms; and the UBIFS management data are scattered and disordered, and a continuous reading mode cannot be used, so that the file reading speed is difficult to optimize, and the UBIFS reading speed can only reach 7MB/s at most. In the embodiment, the mounting root file system of the flash memory platform is switched to the FAT file system, and the flash memory platform is simultaneously switched to the continuous reading mode, so that the loading speed of the file is increased, and the reading speed can reach 30MB/s at the highest.
Referring to fig. 4, fig. 4 is a flowchart of a method for booting a flash platform according to another embodiment of the present application, where the method for booting a flash platform includes, but is not limited to, steps S401 to S404.
Step S401: performing functional configuration on an environment variable file of the flash memory platform to obtain an environment variable value;
step S402: when the environment variable value meets a preset partition value, determining a falcon partition corresponding to the partition value;
Note that the falcon partition is a partition for storing the device tree in the flash platform.
Step S403: when the flash memory platform is started, loading the equipment tree through the falcon partition to obtain an equipment tree address, and compiling a kernel mirror image to obtain a mirror image address;
step S404: and starting the kernel of the flash memory platform according to the mirror image address and the device tree address.
In steps S401 to S404 of some embodiments, the function configuration is performed on the environment variable file of the flash platform to obtain an environment variable value, that is, the env.txt of the flash platform is configured to implement the function of SPINAND loading the env environment variable, when the environment variable value meets a preset partition value, a falcon partition corresponding to the partition value is determined to enter a falcon mode, when the flash platform is started, a device tree is loaded through the falcon partition to obtain a device tree address, and a kernel image is compiled to obtain a mirror address, finally, a kernel of the flash platform is started according to the mirror address and the device tree address, a starting command of SPINAND can be designated by configuring the starting command of SPINAND in the env.txt file, and the device tree snapshot is read from the falcon partition and is transferred to the Linux kernel, so that the Linux kernel can correctly understand the hardware environment when starting, and thus correct initialization and driving loading are implemented.
It should be noted that env.txt is an environment variable file of the U-Boot loader, and includes configuration information required when the Boot loader is started, for example, a command line parameter of a start kernel, information of a Boot device, and the like. The present embodiment sets the startup command of the SPI NAND and other boot parameters by configuring the environment variable file. falcon partitions refer to specific partitions in SPINAND that store a Device Tree (Device Tree), which is a data structure describing hardware Device information and system architecture, that Linux kernel uses to configure hardware at startup. The falcon partition in this embodiment is used to store a snapshot of the device tree for loading and passing to the Linux kernel for use during booting.
It is noted that, in the process of determining that the environment variable value meets the preset partition value, firstly, reading the value of Bootos in the env environment variable, and when the value of Bootos is equal to yes, entering a falcon mode to determine a falcon partition corresponding to the partition value.
Referring to fig. 5, fig. 5 is a specific method flowchart of step S104 in fig. 1, including but not limited to steps S501 to S505.
Step S501: carrying out partition format verification on the bad block management area;
In some embodiments, in the process of performing integrity verification on the accumulated bad block information, firstly, performing partition format verification on the bad block management area to verify whether the partition format of the bad block management area is correct, thereby ensuring the correctness and readability of the partition information and avoiding data loss or damage caused by partition format errors.
It is to be understood that partition format verification includes, but is not limited to, checking the size of a bad block management area partition, the structure of the partition, metadata information, etc., and the present embodiment is not particularly limited.
Step S502: when the bad block management area passes the partition format verification, reading accumulated bad block information in the bad block management area;
in some embodiments, when the bad block management area passes the partition format verification, indicating that the bad block management area is normal, the accumulated bad block information in the bad block management area is directly read, wherein the bad block management area generally includes an information management structure body, and the information management structure body includes a plurality of check fields, so that the integrity of the data is verified through the check fields, thereby ensuring that the data is not damaged or tampered.
The information management structure is provided with a start flag value, an end flag value, address information, a data length value, and a check value.
Step S503: determining a start mark value, an end mark value, address information and a data length value of the accumulated bad block information;
in some embodiments, a start flag value, an end flag value, address information and a data length value of the accumulated bad block information are determined from the information management structure, wherein the start flag value is used for representing the start execution information management structure, the end flag value is used for representing the end execution information management structure, the address information is used for storing the address of the bad block information, and the data length value is used for representing the data length of the bad block information, so that the subsequent detection of the integrity of the accumulated bad block information is facilitated.
Step S504: accumulating the data length values based on the address information to obtain length accumulated values;
in some embodiments, the data length values are accumulated based on the address information to obtain a length accumulated value, so that the number of bad blocks can be checked through the length accumulated value, and the position of the bad block information recorded in the bad block management area can be judged to be accurate or not through the accumulation of the address information on the data length values, so that the accuracy of checking the accumulated bad block information is improved.
Step S505: and comparing the start mark value, the end mark value and the length accumulated value with preset integrity conditions to carry out integrity check on the accumulated bad block information.
In some embodiments, the start marker value, the end marker value, and the length accumulated value are compared with a preset integrity condition, where the integrity condition includes a preset target start marker value, a target end marker value, and a target length accumulated value, and the specific comparison process is to compare the start marker value with the target start marker value, compare the end marker value with the target end marker value, and compare the length accumulated value with the target length accumulated value, so as to complete the integrity check of the accumulated bad block information.
It should be noted that, when the start flag value is consistent with the target start flag value, the end flag value is consistent with the target end flag value, and the length accumulated value is consistent with the target length accumulated value, the accumulated bad block information is considered to pass the integrity check, and if any one of the start flag value, the end flag value, and the length accumulated value is different from the value in the integrity condition, the accumulated bad block information is considered to not pass the integrity check, wherein the target start flag value, the target end flag value, and the target length accumulated value may be set according to the actual needs of the user, for example, the target start flag value is set to constant 0xaa, the target end flag value is set to constant 0×55aa, and the like, and the embodiment is not limited specifically.
Referring to fig. 6, fig. 6 is a flowchart of a method for booting a flash platform according to another embodiment of the present application, where the method for booting a flash platform includes, but is not limited to, steps S601 to S603.
It should be noted that, steps S601 to S603 occur after the flash platform is switched to the continuous read mode.
Step S601: receiving a read instruction, and determining the read data length and the read data address in the read instruction;
step S602: according to the read data length and the read data address, performing data reading on the flash memory chip to obtain target data;
step S603: and transmitting the target data based on the preset burst length and the data bit width.
In steps S601 to S603 of some embodiments, after the flash platform switches to the continuous read mode, a read instruction is received, a read data length and a read data address in the read instruction are determined, then a start position of the read data is determined from the flash chip according to the read data address, then data reading is performed by taking the read data length as a unit, continuous reading of the data is achieved, and finally target data is transmitted based on a preset burst length and a data bit width, so that transmission of the read data is achieved, communication overhead and delay are reduced, and data reading efficiency is improved.
It will be appreciated that the QSPI in the flash platform receives Data via DMA (Direct Memory Access ), where the burst length and Data BIT WIDTH of the DDR (Double Data Rate) receiving end are denoted as (burst_8, bit_width_32) and the burst length and Data BIT WIDTH of the QSPI transmitting end are denoted as (burst_8, bit_width_32), so that the bus load Rate can be optimized.
It will be appreciated that SPINAND reads data one page size data at a time, 2048 bytes. After the flash memory platform is switched to the continuous reading mode, all data needs to be read at one time, so that the buffer address and the data length are directly transferred to the continuous reading mode function, and the transmission times on the bus can be reduced by setting a larger burst length and a wider data bit width, thereby reducing the load rate of the bus.
Referring to fig. 7, fig. 7 is a specific method flowchart of step S302 in fig. 3, including but not limited to steps S701 to S703.
Step S701: acquiring the system capacity of the FAT file system;
step S702: determining cluster units according to the system capacity in the configuration information;
step S703: the FAT file system is divided according to cluster units.
In steps S701 to S703 of some embodiments, in configuring the FAT file system based on preset configuration information, first, the system capacity of the FAT file system is acquired to determine the total capacity of the FAT file system, that is, the size of a storage space available for the FAT file system, and then cluster units are determined according to the system capacity, where in determining the cluster units, the size and the number distribution of files to be stored may be considered, for example, if most of the files are small, selecting a smaller cluster size may better utilize the storage space; if larger files exist, fragmentation and the like can be reduced by selecting larger cluster sizes, and finally, the FAT file system is divided according to cluster units, so that adjustment and testing can be performed according to specific application scenes and requirements, and the flash memory platform is adapted to more application scenes.
It should be noted that the cluster size also affects the addressing efficiency of the file system. Smaller cluster sizes may require more cluster numbers to address, while larger cluster sizes may reduce the number of cluster numbers required for addressing. Selecting an appropriate cluster size balances addressing efficiency and memory space utilization.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a boot system of a flash platform according to an embodiment of the present application.
In some embodiments, a boot system of a flash platform includes:
the chip partitioning module 801 is configured to partition the flash memory chip to obtain a bad block management area;
the bad block recording module 802 is configured to record, for each write of data, information of a bad block occurring in the flash memory chip, so as to obtain bad block information;
a management area updating module 803, configured to update a bad block management area according to bad block information;
the integrity checking module 804 is configured to read the accumulated bad block information in the bad block management area, and perform integrity checking on the accumulated bad block information;
an information accumulation module 805 for storing the accumulated bad block information to the cache memory when the accumulated bad block information passes the integrity check;
the information reading module 806 is configured to read the accumulated bad block information from the cache memory when the flash platform is started.
In some embodiments, the boot system further includes a mode switching module, configured to perform region division on a page of the flash memory chip to obtain a plurality of data regions; detecting bad blocks of the data area; and switching the flash platform to a continuous reading mode when no bad blocks exist in all the data areas.
The file configuration module is used for switching the mounting root file system of the flash memory platform into the FAT file system when the flash memory platform is switched to the mounting mode; and configuring the FAT file system based on the preset configuration information.
The environment configuration module is used for carrying out function configuration on the environment variable file of the flash memory platform to obtain an environment variable value; when the environment variable value meets a preset partition value, determining a falcon partition corresponding to the partition value, wherein the falcon partition is a partition for storing a device tree in the flash memory platform; when the flash memory platform is started, loading the equipment tree through the falcon partition to obtain an equipment tree address, and compiling a kernel mirror image to obtain a mirror image address; and starting the kernel of the flash memory platform according to the mirror image address and the device tree address.
It should be noted that, the booting system includes the beneficial effects brought by the booting method of the flash platform, and this embodiment is not described herein again.
Referring to fig. 9, fig. 9 illustrates a hardware structure of an electronic device according to an embodiment, where the electronic device includes:
the processor 1001 may be implemented by using a general-purpose CPU (Central Processing Unit ), a microprocessor, an application-specific integrated circuit (Application SpecificIntegrated Circuit, ASIC), or one or more integrated circuits, etc. to execute related programs to implement the technical solutions provided by the embodiments of the present application;
The Memory 1002 may be implemented in the form of a Read Only Memory (ROM), a static storage device, a dynamic storage device, or a random access Memory (Random Access Memory, RAM). The memory 1002 may store an operating system and other application programs, and when the technical solutions provided in the embodiments of the present application are implemented by software or firmware, relevant program codes are stored in the memory 1002, and the processor 1001 invokes a boot method for executing the flash platform of the embodiments of the present application;
an input/output interface 1003 for implementing information input and output;
the communication interface 1004 is configured to implement communication interaction between the present device and other devices, and may implement communication in a wired manner (e.g. USB, network cable, etc.), or may implement communication in a wireless manner (e.g. mobile network, WIFI, bluetooth, etc.);
a bus 1005 for transferring information between the various components of the device (e.g., the processor 1001, memory 1002, input/output interface 1003, and communication interface 1004);
wherein the processor 1001, the memory 1002, the input/output interface 1003, and the communication interface 1004 realize communication connection between each other inside the device through the bus 1005.
In addition, an embodiment of the present application further provides a computer readable storage medium, where computer executable instructions are stored, where the computer executable instructions are executed by a processor or a controller, for example, by one of the processors in the above system embodiment, and cause the processor to perform the booting method of the flash platform in the above embodiment.
The embodiments described in the embodiments of the present application are for more clearly describing the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application, and as those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
It will be appreciated by those skilled in the art that the solutions shown in fig. 1-8 are not limiting to embodiments of the present application and may include more or fewer steps than shown, or may combine certain steps, or different steps.
The above described apparatus embodiments are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Those of ordinary skill in the art will appreciate that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
The terms "first," "second," "third," "fourth," and the like in the description of the present application and in the above-described figures, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in this application, "at least one" means one or more, and "a plurality" means two or more. "and/or" for describing the association relationship of the association object, the representation may have three relationships, for example, "a and/or B" may represent: only a, only B and both a and B are present, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the above-described division of units is merely a logical function division, and there may be another division manner in actual implementation, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including multiple instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the various embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing a program.
Preferred embodiments of the present application are described above with reference to the accompanying drawings, and thus do not limit the scope of the claims of the embodiments of the present application. Any modifications, equivalent substitutions and improvements made by those skilled in the art without departing from the scope and spirit of the embodiments of the present application shall fall within the scope of the claims of the embodiments of the present application.

Claims (9)

1. A method for booting a flash platform, the flash platform comprising a flash chip and a cache memory, the method comprising:
partitioning the flash memory chip to obtain a bad block management area;
recording the information of the bad blocks of the flash memory chip for each time of writing data to obtain the bad block information;
updating the bad block management area according to the bad block information;
reading accumulated bad block information in the bad block management area, and carrying out integrity check on the accumulated bad block information;
storing the accumulated bad block information to a cache memory when the accumulated bad block information passes the integrity check;
when the flash memory platform is started, reading accumulated bad block information from the cache memory;
the method further comprises the steps of:
performing functional configuration on the environment variable file of the flash memory platform to obtain an environment variable value;
when the environment variable value meets a preset partition value, determining a falcon partition corresponding to the partition value, wherein the falcon partition is a partition for storing a device tree in the flash memory platform;
when the flash memory platform is started, loading a device tree through the falcon partition to obtain a device tree address, and compiling a kernel mirror image to obtain a mirror image address;
And starting the kernel of the flash memory platform according to the mirror image address and the equipment tree address.
2. The method for booting a flash platform of claim 1, further comprising:
carrying out region division on pages of the flash memory chip to obtain a plurality of data regions;
detecting bad blocks of the data area;
and when all the data areas do not have bad blocks, switching the flash memory platform to a continuous reading mode.
3. The method for booting a flash platform of claim 1, further comprising:
when the flash memory platform is switched to a mounting mode, switching a mounting root file system of the flash memory platform to a FAT file system;
and configuring the FAT file system based on preset configuration information.
4. The method for booting the flash platform according to claim 1, wherein the reading the accumulated bad block information in the bad block management area and performing integrity check on the accumulated bad block information includes:
carrying out partition format verification on the bad block management area;
when the bad block management area passes the partition format verification, reading accumulated bad block information in the bad block management area;
Determining a start mark value, an end mark value, address information and a data length value of the accumulated bad block information;
accumulating the data length values based on the address information to obtain length accumulated values;
and comparing the starting mark value, the ending mark value and the length accumulated value with preset integrity conditions to carry out integrity check on the accumulated bad block information.
5. The method of booting a flash platform according to claim 2, wherein after said switching the flash platform to a continuous read mode, the method further comprises:
receiving a read instruction, and determining the read data length and the read data address in the read instruction;
performing data reading on the flash memory chip according to the read data length and the read data address to obtain target data;
and transmitting the target data based on a preset burst length and a data bit width.
6. The method for booting the flash platform according to claim 3, wherein configuring the FAT file system based on preset configuration information includes:
acquiring the system capacity of the FAT file system;
Determining cluster units in the configuration information according to the system capacity;
and dividing the FAT file system according to the cluster units.
7. A boot system for a flash platform, the flash platform comprising a flash chip and a cache memory, the boot system comprising:
the chip partitioning module is used for partitioning the flash memory chip to obtain a bad block management area;
the bad block recording module is used for recording the information of the bad blocks of the flash memory chip for each writing of data to obtain bad block information;
the management area updating module is used for updating the bad block management area according to the bad block information;
the integrity checking module is used for reading the accumulated bad block information in the bad block management area and carrying out integrity checking on the accumulated bad block information;
the information accumulation module is used for storing the accumulated bad block information into the cache memory when the accumulated bad block information passes the integrity check;
and the information reading module is used for reading the accumulated bad block information from the cache memory when the flash memory platform is started.
8. An electronic device comprising a memory storing a computer program and a processor implementing the method of booting the flash platform of any one of claims 1 to 6 when the computer program is executed by the processor.
9. A computer readable storage medium storing computer executable instructions for performing the boot method of the flash platform of any one of claims 1 to 6.
CN202311669841.7A 2023-12-07 2023-12-07 Starting method and system of flash memory platform, electronic equipment and storage medium Active CN117369905B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311669841.7A CN117369905B (en) 2023-12-07 2023-12-07 Starting method and system of flash memory platform, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311669841.7A CN117369905B (en) 2023-12-07 2023-12-07 Starting method and system of flash memory platform, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117369905A CN117369905A (en) 2024-01-09
CN117369905B true CN117369905B (en) 2024-03-19

Family

ID=89391336

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311669841.7A Active CN117369905B (en) 2023-12-07 2023-12-07 Starting method and system of flash memory platform, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117369905B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722443A (en) * 2012-05-21 2012-10-10 三星半导体(中国)研究开发有限公司 Bad block management method for flash memory
CN103778065A (en) * 2012-10-25 2014-05-07 北京兆易创新科技股份有限公司 Flash memory and bad block managing method thereof
CN104461750A (en) * 2013-09-25 2015-03-25 北京兆易创新科技股份有限公司 Method and device for accessing NAND flash
CN104750565A (en) * 2013-12-31 2015-07-01 重庆重邮信科通信技术有限公司 NAND bad block processing method and NAND flash memory device
CN111007989A (en) * 2019-12-06 2020-04-14 中国空空导弹研究院 Storage and use method of missile-borne FLASH chip bad block information
CN114911662A (en) * 2022-05-31 2022-08-16 中国科学院微电子研究所 Bad block scanning circuit and scanning method arranged in main control chip of solid state disk
CN116400869A (en) * 2023-06-06 2023-07-07 深圳大普微电子科技有限公司 Bad block replacement method of flash memory device, flash memory device controller and flash memory device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8327066B2 (en) * 2008-09-30 2012-12-04 Samsung Electronics Co., Ltd. Method of managing a solid state drive, associated systems and implementations
US8583868B2 (en) * 2011-08-29 2013-11-12 International Business Machines Storage system cache using flash memory with direct block access

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722443A (en) * 2012-05-21 2012-10-10 三星半导体(中国)研究开发有限公司 Bad block management method for flash memory
CN103778065A (en) * 2012-10-25 2014-05-07 北京兆易创新科技股份有限公司 Flash memory and bad block managing method thereof
CN104461750A (en) * 2013-09-25 2015-03-25 北京兆易创新科技股份有限公司 Method and device for accessing NAND flash
CN104750565A (en) * 2013-12-31 2015-07-01 重庆重邮信科通信技术有限公司 NAND bad block processing method and NAND flash memory device
CN111007989A (en) * 2019-12-06 2020-04-14 中国空空导弹研究院 Storage and use method of missile-borne FLASH chip bad block information
CN114911662A (en) * 2022-05-31 2022-08-16 中国科学院微电子研究所 Bad block scanning circuit and scanning method arranged in main control chip of solid state disk
CN116400869A (en) * 2023-06-06 2023-07-07 深圳大普微电子科技有限公司 Bad block replacement method of flash memory device, flash memory device controller and flash memory device

Also Published As

Publication number Publication date
CN117369905A (en) 2024-01-09

Similar Documents

Publication Publication Date Title
US8561194B2 (en) Memory storage device and memory controller and virus scanning method thereof
US11630578B2 (en) Electronic system with storage management mechanism and method of operation thereof
CN104254840A (en) Memory dump and analysis in a computer system
US20060282653A1 (en) Method for updating frimware of memory card
CN106569904A (en) Information storage method and device and server
KR101555210B1 (en) Apparatus and method for downloadin contents using movinand in portable terminal
US11861349B2 (en) Modular firmware updates in an information handling system
CN110716845B (en) Log information reading method of Android system
CN110765032A (en) Method for reading and writing I2C memory based on system management bus interface
CN112133357B (en) eMMC test method and device
KR102116096B1 (en) Multisystem, and method of booting the same
CN118155698B (en) Data testing method, electronic equipment and storage medium
CN113849230B (en) Server startup method, device, electronic device and readable storage medium
CN110990207B (en) BPS memory test method, system, terminal and storage medium based on Whitley platform
CN117369905B (en) Starting method and system of flash memory platform, electronic equipment and storage medium
US20090138633A1 (en) Computer, external storage and method for processing data information in external storage
CN110874333B (en) Storage device and storage method
CN115033298B (en) Multi-scene adaptation method and system for interface resources of industrial Internet equipment
CN113377421B (en) Method, device, equipment and medium for detecting software and hardware version information
CN116974979A (en) Method, system and circuit for deploying file system on embedded memory
CN113031863B (en) SSD command correlation management method, SSD command correlation management device, computer equipment and storage medium
US20040255075A1 (en) Apparatus and method for flash ROM management
CN113791936B (en) Data backup method, device and storage medium
US12235987B2 (en) Method for performing multi-system log access management, associated system on chip integrated circuit and non-transitory computer-readable medium
US20240184454A1 (en) Storage device and operating method of the same

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