cancel
Showing results for 
Search instead for 
Did you mean: 

How can I know if device entered sleep mode?

GunkutA
Senior

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?

1 REPLY 1
Uwe Bonnes
Principal III

measure supply current?