Skip to main content
ron239955_stm1_st
Associate III
December 12, 2016
Solved

What could be consuming power in stop mode after flashing an STM32L073?

  • December 12, 2016
  • 2 replies
  • 3195 views
Posted on December 13, 2016 at 00:28

So I'm running a program on an STM32L073 that puts the device into stop mode to minimise power consumption.

After flashing the device (via ST-LinkV2) it starts up and enters stop mode where it is consuming around 135 uA

After a soft reset (reset button or program) when the device enters stop mode again it consumes the same current.

However if the power is re-cycled upon entering stop mode it consumes around 5 uA

After a soft reset it consumes the same.

So I'd appreciate views on what could be running, or how to identify what could be running, in stop mode after flashing. As I'd like to switch that off!

Pretty sure that it is actually entering stop mode in the former case as putting it into sleep mode the consumption is significantly higher than 135 uA.

(maybe something to do with RTC and backup domains,which survive normal flashing, but can't think what would cause that level of consumption).   Thanks, Ron

    This topic has been closed for replies.
    Best answer by Jaroslav BECKA
    Posted on December 20, 2016 at 16:18

    Hi Ron

    Have you tried the example from STM32CubeL0 FW package?(STM32Cube\Repository\STM32Cube_FW_L0_V1.7.0\Projects\STM32L073RZ-Nucleo\Examples\PWR\PWR_STOP)

    What consumption do you have with this example?

    One thing which is removed after power-on reset is debug support in low power modes. In this case it is not enough to just comment the corresponding lines in the code. 

    Also be sure to check 'Reset and run', 'Reset after download' or similar option in your IDE.

    2 replies

    Walid FTITI_O
    Visitor II
    December 13, 2016
    Posted on December 13, 2016 at 12:57

    Hi

    Segal.Ron

    ,

    As mentionned in the datasheet device you expect the following :

    – 0.43 μA Stop mode (16 wakeup lines)

    – 0.86 μA Stop mode + RTC + 20 KB RAM retention)

    To reproduce the same power consumption value measured, you should apply the same conditions described in the '6.3.4 supply current characteristics' part.

    I presume the you missed to configureAll I/O pins in analog input mode before entering the low power mode.

    you would follow this recommandation.

    If the answer is correct, press correct.

    -Walid F-

    ron239955_stm1_st
    Associate III
    December 13, 2016
    Posted on December 13, 2016 at 20:51

    Hi Walid

    Maybe I didn't explain the situation very well.  The entire board is running at 5 uA in stop mode with RTC and RAM, including the power supply, a LoRa radio and a few other parts besides (LPTIM is also running to count pulses during stop mode) .  So I'm reasonably happy with that.  (It's not possible to isolate measurement of mcu consumption on the board) The GPIO configuration is probably ok (I'm aware of low power mode requirements in that regard). However the 5 uA current is only achieved after an initial power down reset (disconnect and reconnect the power supply). It's a different story when the board restarts after flashing (via SWD) without a power recycle. In that case the board is consuming around 135 uA in stop mode.  So am looking for ideas on how to track that down and/or resolve. The issue seems unlikely to be directly related to pin consumption as the configuration in that regard is of course the same after starting via any reset mode. Thanks, Ron.

    Walid FTITI_O
    Visitor II
    December 14, 2016
    Posted on December 14, 2016 at 11:24

    Hi Ron, 

    You would share the main code of the application ( the part which commande the state machine of power cycle / reset/ wakeup ..and the low power mode configuration ..) to be able to help you on the subject. 

    -WAlid F-

    Jaroslav BECKA
    Jaroslav BECKABest answer
    ST Employee
    December 20, 2016
    Posted on December 20, 2016 at 16:18

    Hi Ron

    Have you tried the example from STM32CubeL0 FW package?(STM32Cube\Repository\STM32Cube_FW_L0_V1.7.0\Projects\STM32L073RZ-Nucleo\Examples\PWR\PWR_STOP)

    What consumption do you have with this example?

    One thing which is removed after power-on reset is debug support in low power modes. In this case it is not enough to just comment the corresponding lines in the code. 

    Also be sure to check 'Reset and run', 'Reset after download' or similar option in your IDE.

    ron239955_stm1_st
    Associate III
    December 20, 2016
    Posted on December 20, 2016 at 19:32

    Hi Jaroslav, thanks, your point about debug support in low power modes is exactly what I was hoping for. So I implemented a debug de-initialisation function that has solved the problem!  As follows:

    /**

    * @brief This function Deinitializes Debug

    * @param None

    * @retval None

    */

    void HW_debug_DeInit(void) {

    /* sw interface off*/

    GPIO_InitTypeDef GPIO_InitStructure;

    GPIO_InitStructure.Mode = GPIO_MODE_ANALOG;

    GPIO_InitStructure.Pull = GPIO_NOPULL;

    GPIO_InitStructure.Pin = (GPIO_PIN_13 | GPIO_PIN_14);

    HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);

    __HAL_RCC_DBGMCU_CLK_ENABLE( );

    HAL_DBGMCU_DisableDBGSleepMode( );

    HAL_DBGMCU_DisableDBGStopMode( );

    HAL_DBGMCU_DisableDBGStandbyMode( );

    __HAL_RCC_DBGMCU_CLK_DISABLE( );

    }

    It is now possible to flash the device whilst retaining RTC backup register contents, which is very useful for the particular application.

    The goal now is to possibly reduce the board's stop mode current even further and also run time power consumption. Longer delays in the radio stack in particular I think could benefit from a sleep based approach.

    In any case, thanks again for taking the time to help.  Best wishes, Ron.