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, ×pec); 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, ×pec) 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, ×pec);
rtcConvertDateTimeToStructTm(×pec, &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
STM32F103 RTC driver
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: STM32F103 RTC driver
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
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