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 08:39 AM
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-
2016-12-21 08:44 AM
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
2016-12-21 09:43 AM
I did that already... No success!
2016-12-21 09:49 AM
Yes, I know this document and followed all steps necessary, but with no luck...
2016-12-21 09:57 AM
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
2016-12-21 10:07 AM
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...
2016-12-21 10:13 AM
ST's numbers likely come from a chip with nothing attached externally, so there are no paths for the current to take.
2016-12-21 10:14 AM
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-
2016-12-21 10:15 AM
I see, I'll give it a shot, maybe I get lucky