2026-04-14 4:56 PM - last edited on 2026-04-15 1:00 AM by Imen.D
I have a question regarding an F407 wake-up error.
I am using an F407ZGT and have connected the power switch to PA0 using a pull-down resistor.
HAL_SuspendTick();
HAL_PWR_EnableWakeUpPin( PWR_WAKEUP_PIN1 );
__HAL_PWR_CLEAR_FLAG( PWR_FLAG_WU | PWR_FLAG_SB );
HAL_PWR_EnterSTANDBYMode();
I have been using this code successfully.
However, after modifying the firmware and downloading it, or when downloading via the gang tool, the MCU fails to wake up via the wake-up input—though not always. Once this issue occurs on a board, the wake-up function permanently stops working, regardless of any operations performed.
Is there any way to restore the wake-up function?
Please help me!
2026-04-15 3:12 AM
Hello @tglim
Make sure to disable all used wakeup sources first. Did you verify the PA0 external signal using logic analyzer?
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.
2026-04-15 3:40 AM - edited 2026-04-15 3:41 AM
@FBL wrote:Make sure to disable all used wakeup sources first.
@tglim Indeed - as shown in the CubeF4 examples; eg,
/**
* @brief This function configures the system to enter Standby mode for
* current consumption measurement purpose.
* STANDBY Mode
* ============
* - Backup SRAM and RTC OFF
* - IWDG and LSI OFF
* - Wakeup using WakeUp Pin (PA.00)
* @PAram None
* @retval None
*/
void StandbyMode_Measure(void)
{
/* Enable Power Clock*/
__HAL_RCC_PWR_CLK_ENABLE();
/* Allow access to Backup */
HAL_PWR_EnableBkUpAccess();
/* Reset RTC Domain */
__HAL_RCC_BACKUPRESET_FORCE();
__HAL_RCC_BACKUPRESET_RELEASE();
/* Disable all used wakeup sources: Pin1(PA.0) */
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1);
/* Clear all related wakeup flags */
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
/* Re-enable all used wakeup sources: Pin1(PA.0) */
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);
/*## Enter Standby Mode ####################################################*/
/* Request to enter STANDBY mode */
HAL_PWR_EnterSTANDBYMode();
}