Hello,
After some time I finally got out of the confusion between the platforms of stm32. Now im working on the STM32duino platform with the bluepillf103 board. I managed to get the rtc working with this libary without a problem. It keeps the track of time nicely.
I ran into problems when I wanted to use the LSE_CLOCK as the clock source, which is the only one accurate enough to be called an rtc. Whenever I use the function as object.setClockSource(LSE_CLOCK); I automatically recieve an error of it not being a matching function to call. When I try to look around the libary its firmly defined as any other function. Any ideas?
Heres the code, platformio.ini and the error output:
void setup() {
rtc.setClockSource(LSE_CLOCK);
rtc.begin(HOUR_FORMAT_24);
if (!rtc.isTimeSet()) {
rtc.setTime(0, 6, 0);
}
}
platformio.ini
[env:bluepill_f103c8]
platform = ststm32
board = bluepill_f103c8
framework = arduino
lib_deps =
STM32duino RTC
Compiler output:
src\main.cpp: In function 'void setup()':
src\main.cpp:69:31: error: no matching function for call to 'STM32RTC::setClockSource(sourceClock_t)'
rtc.setClockSource(LSE_CLOCK);
^
In file included from src\main.cpp:9:0:
.pio\libdeps\bluepill_f103c8\STM32duino RTC_ID5502\src/STM32RTC.h:104:8: note: candidate: void STM32RTC::setClockSource(STM32RTC::Source_Clock)
void setClockSource(Source_Clock source);
^~~~~~~~~~~~~~
.pio\libdeps\bluepill_f103c8\STM32duino RTC_ID5502\src/STM32RTC.h:104:8: note: no known conversion for argument 1 from 'sourceClock_t' to 'STM32RTC::Source_Clock'
*** [.pio\build\bluepill_f103c8\src\main.cpp.o] Error 1