2023-04-27 12:18 AM
2023-04-27 12:45 AM
How is PDR_ON pin connected?
Jw
2023-04-27 02:04 AM
2023-04-27 05:21 AM
> (my code is attached)
You may want to indicate somehow that time reset happened, maybe by blinking a LED or something similar.
> Only issue is when power cut in which time is reset to initial value ? (my code is attached)
Measure voltage directly on VBAT pin, is it correct even during power down?
Do you have BOR enabled in Option bytes? If not, try to enable it.
JW
2023-04-27 11:22 AM
VBAT pin is 3.06 in both situations.
I enabled BOR level 2 but nothing was changed.
I used a blinked led to indicate whether the RTC_BKP_DR1 is reset or not when power is downed and I don't know why the RTC_BKP_DR1 is reset?
Is it a bug in the programming with HAL or not?
2023-04-27 12:06 PM
> Is it a bug in the programming with HAL or not?
I don't know, I don't use Cube/HAL.
You've said, that:
> I don't have any problem when resetting the board by NRST pin. Only issue is when power cut
So, the LED blinks when you power down/up, but it does not blink when you use the NRST pin, correct?
In this case, I have no more ideas how to proceed, sorry.
JW
2023-04-27 09:38 PM
> So, the LED blinks when you power down/up, but it does not blink when you use the NRST pin, correct?
Exactly, backup registers reset after power down.
Thanks JW for your tips.
I hope some body find the solution for this issue
2023-04-28 09:44 PM
Hi,
Nobody knows how to fix this issue?
Thanks
2023-04-28 10:49 PM
Try place these before try to read RTC_BKP_DR1. All of those not necessarily needed, test which line(s) helps.
__BKPSRAM_CLK_ENABLE();
HAL_PWR_EnableBkUpAccess();
__HAL_RCC_RTC_ENABLE();
__HAL_RCC_BKPSRAM_CLK_ENABLE();
HAL_PWREx_EnableBkUpReg();
2023-04-29 12:59 AM
try -just as a test - leave away rtc init : // MX_RTC_Init();
then test rtc is reset or not.