cancel
Showing results for 
Search instead for 
Did you mean: 

Why is the HAL programmed to re-init the RTC when I adjust the time?

john doe
Lead
Posted on December 12, 2017 at 04:06

  RTC->WPR = 0xCA;

  RTC->WPR = 0x53;

  RTC->CR &= ((uint32_t)~(RTC_CR_TSE | RTC_CR_REFCKON | RTC_CR_BYPSHAD |

                                  RTC_CR_ALRBIE | RTC_CR_ALRAIE |  RTC_CR_ALRBE |

                          RTC_CR_ALRAE | RTC_CR_WUCKSEL | RTC_CR_TSEDGE));

  RTC->ISR &= (uint32_t)~(RTC_ISR_TSF | RTC_ISR_TSOVF);

  RTC->WPR = 0xFF;

RTCCR:  0x0000001000000000000000000000000000010000  REFCKON

RTCISR: 0x0000003700000000000000000000000000110111  RSF INITS WUTWF ALRBWF ALRAWF

turns into

RTCCR:  0x00003B3F00000000000000000011101100111111  ALRBIE ALRAIE TSE ALRBE ALRAE BYPSHAD REFCKON TSEDGE WUCKSEL

RTCISR: 0x0000181700000000000000000001100000010111  TSOVF TSF INITS WUTWF ALRBWF ALRAWF

when I call HAL_RTC_SetTime(). it clobbers my settings every time I do a time adjustment.  is there a valid reason for doing that?  I haven't found anything in the documentation that suggests it is necessary.

0 REPLIES 0