Method, device and equipment for improving programming speed of flash memory and storage medium
By presetting communication protocols in the memory space, detecting and executing flash write operations, the problem of slowing flash programming when the debugger and register interaction is solved, and faster flash write speed is achieved.
Patent Information
- Application Number
- CN202410971847.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-11-22
AI Technical Summary
In the prior art, when writing programs into flash memory through a debugger, the writing speed is slow, mainly because the information interaction between the debugger and the register slows down the flash programming process.
By pre-existing communication protocols in the storage space, including command areas and data areas, detecting command status and performing flash write operations, the direct interaction between the debugger and the register is avoided, and commands and data are directly written through the communication protocol.
This greatly improves the speed at which the debugger writes program data to the flash memory, reduces the steps of register participation, and improves the speed of flash memory writing.
Smart Images

Figure CN119002802A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip technology, and in particular to a method, device, equipment and storage medium for improving flash memory programming speed. Background Art
[0002] Debugger flash programming usually refers to the process of using a debugger to write program code to the flash memory of a microcontroller or microprocessor during embedded system development. The process of using a debugger to write a program to flash memory is usually implemented through registers, and this process usually involves the following key steps:
[0003] 1. Connection and configuration: First, physically connect the debugger to the debug port of the target device. Then, configure the debugger parameters in the development environment to ensure that the debugger can correctly identify and communicate.
[0004] 2. Reset and enter debug mode: Send specific instructions to the target chip through the debugger to reset it and enter a special debug state. In this state, the processor suspends the execution of user programs and allows the debugger to access and control internal resources, including registers and memory.
[0005] 3. Read and write registers: In debug mode, the debugger can directly read or modify the register values of the processor. Registers are small storage areas inside the microprocessor that are used to temporarily store data and control signals.
[0006] 4. Programming Flash: The debugger starts the flash programming process by writing a specific command to the control register. The data is usually loaded into the data register first, and then the debugger issues a programming command to transfer the data from the data register to the specified flash address.
[0007] 5. Exit debug mode and restart: After completing all programming steps, the debugger will send instructions to the target device to exit debug mode and return to normal operation, or directly restart the device so that the newly programmed firmware can begin to execute. This process is a common hardware debugging and firmware upgrade method in embedded development, and is widely used in the development and maintenance of chips such as single-chip microcomputers and system-level chips.
[0008] However, when programming registers in flash memory through a debugger, when the debugger sends control commands and writes data, the commands and data need to be loaded into the registers first. This requires information exchange between the debugger and the registers. The debugger and the target chip with the registers are two different devices, so the interaction between them will slow down the flash memory programming. Summary of the invention
[0009] The present invention provides a method, device, equipment and storage medium for improving flash memory programming speed, which are used to solve the problem of slow writing speed when writing a program into a flash memory through a debugger in the prior art.
[0010] In order to solve the above technical problems, in a first aspect, the present invention provides a method for improving the flash memory programming speed, comprising:
[0011] Pre-storing a communication protocol in a storage space, wherein the communication protocol includes a command area and a data area;
[0012] When it is detected that the command status in the command area is in the completed state, writing a flash memory burning command word into the command area, and updating the command status to the ready state;
[0013] When it is detected that the command state is in the ready state, the flash memory burning command word is read and the flash memory burning operation corresponding to the flash memory burning command word is executed, and the command state is updated to the execution state;
[0014] The flash memory burning operation is performed on the flash memory, the data to be burned in the data area is burned into the flash memory, and the command status is updated to a completion status after the flash memory burning operation is performed.
[0015] Optionally, performing the flash memory programming operation on the flash memory includes:
[0016] Performing a data erasing operation on the flash memory to erase the data in the flash memory;
[0017] Performing an erase verification operation on the flash memory to verify whether the data in the flash memory is successfully erased;
[0018] After the data in the flash memory is erased, a data writing operation is performed on the flash memory to write the data in the data area into the flash memory.
[0019] Optionally, performing a data erasing operation on the flash memory to erase data in the flash memory includes:
[0020] Read flash memory block erase command word;
[0021] Reading the address word of the flash memory sector block to be erased in the flash memory block erase command word;
[0022] Erasing data in a block to be erased corresponding to the address word in the flash memory.
[0023] Optionally, performing an erase verification operation on the flash memory to verify whether data in the flash memory is successfully erased includes:
[0024] Read block erase verification command word;
[0025] Obtaining the starting address word and the length word in the block erase verification command word;
[0026] Determine the starting address corresponding to the starting address word, and read the first data after a preset length from the starting address in the flash memory, wherein the preset length is stored in the length word;
[0027] Reading a check code in the data area, and checking the first data by using the check code;
[0028] Check whether the verification result of the first data is consistent with a preset value. If it is consistent, it is determined that the first data in the address to be verified has been completely erased. If it is inconsistent, it is determined that the first data in the address to be verified has not been completely erased.
[0029] Optionally, performing a data writing operation on the flash memory to write the data in the data area into the flash memory includes:
[0030] Read flash write command word;
[0031] Obtaining the address word to be written in the flash memory write command word;
[0032] Acquire the data to be written in the data area;
[0033] The data to be written is written into the address to be written in the flash memory corresponding to the address word to be written.
[0034] Optionally, after the communication protocol is pre-stored in the storage space and before the command status is updated to a completion status after the flash memory programming operation is performed, the method further includes:
[0035] Reading the error status word in the command area;
[0036] Determining whether an error occurs during the programming of the flash memory according to the error status word;
[0037] When an error occurs during the programming process of the flash memory, reading the error type word in the command area;
[0038] When the error type word is a first error type word, determining the error type is a read command word error;
[0039] When the error type word is the Nth error type word, it is determined that the error type is a command parameter N-1 check failure, where the value of N is greater than 1.
[0040] Optionally, after the communication protocol is pre-stored in the storage space and before the command status is updated to a completion status after the flash memory programming operation is performed, the method further includes:
[0041] Reading the tracking command word in the command area;
[0042] If the tracking command word is a first tracking command word, obtaining an index value of a flash memory block where the data to be tracked is located from the first tracking command word;
[0043] If the tracking command word is a second tracking command word, obtaining an index value of a flash memory page where the data to be tracked is located from the second tracking command word;
[0044] If the tracking data word is a third tracking command word, a cyclic redundancy check value of the data written in the flash memory and the source data is obtained from the third tracking command word.
[0045] In a second aspect, the present invention provides a device for improving the flash memory programming speed, comprising:
[0046] A pre-storage module, used to pre-store the communication protocol in the storage space, wherein the communication protocol includes a command area and a data area;
[0047] A writing module, used for writing a flash memory burning command word into the command area and updating the command state to a ready state when detecting that the command state in the command area is a completed state;
[0048] A reading module, used for reading the flash memory burning command word and executing the flash memory burning operation corresponding to the flash memory burning command word when detecting that the command state is a ready state, and updating the command state to an execution state;
[0049] The execution module is used to execute the flash memory burning operation on the flash memory so as to burn the data to be burned in the data area into the flash memory, and update the command status to a completion status after executing the flash memory burning operation.
[0050] In a third aspect, the present invention provides a device for improving flash memory programming speed, comprising a memory and a processor, wherein:
[0051] The memory is used to store computer programs;
[0052] The processor is used to read the program in the memory and execute the steps of the method for improving the flash memory programming speed provided in the first aspect above.
[0053] In a fourth aspect, the present invention provides a computer-readable storage medium having a readable computer program stored thereon, which, when executed by a processor, implements the steps of improving the flash memory burning speed provided in the first aspect above.
[0054] Compared with the prior art, the method for improving the flash memory writing speed provided by the present invention has the following beneficial effects:
[0055] In the present invention, the flash memory programming commands (such as flash memory burning command words) and data are pre-stored in the command area and data area of the communication protocol respectively. In this way, when the debugger writes data to the flash memory, the communication protocol can be used to exchange commands and data, and the program data can be written into the flash memory. Therefore, in the present invention, the debugger does not need the participation of registers when writing data into the flash memory, so the writing speed of the debugger writing program data into the flash memory can be greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only part of the embodiments of the present invention, rather than all of the embodiments. For ordinary technicians in this field, without paying creative work, other drawings obtained based on these drawings all fall within the scope of protection of this application.
[0057] Figure 1 It is a flow chart of a method for improving flash memory programming speed provided by an embodiment of the present invention;
[0058] Figure 2 It is a structural diagram of a device for improving flash memory programming speed provided by an embodiment of the present invention;
[0059] Figure 3 is a schematic diagram of a communication protocol provided by an embodiment of the present invention;
[0060] Figure 4 It is a structural diagram of another device for improving flash memory programming speed provided by an embodiment of the present invention;
[0061] Figure 5 It is a structural schematic diagram of a device for improving flash memory writing speed provided by an embodiment of the present invention;
[0062] Figure 6 It is a structural schematic diagram of a computer-readable storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0064] In order to make the description of the disclosed content more detailed and complete, the following is an illustrative description of the implementation mode and specific examples of the present invention; however, this is not the only form of implementing or applying the specific embodiments of the present invention. The implementation mode covers the features of multiple specific embodiments and the method steps and their sequence for constructing and operating these specific embodiments. However, other specific embodiments can also be used to achieve the same or equal functions and step sequences. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0065] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein.
[0066] In addition, in the description of the embodiments of the present application, "multiple" refers to two or more than two, and other quantifiers are similar and should be understood. The preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention. In addition, the embodiments of the present application and the features therein may be combined with each other if there is no conflict.
[0067] like Figure 1 The flowchart of a method for improving flash memory programming speed provided by an embodiment of the present invention includes the following steps.
[0068] Step S101, pre-store the communication protocol in a storage space.
[0069] Wherein, the communication protocol includes a command area and a data area.
[0070] It should be noted that the storage space in this step may be located in the internal storage space of the chip or microprocessor, or in the external storage space of the chip or microprocessor, which is not limited in detail here.
[0071] It should be noted that the commands read and written in the command area and the data read and written in the data area in the communication protocol can be set and expanded according to specific needs of the application, and are not limited in detail here.
[0072] Step S102, when it is detected that the command status in the command area is in the completed status, a flash memory programming command word is written into the command area, and the command status is updated to the ready status.
[0073] It should be noted that the command status in the command area can be determined by the command status word in the command area, and the position of the command status word in the command area can be specifically set according to application needs, which is not limited in detail here.
[0074] It should be noted that the command status word may include a completion status command word, a ready status command word, and an execution status command word. The number of bits and specific values of each command word can be specifically set by relevant field personnel during application. For example, the completion command status word can be 0x5C8D2A3B, the ready status command word can be 0xA2B3C5D8, and the execution status command word can be 0x2A3B5C8D.
[0075] It should be noted that the type of flash memory burn command word can be set according to the specific needs of the application. For example, the type of flash memory burn command word can include a flash memory write command word; the position of the flash memory burn command word in the command area can be specifically set according to the needs of the application, and is not limited in detail here.
[0076] Step S103, when it is detected that the command state is the ready state, the flash memory burning command word is read and the flash memory burning operation corresponding to the flash memory burning command word is executed, and the command state is updated to the execution state.
[0077] It should be noted that the flash memory burn operation corresponding to the flash memory burn command word can be set according to the specific needs of the application. For example, when the flash memory burn command word is a flash memory write command word, the flash memory burn operation corresponding to the flash memory write command word is a flash memory write operation. Executing the flash memory write operation can write the program to be written into the flash memory.
[0078] Step S104, executing the flash memory burning operation on the flash memory, burning the data to be burned in the data area into the flash memory, and updating the command status to a completion status after executing the flash memory burning operation.
[0079] It can be understood that the data to be burned in the data area in this step may be data that needs to be written into the flash memory, for example, may be a program that needs to be written into the flash memory.
[0080] As a specific example, Figure 2 The figure shows a device for improving flash memory programming speed provided by an embodiment of the present invention, in which a debugging host 210 can be connected to a debugger 220, the debugger 220 is connected to a target board 230, the target board 230 has a central processing unit chip 231 and a flash memory chip 232, and the central processing unit chip 231 is connected to the flash memory chip 232, wherein a communication protocol is pre-stored in the central processing unit chip 231;
[0081] The command status in the command area can be periodically detected by the debugging host 210. When the command status is the completed status, the flash memory burning command word is written into the command area, and the command status is updated to the ready status; the command status is periodically detected by the central processing unit chip 231. When the command status is the ready status, the flash memory burning command word is read and the flash memory burning operation corresponding to the flash memory burning command word is executed, and the command status is updated to the execution status. The central processing unit chip 231 communicates with the flash memory chip 232, sends a flash memory burning command to the flash memory chip 232, and waits for the flash memory chip 232 to execute the flash memory burning operation on the flash memory, until the flash memory burning operation is completed and the command status is updated to the completed status.
[0082] Thus, in the embodiment of the present invention, the flash memory programming commands (such as flash memory burning command words) and data are pre-stored in the command area and data area of the communication protocol, respectively. Thus, when the debugger writes data to the flash memory, the command and data interaction can be realized through the communication protocol, and the program data can be written into the flash memory. Therefore, in the embodiment of the present invention, the debugger does not need the participation of registers when writing data into the flash memory, so the writing speed of the debugger writing program data into the flash memory can be greatly improved.
[0083] In an optional implementation, performing the flash memory programming operation on the flash memory includes:
[0084] Performing a data erasing operation on the flash memory to erase the data in the flash memory;
[0085] Performing an erase verification operation on the flash memory to verify whether the data in the flash memory is successfully erased;
[0086] After the data in the flash memory is erased, a data writing operation is performed on the flash memory to write the data in the data area into the flash memory.
[0087] It should be noted that, in this implementation, the flash memory programming operation includes three operations, namely, a data erase operation, an erase verification operation, and a data write operation, wherein the data erase operation is used to erase the historical data in the flash memory, the erase verification operation is used to verify whether the historical data in the flash memory is erased cleanly, and the data write operation is used to write the new program data to be written into the erased flash memory;
[0088] It should be noted that the addresses to be erased, verified and written in the flash memory may be all addresses in the flash memory or part of the addresses in the flash memory, and may be set according to specific needs of the application, which is not limited in detail here.
[0089] In an optional implementation manner, performing a data erasing operation on a flash memory to erase data in the flash memory includes:
[0090] Read flash memory block erase command word;
[0091] Reading the address word of the flash memory sector block to be erased in the flash memory block erase command word;
[0092] Erasing the data in the address to be erased corresponding to the address word in the flash memory.
[0093] It should be noted that the flash block erase command word is a type of flash memory write command word, and can also be a part of the flash memory write command word. When the flash block erase command word is a type of flash memory write command word, the last flash memory write command word needs to be overwritten when writing the flash memory write command word. When the flash block erase command word is a part of the flash memory write command word, only the part of the flash block erase command word in the flash memory write command word can be overwritten when writing the flash block erase command word. As a specific example, the flash block erase command word can be embodied by a specific value, for example, the flash block erase command word can be 0x00500101.
[0094] It should be noted that the flash memory block erase command word includes an address word, and the address to be erased in the flash memory can be determined by the address word. The corresponding relationship between the address word and the address to be erased in the flash memory can be set according to the specific needs of the application. For example, the address word can be the same as the address to be erased;
[0095] It should be noted that the position of the address word in the flash memory block erase command word can be set according to specific needs of the application, and is not limited in detail here.
[0096] In an optional implementation, performing an erase verification operation on the flash memory to verify whether the data in the flash memory is successfully erased includes:
[0097] Read block erase verification command word;
[0098] Obtaining the starting address word and length word of the verification block in the block erase verification command word;
[0099] Determine a starting address corresponding to the starting address word, and read first data of a preset length from the starting address in the flash memory, wherein the preset length is stored in the length word;
[0100] Reading a check code in the data area, and checking the first data by using the check code;
[0101] Check whether the verification result of the first data is consistent with a preset value. If it is consistent, it is determined that the first data has been completely erased. If it is inconsistent, it is determined that the first data has not been completely erased.
[0102] It should be noted that the block erase verification command word is a type of flash memory programming command word, and may also be a part of the flash memory programming command word. As a specific example, the block erase verification command word may be embodied by a specific value, such as the block erase verification command word may be 0x00500401.
[0103] It should be noted that the check code in the data area may be pre-stored in a preset position in the data area, or may be written into the data area after the block erase check command word is read.
[0104] Optionally, reading the first data in the flash memory can also be achieved by reading a flash memory read command word, that is, the flash memory read command word can be read, the address word to be read in the flash memory read command word is obtained, the first data in the address to be read corresponding to the address word to be read in the flash memory is read, and then the verification command word is read, the verification code in the data area is read, and the first data is verified by the verification code. As a specific example, the flash memory read command word can be 0x00500201.
[0105] It should be noted that the preset value can be determined according to the specific method of verification. In this implementation, since the default value of each unit in the flash memory is a high level state when the data in the flash memory is cleared, the first data read should be 0xFF when the data in the flash memory is cleared. Therefore, the check code can be selected as 0x00, and then the first data and the check code can be ORed. If the preset value is 0xFF, it can be determined that the first data has been completely erased. As a specific example, the verification method in this implementation can also be a white check. When verifying using this verification method, the check code in the data area can be a null value. By directly verifying whether the first data read is 0xFF, it can be confirmed whether the data in the flash memory is cleared. When the first data is 0xFF, the data in the flash memory is cleared. When the first data is not 0xFF, the data in the flash memory is not cleared.
[0106] In an optional implementation, performing a data writing operation on the flash memory to write the data in the data area into the flash memory includes:
[0107] Read flash write command word;
[0108] Obtaining the address word to be written in the flash memory write command word;
[0109] Acquire the data to be written in the data area;
[0110] The data to be written is written into the address to be written in the flash memory corresponding to the address word to be written.
[0111] It should be noted that the flash memory write command word may be a type of flash memory burn command word, or may be a part of the flash memory burn command word. As a specific example, the flash memory write command word may be embodied by a specific value, such as the flash memory write command word may be 0x00500301.
[0112] It should be noted that the address word to be written in the flash memory write command word can be the address word of the flash memory block or the address word of the flash memory page, and the flash memory block usually includes multiple flash memory pages. In this way, when writing data to the flash memory block, data can be written to the flash memory pages in the flash memory block page by page.
[0113] In an optional implementation, after the communication protocol is pre-stored in the storage space and before the command status is updated to the completion status after the flash memory programming operation is performed, the method further includes:
[0114] Reading the error status word in the command area;
[0115] Determining whether an error occurs during the programming of the flash memory according to the error status word;
[0116] When an error occurs during the programming process of the flash memory, reading the error type word in the command area;
[0117] When the error type word is a first error type word, determining the error type is a read command word error;
[0118] When the error type word is the Nth error type word, it is determined that the error type is a command parameter N-1 check failure, where the value of N is greater than 1.
[0119] It should be noted that the position of the error status word in the command area can be set according to specific needs of the application and is not limited in detail here.
[0120] Optionally, there may be two types of error status words, one is an error status word indicating a success status, and the other may be an error status word indicating a failure status. As a specific example, 0x5A5A5A5A is an error status word indicating a success status; 0xA5A5A5A5 indicates an error status word indicating a failure status. When the error status word indicating a failure status is read, it can be determined that an error has occurred during the flash memory burning process.
[0121] It should be noted that the flash memory burning process can be any step when burning data into the flash memory, such as writing a flash memory burning command into the communication protocol, reading a flash memory burning command, or executing any link of the flash memory burning operation.
[0122] It should be noted that the position of the error type word in the command area can be set according to the specific needs of the application, and is not limited in detail here. As a specific example, the first error type word can be 0xF0500401, and the Nth error type word can be 0xF050040(N-1).
[0123] Specifically, the manifestation of the error in reading the command word can be specifically defined in the application, for example, it can be that a non-existent command word is read, the format of the read command word is wrong, etc.;
[0124] Specifically, the command parameter may be any command parameter, for example, each address command word, a check code command word, etc. in the flash memory burning command word.
[0125] In an optional implementation, after the communication protocol is pre-stored in the storage space and before the command status is updated to the completion status after the flash memory programming operation is performed, the method further includes:
[0126] Reading the tracking command word in the command area;
[0127] If the tracking command word is a first tracking command word, obtaining an index value of a flash memory block where the data to be tracked is located from the first tracking command word;
[0128] If the tracking command word is a second tracking command word, obtaining an index value of a flash memory page where the data to be tracked is located from the second tracking command word;
[0129] If the tracking data word is a third tracking command word, a cyclic redundancy check value of the data written in the flash memory and the source data is obtained from the third tracking command word.
[0130] It should be noted that the index values of the flash memory block and the flash memory page are the values for indexing the flash memory block and the flash memory page. For example, multiple flash memory blocks and flash memory pages can be numbered in advance. Then, obtaining the index value of the flash memory block can determine the corresponding number of the flash memory block where the data to be tracked is located, and obtaining the index value of the flash memory page can determine the corresponding number of the flash memory page where the data to be tracked is located. Therefore, obtaining the index value of the flash memory block and the flash memory page can determine the flash memory block where the data to be tracked is located, and which flash memory page in the flash memory block is located, thereby achieving accurate positioning of the data to be tracked. In this way, if the data to be tracked is erroneous data, the position of the erroneous data can naturally be located.
[0131] It should be noted that the source data is the program data to be written into the flash memory. After the source data is written into the flash memory, the current data in the flash memory can be read out and a cyclic redundancy check is performed on the read data and the source data to verify whether the written data is correct.
[0132] As a specific example, 0x01 may be the first tracking command word; 0x02 may be the second tracking command word; and 0x03 may be the third tracking command word.
[0133] Optionally, the command area may also include a reserved segment, which may be an extension area in the communication protocol. When functions need to be expanded, fields may be further defined in the extension area to achieve the expansion of functions.
[0134] As a specific example, Figure 3 As shown is a specific structural diagram of a communication protocol provided by an embodiment of the present invention, the communication protocol includes a command area and a data area, the command area includes a command status area, an error status area, an error type area, a flash memory burn command area, a tracking data area and a reserved segment, etc., wherein the command status area is used to read and write command status, the error status area is used to read and write error status words, the error type area is used to read and write error type words, the flash memory burn command area is used to read and write flash memory block erase command words, block erase verification command words and flash memory write command words, etc., and the tracking data area is used to read and write the first tracking command word to the third tracking command word, etc.
[0135] Based on the above method for improving the flash memory writing speed, the embodiment of the present invention provides a device for improving the flash memory writing speed, such as Figure 4 As shown, the device for improving the flash memory programming speed includes:
[0136] A pre-storage module 410, used to pre-store the communication protocol in the storage space, wherein the communication protocol includes a command area and a data area;
[0137] A writing module 420, configured to write a flash memory programming command word into the command area and update the command status to a ready status when detecting that the command status in the command area is a completed status;
[0138] A reading module 430, configured to read the flash memory burn command word and execute the flash memory burn operation corresponding to the flash memory burn command word when detecting that the command state is in the ready state, and update the command state to the execution state;
[0139] The execution module 440 is used to execute the flash memory burning operation on the flash memory so as to burn the data to be burned in the data area into the flash memory, and update the command status to a completion status after executing the flash memory burning operation.
[0140] For other details about how the modules in the above-mentioned device for improving the flash memory writing speed implement the above-mentioned technical solution, please refer to the description of the method for improving the flash memory writing speed provided in the above-mentioned invention embodiment, which will not be repeated here.
[0141] Based on the above method of improving flash memory programming speed, Figure 5As shown, an embodiment of the present invention further provides a structural schematic diagram of a device for improving the flash memory burning speed, and the identification device includes a processor 51 and a memory 52 coupled to the processor 51. The memory 52 stores a computer program, and when the computer program is executed by the processor 51, the processor 51 executes the steps of the method for improving the flash memory burning speed in the above embodiment.
[0142] For other details about how the processor 51 in the device for improving flash memory writing speed implements the above technical solution, please refer to the description of the method for improving flash memory writing speed provided in the above invention embodiment, which will not be repeated here.
[0143] Among them, the processor 51 can also be called a CPU (Central Processing Unit), and the processor 51 may be an integrated circuit chip with signal processing capabilities; the processor 51 can also be a general-purpose processor, DSP (Digital Signal Process), ASIC (Application Specific Integrated Circuit), FPGA (Field Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, among which the general-purpose processor can be a microprocessor or the processor 51 can also be any conventional processor, etc.
[0144] like Figure 6 As shown, the embodiment of the present invention also provides a schematic diagram of the structure of a computer-readable storage medium, on which a readable computer program 61 is stored; wherein the computer program 61 can be stored in the above storage medium in the form of a software product, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, magnetic disk or optical disk, ROM (Read-Only Memory), RAM (Random Access Memory) and other media that can store program codes, or terminal devices such as computers, servers, mobile phones, and tablets.
[0145] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0146] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0147] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0148] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0149] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium), or a semiconductor medium (e.g., an SSD (solid state disk, solid state hard disk)), etc.
[0150] The technical solution provided by the present application is introduced in detail above. The principles and implementation methods of the present application are explained by using specific examples in the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
[0151] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) that contain computer-usable program code.
[0152] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0153] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0154] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0155] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for improving flash memory programming speed, characterized in that: include: Pre-storing a communication protocol in a storage space, wherein the communication protocol includes a command area and a data area; When it is detected that the command status in the command area is in the completed state, writing a flash memory burning command word into the command area, and updating the command status to the ready state; When it is detected that the command state is in the ready state, the flash memory burning command word is read and the flash memory burning operation corresponding to the flash memory burning command word is executed, and the command state is updated to the execution state; The flash memory burning operation is performed on the flash memory, the data to be burned in the data area is burned into the flash memory, and the command status is updated to a completion status after the flash memory burning operation is performed.
2. The method for improving flash memory writing speed according to claim 1, characterized in that: The performing the flash memory programming operation on the flash memory comprises: Performing a data erasing operation on the flash memory to erase the data in the flash memory; Performing an erase verification operation on the flash memory to verify whether the data in the flash memory is successfully erased; After the data in the flash memory is erased, a data writing operation is performed on the flash memory to write the data in the data area into the flash memory.
3. The method for improving flash memory programming speed according to claim 2, characterized in that: The performing of a data erasing operation on the flash memory to erase the data in the flash memory comprises: Read flash memory block erase command word; Reading the address word of the flash memory sector block to be erased in the flash memory block erase command word; Erasing data in a block to be erased corresponding to the address word in the flash memory.
4. The method for improving flash memory programming speed according to claim 2, characterized in that: The performing an erase verification operation on the flash memory to verify whether the data in the flash memory is successfully erased includes: Read block erase verification command word; Obtaining the starting address word and length word of the verification block in the block erase verification command word; Determine a starting address corresponding to the starting address word, and read first data of a preset length from the starting address in the flash memory, wherein the preset length is stored in the length word; Reading a check code in the data area, and checking the first data by using the check code; Check whether the verification result of the first data is consistent with a preset value. If it is consistent, it is determined that the first data has been completely erased. If it is inconsistent, it is determined that the first data has not been completely erased.
5. The method for improving flash memory programming speed according to claim 2, characterized in that: The step of performing a data writing operation on the flash memory to write the data in the data area into the flash memory comprises: Read flash write command word; Obtaining the address word to be written in the flash memory write command word; Acquire the data to be written in the data area; The data to be written is written into the address to be written in the flash memory corresponding to the address word to be written.
6. The method for improving flash memory programming speed according to claim 1, characterized in that: After the communication protocol is pre-stored in the storage space, and before the command status is updated to the completion status after the flash memory programming operation is completed, the method further includes: Reading the error status word in the command area; Determining whether an error occurs during the programming of the flash memory according to the error status word; When an error occurs during the programming process of the flash memory, reading the error type word in the command area; When the error type word is a first error type word, determining the error type is a read command word error; When the error type word is the Nth error type word, it is determined that the error type is a command parameter N-1 check failure, where the value of N is greater than 1.
7. The method for improving flash memory programming speed according to claim 1, characterized in that: After the communication protocol is pre-stored in the storage space, and before the command status is updated to a completion status after the flash memory programming operation is completed, the method further includes: Reading the tracking command word in the command area; If the tracking command word is a first tracking command word, obtaining an index value of a flash memory block where the data to be tracked is located from the first tracking command word; If the tracking command word is a second tracking command word, obtaining an index value of the flash memory page where the data to be tracked is located from the second tracking command word; If the tracking data word is a third tracking command word, a cyclic redundancy check value of the data written in the flash memory and the source data is obtained from the third tracking command word.
8. A device for improving flash memory programming speed, characterized in that: include: A pre-storage module, used to pre-store the communication protocol in the storage space, wherein the communication protocol includes a command area and a data area; A writing module, used for writing a flash memory burning command word into the command area and updating the command state to a ready state when detecting that the command state in the command area is a completed state; A reading module, used for reading the flash memory burning command word and executing the flash memory burning operation corresponding to the flash memory burning command word when detecting that the command state is a ready state, and updating the command state to an execution state; The execution module is used to execute the flash memory burning operation on the flash memory so as to burn the data to be burned in the data area into the flash memory, and update the command status to a completion status after executing the flash memory burning operation.
9. A device for improving flash memory programming speed, characterized in that: comprising a memory and a processor, wherein: The memory is used to store computer programs; The processor is used to read the computer program in the memory and execute the steps of any method for improving the flash memory programming speed as described in claims 1-7.
10. A computer-readable storage medium, characterized in that: A readable computer program is stored thereon, and when the program is executed by a processor, the steps of any method for improving the flash memory programming speed as described in claims 1-7 are implemented.
