STM32F103 RTC driver

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: RoccoMarco, barthess

pcharest_chibios
Posts: 1
Joined: Sat Oct 27, 2018 1:28 pm

STM32F103 RTC driver

Postby pcharest_chibios » Sat Oct 27, 2018 1:47 pm

Hello, tks for your great work, please note I am not an expert developer just a tinkerer I have two issues with the RTC driver on STM32F103:

1)First when using rtcGetTime(&RTCD1, &timespec); when compiling I get code bloat of about 13 Kbytes instead of using the direct method of rtcSTM32GetSecMsec(&RTCD1,&secs,NULL); or direct register method (((uint32_t)(RTCD1.rtc->CNTH) << 16) + RTCD1.rtc->CNTL)).

2)Also when using rtcGetTime(&RTCD1, &timespec) without initializing a chTM object the output of my tm structure seens to be garbage otherwise it is fine this does not make sense to me.

chTMObjectInit(&gett);
chTMStartMeasurementX(&gett);
rtcGetTime(&RTCD1, &timespec);
rtcConvertDateTimeToStructTm(&timespec, &mytime,NULL);
chTMStopMeasurementX(&gett);

Also I have noticed when compiling and linking with arm-none-eabi-gcc-6.3.1 any drive using streams seems to hang a thread but with arm-none-eabi-gcc-7.2.1 everything is fine... I am pretty sure the code bloat has to do with linking to a library any idea?

Philippe

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

Re: STM32F103 RTC driver

Postby Giovanni » Sat Oct 27, 2018 5:48 pm

Hi,

The driver includes some library code so this could explain both issues (bloat and different behavior on 2 compilers).

If the code size is a concern then I recommend using the direct method.

Giovanni


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 10 guests