AnsweredAssumed Answered

Why there is an Increased current consumption after 3 minutes during Stop mode with RTC with HAL driver?

Question asked by carole jacquinot on Dec 6, 2017
Latest reply on Feb 1, 2018 by carole jacquinot

Hello,

I used the STM32L073RZ and I used Stop mode for saving current.

And my problem is when I measured the current consumption of this MCU, I found arround 3uA during only 3 minutes after starting the Stop mode and then arround 15uA until my system wake-up, as you can see on the next chart the Current consumption measure with X-NUCLEO-LPM01A at the increase of current :

Current consumption measure with X-NUCLEO-LPM01A

I already check the same result with an amperemeter.

It is like some internal power supply just turn on, but my system is always in stop mode.

 

I put the MCU in stop mode with the HAL driver function like that:

/* Enable Power Control clock */
__HAL_RCC_PWR_CLK_ENABLE();

/* Enable Ultra low power mode */
HAL_PWREx_EnableUltraLowPower();

/* Enable the fast wake up from Ultra low power mode */
HAL_PWREx_EnableFastWakeUp();

HAL_SuspendTick();
//Request to enter STOP mode with regulator in low power mode
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
HAL_ResumeTick();


//After wake-up from STOP reconfigure the PLL
SystemClock_Config();

Where : 

void SystemClock_Config(void)
{

RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_ClkInitTypeDef RCC_ClkInitStruct;
RCC_PeriphCLKInitTypeDef PeriphClkInit;

/* Enable Power Control clock */
__HAL_RCC_PWR_CLK_ENABLE();
/* The voltage scaling allows optimizing the power consumption when the device is
clocked below the maximum system frequency, to update the voltage scaling value
regarding system frequency refer to product datasheet. */
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2);
/* Disable Power Control clock */
__HAL_RCC_PWR_CLK_DISABLE();

/**Initializes the CPU, AHB and APB busses clocks
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = 16;
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLLMUL_4;
RCC_OscInitStruct.PLL.PLLDIV = RCC_PLLDIV_4;

 

if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}

/**Initializes the CPU, AHB and APB busses clocks
*/
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_DIV2;
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;

if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK)
{
Error_Handler();
}

PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART2|RCC_PERIPHCLK_LPUART1
|RCC_PERIPHCLK_I2C1|RCC_PERIPHCLK_I2C3
|RCC_PERIPHCLK_RTC;
PeriphClkInit.Usart2ClockSelection = RCC_USART2CLKSOURCE_PCLK1;
PeriphClkInit.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
PeriphClkInit.I2c1ClockSelection = RCC_I2C1CLKSOURCE_PCLK1;
PeriphClkInit.I2c3ClockSelection = RCC_I2C3CLKSOURCE_PCLK1;

 

PeriphClkInit.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;

 

if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
{
Error_Handler();
}

 

//Configure the Systick interrupt time
HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);
//Configure the Systick
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);
//SysTick_IRQn interrupt configuration
HAL_NVIC_SetPriority(SysTick_IRQn, 3, 0);
}

And just before Put the system in stop mode, I cut all interfaces that I don't need except one UART and 6 IO.

I don't that the problem come from the interface that I let awake because as I said, the increase of current is during the stop mode.

 

According to you, where could this increase of current come from during the stop mode?

Outcomes