LPTIMER fail to wakeup in STOP2 mode for longer timeout
Hello,
Trying to achieve wakeup system at every 60 sec or more using LPTIMER1 in STOP2 mode.
Observation:
1. STOP2 = enable and LPTIMER = 60 sec --> Wakeup not work
2. STOP2 = disable and LPTIMER = 60 sec --> Wakeup work
3. STOP2 = enable and LPTIMER = 2 sec --> Wakeup work
4. STOP2 = disable and LPTIMER = 2 sec --> Wakeup work
void enterLowPowerMode()
{
HAL_UARTEx_EnableStopMode(&hlpuart1);
HAL_SuspendTick();
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
HAL_ResumeTick();
Reset_SystemClock();
HAL_UARTEx_DisableStopMode(&hlpuart1);
}Using LPTIMER1, below is the configuration,
static void MX_LPTIM1_Init(void)
{
/* USER CODE BEGIN LPTIM1_Init 0 */
/* USER CODE END LPTIM1_Init 0 */
LPTIM_OC_ConfigTypeDef sConfig1 = {0};
/* USER CODE BEGIN LPTIM1_Init 1 */
/* USER CODE END LPTIM1_Init 1 */
hlptim1.Instance = LPTIM1;
hlptim1.Init.Clock.Source = LPTIM_CLOCKSOURCE_APBCLOCK_LPOSC;
hlptim1.Init.Clock.Prescaler = LPTIM_PRESCALER_DIV64;
hlptim1.Init.Trigger.Source = LPTIM_TRIGSOURCE_SOFTWARE;
hlptim1.Init.Period = 31000;
hlptim1.Init.UpdateMode = LPTIM_UPDATE_IMMEDIATE;
hlptim1.Init.CounterSource = LPTIM_COUNTERSOURCE_INTERNAL;
hlptim1.Init.Input1Source = LPTIM_INPUT1SOURCE_GPIO;
hlptim1.Init.Input2Source = LPTIM_INPUT2SOURCE_GPIO;
hlptim1.Init.RepetitionCounter = 0;
if (HAL_LPTIM_Init(&hlptim1) != HAL_OK)
{
Error_Handler();
}
sConfig1.Pulse = 30720;
sConfig1.OCPolarity = LPTIM_OCPOLARITY_HIGH;
if (HAL_LPTIM_OC_ConfigChannel(&hlptim1, &sConfig1, LPTIM_CHANNEL_1) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN LPTIM1_Init 2 */
HAL_LPTIM_IC_Start_IT(&hlptim1, LPTIM_CHANNEL_1);
/* USER CODE END LPTIM1_Init 2 */
}Help me what I'm missing here,
