Showing results for 
Search instead for 
Did you mean: 

Stop mode power draw increases after configuring ADC

Posted on January 23, 2017 at 18:59



The original post was too long to process during our migration. Please click on the attachment to read the original post.
Posted on January 25, 2017 at 10:38

No ideas out there at all on this one? What checklist do people use when trying to optimise power consumption in their projects? There's got to be something big and obvious that I am missing here.

Andreas Mroß
Posted on February 08, 2017 at 08:54

I have a very similar problem. I'm using the STM32L051.

Wehn I go to the Stop mode and I don't use the ADC before my circuit draws 2.5µA. When I switch on the ADC und make one measurment of the internal reference before I go to the standby with the HAL und disable it after using also the HAL it draws around 15µA.

I able to bring it down to 4µA when I deconfigure the Vrefint ADC channel because there is some buffer which is not automatically disabled when entering stop mode or disabling the ADC.

But I want to get rid of the remaining 1.5µA. I don't know what is also activated and has to be manually deactivated - I didn't found anything else. It seems that there is something outside of the ADC switched on because resetting the ADC peripheral did not help.
Posted on February 08, 2017 at 11:12

Hi Andreas

I ended up giving up on the HAL for this and rewriting using the LL libraries. For me, this has been a bit of a learning curve but it's now much easier to work with and my code is around a third of the size. Disabling Vrefint is definitely a good idea, as is checking whether the internal temperature sensor is enabled. You may also want to take a look at the low power mode settings - low-power run mode is incompatible with the ADC being used and as such it may be that the HAL is also not enabling further low power savings in stop / standby.

Another useful hint here is to do register-by-register comparisons between code that you're happy with current consumption-wise and the HAL ADC code. Step through and take a look at the differences in register settings - I learned more about the internal functionality of the peripherals doing this than any other attempt I made. This also gives you useful things to search for in the programming reference manual for your target MCU (


Good luck!

Posted on February 08, 2017 at 11:38

Did it help you with your drawn power? Do you get your 2.5uA back?

Writing my own ADC driver would be my next task. It should be not do complicated for one measurement.

Many thanks.

Posted on February 08, 2017 at 12:22

Yup, I actually got more - I'm down to 1.5uA by optimising more aspects (which were easier to see with the LL drivers). I would recommend taking a look at the LL drivers rather than writing your own ADC driver - they seem very complete and are easy to understand (they are mostly just preprocessor macros).

Jan Beckendorf
Associate II
Posted on July 06, 2017 at 09:13

Also ran into that issue on an STM32L0 - HAL automatically activates ADC_CCR_TSEN for the Temperature sensor and ADC_CCR_VREFEN for the VRefInt channels, if those are configured for conversion and (at least in my case) DMA.

'Manually' clearing the bits before entering STOPMode does not work, but 'disabling the selected rank (selected channel) from sequencer', if used in the correct power down sequence, does:

void ADC_Desequence_Powerhungry_Channels(void)


  ADC_ChannelConfTypeDef sConfig;

    /**Configure for the selected ADC regular channel NOT to be converted.



  sConfig.Rank = ADC_RANK_NONE;  // Disable the selected rank (selected channel) from sequencer

  if (HAL_ADC_ConfigChannel(&hadc, &sConfig) != HAL_OK)


    _Error_Handler(__FILE__, __LINE__);


    /**Configure for the selected ADC regular channel NOT to be converted.


  sConfig.Channel = ADC_CHANNEL_VREFINT;

  sConfig.Rank = ADC_RANK_NONE;  // Disable the selected rank (selected channel) from sequencer

  if (HAL_ADC_ConfigChannel(&hadc, &sConfig) != HAL_OK)


    _Error_Handler(__FILE__, __LINE__);


Lukasz Nowak
Associate III
Posted on September 01, 2017 at 01:05

I have just run into the same problem, but on L4. After ADC was first initialized, in STOP2 mode I was getting around 20uA consumption. Without ADC, it was 1.2uA as per datasheet.

But it turns out that L4 has a completely different ADC driver to L0. The method with ADC_RANK_NONE does not exist in it. Clearing VREF_EN, CH17_SEL, CH18_SEL bits in CCR manually does not fix the problem either. The LL driver does not have any support for the internal channels.

Luckily, it seems that calling HAL_ADC_DeInit() before entering stop mode fixes the issue. Of course, the init/calibrate sequence needs to be run after wake-up.

It's a bit of a shame that drivers for a low-power mcu don't have a proper procedure of entering and exiting the sleep/stop mode. And none of the examples mention having to disable anything manually before stopping.

Posted on October 03, 2017 at 16:30

this patch is working on STM32L031

Posted on November 28, 2017 at 12:52

Had similar issue (ADC and DMA) and this patch also worked for my SMT32L063. Thanks!

Now I still having some interesting behavior. I have the MCU + ADC + RTC with Wakeup Timer. At the first 'loop', the MCU initi all peripherals, some some minimal tasks and goes to Stop mode.. at this point I measure 1.2uA. Now, after the MCU wakes-up by the RTC Timer, it does only a HAL_Delay() and goes back to Stop Mode, drawing 2.0uA.

I've tried disabling all peripherals but the RTC and it stills increase by 0.8uA the consumption in Stop Mode after the first Timer Wake-up... does anybody has experienced something similar?