Skip to main content
AKara.9
Associate
July 5, 2022
Question

Backup SRAM duration

  • July 5, 2022
  • 5 replies
  • 1741 views

Hi STM,

I am having short question about BACKUP SRAM on STM32F437 MCU. 

So, for how long will BACKUP SRAM keep data, if power supply is removed. Will the data stay there, after some long period or will they be wiped out?

If they are going to be wiped out, should I expect to find some garbage there or wiping out means clearing SRAM - e.g. resetting it to some value (e.g. 0)?

Thanks,

Aleksandar

This topic has been closed for replies.

5 replies

waclawek.jan
Super User
July 5, 2022

It is meant to be powered from a backup battery connected on the VBAT pin, so it maintains data as long as that battery provides a minimal voltage given by datasheet.

There is no mechanism which would "wipe" that memory.

JW

PS. Just to avoid any misunderstanding, this is a user-driven forum, with only casual ST presence.

AKara.9
AKara.9Author
Associate
July 5, 2022

Thanks JW for the really prompt reply.

So in short, once power is back, I would find the data that were there at the time battery has some power?

Thanks,

Aleksandar

Andrew Neil
Super User
July 5, 2022

The battery is required to maintain the memory content.

If the battery fails or is disconnected at any time the main power is off, the memory content will be lost.

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.
AKara.9
AKara.9Author
Associate
July 6, 2022

Thanks Andrew,

What am I concerned with is initial state of memory after power is back - memory content is lost but... will there be some garbage or some meaningful values (e.g. all 0's)? I would then use status of SRAM to see if my battery went off.

Regards,

Aleksandar

Andrew Neil
Super User
July 6, 2022

What does the datasheet say? Is there any status register you could check?

In general (not specific to STM32), the contents of SRAM are undefined at power-up. So you need to provide some way to determine whether what's there is valid or not; eg,

  • Have some defined pattern with a very low probability of happening "randomly";
  • Have a checksum, CRC, or similar of your data - and check that.

This is general stuff - not specific to STM32; again, check the datasheet for any specific features that a particular chip may provide...

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.