System and method for accelerating user system modification of NorFlash storage media
The DMA processing layer automates NorFlash modification and erase operations, enhancing efficiency by batch data migration and reducing CPU intervention, thus accelerating user system operations.
Patent Information
- Application Number
- CN202210333707.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-30
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2042-03-30
AI Technical Summary
NorFlash storage media modification and erase operations are time-consuming due to the need to read and rewrite entire pages, which is inefficient and consumes significant hardware resources.
A system and method utilizing a DMA processing layer to automate data modification and erase operations, including data transfer to a storage space, modification, and subsequent write-back to NorFlash, without direct CPU intervention.
Accelerates NorFlash modification by enabling batch data migration and parallel processing, reducing CPU involvement and time consumption, allowing users to perform other tasks concurrently.
Smart Images

Figure CN114691045B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data cloud storage, and in particular to a system and method for accelerating a user system to modify a NorFlash storage medium. Background Art
[0002] As a programmable and erasable read-only memory, NorFlash storage technology has the advantages of non-volatility, small size, high performance, and low power consumption. NorFlash has the feature of on-chip execution, so that the application can run directly in NorFlash without having to read the code into RAM. It has been widely used in industrial control, smart home smart devices, information security and other fields at home and abroad.
[0003] Although NorFlash has the feature of on-chip execution, it often takes a lot of time to modify or erase the internal storage of NorFlash. This kind of erase and modify operation is an event that the user program needs to trigger frequently. When the user modifies the content of a storage unit in NorFlash, it is usually necessary to read out the entire page content where the address is located, and the software overhead storage is cached, and then the entire page content is slowly written back after the target modification is completed.
[0004] Therefore, when modifying the NorFlash storage medium, it is urgent to find a hardware implementation method that can speed up the NorFlash modification time, so as to bring convenience to the user's use process with less hardware consumption. Summary of the invention
[0005] The object of the present invention is to provide a system and method for accelerating the modification of NorFlash storage media by a user system, thereby solving the above-mentioned problems existing in the prior art.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0007] A system for accelerating a user system to modify a NorFlash storage medium, comprising a DMA processing layer, a user application layer, a NorFlash storage medium, a storage space A and a CPU bus layer, wherein the DMA is connected to the NorFlash storage medium, the storage space A and the CPU bus layer respectively; the user application layer is in communication connection with the CPU bus layer;
[0008] The DMA processing layer is used to receive and parse the data modification command sent by the user application layer through the CPU bus layer, and obtain the location of the NorFlash storage medium where the data to be modified is located and the control signal for starting DMA: the DMA processing layer automatically converts the starting address of the page where the data to be modified is located in the NorFlash storage medium, and starts the reading process from the starting address of the page to the ending address of the page; and at the same time, stores the read data in the storage space A;
[0009] The user application layer is notified to modify the data in the storage space A. After the modification is completed, the DMA processing layer automatically starts erasing the original NorFlash storage address; after the erasing is completed, the modified data in the storage space A is automatically written back to the NorFlash storage address.
[0010] The storage space A is used to provide a data modification command and to modify the stored data according to the instruction of the DMA processing layer.
[0011] Another object of the present invention is to provide a method for accelerating a user system to modify a NorFlash storage medium, which is implemented by using the system for accelerating a user system to modify a NorFlash storage medium, and includes the following steps:
[0012] S1, the user application layer sends a command to modify data to the DMA processing layer through the CPU bus layer, and the DMA processing layer parses the user command;
[0013] S2, the DMA processing layer obtains the storage address of the data to be modified in the NorFlash storage medium (1), and simultaneously starts the DMA control signal;
[0014] S3, the DMA automatically converts and reads the starting address to the ending address of the storage address (1) of the data to be modified, and stores the read data into the storage space A;
[0015] S4, the user application layer receives the signal sent by the DMA processing layer to modify the data in the storage space A, and sends a modification completion signal to the DMA processing layer after the modification is completed;
[0016] S5, after receiving the signal indicating that the modification is completed by the user, the DMA automatically starts erasing the page at the storage address (2) in the NorFlash storage medium;
[0017] S6, after DMA erasing is completed, the modified data in storage space A is automatically written back to the page at storage address (2) in the NorFlash storage medium, and the CPU is notified after writing is completed.
[0018] Preferably, the storage address (1) is the RAM space used by the user to quickly and conveniently repair temporary content; the storage address (2) refers to the Norflash space address to which the temporarily modified data needs to be moved back.
[0019] The beneficial effects of the present invention are:
[0020] The present invention discloses a system and method for accelerating the modification of NorFlash storage medium by a user system. The user configures a DMA migration module to perform batch migration of NorFlash, and the user application layer no longer calls the CPU and bus mode to read the data to be modified word by word. During the DMA migration operation, the CPU can process other user layer transaction flows. After the migration is completed, the DMA processing layer notifies the user application layer to write and modify the data through an interrupt system. After the user application layer finishes writing the data to be modified, the DMA processing layer starts the erasing work of the original NorFlash storage address, and the user application layer no longer calls the CPU and bus mode to erase NorFlash, further saving the time cost of the user program. After the hardware DMA erases NorFlash, the user application layer is no longer required to configure, and the DMA automatically performs the write-back function of the modified data, further saving the time cost of the user frequently writing word by word. Therefore, since there is no user application layer, CPU and bus mode involved in the DMA write-back, the user can process other external affairs in parallel at this time, further saving the user time cost, and realizing the convenience of the user program using NorFlash. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a diagram of the system composition for accelerating the modification of the NorFlash storage medium by the user system provided in Embodiment 1;
[0022] Figure 2 is a schematic diagram of the method for accelerating the user system to modify the NorFlash storage medium provided in Example 2; DETAILED DESCRIPTION
[0023] 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. It should be understood that the specific implementation methods described herein are only used to explain the present invention and are not used to limit the present invention.
[0024] Example 1
[0025] This embodiment provides a system for accelerating the modification of NorFlash storage media by a user system, such as Figure 1As shown, it includes a DMA processing layer, a user application layer, a NorFlash storage medium, a storage space A and a CPU bus layer, wherein the DMA is connected to the NorFlash storage medium, the storage space A and the CPU bus layer respectively; the user application layer is connected to the CPU bus layer in communication;
[0026] The DMA processing layer is used to receive and parse the data modification command sent by the user application layer through the CPU bus layer, and obtain the location of the NorFlash storage medium where the data to be modified is located and the control signal for starting DMA: the DMA processing layer automatically converts the starting address of the page where the data to be modified is located in the NorFlash storage medium, and starts the reading process from the starting address of the page to the ending address of the page; and at the same time, stores the read data in the storage space A;
[0027] The user application layer is notified to modify the data in the storage space A. After the modification is completed, the DMA processing layer automatically starts erasing the original NorFlash storage address; after the erasing is completed, the modified data in the storage space A is automatically written back to the NorFlash storage address.
[0028] The method is used to provide a data modification command and modify the stored data according to the instruction of the DMA processing layer.
[0029] Example 2
[0030] This embodiment provides a method for accelerating the modification of NorFlash storage media by a user system, which is implemented by the system provided in the embodiment 1. The implementation principle is as follows: Figure 2 As shown, the following steps are included:
[0031] S1, the user application layer sends a command to modify data to the DMA processing layer through the CPU bus layer, and the DMA processing layer parses the user command;
[0032] S2, the DMA processing layer obtains the storage address of the data to be modified in the NorFlash storage medium (1), and simultaneously starts the DMA control signal;
[0033] S3, the DMA automatically converts and reads the starting address to the ending address of the storage address (1) of the data to be modified, and stores the read data into the storage space A;
[0034] S4, the user application layer receives the signal sent by the DMA processing layer to modify the data in the storage space A, and sends a modification completion signal to the DMA processing layer after the modification is completed;
[0035] S5, after receiving the signal indicating that the modification is completed by the user, the DMA automatically starts erasing the page at the storage address (2) in the NorFlash storage medium;
[0036] S6, after DMA erasing is completed, the modified data in storage space A is automatically written back to the page at storage address (2) in the NorFlash storage medium, and the CPU is notified after writing is completed.
[0037] Preferably, storage address 1 is the RAM space used by the user to quickly and conveniently repair temporary content; storage address (2) refers to the Norflash space address to which the temporarily modified data needs to be moved back.
[0038] By adopting the above technical solution disclosed in the present invention, the following beneficial effects are obtained:
[0039] The present invention discloses a system and method for accelerating the modification of NorFlash storage medium by a user system. The user configures a DMA migration module to perform batch migration of NorFlash, and the user application layer no longer calls the CPU and bus mode to read the data to be modified word by word. During the DMA migration operation, the CPU can process other user layer transaction flows. After the migration is completed, the DMA processing layer notifies the user application layer to write and modify the data through an interrupt system. After the user application layer finishes writing the data to be modified, the DMA processing layer starts the erasing work of the original NorFlash storage address, and the user application layer no longer calls the CPU and bus mode to erase NorFlash, further saving the time cost of the user program. After the hardware DMA erases NorFlash, the user application layer is no longer required to configure, and the DMA automatically performs the write-back function of the modified data, further saving the time cost of the user frequently writing word by word. Therefore, since there is no user application layer, CPU and bus mode involved in the DMA write-back, the user can process other external affairs in parallel at this time, further saving the user time cost, and realizing the convenience of the user program using NorFlash.
[0040] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be considered as the scope of protection of the present invention.
Claims
1. A system for accelerating the modification of NorFlash storage media by a user system, characterized in that: It includes a DMA processing layer, a user application layer, a NorFlash storage medium, a storage space A and a CPU bus layer, wherein the DMA is connected to the NorFlash storage medium, the storage space A and the CPU bus layer respectively; the user application layer is connected to the CPU bus layer in communication; The DMA processing layer is used to receive and parse the data modification command sent by the user application layer through the CPU bus layer, and obtain the location of the NorFlash storage medium where the data to be modified is located and the control signal for starting DMA: the DMA processing layer automatically converts the starting address of the page where the data to be modified is located in the NorFlash storage medium, and starts the reading process from the starting address of the page to the ending address of the page; and at the same time, stores the read data in the storage space A; Notify the user application layer to modify the data in the storage space A, and after the modification is completed, the DMA processing layer automatically starts erasing the original NorFlash storage address; after the erasing is completed, automatically write the modified data in the storage space A back to the NorFlash storage address; The storage space A is used to provide a data modification command and to modify the stored data according to the instruction of the DMA processing layer.
2. A method for accelerating a user system to modify a NorFlash storage medium, characterized in that: The method for accelerating the modification of the NorFlash storage medium by a user system as claimed in claim 1 is implemented by the following steps: S1, the user application layer sends a command to modify data to the DMA processing layer through the CPU bus layer, and the DMA processing layer parses the user command; S2, the DMA processing layer obtains the storage address of the data to be modified in the NorFlash storage medium (1), and simultaneously starts the DMA control signal; S3, the DMA automatically converts and reads the starting address to the ending address of the storage address (1) of the data to be modified, and stores the read data into the storage space A; S4, the user application layer receives the signal sent by the DMA processing layer to modify the data in the storage space A, and sends a modification completion signal to the DMA processing layer after the modification is completed; S5, after receiving the signal indicating that the modification is completed by the user, the DMA automatically starts erasing the page at the storage address (2) in the NorFlash storage medium; S6, after DMA erasing is completed, the modified data in storage space A is automatically written back to the page where the storage address (2) is located in the NorFlash storage medium, and the CPU is notified after the writing is completed.
3. The method for accelerating the modification of NorFlash storage medium by a user system according to claim 2, characterized in that: The storage address (1) is the RAM space used by the user to quickly and conveniently repair temporary content; the storage address (2) refers to the Norflash space address to which the temporarily modified data needs to be moved back.
Citation Information
Patent Citations
Data storage system, data storage method and PCM bridge
CN103838676A
Methods for internal data movements of a flash memory device and apparatuses using the same
CN109542335A
Data segmentation operation method of neural network based on NOR Flash module
CN111222626A
System, method and computer program product for fetching data between an execution of a plurality of threads
US20180107591A1
Fetching data between thread execution in a flash / DRAM / embedded DRAM-equipped system
US9176671B1