Hello @clemente ,
Thank you for this clarification.
The backup SRAM (BKPSRAM) can be retained in low-power modes and when VDD is off in VBAT mode.
The HAL_PWREx_EnableBkupRAMRetention function is used to enable the Backup RAM retention in Standby and VBAT modes.
So, as defined in this function and also in RM0456 section 10.10.9 PWR backup domain control register 1 (PWR_BDCR1), when "BREN": Backup RAM retention in Standby and VBAT modes bit is set, the backup RAM content is kept in Standby and VBAT modes.
If BREN is reset, the backup RAM can still be used in Run, Sleep, and Stop modes. However, its content is lost in Standby, Shutdown, and VBAT modes.
This BREN bit can be written only when the regulator is LDO, which must be configured before switching to SMPS.
Note:
- The backup SRAM content is lost in Standby mode without SRAM2 retention. If either RRSB1 or RRSB2 bit is set
in Standby mode, the backup SRAM is also retained.
Thanks and best regards,
Kaouthar