Page 21 of 23
Re: The RTC driver topic
Posted: Mon Dec 29, 2014 11:05 pm
by Giovanni
Fix committed, thanks.
Giovanni
Re: The RTC driver topic
Posted: Fri Mar 27, 2015 1:29 pm
by barthess
Hi Giovanni
I want to change function prototype from
Code: Select all
void rtcConvertDateTimeToStructTm(const RTCDateTime *timespec,
struct tm *timp)
to
Code: Select all
void rtcConvertDateTimeToStructTm(const RTCDateTime *timespec,
struct tm *timp,
uint32_t *tv_msec)
to be able to obtain fractional seconds part.
Is it possible in trunk?
Re: The RTC driver topic
Posted: Fri Mar 27, 2015 1:31 pm
by Giovanni
Sure go ahead, just make sure both implementations work with the change.
Note that I wish to do a "preview" 3.0 release during the weekend.
Giovanni
Re: The RTC driver topic
Posted: Fri Mar 27, 2015 1:40 pm
by barthess
What the second implementation you talking about? I want to improve just a single function
rtcConvertDateTimeToStructTm from RTC HAL realization.
Re: The RTC driver topic
Posted: Fri Mar 27, 2015 1:43 pm
by Giovanni
I thought low level drivers were impacted, this is not the case.
Giovanni
Re: The RTC driver topic
Posted: Wed Jun 03, 2015 3:29 am
by Chudik
Did I understand correctly that this driver does not initialize which clock should be used for the RTC?
STM32L1 family has internal 37kHz generator, I would like to is it instead of the External 32kHz clock
Re: The RTC driver topic
Posted: Wed Jun 03, 2015 8:00 am
by Giovanni
Hi,
Clock settings are all in mcuconf.h in the clocks section.
Giovanni
Re: The RTC driver topic
Posted: Thu Jun 04, 2015 12:17 am
by Chudik
Hmm... LSI in mcuconfig.h is enabled by default.
HAL_USE_RTC in halconf.h I set to TRUE
That means RTC should work and rtcInit() should pass, but it does not.
It stops in rtc_lld_init() at calling
Code: Select all
/* If calendar not init yet. */
if (!(RTC->ISR & RTC_ISR_INITS)){
rtc_lld_enter_init(); // <----------- stops here
....
}
If I try to make a step over the function or into it, the system hangs.
What could be the problem?
Re: The RTC driver topic
Posted: Thu Jun 04, 2015 8:12 am
by Giovanni
Probably the oscillator is not starting at all, it is very critical, see application notes.
Giovanni
Re: The RTC driver topic
Posted: Wed Jun 10, 2015 1:12 am
by Chudik
Found what was the problem.
in mcuconf.h by default set
#define STM32_RTCSEL STM32_RTCSEL_LSE
while by default we have
#define STM32_LSI_ENABLED TRUE
#define STM32_LSE_ENABLED FALSE
When I changed
#define STM32_RTCSEL STM32_RTCSEL_LSI
RTC initialization went successfully.
Found that after switching from 2.6.7 to 2.6.8, because it gave error that wrong setting used.
Probably would be useful to have
Code: Select all
#if (STM32_LSI_ENABLED)
#define STM32_RTCSEL STM32_RTCSEL_LSI
#elif (STM32_LSE_ENABLED)
#define STM32_RTCSEL STM32_RTCSEL_LSE
#endif