Page 1 of 1
RTC on STM32F4-Discovery
Posted: Mon Dec 24, 2012 5:43 pm
by Kirill
Hi,
ChibiOS 2.4.3 downloaded yesterday. Tried to enable RTC on STM32F4-Discovery demo (Keil).
HAL_USE_RTC is set TRUE. The rtc.x and rtc_lld.x files are added. I got a lot of such errors:
Code: Select all
..\..\..\os\hal\platforms\STM32\RTCv1\rtc_lld.c(113): error: #136: struct "<unnamed>" has no field "CRL"
..\..\..\os\hal\platforms\STM32\RTCv1\rtc_lld.c(113): error: #20: identifier "RTC_CRL_RSF" is undefined
..\..\..\os\hal\platforms\STM32\RTCv1\rtc_lld.c(116): error: #136: struct "<unnamed>" has no field "CRH"
Also tried versions: 2.4.2 and 2.5.1. Only version 2.5.0 demo compiles successfully after enabling RTC.
Please help

Re: RTC on STM32F4-Discovery
Posted: Mon Dec 24, 2012 6:01 pm
by Giovanni
Hi,
For some reason you are including the "RTCv1" RTC driver, the right one for the STM32F4xx is the RTCv2. It is strange because the standard makefiles include the right one. Verify your makefiles.
Giovanni
Re: RTC on STM32F4-Discovery
Posted: Mon Dec 24, 2012 6:23 pm
by Kirill
There is no RTCv2 folder in 2.4.3, just have checked (re-downloaded).
I found the difference in testhalls. STM32F1xx has RTC folder while STM32F4xx has not.
Please tell me what MCUs and dev boards are most used while developing ChibiOS? Maybe I just need some other platform for my hobby (at the very begging).
Re: RTC on STM32F4-Discovery
Posted: Mon Dec 24, 2012 7:09 pm
by Giovanni
Hi,
The most recent ChibiOS/RT is 2.5.2unstable, I recommend using this one if you are not interested in the exception to the GPL license.
STM32F4xx is the best supported in this moment, I recommend the
excellent Olimex STM32-E407 but also the cheap STM32F4-Discovery is very used with the bonus of the on-board debugger.
A comparison is here:
http://www.chibios.org/dokuwiki/doku.ph ... ry_vs_e407Giovanni
Re: RTC on STM32F4-Discovery
Posted: Sun May 04, 2014 1:36 pm
by bezmic
Hello.
On my board the RTC is 1-3% slow. How can i calibrate the RTC ? I can't find the CALP/CALM links on Chibios.
Re: RTC on STM32F4-Discovery
Posted: Sun May 04, 2014 1:52 pm
by Giovanni
Hi,
I think you have to operate on registers for this.
Giovanni
Re: RTC on STM32F4-Discovery
Posted: Sun May 04, 2014 8:22 pm
by bezmic
But in AN3371 wrote: The calibration settings can only be changed during initialization.
I must disable rtcInit() in ChibiOS's hal.c and declare proper init sequence?
Re: RTC on STM32F4-Discovery
Posted: Sun May 04, 2014 8:32 pm
by Giovanni
You can enter the initialization mode even after the RTC initialization:
Code: Select all
/**
* @brief Beginning of configuration procedure.
*
* @notapi
*/
#define rtc_lld_enter_init() { \
RTCD1.id_rtc->ISR |= RTC_ISR_INIT; \
while ((RTCD1.id_rtc->ISR & RTC_ISR_INITF) == 0) \
; \
}
/**
* @brief Finalizing of configuration procedure.
*
* @notapi
*/
#define rtc_lld_exit_init() {RTCD1.id_rtc->ISR &= ~RTC_ISR_INIT;}
Giovanni