Skip to main content
JosepM Ribera
Associate II
November 26, 2021
Question

STM32H7 RTC BKUP registers issue

  • November 26, 2021
  • 4 replies
  • 1511 views

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

This topic has been closed for replies.

4 replies

Peter BENSCH
ST Technical Moderator
November 26, 2021

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 II
November 30, 2021

Hi Peter

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

Pavel A.
December 1, 2021

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

Try a fresh new chip.

JosepM Ribera
Associate II
December 1, 2021

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