cancel
Showing results for 
Search instead for 
Did you mean: 

RTC_TR and RTC_DR are not set on STM32H743

MHaji.1
Associate III

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.

12 REPLIES 12

While in INIT mode, you won't see changes made to DR and TR registers (*).

You have to exit INIT mode and wait for reload (clear RSF and wait until hardware sets it), then you will see the new values of TR/DR.

JW

(*) unless you set RTC->CR.BYPSHAD

1- I've checked all things, LSI is works fine, because I can read time and calendar...(Time is alive)

2- First write protection is disabled... I assume that it is worked because INITF and INIT could be set in next step.

2- I checked RTC_ISR when goning to Init mode, INITF and INIT are set and RSF is zero.

3- After assigning a value to RTC_TR, next step is exiting from init mode.

4- I checked, when ISR_INITF and RSF set to zero after some tick, RSF became one....

5- enabling write protection....

After all these steps which their code is developed by CubeMX and I checked all steps and registers... unfortunately RTC_DR and RTC_TR values dose not changed...and they start from some random numbers usually zero and one... It is so weird, I stuck in this simple part for a week....

Please check and help me... I have checked all thing which we discussed here.. no progress :loudly_crying_face:

@Community member​ 

@Community member​ 

Is this a custom board?

Have you tried porting/using some existing examples, perhaps built to printf() to your serial debug terminal?

STM32Cube_FW_H7_V1.8.0\Projects\STM32H743I-EVAL\Examples\RTC\RTC_TimeStamp\Src\main.c

Make sure clocking sources are working and correctly selected. Output LSI via MCO/PA8, or other pins you might be able to expose it on. Check it is running via RCC/PWR peripheral registers.

Write some code to dump all the interrelated registers, its going to be impossible to play guess-whats-wrong remotely, without some clean/clear code and full register dumps. No one is going to want to dig into register level code as it is involved and expensive. Work all the HAL examples.

Assume the RTC is going to be running several hundred times slower than the MCU, watch for timing, and write buffer flushing expectations.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..