cancel
Showing results for 
Search instead for 
Did you mean: 

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

Chao
Senior

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

4 REPLIES 4
Chao
Senior

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();		

 

Sarra.S
ST Employee

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.

Thank you so much!

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

Sarra.S
ST Employee

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.