Skip to main content
Anne1
Associate
February 19, 2020
Question

STM32F030R8. Need to get unitialized data from sram after standby, but the data are always initialized.

  • February 19, 2020
  • 1 reply
  • 773 views

Hello,

I'm using STM32F030R8 Nucleo board to read unitialized data from sram (for sram puf purpose). I'm using Standby mode to repeatedly reset the board. It is woken up by RTC alarm. The problem is that the data I receive after reset are always initialized.

E.g. I set first byte of sram to value 2 and after return from Standby mode there is still value 2. I'm reading 64B from the beggining of sram, which is 0x20000000 (In .ld file I set the new beginning of sram to 0x20000040, so nothing would mess up the part of ram I'm reading). I use the PWR_EnterSTANDBYMode(), function provided with the ST-lib to enter Standby mode.

Anyone else that recognizes this behavior?

Thank you =)

int main(void)

{

/* Initialize serial communication */

initUart();

print("\r\nSerial init\r\n");

/* Initialize RTC modul */

 StandbyRTCMode_Init();

 /* Check and handle if the system was resumed from StandBy mode */

 if (PWR_GetFlagStatus(PWR_FLAG_SB) != RESET)

 {

 /* Clear StandBy flag */

 PWR_ClearFlag(PWR_FLAG_SB);

 /* Check if the StandBy flag is cleared */

 if (PWR_GetFlagStatus(PWR_FLAG_SB) != RESET)

 {

 while(1);

 }

 RTC_WaitForSynchro();

 /* Read data from SRAM */

 SRAMreadout();

 /* Clear SRAM */

 SRAMclear();

 /* Enable Standby mode */

 StandbyRTCMode_Measure();

 }

else

{

/* Configure RTC modul */

StandbyRTCMode_Config();

/* Read data from SRAM */

initialSRAMreadout();

/* Clear SRAM */

SRAMclear();

/* Enable Standby mode */

StandbyRTCMode_Measure();

 }

}

This topic has been closed for replies.

1 reply

Anne1
Anne1Author
Associate
February 25, 2020

Ok, so it seems working now. Apparently I have to run the code (while receiving uncorrect data) -> unplugg the device from PC -> connect again, turn on serial console -> bingo, I'm now receiving correct data. (I guess the problem is that if st-link and ide are connected, the device memory is not correctly resetted when in standby.) Hope it helps ;)