2020-06-19 06:24 AM
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).
Solved! Go to Solution.
2020-06-19 11:10 AM
> 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
2020-06-19 08:19 AM
Are all needed RCC clocks for domain 3 activated?
Kind regards
Daniel
2020-06-19 11:10 AM
> 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