WUF flag don't set after shutdown
Hi everybody)
I have a problem with exiting after shutdown mode.
Entering code
if( (LL_PWR_IsActiveFlag_C1SB() == 0)
|| (LL_PWR_IsActiveFlag_C2SB() == 0)
)
{
/* Set the lowest low-power mode for CPU2: shutdown mode */
LL_C2_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
}
HAL_RTCEx_BKUPWrite(&hrtc, 5, 0x0005);
HAL_PWREx_ClearWakeupFlag(PWR_FLAG_WU);
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1_LOW);
HAL_SuspendTick();
HAL_PWREx_EnterSHUTDOWNMode();My board have a button in PA0 with external pullup resistor.
When I press the button MCU exiting from shutdown mode, but my function
if (__HAL_PWR_GET_FLAG(PWR_FLAG_WUF1)) ...return FALSE always.
My starting code:
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_I2C1_Init();
MX_SPI1_Init();
MX_TIM1_Init();
MX_ADC1_Init();
MX_RTC_Init();
MX_RF_Init();
/* USER CODE BEGIN 2 */
if (__HAL_PWR_GET_FLAG(PWR_FLAG_WUF1))
{
reboot = true;
}RTC is enable in shutdown, but don't use to wakeup. RTC tampers are disabled.