cancel
Showing results for 
Search instead for 
Did you mean: 

F407 wake-up error

tglim
Associate

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!

2 REPLIES 2
FBL
ST Employee

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.




Best regards,
FBL

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

https://github.com/STMicroelectronics/STM32CubeF4/tree/master/Projects/STM32F401RE-Nucleo/Examples/PWR/PWR_CurrentConsumption 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.