cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F411 - Not getting lowest current consumption when putting device into standby

bm
Associate II
Posted on December 21, 2016 at 17:23

So I want my device to go into standby mode to run on the lowest power mode possible. Unfortunately, when measuring the current it does not drop below 360�A and I have no clue why...

This is my HSI setup:

configure_system_clock(void)

{

RCC_OscInitTypeDef RCC_OscInitStruct;

RCC_ClkInitTypeDef RCC_ClkInitStruct;

RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;

__HAL_RCC_PWR_CLK_ENABLE();

__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);

RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;

RCC_OscInitStruct.HSIState = RCC_HSI_ON;

RCC_OscInitStruct.HSICalibrationValue = 16;

RCC_OscInitStruct.LSIState = RCC_LSI_OFF;

RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;

RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;

RCC_OscInitStruct.PLL.PLLM = 8;

RCC_OscInitStruct.PLL.PLLN = 192;

RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;

RCC_OscInitStruct.PLL.PLLQ = 8;

HAL_RCC_OscConfig(&RCC_OscInitStruct);

RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK

|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;

RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;

RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;

RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;

RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;

HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3);

return;

This is my main routine:

void main() {

HAL_SuspendTick();

volatile uint32_t x;

for (int i = 0; i < 599999; i++) {

for (int y = 0; y < 9; y++) {

volatile uint32_t x = +y;

}

}

__HAL_RCC_PWR_CLK_ENABLE();

__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);

HAL_PWR_EnableBkUpAccess();

__HAL_RCC_BACKUPRESET_FORCE();

__HAL_RCC_BACKUPRESET_RELEASE();

HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1);

__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);

HAL_PWR_EnterSTANDBYMode();

while(1);

}

No wakeup source configure since I just want to test standby current consumption.

Any idea what I am missing?

Thanks in advance.

#low-power-standby
19 REPLIES 19
Nesrine M_O
Lead II
Posted on December 21, 2016 at 17:39

Hi

Moll.Benjamin

‌,

I recommend you to start fromthe PWR Current Consumption example under the

STM32F4cube firmware

STM32Cube_FW_F4_V1.0\Projects\STM32F411E-Discovery\Examples\PWR\PWR_CurrentConsumption

This example shows how to configure the STM32F4xx system to measure different

Low-power modes current consumption.

-Nesrine-

Posted on December 21, 2016 at 17:44

I know ST's web is a mess and it's hard to find relevant appnotes, but you should read AN4365 'Using STM32F4 MCU power modes with best dynamic efficiency'.

JW

Posted on December 21, 2016 at 17:43

I did that already... No success!

Posted on December 21, 2016 at 17:49

Yes, I know this document and followed all steps necessary, but with no luck...

Posted on December 21, 2016 at 17:57

Including

To avoid extra I/O current, all pins should be configured as analog input (AIN); in this mode

the Schmitt trigger input is disabled, providing zero consumption for each I/O pin.

?

JW

Posted on December 21, 2016 at 18:07

Well, regarding the ST example this is only necessary if you put the device into Stop mode not Standby mode. So no, I did not do it. I can try it though...

Posted on December 21, 2016 at 18:13

ST's numbers likely come from a chip with nothing attached externally, so there are no paths for the current to take.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on December 21, 2016 at 18:14

Hi

Moll.Benjamin

‌,

I did that already... No success!

  • You are using a custom board or an ST board?

  • Could you please provide more explanation on your case, so that it will be easier to understand the issue?

-Nesrine-

Posted on December 21, 2016 at 18:15

I see, I'll give it a shot, maybe I get lucky