2021-09-30 11:13 AM
Hi,
I've used STM32CubeMX to configure my STM32H7 MCU, but RTC initial values which I set on CubeMX as default value are not set on RTC_TR and RTC_DR registers after debugging line by line when MX_RTC_Init() is called. There is no fault reported or any hardfault..., and I've use LSI for RTC.
Please help in this simple issue which waste my time couple of days ...
Thanks.
2021-10-03 01:49 AM
Please some one help, on this topic ...
2021-10-03 03:27 AM
The 'H7 is an overly complicated design and I don't use it so maybe some step is different from the usual procedure for other STM32, but you are supposed to:
JW
2021-10-03 04:51 AM
Thanks for your reply,
I should add, I can read RTC_TR and RTC_DR, but their values are started always from zero each time I start my code and in the following it work properly (count time), .. It seems RTC clock works properly but the problem is where I want set these registers...
Thanks.
2021-10-03 06:08 AM
> their values are started always from zero each time I start my code
Do you have battery connected to VBAT pin? If not, RTC is reset whenever VDD is removed.
If date/time is reset when system reset occurs without actually removing power, then it's software issue, but I don't use Cube and can't help there.
JW
2021-10-03 08:47 AM
Yes, when system reset, date/Time is lost....
How we can find out removing write protection by writing 0xCA and 0x53 is done properly... Is there any other register to check for insurance?
2021-10-03 01:55 PM
> How we can find out removing write protection by writing 0xCA and 0x53 is done properly... Is there any other register to check for insurance?
You can't check it directly, but if it's not done properly, you won't be able to change RTC_ISR.INIT.
JW
2021-10-04 02:27 AM
RTC_ISR.INIT is changed... but RTC_TR value does not change...
2021-10-04 03:01 AM
2021-10-04 04:07 AM
Once I write RTC_DR or RTC_TR, check its register on debugger just after witting, nothing changed ...
After initializing when my threads starts... I read RTC_TR and RTC_DR... It works properly but all start from zero and nothing was written on their registers.
There is something wrong here which I can not write any thing on RTC_DR and RTC_TR as initial time...