cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP153 rtc stop counting when power down

MWoło.2
Senior II

Hi,

I have a small problem with the RTC on STM32MP153. From hardware point of view I'm able to see sine waveform on the resonator 32.768kHz which is connected to PC14, PC15.

I use the Openstlinux - kirkstone (openstlinux-5.15-yocto-kirkstone-mp1-v22.11.23).

I configure rtc section only in tfa file

 

	clocks {
		/* USER CODE BEGIN clocks */
		clk_lsi: clk-lsi {
			clock-frequency = <32000>;
		};
		clk_hsi: clk-hsi {
			clock-frequency = <64000000>;
		};
		clk_csi: clk-csi {
			clock-frequency = <4000000>;
		};
		clk_hse: clk-hse {
			clock-frequency = <24000000>;
		};
		/* USER CODE END clocks */

		/* USER CODE BEGIN clk_lse */
		clk_lse: clk-lse {
			st,drive = < LSEDRV_MEDIUM_HIGH >;
			#clock-cells = <0>;
			compatible = "fixed-clock";
			clock-frequency = <32768>;
		};
		/* USER CODE END clk_lse */

		/* USER CODE BEGIN clk_hse */
		/* USER CODE END clk_hse */
	};

...

&rcc{
	status = "okay";

	/* USER CODE BEGIN rcc */
	/* USER CODE END rcc */

	st,clksrc=<
		CLK_MPU_PLL1P
		CLK_AXI_PLL2P
		CLK_MCU_HSI
		CLK_PLL12_HSE
		CLK_PLL3_HSE
		CLK_PLL4_HSE
		CLK_RTC_LSE
		CLK_MCO1_DISABLED
		CLK_MCO2_DISABLED
	>;
	st,clkdiv = <
		1 		/*MPU*/
		0 		/*AXI*/
		0 		/*MCU*/
		0 		/*APB1*/
		0 		/*APB2*/
		0 		/*APB3*/
		1 		/*APB4*/
		2 		/*APB5*/
		0 		/*RTC*/
		0 		/*MCO1*/
		0 		/*MCO2*/
	>;

...

&rtc{
	status = "okay";

	/* USER CODE BEGIN rtc */
	/* USER CODE END rtc */
};

 

after the system start I see in the console

 

[    1.925447] stm32_rtc 5c004000.rtc: registered as rtc0
[    1.929185] stm32_rtc 5c004000.rtc: setting system clock to 2024-06-13T10:28:55 UTC (1718274535)
[    1.938524] stm32_rtc 5c004000.rtc: registered rev:1.2

 

I set the time using

date --set="Thu Jun 13 10:43:51 UTC 2024"

and store it into internal RTC using

hwclock --systohc --utc

So far without any troubles. So next before power down I wait a few minutes to check if the RTC still ongoing using

hwclock

working perfectly. Than after power down and waiting for instance 5 minutes I get old time, the time before the power down. It's seems to be the RTC not counting during power down. I check and sine waveform is generated during power down. Of course battery 3V is connected to VBAT pin.

Where to resolve this problem.

BR Michal

 

1 ACCEPTED SOLUTION

Accepted Solutions

It seems to be a hardware issue, on second board works perfectly. Sorry for the problem.

BR

MIchał

View solution in original post

2 REPLIES 2
Olivier GALLIEN
ST Employee

Hi @MWoło.2 

 

Seems this old post is similar Solved: RTC is not keeping time during low power mode - STMicroelectronics Community

Does it help ? 

Thanks

Olivier 

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

It seems to be a hardware issue, on second board works perfectly. Sorry for the problem.

BR

MIchał