2016-12-21 08:23 AM
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-standby2016-12-21 10:22 AM
1. We use a custom PCB but I'll try to find a discovery board. I'll use the same code and see if it behaves the same..
2. Well there is not much to explain. I want to put our device into standby mode to measure the current consumption. Therefore, we disconnected all external ICs, Oscillators, etc.. hooked up a battery and a power monitor. Regarding the code I had a look at the PWR_CurrentConsumption example in the cube package under STM32F411E-Discovery. The measured current consumption is 380µA. Too much for standby mode.
2016-12-21 10:30 AM
Hi
Moll.Benjamin
,-Nesrine-
2016-12-21 10:33 AM
I will do this and let you know, thx!
2016-12-22 05:47 AM
It worked on the F411 Discovery board but not on my PCB. I guess I need to double check what draws the additional power :\
But thx anyways.
2016-12-22 05:48 AM
oh man; it worked on the F411 Discovery board but not on my PCB. I guess I need to double check what draws the additional power in my design :\
2016-12-23 12:29 AM
When the STM32F4 go into stand-by mode all the IOs are set into High impedance state. So I don't know if you measure the total power consumption of your board but you have to take it into account. Example : one IO driving an external input which will float, etc...
Please note that on STM32L4 you can program each state of IO in standby mode.
2016-12-23 03:12 AM
I am measuring the 3,3 line directly before the ST controller. We did a complete strip down of the PCB and removed everything; even the external OSC. Most of the I/O lines now are of course not routed. So no I/O can possibly drive another IC.
strange...
2016-12-23 07:13 AM
Hi binaryguy,
be sure to configure all unused I/Os to either analog mode or output push-pull low.
2016-12-23 07:43 AM
So the 330µA could be traced back to a resistor that should not be present at all.
It's working now. Thank you!
But can someone finally confirm if I need to set my I/Os to analog-in before entering standby or not because in the HAL example code it is not done for standby but only for STOP mode.
2016-12-23 01:36 PM
You don't need because as written above all IOs are automatically set in high impedance when you enter in standby mode.