Page 14 of 23
Re: The RTC driver topic
Posted: Fri Mar 09, 2012 4:24 pm
by Giovanni
Post the code and show me where it is too complex, we will find a solution.
I imagine that if you have a conversion function xyz(native, final) you can have multiple implementations:
Code: Select all
#if defined(STM32F1)
xyz(native, final) {
}
#elif defined(STM32F2_4)
xyz(native, final) {
}
#elif
....
It does not look complex just the code is into another module.
Giovanni
Re: The RTC driver topic
Posted: Fri Mar 09, 2012 7:39 pm
by barthess
It is not too complex. It just lays in slightly unexpected place. Any way, rev. 4020 contains finished ideas.
Re: The RTC driver topic
Posted: Sat Sep 15, 2012 7:21 pm
by Giovanni
Barthess, when you have a little time could you review the ticket 3567597?
https://sourceforge.net/tracker/?func=d ... tid=995489thanks,
Giovanni
Re: The RTC driver topic
Posted: Sat Sep 15, 2012 10:34 pm
by barthess
I have reviewed the ticket. Problem confirmed. I have merged fix to trunk and test it on STM32-103STK board.
Re: The RTC driver topic
Posted: Sun Sep 16, 2012 6:55 am
by Giovanni
Thanks.
Giovanni
Re: The RTC driver topic
Posted: Wed Sep 19, 2012 10:13 am
by Giovanni
Hi,
Barthess, there is another one, this time regarding RTCv2, could you examine it? ticket 3568626.
https://sourceforge.net/tracker/?func=d ... tid=995489thanks,
Giovanni
Re: The RTC driver topic
Posted: Wed Sep 19, 2012 11:13 am
by barthess
Accepted. I am working on it.
Re: The RTC driver topic
Posted: Wed Sep 19, 2012 1:27 pm
by barthess
Giovanni,
After investigating of bug i have found following:
1) this is serous bug able to cause unexpected issues and crushes.
2) localtime() returns pointer to statically allocated buffer with calculated result. In other
words, the function is not thread safe. I have changed it to localtime_r() analog.
Fixed in rev. 4694
UPDATE Tested on my custom board with F4x. I am not able to test it in F1x, could
any body test it on F1x?
Re: The RTC driver topic
Posted: Wed Sep 19, 2012 1:32 pm
by Giovanni
Thanks,
I am worried about portability, localtime_r() is specific of newlib and we support other compilers. Probably we should study a solution with FAT time directly supported in the driver without any external dependency.
Giovanni
Re: The RTC driver topic
Posted: Wed Sep 19, 2012 1:42 pm
by barthess
Create timestamp on device with hardware calendar is not a big problem, but for other devices we must create time conversion function. This does not look trivial for me. Probably some one has his own realization.