AnsweredAssumed Answered

RTC_SetCounter() function ;

Question asked by mihalev.ivan on Jan 8, 2011
I've have problem with  RTC_SetCounter()  function .
When I use RTC_SetCounter() mine program stopped in the next function  RTC_WaitForLastTask() ;
I tried this metod  :
        PWR_BackupAccessCmd(ENABLE);
         /* Wait until last write operation on RTC registers has finished */
         RTC_WaitForLastTask();

         /* Set initial value */
         RTC_SetCounter(0x0); 

         /* Wait until last write operation on RTC registers has finished */
         RTC_WaitForLastTask();
         PWR_BackupAccessCmd(DISABLE);

,but it doesn't solve the problem :( .What  can I do ? 
I use stm32 discovery board with external power for backup domain Vbat=3v , and removed SB1 from factory board.


I'am sorry but there was  my fault .I forgot to set clk for backup domain .
 RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR |RCC_APB1Periph_BKP ,ENABLE); 
I do this when configuration bckdomain for the first time , and next time when start up board I was missing to do that.

Outcomes