cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0 sleep or standby mode excessive consumption

michelemancini2
Associate III
Posted on September 27, 2012 at 11:26

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 code

flashes

a led blue 10

times

and

after

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!!!.

1 REPLY 1
frankmeyer9
Associate II
Posted on September 29, 2012 at 16:57

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.