AnsweredAssumed Answered


Question asked by wahba.ashraf on Mar 31, 2015
Latest reply on Mar 31, 2015 by waclawek.jan

I am trying to read the RTC time after setting it up. I am experiencing weird behavior.

I am using the STM32L0 discovery board.
I am using the new HAL libraries and the RTC alarm example.
I am using internal LSI and set the prescaler accordingly, per an app note.
I am using IAR

The alarm is working all the time, I can see the interrupt fire at the end of a minute delay,  so I know the clock is actually working

However, I am trying to periodically read the current time using the following code:

//get time  
      sprintf((char *) statusline,"%2d:%2d:%2d",currenttimestructure.Hours,currenttimestructure.Minutes,currenttimestructure.Seconds);
      sprintf((char *) statusline,"error");

The problem: 
if I set a breakpoint in the code, I see the RTC_TR update and the time is updated on the epd display
If I remove the breakpoint, the currenttime structure is never updated.