AnsweredAssumed Answered

RTC daylight saving time STM32f3 discovery

Question asked by arno on Feb 25, 2013
Latest reply on Feb 27, 2013 by arno
I'm using the standard peripheral library to manage the RTC on my STM32f3 discovery board.

As I understand it, when things are running, you can go into the daylight saving time mode by this command :

RTC_DayLightSavingConfig(RTC_DayLightSaving_ADD1H, RTC_StoreOperation_Set);

Which add 1h to the RTC hour and set the RTC_BCK (or RTC_BKP) bit to 1.
Reversely, when winter is coming, I use this command :

RTC_DayLightSavingConfig(RTC_DayLightSaving_SUB1H, RTC_StoreOperation_Reset);

And between those days, I can use the RTC_BCK bit to be check if I'm in daylight saving time or not via the GetStoreOperation() function.

All of this is very fine with me except that, at the first start-up, I can't set the RTC_BCK bit during the RTC initialization. The only way I figured out to do so is either to go and write directly the RTC_BCK bit or use a trick like this :

RTC_DayLightSavingConfig(RTC_DayLightSaving_ADD1H, RTC_StoreOperation_Set);
RTC_DayLightSavingConfig(RTC_DayLightSaving_SUB1H, RTC_StoreOperation_Set);

So that the time remain the same but I know the status of the RTC_BCK bit.

Eventually, I'm not very happy with this trick : I don't find it very elegant and I'm afraid I missed something. So I turned to you to explain me if I missed something!

Is there any function to set the RTC_BCK bit?
Is my usage of this bit correct?
Am I supposed to write directly the bit whereas no mention of this operation could be found in the UM1581?

Thanks in advance for your answer and/or explaination!