cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB55 - SRAM2a not retained after reset from standby mode

AlexLATH
Associate

Hi,

I would like to use StandbyMode + RTC + Sram2a (backup).

From the STM32WB55RG datasheet, the Sram2a can be retained after reset from standby mode.

"Standby mode with SRAM2a retention when bit RRS is set in the PWR control

register 3 (PWR_CR3). In this case, SRAM2a is supplied by the low-power"

Before low power mode, I have to do :

/* Enable SRAM2a retention */
HAL_PWREx_EnableSRAMRetention();
 
/* Set the lowest low-power mode for CPU2: shutdown mode */
LL_C2_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
 
/* Enter the standbyMode mode for CPU1 */
HAL_PWR_EnterSTANDBYMode();

and to place datas in sram2a :

static tDataFormat   _t_Data    __attribute__((section("MB_MEM2")));

But when device reseting from standyMode, SRAM2a (and _t_Data) is empty.

Thank for your help.

3 REPLIES 3
lizerd
Associate III

Same problem, did you solve it ?

Hello lizardboy,

Indeed, enable SRAM retention wasn't enough.

You also need to check SRAM RESET flag in option bytes.

From P90 of RM0434 Reference manual
 
Bit 25 SRAM2_RST: SRAM2 and PKA RAM erase when system reset
0: SRAM2 and PKA RAM erased when a system reset occurs
1: SRAM2 and non-secure PKA RAM not erased when a system reset occurs
#define FLASH_OPTR_SRAM2RST        FLASH_OPTR_SRAM2RST_Msk   /*!< SRAM2 erase option when system reset   */

Let me know if you need more help.

Wow !! super thanks for the help.

that was not easy to find.

It did work, and its simple to explain why it did not work.

Big thanks