Unlock instant, AI-driven research and patent intelligence for your innovation.

Method for storing nonvolatile data by using MCU internal data Flash

A technology of non-volatile data and internal data, applied in the direction of memory address/allocation/relocation, etc., can solve the problems of long time consumption, data loss, low efficiency, etc., to avoid repeated erasure, improve service life, and avoid erasure. the effect of removing

Active Publication Date: 2015-05-27
SHANDONG ACAD OF SCI INST OF AUTOMATION
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The traditional way of storing data in Flash is to assign a fixed storage address for each data. Since Flash needs to erase the entire sector where the data is located when performing a write operation, writing one data will cause other data in the sector to be deleted. The erasing of data, because the erasing operation takes a long time, is not only inefficient, but also affects the real-time performance of the embedded system, and in order to avoid losing other data, it requires quite complicated processing, and there are certain requirements for the RAM space of the MCU.
If writing data fails, the written data will be lost. If power failure occurs after the sector is erased, all data in the sector will be lost.
Not only that, because each write operation needs to erase the sector first, the service life of Flash represented by the number of erasures cannot meet the requirements of the product life cycle

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for storing nonvolatile data by using MCU internal data Flash
  • Method for storing nonvolatile data by using MCU internal data Flash
  • Method for storing nonvolatile data by using MCU internal data Flash

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0025] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0026] figure 1 Among them, the present invention first reasonably sets the size and number of data partitions according to the application requirements of the embedded system and the sector size of the MCU internal data Flash. Carry out numbering, the number is not more than 256. The setting of partition size and number matches the sector length of the data Flash, that is, partition size * number of partitions = sector size * number of sectors.

[0027] Set the partition status word at the start address of each data partition to reflect the storage history time of the data partition, and update it after the first write operation after the partition is erased. For the update algorithm, see the data write operation process.

[0028] Then set the format of the data entry to data id+data, the value range of the data id is [0,254], assign an offset addre...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method for storing nonvolatile data by using MCU internal data Flash, characterized by convenient operation, simple application interface and being capable of avoiding sector erase operation to the greatest extent as well as improving storage efficiency and improving the service life of the MCU internal data Flash. According to the method, all nonvolatile data entries are organized in a partition, and a plurality of sectors of the data Flash are parted into a plurality of data partitions, copies of data in different historical times being stored by different data partitions; a latest copy of the data is stored by a current data partition; when read operation of the data is performed, a Flash storage position of the latest copy of the data is calculated to directly read the address of the position; when a write operation of the data is performed, it is determined whether a writing position of the data has been erased, and if not, the data is written into the next partition, and at the same time, the rest data in the current partition is copied into the next partition; if yes, the data is directly written into the current partition.

Description

technical field [0001] The invention belongs to the technical field of embedded systems, and more specifically relates to a method for storing non-volatile data by using an MCU internal data Flash. Background technique [0002] In embedded system design, it is often necessary to store some non-volatile data. If EEPROM that supports byte reading and writing is used for data storage, the operation is as simple and convenient as RAM, but at the same time it will be used in the production of mass products. Brings cost issues and maintenance issues. In an MCU with data Flash, using data Flash instead of EEPROM to realize non-volatile storage can save costs and requires no maintenance. [0003] The traditional way of storing data in Flash is to assign a fixed storage address for each data. Since Flash needs to erase the entire sector where the data is located when performing a write operation, writing one data will cause other data in the sector to be deleted. The erasing of dat...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F12/06
Inventor 马建辉王知学刘源杨李研强
Owner SHANDONG ACAD OF SCI INST OF AUTOMATION