cancel
Showing results for 
Search instead for 
Did you mean: 

SRAM wipes data when VBAT is higher than 3V

LPola.1
Associate II

Hi there,

I use backup SRAM and RTC in STM32F407. I have a diode between VDD and VBAT and 2.2u capacitors connected to VCAP_1 and VCAP_2. 3v CR1220 battery is connected to VBAT. Now the issue is that SRAM data are wiped when VDD power is off and battery voltage is above 3V. It not affect RTC registers which keep values. If the voltage is under 3V the issue cannot be reproduced. My init code

__HAL_RCC_PWR_CLK_ENABLE();

__HAL_RCC_BKPSRAM_CLK_ENABLE(); // additional code for Backup RAM enable

HAL_PWR_EnableBkUpAccess(); // additional code for Backup RAM enable

HAL_PWREx_EnableBkUpReg(); // additional code for Backup RAM enable

HAL_PWR_DisableBkUpAccess();

Reading from SRAM

HAL_PWR_EnableBkUpAccess();

BKPSRAM_Read16(addr);

HAL_PWR_DisableBkUpAccess();

Is there any explanation for this? Is anything else I can check or measure?

9 REPLIES 9

> I have a diode between VDD and VBAT

There is no need for that, unless you want to charge the battery - which with CR1220 you shouldn't.

This probably does not explain your problem, but you should remove it anyway.

JW

LPola.1
Associate II

I have removed the diode but behavior is the same.

LPola.1
Associate II

I think it could be because of charging / disacharging when I remove the source.

What charging? You are using a non-rechargable battery (CR1220), am I wrong?

Also, check your VDDA/VSSA connections, they should go up/down together with VDD.

JW

ONadr.1
Senior III

Is the tamper disabled?

Yes the tamper function is not implemented.

Yes I use non-rechargable battery, I ment charging in pins of VDD or VSS when power is plugged on and off. I measured a voltage on VBAT pin and is stable. Maybe this problem has nothing to do with voltage of a battery at all and I am in cul-de-sac. Unfortunatelly I can't figure out why this is happening so I considered to move this data to flash memory instead.

I am using battery-backup RAM for quite some time and had no issues whatsoever.

Check your VDDA/VSSA connections, they should go up/down together with VDD. I mean, VDDA should be derived from VDD and VSSA should be connected directly to VSS. Check also for bad solder joints.

Check also with some very simple program, which does not write to the backup RAM.

You may also want to try a "known good" board such as Nucleo or Disco.

JW

LPola.1
Associate II

Good ideas thank you.