Hi!
I had this problem: My Backup SRAM lost data randomly when power connector was unplugged. I finally found the solution of this problem and I would like to share the problem solution here.
For a long time I was looking for a problem in the configuration and init of the backup domain. Then I tried locking access to SRAM memory and RTC registers. None of this helped. And it was terrible.
Then I thought about it and I realized that I was using bootloader based on chibios located in another part of the flash, and probably has deactivated the backup domain. Of course that was the case. I modified the bootloader code based on chibios and activated backup domain.
Problem with random data loss is gone.
Conclusion: If you are using bootloader independently on your application, make sure that bootlader has also activated backup domain.
[SOLVED] STM32F4 Backup SRAM loses data
Moderator: RoccoMarco