AnsweredAssumed Answered

My Solution to Issues with RTC and Alarm Wakeup

Question asked by C. Adam Lamb, PE on Jun 15, 2012
Latest reply on Oct 26, 2012 by p.suresh
Hello Everyone,

I've had issues a couple times getting my Real Time Clock to correctly alarm and wake up my processor.  My most recent issue had me reading through many posts on this site to try to figure out my problem.  While I didn't find my answer on this site, I did want to share my solution here.

My latest problem with the real time clock alarm ended up being that I had "upgraded" my STM32F103 libraries to the most recent version.  I had forgotten that I had modified ST's real time clock library to add some synchronization and some error checking when I first turned on the alarm (a year or three ago) because I was having problems then too.  Once I went back to my old files, things started working again.

I have included the files as I modified them.  Please note that I did use a couple timing features of an RTOS I am using (Segger's emBOS) to help me create a timeout from a loop.  For testing purposes, you could simply comment out the timeouts, or replace them with your own way to do a timeout.  No warranties are implied or provided by providing this code for a learning exercise, yada, yada...

Hopefully looking at my modifications to ST's files can be helpful to you.  If not, sorry I wasted your time... ;-)

Good luck!
Adam

Attachments

Outcomes