2017-11-15 10:54 AM
I am using STM32F042F6 uC. I am not sure why this HAL_PWR_EnterSTANDBYMode() does not put the uC to sleep mode. But the odd thing is in certain condition, it does go the Standby mode, but in some other boards, the uC does not go to standby mode.
I would think this function is unconditionally put the uC to Standby mode. Is there any condition in which the uC cannot be put into Standby mode? Why would in some condition I can put uC in standby and in some I could not?
Thanks.
Solved! Go to Solution.
2017-11-16 05:04 AM
Hi
Vu.Andy
,I recommend you to start from ready example under the
firmware package:STM32Cube_FW_F0_V1.9.0\Projects\STM32072B_EVAL\Examples\PWR\PWR_STANDBY
-Nesrine-
2017-11-16 05:04 AM
Hi
Vu.Andy
,I recommend you to start from ready example under the
firmware package:STM32Cube_FW_F0_V1.9.0\Projects\STM32072B_EVAL\Examples\PWR\PWR_STANDBY
-Nesrine-
2017-11-16 12:07 PM
,
,
Thank you.
After looking into the example, apparently I have to execute the following codes before going into standby mode.
I am using the IWDG to wake up so the Wakeup in is not needed.
, __HAL_RCC_PWR_CLK_ENABLE(), , , ,
, /* ♯ ♯ ♯ ♯ Disable all used wakeup sources: WKUP pin ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ */
,
, HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1),,
,,
, /* ♯ ♯ ♯ ♯ Clear all related wakeup flags ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ ♯ */,
, /* Clear PWR wake up Flag */,
, __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU),,
,,
, /* Disable WKUP pin */,
// , HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN2),,
, , ,,
, , ,HAL_PWR_EnterSTANDBYMode(),