Skip to main content
Senior
May 30, 2025
Question

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

  • May 30, 2025
  • 3 replies
  • 523 views

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

3 replies

ChaoAuthor
Senior
June 2, 2025

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
June 3, 2025

Hello @Chao

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

ChaoAuthor
Senior
June 4, 2025

Thank you so much!

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

ST Employee
June 10, 2025

Hello again @Chao, any updates on this matter?