cancel
Showing results for 
Search instead for 
Did you mean: 

RTC Backup Register Read/Write not Working

AAgar.2
Associate III

I am trying to read/write from backup registers in STM32H7.

Below is my code:

__HAL_RTC_WRITEPROTECTION_DISABLE(hrtc);
HAL_PWR_EnableBkUpAccess();
 
 HAL_RTCEx_DeactivateTamper(hrtc, RTC_TAMPER_1);
 __HAL_RTC_TAMPER_CLEAR_FLAG(hrtc, RTC_FLAG_TAMP1F);
 
uint32_t tmp = HAL_RTCEx_BKUPRead(hrtc, RTC_BKP_DR0);
HAL_RTCEx_BKUPWrite(hrtc, RTC_BKP_DR0, (uint32_t) 0xFF88FF88);
tmp = HAL_RTCEx_BKUPRead(hrtc, RTC_BKP_DR0);

The read/write is not working, I am getting the same value (which is 1701732715) every time I read. The RTC clock is enabled and tamper 1 is enabled.

What is the issue?

Related questions:

https://community.st.com/s/question/0D50X00009XkXJ0/why-rtc-backup-register-write-fails-stm32f446 (I have tried the related question from here).

1 ACCEPTED SOLUTION

Accepted Solutions

> 1701732715

That's 0x656E616B or "kane". Suspicious.

I'd say hrtc does not contain what it ought to contain.

Read the RTC registers content in debugger.

JW

View solution in original post

2 REPLIES 2
DFuchs
Associate III

Are all needed RCC clocks for domain 3 activated?

Kind regards

Daniel

> 1701732715

That's 0x656E616B or "kane". Suspicious.

I'd say hrtc does not contain what it ought to contain.

Read the RTC registers content in debugger.

JW