cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 RTC BKUP registers issue

JosepM Ribera
Associate III

Hi

We are using the STM32H7A3ZIT6 for one of our irrigation controllers that we are developing. To check the "power cuts" time, we always save the RTC value (uint_32 seconds value) before voltage goes down, using:

HAL_PWR_EnableBkUpAccess();

HAL_RTCEx_BKUPWrite(&hrtc, RTC_BKP_DR2, Value);

It has been working fine. But, suddenly, in two protos it started to fail. When we read the RTC register using:

HAL_RTCEx_BKUPRead(&hrtc, RTC_BKP_DR2);

We always read 0. Same hardware and same code.

Do you have any idea of what could be the problem?

Thank you in advance

4 REPLIES 4
Peter BENSCH
ST Employee

Are you absolutely sure that you have not accidentally triggered the tamper function and thus deleted the RTC backup data registers?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
JosepM Ribera
Associate III

Hi Peter

Yes, we have checked it. We don't use any tamper function.

Maybe somebody somewhere activated tamper function and the trigger pin is/was in active state?

Try a fresh new chip.

JosepM Ribera
Associate III

If I remove VBAT (CR2032) for a while (reset RTC), then it works fine. Maybe some register has been activated?? What could be?