cancel
Showing results for 
Search instead for 
Did you mean: 

Reinitialize RTC upon watchdog reset

timothy0508
Associate II

In my application, I have a watchdog timer that resets every 45 seconds if not fed. I also have an RTC. The application records sensor samples, along with timestamps from the RTC.

Problem is, when there is a watchdog reset, the RTC is re-initialized to default date and time. This messes up the sample/timestamp collection.

  • Are the RTC time/date values still maintained even when there is a watchdog reset?
  • Would it make sense to skip setting the default date/time when a watchdog reset has been detected?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

Which STM32?

> Are the RTC time/date values still maintained even when there is a watchdog reset?

Yes. Your problems are caused by using Cube.

> Would it make sense to skip setting the default date/time when a watchdog reset has been detected?

Yes. You need to detect, if RTC is already set - see RTC_ISR.INITS flag - and act accordingly.

JW

View solution in original post

2 REPLIES 2

Which STM32?

> Are the RTC time/date values still maintained even when there is a watchdog reset?

Yes. Your problems are caused by using Cube.

> Would it make sense to skip setting the default date/time when a watchdog reset has been detected?

Yes. You need to detect, if RTC is already set - see RTC_ISR.INITS flag - and act accordingly.

JW

STM32L4

Thanks. I just tested this out and it worked. The RTC values are maintained even with a watchdog reset.

Just needed to be absolutely sure.

Tim