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

STM32 single-chip microcomputer FLASH memory storage and reading algorithm

A technology of FLASH memory and single-chip microcomputer, which is used in instruments, computing, electrical and digital data processing, etc., can solve the problems of less erasing and writing times, increased PCB area, and increased material cost, so as to increase the lifespan of erasing and writing times and increase the usability. IO port, the effect of reducing the PCB area

Pending Publication Date: 2021-01-29
北京东方百士电子有限公司
View PDF0 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Disadvantages: increase material cost, occupy PCB area, occupy the IO port of the microcontroller for communication with EEPROM memory
Disadvantages: the price of single-chip microcomputer is more expensive; there are not many optional models; the flexibility is poor, and it may lack certain functions and performance required by the project
Disadvantages: the number of times of erasing and writing is small, you need to pay attention not to erase the program code, and there may be more waste of FLASH space
The usual solution is to plug in an EEPROM memory chip, which will cause problems such as increased material costs, increased PCB area, and reduced IO ports available for single-chip microcomputers.

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
  • STM32 single-chip microcomputer FLASH memory storage and reading algorithm
  • STM32 single-chip microcomputer FLASH memory storage and reading algorithm

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0020] Example: such as Figure 1-2 Shown, the present invention a kind of STM32 one-chip computer FLASH memory storage, reading algorithm.

[0021] The storage algorithm includes the following steps. Step 1. When the STM32 single-chip microcomputer leaves the factory, the chip manufacturer has set all the bits of the FLASH to "1". The address of the first unit is set as the initial address; step 3, before writing data, read the data of each unit sequentially from the first unit in Word word; step 4, if the current unit reads the data as 0xFFFFFFFF, Then stop reading the data of the next unit and store the data to be stored in the current unit. Step 5, if the data of the last unit read is not 0xFFFFFFFF, then erase the data of all units, and store the data to be stored in the first unit;

[0022] The reading algorithm comprises the following steps, step one, setting the first unit address of the memory of the stored data as the initial address; step two, reading the data of ...

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 an STM32 single-chip microcomputer FLASH memory storage and reading algorithm which comprises the following steps: step 1, when an STM32 single-chip microcomputer leaves a factory, a chip manufacturer already sets all bit positions of FLASH as ' 1 ', and in order to guarantee the security, erasing all FLASH when the program is burnt; 2, setting a first unit address of a memory for storing data as an initial address; 3, sequentially reading the data of each unit from the first unit by taking Word words as units before writing the data; 4, if the data read by the currentunit is 0 x FFFFFFFF, stopping reading the data of the next unit and storing the data to be stored in the current unit; 5, if the data read by the last unit is not 0 X FFFFFFFF, erasing the data of all the units, and storing the data to be stored in the first unit. According to the method, a new logic algorithm is adopted, so that the erasing frequency of the FLASH memory during data storage is greatly reduced, the service life of the FLASH memory is greatly prolonged, and compared with a method of externally hanging an EEPROM memory chip, the method has the advantages that the material cost is reduced, the area of a PCB is reduced, available IO ports of a single-chip microcomputer are increased, and the like.

Description

technical field [0001] The invention relates to the technical field of FLASH memory algorithms, in particular to an STM32 single-chip microcomputer FLASH memory storage and reading algorithm. Background technique [0002] There are two types of non-power-down memories commonly used in modern microcontrollers: FLASH and EEPROM. FLASH is mainly used to store program codes. Usually, the so-called "burning program" refers to burning the program in the FLASH memory. When the microcontroller is running, it reads the code from the FLASH memory and executes it. EEPROM is mainly used for storage and needs to be updated frequently. data. [0003] In a single-chip microcomputer that can repeatedly program programs, FLASH memory is a must, and EEPROM memory is usually not built-in due to cost. Due to different principles and structures, the erasing and writing life of FLASH memory is much smaller than that of EEPROM memory. [0004] When it is necessary to perform and update the user...

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
IPC IPC(8): G06F3/06
CPCG06F3/0619G06F3/0652G06F3/0638G06F3/0679
Inventor 赵志谢帅
Owner 北京东方百士电子有限公司