cancel
Showing results for 
Search instead for 
Did you mean: 

Can't get my controller in Low Power mode

sde c.1
Senior II

0693W00000GYEMNQA5.pngHi,

My controller still consumes 360µA in STOP mode, i can't figure out why.

Maybe one of the inputs/outputs that leaks current?

I have this IO setup the moment i execute STOP

PA0-PA5 = External interrups up down edgle no pull up of down

PA6 = ADC input

PA9,10,14 = input mode no pull up or down

PA7 = External interrups up down edgle no pull up of down

PB1 = input mode no pull up or down

PB9 = input mode

code :

int main(void)
{
  /* USER CODE BEGIN 1 */
 
  /* USER CODE END 1 */
 
  /* MCU Configuration--------------------------------------------------------*/
 
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();
 
  /* USER CODE BEGIN Init */
 
  /* USER CODE END Init */
 
  /* Configure the system clock */
  SystemClock_Config();
 
  /* USER CODE BEGIN SysInit */
 
  /* USER CODE END SysInit */
 
  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_ADC_Init();
  MX_RTC_Init();
  /* USER CODE BEGIN 2 */
 
  HAL_SuspendTick();
  HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON,PWR_STOPENTRY_WFI);
 
  /* USER CODE END 2 */
 
  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
    /* USER CODE END WHILE */
 
    /* USER CODE BEGIN 3 */
  }
  /* USER CODE END 3 */
}

3 REPLIES 3
MM..1
Chief II

Maybe your MCU isnt STOP , your code leave STOP and dont go back.

in the full project the wakup happens in an EXTI callback.

But to test i limited the code to only this, so no wakeup can happen, so i can measure the current after stop is executed.

the MCU should stop at HAL_PWR_EnterSTOPMode ..

MM..1
Chief II

Place in while for example gpio check led toggle or other type, because one false interrupt wake your code from stop and ...

In normal code is stop called in while and repeat after do jobs back to stop mode...