Skip to main content
Senior
Apr 26, 2024 7:13 AM UTC
Solved

Store values in internal flash

Can variable values be stored in some fixed addresses of internal flash and retrieved from them after reset? 

is there any example for same.

This topic has been closed for replies.
Andrew Neil
Andrew NeilBest answer
Super User
Apr 26, 2024 9:24 AM UTC

@Uwe Bonnes wrote:

You can write to erased memory cells. 


@GauravK for more on this, see:

https://community.st.com/t5/stm32-mcus-products/flash-write-versus-erase-cycles/m-p/665631/highlight/true#M241948

and follow the link.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.

6 replies

Uwe Bonnes
Chief
Apr 26, 2024 9:07 AM UTC

You can write to erased memory cells. This must happen in chunks, e.g. 256 bits on H7 and down to single bytes on some older families. If the retrieved value needs to be reporgrammed later, look for EPROM emulation.

Andrew Neil
Andrew NeilBest answer
Super User
Apr 26, 2024 9:24 AM UTC

@Uwe Bonnes wrote:

You can write to erased memory cells. 


@GauravK for more on this, see:

https://community.st.com/t5/stm32-mcus-products/flash-write-versus-erase-cycles/m-p/665631/highlight/true#M241948

and follow the link.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
GauravKAuthor
Senior
Apr 30, 2024 9:09 AM UTC

I will be checking and get back if needed

Andrew Neil
Super User
Apr 26, 2024 9:16 AM UTC
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Akuma.6
Associate III
Jul 18, 2024 3:20 AM UTC

Hi,

I am working on STM32G0 series and trying to save the records (120bytes each record) into internal mcu flash memory location and when it required will read the read the stored records and do our operations.

Please let us know the logic.

Regards,

Kumar

 

Andrew Neil
Super User
Jul 18, 2024 9:19 AM UTC

See the links posted earlier!

Some more info here - including links to some other implementations:

https://community.st.com/t5/stm32-mcus-embedded-software/eeprom-emulation-virtual-addresses/m-p/675788

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.