2015-08-21 08:08 AM
I downloaded application note write code.my device(stm32f0discovery,stm32f051r8t6).the weird thing with cube generated code it doesnt work either.In addition if I put breakpoint on while loop when I look rtc I see RTC->ISR INIT(7.) not set it is weird if somebody knows answer thanks before hand
RTC->WPR = 0xCA;
RTC->WPR = 0x53;
RTC->ISR |= (1<<
ISR_INIT_BIT
);
while((RTC->ISR & (1<<
ISR_INITF_BIT
)) == 0){}//the program stucks here
RTC->PRER = 0;
RTC->PRER |= (127<<
16
);
RTC->PRER |= 255;
//here i will put time values
RTC->TR = 0;
RTC->TR = (5<<
0
);//second units
RTC->TR |= (1<<
4
);//second tens
RTC->TR |= (4<<
8
);//minute units
RTC->TR |= (2<<
12
);//minute tens
RTC->TR |= (5<<
16
);//hour units
RTC->TR |= (1<<
20
);//hour tens
//here i will put date values
RTC->CR &= ~(1<<
CR_FMT_BIT
);
RTC->ISR &= ~(1<<
ISR_INIT_BIT
);
RTC->WPR = 0xFF;
2015-08-21 08:32 AM
Is the PWR clock enabled, and then access to the backup domain enabled?
2015-08-21 10:47 AM
2015-08-21 02:26 PM
partly solved in debug mode I get it working at least now I can set rtc in normal mode it does not counts up seconds.I will look into it
__PWR_CLK_ENABLE();
HAL_PWR_EnableBkUpAccess();
__HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSI);
__HAL_RCC_RTC_ENABLE();
altough I didnt full understand I ll try
2015-09-05 11:04 PM
I noticed rtc is working I could not able display on the screen. Hal library function get time is not working some reason.I did not dig into it.I simply read RTC->TR register