Method and device for reading and writing a counter
A read-write method and counter technology, applied in the field of communication, can solve the problems of long execution time of instructions and low read-write efficiency, and achieve the effects of reducing multiple operations, increasing read-write speed, and realizing power-off protection
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0029]The reading and writing of the FLASH chip is generally operated by block or page. Even if the written data is only 1 byte, the entire block or page data containing this byte must be erased and written during actual writing. The reading and writing characteristics of the FLASH chip will greatly increase the data writing time, and will have a great impact on the execution time of some instructions that need to update the FLASH frequently. When the counter is updated according to the conventional power-down protection scheme, when 4-byte data is required to be updated, the erasing and writing operations of 4 pages of data are actually performed, and the time of these operations becomes the key factor of the execution time of the instruction .
[0030] FLASH chips are divided into two categories according to their erasing performance. The first type of chip, as long as the data in a certain place is modified, it must be erased and rewritten; the second type of chip supports...
Embodiment 2
[0046] figure 2 For the flowchart of the reading and writing method of the counter provided by another embodiment of the present invention, please refer to figure 2 , this embodiment further defines step S3 on the basis of the first embodiment.
[0047] Step S3 in this embodiment may include:
[0048] S31. According to the counter information stored in the first storage page and the second storage page, respectively determine whether the first storage page and the second storage page are empty.
[0049] Specifically, when the FLASH chip leaves the factory, the storage space in the storage page is initialized to 0xFF, that is, whether the storage page is empty can be judged by judging whether the entire page data is 0xFF. Obtain the counter information stored in the storage page. If the counter information stored in the current storage page is all 0xFF, the current storage page is empty.
[0050] S32. If both the first storage page and the second storage page are empty, th...
Embodiment 3
[0067] image 3 For the flowchart of the reading and writing method of the counter provided by the next embodiment of the present invention, please refer to image 3 , in this embodiment, the operation request is a read operation request, which is further limited on the basis of the foregoing embodiments.
[0068] Before step S4, also include:
[0069] Step S51, according to the counter information stored in the first storage page and the second storage page, respectively determine the maximum value of the counter numbers in the first storage page and the second storage page;
[0070] Step S52, respectively determining the offset address of the maximum value of the counter serial numbers in the first storage page and the second storage page relative to the first address of the first storage page;
[0071] Then step S4 includes:
[0072] Step S41 , read the value of the counter according to the operation request and the offset address of the maximum value of the counter numb...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com