Skip to main content
KRuss.1
Associate
Jul 20, 2022 8:18 PM UTC
Question

Why does sleep current increase significantly after 3 minutes?

I am having the exact issue experienced by Carole Jacquinot in this post: https://community.st.com/s/question/0D50X00009XkWxASAV/why-there-is-an-increased-current-consumption-after-3-minutes-during-stop-mode-with-rtc-with-hal-driver

Some additional information in my situation is that it has nothing to do with I/O pins. They are all accounted for. If I do a reset, configure the I/O and then go directly to sleep, the high-current behavior does not occur. Any ideas?

This topic has been closed for replies.

7 replies

Andrew Neil
Super User
Jul 21, 2022 9:36 AM UTC

Please post a trace of the supply current - as Carole Jacquinot did.

Do you have a timer or Watchdog that could explain the 3 minutes (ie, 180s)?

"in my situation ... it has nothing to do with I/O pins"

how have you verified that?

"If I do a reset, configure the I/O and then go directly to sleep, the high-current behavior does not occur"

So look at what your "real" code does in addition to that test case.

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.
KRuss.1
KRuss.1Author
Associate
Aug 30, 2023 12:18 PM UTC

I discovered the source of this issue. It is a problem with the way the ADC peripheral is de-initialized in Cube. Reversing the initialization does not return the ADC to its original reset state. You have to perform an ADC hardware  reset, or it will start to draw current about three minutes into a sleep state. This problem is likely rooted in a silicon error, because a hard reset should not be necessary.

The way to fix it is to go to the HAL_StatusTypeDef HAL_ADC_DeInit(ADC_HandleTypeDef* hadc) function and find the lines:
/* Reset register CALFACT */
hadc->Instance->CALFACT &= ~(ADC_CALFACT_CALFACT);
And directly after, add the lines:
__HAL_RCC_ADC1_FORCE_RESET();
__HAL_RCC_ADC1_RELEASE_RESET();

This will reset the entire ADC system, so if you have other ADC processes going, you will want to consider this.

Tesla DeLorean
Guru
Aug 30, 2023 12:28 PM UTC

@STOne-32 interesting observations related too STM32L073RZ ?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
STOne-32
ST Technical Moderator
Aug 30, 2023 5:19 PM UTC

Hi @Tesla DeLorean ,

Thank you for the flag much appreciated and many thanks for @KRuss.1 for the findings . We escalated this case internally with this tracking number #160332.

Have a great day,

STOne-32.

Visitor II
Nov 20, 2023 2:05 PM UTC

I'm facing the same problem with rising supply current after about 3 minutes - STM32L010RB. So far there is no reference in the errata sheet. What is the current status of the investigation?