2014-04-24 06:08 AM
Hello, I noticed a problem in the software implementation of STM32F1 's clock/calendar. If the device is switched off for a long time (>= 255 days) it will enter infinite loop inside CheckForDaysElapsed() (which is inside RTC_Configuration() function) because the for(;;) loop variable is only 8bits in size. I replaced several microcontrollers before finding this as I thought they were faulty.
Has anyone encountered this issue ?2014-04-28 07:03 AM
Which software implementation are you speaking about?
-Mayla-To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2014-04-28 01:08 PM
The one from
http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF257855
. It is for STM32F1 series only.2014-04-28 02:21 PM
Yes, there appear to be issues with that, and frankly I don't care for that approach to calendering. I built a scheme using a 32-bit second value from epoch (136 years), and computed the date/time when required. A linear view of time is best expressed in seconds, not human centric dates.
Rule#1 For Third-Party calendering solutions : They are usually broken in subtle ways, and the time required to validate them would exceed the time to write correctly from scratch.2014-04-28 03:05 PM
Couldn't agree more Clive, good thing I only used the lib for one project. I then switched to UNIX time format too. As you said it is pretty straightforward.