cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, I'm using the MCU STM32l476, and I have a problem with RTC. The RTC works only if the board is turned on. When the board is turned off or it's sent a command to the MCU go to shutdown mode, the RTC is reset to zero values.

FDigi
Associate III

According to the datasheet, there is shutdown mode with and without RTC, so I believe it's a problem of configuration. Can be some parameter of configuration that is missing? How to configure the shutdown mode with RTC?

Thanks!

12 REPLIES 12

In this case the RTC is reset to zero too.

FDigi
Associate III

Are the functions HAL_RTC_SetDate() and HAL_RTC_SetTime() enough to configure the RTC for working in shutdown mode?

Looking into these functions, they do the same steps for initializing and configuring the RTC as doing it step by step, so I think it's missing some parameter of configuration or I have a hardware problem.

That means you do something wrong in software then.

I don't use Cube so can't help with that. Maybe I'd set a breakpoint immediately after the reset label, before any "initialization" code is called in the startup, and check in debugger if the RTC is still up and running. Then, step through any of the "clock initialization" or whatever Cube imposes on you to see if there is any backup domain reset or anything similar occuring there.

JW