The RTC driver topic

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: The RTC driver topic

Postby Giovanni » Mon Dec 29, 2014 11:05 pm

Fix committed, thanks.

Giovanni

User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Location: Minsk, Belarus
Been thanked: 7 times

Re: The RTC driver topic

Postby barthess » Fri Mar 27, 2015 1:29 pm

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?

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: The RTC driver topic

Postby Giovanni » Fri Mar 27, 2015 1:31 pm

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

User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Location: Minsk, Belarus
Been thanked: 7 times

Re: The RTC driver topic

Postby barthess » Fri Mar 27, 2015 1:40 pm

What the second implementation you talking about? I want to improve just a single function
rtcConvertDateTimeToStructTm from RTC HAL realization.

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: The RTC driver topic

Postby Giovanni » Fri Mar 27, 2015 1:43 pm

I thought low level drivers were impacted, this is not the case.

Giovanni

User avatar
Chudik
Posts: 152
Joined: Fri Jan 16, 2015 7:51 am
Location: California
Has thanked: 7 times
Been thanked: 1 time

Re: The RTC driver topic

Postby Chudik » Wed Jun 03, 2015 3:29 am

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

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: The RTC driver topic

Postby Giovanni » Wed Jun 03, 2015 8:00 am

Hi,

Clock settings are all in mcuconf.h in the clocks section.

Giovanni

User avatar
Chudik
Posts: 152
Joined: Fri Jan 16, 2015 7:51 am
Location: California
Has thanked: 7 times
Been thanked: 1 time

Re: The RTC driver topic

Postby Chudik » Thu Jun 04, 2015 12:17 am

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?

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: The RTC driver topic

Postby Giovanni » Thu Jun 04, 2015 8:12 am

Probably the oscillator is not starting at all, it is very critical, see application notes.

Giovanni

User avatar
Chudik
Posts: 152
Joined: Fri Jan 16, 2015 7:51 am
Location: California
Has thanked: 7 times
Been thanked: 1 time

Re: The RTC driver topic

Postby Chudik » Wed Jun 10, 2015 1:12 am

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


Return to “Development and Feedback”

Who is online

Users browsing this forum: Bing [Bot] and 12 guests