Skip to main content
Visitor II
October 6, 2020
Question

How can I know if device entered sleep mode?

  • October 6, 2020
  • 1 reply
  • 937 views

Hello I am using these lines in order to put my STM32F10x to sleep mode:

void enter_LPSleep (void)
{
	//Suspend SYS Tick
	HAL_SuspendTick();
	//Enable Power Control Clock
	__HAL_RCC_PWR_CLK_ENABLE();
		//Put regulator to low power mode
	HAL_PWR_EnterSLEEPMode(PWR_LOWPOWERREGULATOR_ON,PWR_SLEEPENTRY_WFI);
	HAL_ResumeTick();
	HAL_GPIO_WritePin(LED_BLUE_GPIO_Port, LED_RED_Pin,GPIO_PIN_RESET);
}

But how can I know if it entered to sleep mode correctly? I am not planning to wake it up after sleep mode. So it will be sleeping till the power is off.

Edit: Also I am usin FreeRTOS, would FreeRTOS task switching wake up the device?

    This topic has been closed for replies.

    1 reply

    Graduate II
    October 6, 2020

    measure supply current?