I'm playing with a fairly bare stm32f407 ebay board, and am a bit surprised at the current consumption - which is higher than I expected at 17mA? Googling shows references to 200-250uA/MHz - but perhaps that's not correct at lower-clock frequencies?
Notes -
- The board is powered directly using only the 3.3V output of the stlink SWD
- The board's smd 3.3V regulator has been desoldered.
- There are two leds - with 1k current limiting resistors - they consume at most 2mA - confirmed by watching the current difference with the led blinking.
- The external oscillator was checked to be 8MHz with an oscilloscope
- current measurements were performed with a 1ohm series resistor, and also directly with meter current range
- The slow-clocking code was hacked together by digging through the libopencm3 examples and source. From reading - the main thing is to configure the system clock to use the external oscillator (hse), and to bypass all the pll stuff. Based on the frequency of the blinking led, I believe it's working correctly.
if(false) {
// works - uses 50mA
// hse is the external clock
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
} else if(false) {
// works - uses 25mA
// ok 48mhz - ok - and uart appears to work ok - .
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_48MHZ]);
} else if(true) {
// works - uses 17mA
// Enable external high-speed oscillator - 8MHz.
rcc_osc_on(RCC_HSE);
rcc_wait_for_osc_ready(RCC_HSE);
/* disable high performance mode */
pwr_set_vos_scale(PWR_SCALE2);
// Select HSE as SYSCLK source.
rcc_set_sysclk_source(RCC_CFGR_SW_HSE);
// needed?
rcc_wait_for_sysclk_status(RCC_HSE);
// Set the peripheral clock frequencies used.
rcc_ahb_frequency = 8000000;
rcc_apb1_frequency = 8000000;
rcc_apb2_frequency = 8000000;
// turn internal clock off
rcc_osc_off(RCC_HSI);
}
The only peripheral enabled is for gpio to blink the led,
static void gpio_setup(void)
{
/* Using API functions: */
rcc_periph_clock_enable(RCC_GPIOE);
// setup led open-drain
gpio_mode_setup(GPIOE, GPIO_MODE_OUTPUT, GPIO_OTYPE_OD, GPIO0);
}
Does anyone have experience with expected current consumption? Turning on and using the UART, ADC, DAC only adds a couple more mA.