cancel
Showing results for 
Search instead for 
Did you mean: 

Too high current draw in shutdown mode

minded
Associate II

I'm just getting started with my STM32WB15CC nucleo board, and my first goal was to put in shutdown mode to check the current draw, which I expected to be around 1 uA. I'm measuring the current on the JP3 header with a joulescope which should represent the actual current used by the MCU itself.

I'm using the PWR_LPSLEEP example in the CubeMX IDE, and exchanged the "entersleepmode" call to the "enter shutdown mode", see below:

 

/* Enter Sleep Mode, wake up is done once User push-button (SW1) is pressed */

//HAL_PWR_EnterSLEEPMode(PWR_LOWPOWERREGULATOR_ON, PWR_SLEEPENTRY_WFI);

HAL_PWREx_EnterSHUTDOWNMode();

 

After the shutdown call, the joulescope shows a current draw of 42 uA, which seems very high for shutdown mode.

Am I missing something? Any pointers?

The reason I want to start with this basic test is because the project I'm working on is for a battery driven sensor, so a low current is crucial.

1 ACCEPTED SOLUTION

Accepted Solutions
minded
Associate II

By examining and copying the code used in the STM32LowPower Arduino library from the STM32duino core, I found the issue. What was missing was to enter shutdown mode on the radio core of the STM32WB15CC:

 
LL_C2_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);

/**
* @brief Set Low-Power mode for CPU2
* @rmtoll C2CR1 LPMS LL_C2_PWR_SetPowerMode
* @PAram LowPowerMode This parameter can be one of the following values:
* @arg @ref LL_PWR_MODE_STOP0
* @arg @ref LL_PWR_MODE_STOP1
* @arg @ref LL_PWR_MODE_STOP2 (*)
* @arg @ref LL_PWR_MODE_STANDBY
* @arg @ref LL_PWR_MODE_SHUTDOWN
*
* (*) Not available on devices STM32WB15xx, STM32WB10xx, STM32WB1Mxx
* @retval None
*/
__STATIC_INLINE void LL_C2_PWR_SetPowerMode(uint32_t LowPowerMode)
{
  MODIFY_REG(PWR->C2CR1, PWR_C2CR1_LPMS, LowPowerMode);
}

Code formatting applied - please see How to insert source code for future reference.

View solution in original post

3 REPLIES 3

Make sure you've disconnected all connections to the ST-Link - leakage there could easily account for 40uA...

Check the schematics very carefully for any other possible leakage paths.

You may need to power cycle - not just reset - after using the debugger/programmer ...

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

I'm using USB-C only, can I still disconnect ST-Link in that case, or is not needed then?

I also tried to put the device in shutdown from an application built with Arduino-IDE and the "low power" library. And this seems to work - I get about 1 uA current draw in shutdown.

minded
Associate II

By examining and copying the code used in the STM32LowPower Arduino library from the STM32duino core, I found the issue. What was missing was to enter shutdown mode on the radio core of the STM32WB15CC:

 
LL_C2_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);

/**
* @brief Set Low-Power mode for CPU2
* @rmtoll C2CR1 LPMS LL_C2_PWR_SetPowerMode
* @PAram LowPowerMode This parameter can be one of the following values:
* @arg @ref LL_PWR_MODE_STOP0
* @arg @ref LL_PWR_MODE_STOP1
* @arg @ref LL_PWR_MODE_STOP2 (*)
* @arg @ref LL_PWR_MODE_STANDBY
* @arg @ref LL_PWR_MODE_SHUTDOWN
*
* (*) Not available on devices STM32WB15xx, STM32WB10xx, STM32WB1Mxx
* @retval None
*/
__STATIC_INLINE void LL_C2_PWR_SetPowerMode(uint32_t LowPowerMode)
{
  MODIFY_REG(PWR->C2CR1, PWR_C2CR1_LPMS, LowPowerMode);
}

Code formatting applied - please see How to insert source code for future reference.