cancel
Showing results for 
Search instead for 
Did you mean: 

flash memory-STM32F103C8

Sbhus.1
Associate

 STM32F103C8 , with MXCUBE, MDK-ARM V5.

I would like to know how to program to store the counter value in flash memory even in power failure. when power goes up automatically recall the counter value. Please support me to solve this. I am not fully aware of microcontrollers. I am RF engineer.

1 ACCEPTED SOLUTION

Accepted Solutions

Read PM0075.

Note that you will need to erase the FLASH page where you store the data before you write new value to it. The whole page gets erased at once, but it takes quite a significant time (see datasheet). During that time, FLASH is inaccessible for read, so the program can't run out of it. If this is an issue, you'd need to move relevant portions of the program into RAM and run from there; this is not entirely trivial.

You may want to consider attaching an external serial EEPROM instead.

JW

View solution in original post

1 REPLY 1

Read PM0075.

Note that you will need to erase the FLASH page where you store the data before you write new value to it. The whole page gets erased at once, but it takes quite a significant time (see datasheet). During that time, FLASH is inaccessible for read, so the program can't run out of it. If this is an issue, you'd need to move relevant portions of the program into RAM and run from there; this is not entirely trivial.

You may want to consider attaching an external serial EEPROM instead.

JW