cancel
Showing results for 
Search instead for 
Did you mean: 

Hi friends I have a problem with SRAM. After a short time, the memory is cleared

Hafsh.1
Associate
 
7 REPLIES 7
LMI2
Lead

That's a short mail. How is your power supply and software. Uneven power can make any device unreliable. Then a memory is filled with random or semirandom data. Check power supply pins with oscilloscope. But wipimg a memory is easy with your SW is easy, too.

There is no problem with the power supply circuit. I used the HAL_SRAM_Write_16b functions and this problem occurs after a short time

alister
Lead

>After a short time, the memory is cleared

Assuming GCC. Assuming the memory in question is .bss. Check reset-reason. Watchdog-reset? Break-point your hard-fault exception.

prain
Senior III

There is standard ​ways in C language to do that. Use structs, memcpy , ...

I recommend you not to write to memory manually.

What board/hardware are you using?

Present the problem more clearly/completely.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
S.Ma
Principal

in a simple unweird application, after reset, the compiler init the global variables to their init value, typically zeros. it is prior to main in startup function, as power up sram yield random content.

Piranha
Chief II

In 99% cases it's just a software issue related to buffer overflows, pointer mismanagement, interrupt/thread unsafe code or other flaws.