Skip to main content
Lead
September 18, 2021
Question

Does the RTC run when Vdd = 0 but Vbat = 3 volt?

  • September 18, 2021
  • 2 replies
  • 677 views

I have a STM32F373VBTx serie. I know that the RTC saves the backup registers for every second. But when I restart my STM32, then the RTC sets to default date and time again due to the MX_RTC_INIT() function who is generated by CubeMX.

I have two questions:

  1. Does the RTC run, even if Vdd = 0 and Vbat = 3 volt?
  2. If 1 is YES: How can I make sure so I don't run MX_RTC_INIT() at start up if Vbat have a voltage source?

This topic has been closed for replies.

2 replies

TDK
September 18, 2021

1 yes

2 in the user code section at the start of MX_RTC_INIT, check to see if it's initialized and if so, return from the function.

"If you feel a post has answered your question, please click ""Accept as Solution""."
DMårtAuthor
Lead
September 18, 2021

You men between here?

/* USER CODE BEGIN Check_RTC_BKUP */
 
 /* USER CODE END Check_RTC_BKUP */

 Edit:

So what can I do with the backup registers?

0693W00000DndLNQAZ.png 

Edit:

Or do you mean like this?

static void MX_RTC_Init(void)
{
 
 /* USER CODE BEGIN RTC_Init 0 */
	if(hrtc != NULL)
		return;
 /* USER CODE END RTC_Init 0 */

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-ComputerSTM32MP257FAK3 custom board with STM64-OS as operating system: https://github.com/DanielMartensson/STM64-Computer