Skip to main content
Associate II
January 21, 2026
Solved

Can we use RTC timestamp with standby?

  • January 21, 2026
  • 4 replies
  • 413 views

We have a STM32H725 and would like to use the RTC timestamp when entering/exiting standby but from what I understand from the reference manual this is not possible? I did run a quick test and the event doesn't seem to fire even though it works as expected when  we power it down externally so it runs only on VBAT.

Before I give up and solve it a different way I came here to verify whether it was possible to do so? 

// Hopeful developer

Best answer by waclawek.jan

> is it even possible to use RTC timestamp with standby?

There is no hardware in RTC which would generate a timestamp event upon standby entry/exit.

JW

4 replies

TDK
Super User
January 21, 2026

Per the reference manual, the system exits standby on an RTC timestamp event.

TDK_0-1769013011993.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
obj87Author
Associate II
January 21, 2026

Out of memory this is what the example I tried looked like. I provided it mostly to show what the goal was. If I use the external button to turn of power so that it runs on VBAT it behaves as expected and I can retrieve the timestamp when turning the power on agian. If I wait until it enters standby there is no timestamp upon start and it will just print "No timestamp occurred\n".

So I am not trying to use the timestamp as a wakeup source, I am trying to timestamp when entering standby.

Unless I misunderstood your answer and then I apologize.

if (__HAL_RTC_TIMESTAMP_GET_FLAG(&hrtc, RTC_FLAG_TSF))
{
 RTC_TimeTypeDef time;
 RTC_DateTypeDef date;
 HAL_RTCEx_GetTimeStamp(&hrtc, &time, RTC_FORMAT_BIN);
 HAL_RTCEx_GetTimeStampDate(&hrtc, &date, RTC_FORMAT_BIN);
 __HAL_RTC_TIMESTAMP_CLEAR_FLAG(&hrtc, RTC_FLAG_TSF);
 // do stuff with the rtc data
}
else
{
 LOG("No timestamp occurred\n");
}

HAL_RTCEx_SetInternalTimeStamp(&hrtc)

// delay to give me time to kill the power 
vTaskDelay(15000);

// Clean up and enter standby mode
systemEnterStandby(4000);

 

waclawek.jan
Super User
January 21, 2026

waclawekjan_0-1769015736882.png

You enter Standby (or any other power saving mode) by a software action, in contrast to entering VBAT mode, which is a loss of power. Thus, as the mcu is running when you enter standby, you can simply read the current time from RTC and store it in any suitable way, there's no need to have hardware for that.

JW

 

obj87Author
Associate II
January 22, 2026

Yes, our alternative solution is to store it in the backup ram before entering standby and using timestamp when powered off by a button connected to the IC that powers the MCU.

Maybe you answer it and I do not understand but is it even possible to use RTC timestamp with standby?

It would be a preferable solution for us to use the same method for both cases so I want to make sure

 

Thank you.

waclawek.jan
waclawek.janBest answer
Super User
January 22, 2026

> is it even possible to use RTC timestamp with standby?

There is no hardware in RTC which would generate a timestamp event upon standby entry/exit.

JW

obj87Author
Associate II
January 22, 2026

Thank you very much for your help!