I've got a project where I'm trying to get the power consumption down as low as possible (on an STM32F103RCT6).
I looked at ST's document on getting the STM32F2 power consumption down as low as possible, and tried to follow its recommendations:
- Setting all unused pins to AIN
- Turn off the ADCs
- Turn off USB
- Using PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFE); to go into STOP mode while being able to wake up with EXTI
Thing is, power draw is still 4.6mA (down from 15 in standard _WFI sleep, and around 30 when actually doing stuff). The datasheets seem to suggest that power consumption in STOP should be under 0.5mA.
I've put a scope on the external oscillator and that does indeed stop.
Is there anything obvious I'm missing? Is there any way for me to check what could be causing the extra power draw?
UPDATE: I've come up with a very simple test program, derived from ST's example code:
#include "stm32f10x.h"
GPIO_InitTypeDef GPIO_InitStructure;
int main(void)
{
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB |
RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD |
RCC_APB2Periph_GPIOE, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_Init(GPIOB, &GPIO_InitStructure);
GPIO_Init(GPIOC, &GPIO_InitStructure);
GPIO_Init(GPIOD, &GPIO_InitStructure);
GPIO_Init(GPIOE, &GPIO_InitStructure);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB |
RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD |
RCC_APB2Periph_GPIOE, DISABLE);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR | RCC_APB1Periph_BKP, ENABLE);
while (1) PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
}
Power draw with this is still 4.3mA. I've checked the circuit too - it's REALLY basic and I've measured the voltage across every resistor (and it's zero).
Any ideas? I'm currently thinking that it's actually the LD1117 voltage regulator that's at fault!