Skip to main content
Senior
May 30, 2025 5:36 PM UTC
Question

STM32F103: Failed to wake up with RTC alarm from Standby mode

Hi,

We have a customized board with STM32F103, it measures water level and sends the data to a server, and then enters into Standby mode for 1 minute after setting up a RTC alarm for wakeup. 

Occasionally, we see wakeup failures. This happens randomly, it could be once after running for thousands of minutes, or could be once for hundreds of minutes.

Any ideas ? And is there any way to check the reason why it happens?

Any replies would be highly appreciated.

Chao

This topic has been closed for replies.

4 replies

ChaoAuthor
Senior
Jun 2, 2025 11:17 AM UTC

After 60 hours running, it failed to wake up again!

During the 60 hours, it has entered into Standby and exited from it for 3484 times. The following is what I have done befor entering into Standby mode:

	GPIO_InitTypeDef GPIO_InitStruct = {0};
 /* Turn off the power for 4G module*/
	HAL_GPIO_WritePin(GPIOA, VccEnable4G_Pin, GPIO_PIN_RESET);
 /* Deinitialize the UART used by the 4G module */
	HAL_UART_DeInit(&huart3);

	GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
	GPIO_InitStruct.Pull = GPIO_NOPULL;
	GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM;

 /* Put the pins (PA11 PB12 PB13) used by the 4G module into GPIO_MODE_ANALOG mode */
	GPIO_InitStruct.Pin = VccEnable4G_Pin;
	HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
 GPIO_InitStruct.Pin = DtuReset_Pin|DtuPower_Pin;
	HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

	RtcSetAlarm(hour, minute, second);
	/* Enable Power Clock */
	__HAL_RCC_PWR_CLK_ENABLE();
	/* Clear all related wakeup flags */
	__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
	HAL_PWR_EnterSTANDBYMode();		

 

ST Employee
Jun 3, 2025 3:43 PM UTC

Hello @Chao, 

Could you monitor the voltage levels and check if it's dropping? 

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.
ChaoAuthor
Senior
Jun 4, 2025 2:29 PM UTC

Thank you so much!

I will change to a AC/DC with meter reading for this.

ST Employee
Jun 10, 2025 1:43 PM UTC

Hello again @Chao, any updates on this matter?

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.