2012-09-27 02:26 AM
Hi,
I use the STM32F0 Discovery. I disconnect jump JP2 and connect ammeter. I build a simple program in IAR: int main() { DWORD i; UINT16 j; SystemInit(); SystemCoreClockUpdate(); init_hardware(); for(j=0;j<10;j++){ GPIO_SetBits(GPIOC,GPIO_Pin_8); for(i=0;i<200000;i++); GPIO_ResetBits(GPIOC,GPIO_Pin_8); for(i=0;i<200000;i++); } PWR_EnterSTANDBYMode(); while(1){ GPIO_SetBits(GPIOC,GPIO_Pin_9); for(i=0;i<200000;i++); GPIO_ResetBits(GPIOC,GPIO_Pin_9); for(i=0;i<200000;i++); }//while } I set the clock : *============================================================================= *============================================================================= * System Clock source | HSI *----------------------------------------------------------------------------- * SYSCLK(Hz) | 8000000 *----------------------------------------------------------------------------- * HCLK(Hz) | 8000000 *----------------------------------------------------------------------------- * AHB Prescaler | 1 *----------------------------------------------------------------------------- * APB Prescaler | 1 *----------------------------------------------------------------------------- * HSE Frequency(Hz) | NA *---------------------------------------------------------------------------- * PLLMUL | NA *----------------------------------------------------------------------------- * PREDIV | NA *----------------------------------------------------------------------------- * Flash Latency(WS) | 0 *----------------------------------------------------------------------------- * Prefetch Buffer | ON *----------------------------------------------------------------------------- I compile and download code in the flash , The first part of codeflashes
a led blue 10times
andafter
it goes to sleep
. The sleep mode works, in fact the rest of code (after the sleep condition) doesn't run. After the sleep command, the STM32F0 consumes 5mA; in stand by mode, it consumes 2mA, instead of uA!!!.2012-09-29 07:57 AM
I found a somehow matching comment in the LPC1227 user manual (UM10441). It states that sleep mode consumtion measurements are rather worthless on any M0 with a debugger attached.
So I would at least detach the STLink connection by removing the two associated jumpers, before trying again.