2018-10-27 08:32 AM
entry into stop mode:
HAL_NVIC_EnableIRQ(EXTI0_IRQn);
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);
__enable_irq();
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
leave stop mode :
__disable_irq();
/* Configure the system clock */
SYSCLKConfig_STOP();
__HAL_GPIO_EXTI_CLEAR_IT(WAKEUP_Pin);
//SystemClock_Config()
MX_GPIO_Init();
MX_DMA_Init();
MX_ADC1_Init();
MX_CAN1_Init();
MX_RTC_Init();
MX_SPI1_Init();
MX_USART1_UART_Init();
MX_USART2_UART_Init();
MX_USART3_UART_Init();
MX_CAN2_Init();
MX_USART6_UART_Init();
__HAL_SPI_ENABLE(&hspi1);
__enable_irq();
void SYSCLKConfig_STOP(void)
{
__HAL_RCC_HSE_CONFIG(RCC_HSE_ON);
while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == RESET);
__HAL_RCC_PLL_ENABLE();
while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == RESET)
{
}
__HAL_RCC_SYSCLK_CONFIG(RCC_SYSCLKSOURCE_PLLCLK);
while(__HAL_RCC_GET_SYSCLK_SOURCE() != 0x08)
{
}
}
but it doesn't work, after wake up form stop mode , it fall in error handle. how to solve this issue?