STM32F103 RTC driver
Posted: 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, ×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
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