Skip to main content
ausera uirwaij
Associate III
April 28, 2022
Solved

how about the MCU using flash

  • April 28, 2022
  • 4 replies
  • 2104 views

0693W00000LzJQYQA3.pngI'm wanting to save user data (less than 50bytes) and factory data (less than 100bytes) to internal flash, however the user data may changes everyday and it may overrun datasheet's 10 K erases and writes. So whether the MCU or the other flash sectors where saved main program will work well if the sector (such as sector 3 ) at which EEPROM emulate breakdown? I'm using STM32F42x.

This topic has been closed for replies.
Best answer by TDK

> I may need get definitive answer about if MCU can work , which is involved in product design.

The chip is not guaranteed to work outside of the datasheet specifications.

4 replies

waclawek.jan
Super User
April 28, 2022

The rest of the mcu will most probably continue to work, maybe with some insignificant increase in power consumption. I doubt you will get a formal guarantee for this from ST or any other manufacturer.

However, why would you *plan* on mcu damage, rather than design for survival? You don't need to erase/rewrite the whole page (which in 'F4 is huge) every time a small amount of data are rewritten - just keep writing within the page, using erased state (0xFFs) as an endmark, and erase only when page is full.

Other option is to add a cheap external serial EEPROM or FRAM.

JW

ausera uirwaij
Associate III
April 28, 2022

thank you.

I want ​to save a piece of EEPROM but don't lose reliability. I may need get definitive answer about if MCU can work , which is involved in product design.

your proposal are interesting.

>>just keep writing within the page, using erased state (0xFFs) as an endmark...

how do this in detail? I read the datasheet which writes requiring an

erase operation to free up space before data can be written again.<AN4894 Application note>

Tesla DeLorean
Guru
April 28, 2022

It is a method called journalling, you write new small chunks to an erased sector until full, thus decimating the erase cycles.

Not familiar with the concept perhaps look it up rather than get it reexplained, again..​

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
TDK
TDKBest answer
Super User
April 28, 2022

> I may need get definitive answer about if MCU can work , which is involved in product design.

The chip is not guaranteed to work outside of the datasheet specifications.

"If you feel a post has answered your question, please click ""Accept as Solution""."
MM..1
Chief III
April 28, 2022

Little match example: Use last sector 128ksize.

EEPROM emulating mode with 16bit addr plus 16bit data in one word write (32bit)

On initial erased all is FFFFFFFF ....

Your data to store need split to 16bit parts.

markering

#define VAR1 0xFF01
#define VAR2 0xFF02
#define VAR3 0xFF03
...

Store VAR1 plus 16bit data ...

Read search last VAR1 writed before FFFF.

Storage is 128k/4 16bit = 32k vars x 10k flashes = 320Milions rewrited 16bit vars.

After this sector maybe dead = you can use spare ...

ausera uirwaij
Associate III
April 29, 2022

Thank you.

Piranha
Principal III
April 29, 2022

Just read the AN3969.