2020-08-18 03:08 AM
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.
Solved! Go to Solution.
2020-08-18 03:39 AM
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
2020-08-18 03:39 AM
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