Skip to main content
HPate.5
Associate II
Dec 29, 2022 12:37 PM UTC
Question

After power cycle getting data from SRAM.

I have initialized variable as below

uint8_t u8Flag1ForStoreVer __attribute__ ((section (".RAM1_region")));

So, after soft reset I am getting data back.

But also same I am getting after hard reset(Power cycle) , even aftre long time

What should be value in RAM after power on ?

I am using STM32WL controller.

This topic has been closed for replies.

10 replies

Tesla DeLorean
Guru
Dec 29, 2022 12:58 PM UTC

Indeterminate ​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
HPate.5
HPate.5Author
Associate II
Dec 29, 2022 1:09 PM UTC

can we make it zero (Only incase power on) ?

And also in my case mostly I am getting same value not Indeterminate .

Tesla DeLorean
Guru
Dec 29, 2022 6:23 PM UTC

I think "frequently the same" fits within the venn diagram I'm drawing.

Perhaps there is significant bulk capacitance in the design, and very low current draw?

I would perhaps look at the RTC or wakeup/standby related status bit. Not an active user of the STM32WL family

Perhaps there's some RAM area cleared via TAMPER ?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
KnarfB
Super User
Dec 29, 2022 2:24 PM UTC

> can we make it zero

by writing your own software.

> And also in my case mostly I am getting same value not Indeterminate .

There is no guarantee for any specific (deterministic) content and no physical "reset" line in a typical SRAM cell.

hth

KnarfB

HPate.5
HPate.5Author
Associate II
Dec 30, 2022 4:02 AM UTC

I have tried to write zero on respective address and I am getting that.

But after power on/off , I am still getting default previous value

UPomm
Associate
Dec 30, 2022 5:48 AM UTC

Controller can supplied parasitic through the protection diodes of the GPIOs from stlink/jlink, if connected.

HPate.5
HPate.5Author
Associate II
Dec 30, 2022 6:15 AM UTC

No its not connected

KnarfB
Super User
Dec 30, 2022 10:17 AM UTC

If you just want to distinguish between a power-on reset and other, there should be reset cause flags doing that job.

Otherwise: What is the idea behind the section attribute in your code, and does that work correctly?

> I have initialized variable as below

Don't see any intialization here. Global uninitialized C variables (in .bss) are zeroed and initialized (.data) are copied from flash to RAM by the C runtime.

hth

KnarfB