cancel
Showing results for 
Search instead for 
Did you mean: 

Current consumption of STM32L4R5 in low power modes not as per datasheet

SD0509
Associate II

I'm attempting to enable the Stop mode on the STM32L4R5ZIP, but it appears to significantly deviate from the specifications outlined in the datasheet, exhibiting a higher current consumption ranging from 7 to 9 mA in both sleep and stop modes.
Even after setting all free pins to default mode, deactivating all GPIOs, the power consumption remains consistent. I have experimented with both FreeRTOS and a non-FreeRTOS project, yet I consistently observe a 7mA current consumption in STOP Low-Power modes.

In the FreeRTOS project, I implemented tickless mode with the following code snippet:

void PreSleepProcessing(uint32_t ulExpectedIdleTime)
{
/* Called by the kernel before it places the MCU into a sleep mode because
  configPRE_SLEEP_PROCESSING() is #defined to PreSleepProcessing().
 
  NOTE:  Additional actions can be taken here to get the power consumption
  even lower.  For example, peripherals can be turned off here, and then back
  on again in the post sleep processing function.  For maximum power saving
  ensure all unused pins are in their lowest power state. */
 
HAL_SuspendTick();
HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 0x801, RTC_WAKEUPCLOCK_RTCCLK_DIV16);
__disable_irq();
 __HAL_RCC_USB_OTG_FS_CLK_DISABLE();
__HAL_RCC_GPIOE_CLK_DISABLE();
__HAL_RCC_GPIOC_CLK_DISABLE();
__HAL_RCC_GPIOF_CLK_DISABLE();
__HAL_RCC_GPIOH_CLK_DISABLE();
__HAL_RCC_GPIOA_CLK_DISABLE();
__HAL_RCC_GPIOB_CLK_DISABLE();
__HAL_RCC_GPIOG_CLK_DISABLE();
__HAL_RCC_GPIOD_CLK_DISABLE();
  HAL_PWREx_DisableVddIO2();
 
//STOP2 MODE
HAL_PWREx_EnterSTOP2Mode(PWR_SLEEPENTRY_WFI); /
}
 
void PostSleepProcessing(uint32_t ulExpectedIdleTime)
{
/* Called by the kernel when the MCU exits a sleep mode because
  configPOST_SLEEP_PROCESSING is #defined to PostSleepProcessing(). */
 
/* WAKE UP WITH RTC */
HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
 
HAL_RCC_DeInit();
__enable_irq();
 
/* resume systicks */
HAL_ResumeTick();
SystemClock_Config();
 
__HAL_RCC_GPIOE_CLK_ENABLE();
__HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOF_CLK_ENABLE();
__HAL_RCC_GPIOH_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_GPIOG_CLK_ENABLE();
__HAL_RCC_GPIOD_CLK_ENABLE();
}
I would highly appreciate any insights or suggestions to minimize the current consumption in this scenario.
19 REPLIES 19

Do you have debugger connected?

JW

Andrew Neil
Evangelist

Use this button to properly post source code:

AndrewNeil_0-1707934668925.png

 

What board is the chip on?

Have you taken care to ensure that what you're measuring is just the chip and not anything else?

STOne-32
ST Employee

Dear @SD0509 ,

A first hypothesis, the MCU is not entering STOP mode but only sleep mode as there is an active IRQ or pending , such as the Systick used as time base for FreeRTOS . I would suggest to start by basic examples as provided in the HAL use case for standby, so we can eliminate any unnecessary debug on hardware side and also measuring only MCU IDD .  Let us know your correct environment such as the board schematics and software, we will try to help . Chokran 🙂 

Cheers,

STOne-32

That's not actually disabling the IO's in any meaningful way..

Turning off the clock precludes register access, it doesn't change what they are doing, or driving into.

Change all to Analogue Input mode, where safe to do so, then disable the clock. Watch for debug pins, or those being used for telemetry or diagnostics if you need to understand what's happening internally.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Yes i do and I have enabled the debug in low power modes.
But that doesn't justify a power consumption of 7mA in stop modes

> But that doesn't justify a power consumption of 7mA in stop modes

Why do you think so?

Have you tried with disconnected debugger, after a reset (in order to clear given bits)?

JW


@SD0509 wrote:

 I have enabled the debug in low power modes.


Then the low power modes are not really low power at all!

 

@SD0509 wrote:

But that doesn't justify a power consumption of 7mA in stop modes


Oh yes it does - It explains it entirely!

 

Addendum - from the Reference Manual:

AndrewNeil_1-1708017187505.png

 

 

> It explains it entirely!

Whoa there. It may be *one* of the explanation - others brought up valid points, too.

JW

I am using the Nucleo STM32L4R5ZI-P board.
I removed the jumper JP5 (labeled IDD) on the board and connected a multimeter in series to measure the MCU consumption.