2019-03-12 12:08 AM
Recovery of Standby Mode in LIS3DH + STM32L072
I am developing using LIS3DH + STM32L072 now.
I think that I want to restore with WKUP (PA0) of STM32L072 by INT1 when it enters Standby Mode and exceeds the threshold set to LIS3DH.
However, I will not return.
The settings are described below.
STM32L072
Setting of Standby Mode
void Enter_Standby_HAL (void)
{
__HAL_RCC_PWR_CLK_ENABLE ();
HAL_PWREx_EnableUltraLowPower ();
HAL_PWREx_EnableFastWakeUp ();
if (__ HAL_PWR_GET_FLAG (PWR_FLAG_SB)! = RESET) {
__HAL_PWR_CLEAR_FLAG (PWR_FLAG_SB);}
HAL_Delay (5000);
HAL_PWR_DisableWakeUpPin (PWR_WAKEUP_PIN1);
__HAL_PWR_CLEAR_FLAG (PWR_FLAG_WU);
HAL_PWR_EnableWakeUpPin (PWR_WAKEUP_PIN1);
HAL_PWR_EnterSTANDBYMode ();
while (1)
{
}
}
WKUP Pin setting
void Set_WkupPin1 (void)
{
GPIO_InitTypeDef initStruct = {0};
__HAL_RCC_GPIOA_CLK_ENABLE ();
initStruct.Mode = GPIO_MODE_INPUT;
initStruct.Pull = GPIO_PULLDOWN;
HW_GPIO_Init (GPIOA, GPIO_PIN_0, & initStruct);
}
Setting of LIS3DH
CTRL_REG1 = 0x1F
CTRL_REG2 = 0xF9
CTRL_REG3 = 0x40
CTRL_REG4 = 0x00
CTRL_REG5 = 0x00
CTRL_REG6 = 0x00
INT1_THS = 0x03
INT1_DURATION = 0x00
INT1_CFG = 0x2A
For the beginners, I could not identify what was the cause.
Please tell me if you understand.