cancel
Showing results for 
Search instead for 
Did you mean: 

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

DMårt
Senior III

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?

2 REPLIES 2
TDK
Guru

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".

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 */