cancel
Showing results for 
Search instead for 
Did you mean: 

processor crashes after wake up from sleep STM32L151

Mikhail Polyakov
Associate II
Posted on July 01, 2012 at 10:01

I use sleep mode WFI.

After wake by interrupt I switch on HSI , switch system clock to HSI,  and just after it processor performs 5-10 lines and stuck(stop)

The effect is very

unstable, it stuck in different moments, sometimes not stuck at all.

So , I can not exactly determine the place where problem happens.

I only know that :

1) If I do not use sleep mode, there is no problem.

2) If I do not switch to HSI,   there is no problem.

3)Problem can occur  only just after wake up and switch on HSI.  If  processor have successfull run throw first moment after wake up, it will never stop.

I switch to HSI the same way :

RCC_CR_MASK=RCC->CR;

 RCC_CR_MASK |=RCC_CR_HSION;

 RCC->CR=RCC_CR_MASK;  

while(!(RCC->CR & RCC_CR_HSIRDY)){}   //now HSI is ON

RCC_CFGR_MASK=RCC->CFGR;

RCC_CFGR_MASK &=~RCC_CFGR_SW;

RCC_CFGR_MASK |= RCC_CFGR_SW_HSI;

RCC->CFGR=RCC_CFGR_MASK    //now system clock is HSI

 I think, that this problem , as it is so unstable, is connect with hardware.

But no

other thoughts 

do not come in my head.

Can

anyone

suggest anything

?

#processor-crush-sleep-wake-up
1 REPLY 1
frankmeyer9
Associate II
Posted on July 02, 2012 at 10:14

Could it be a brown-out, caused by the power supply ?

Wake-up from sleep should cause a significant load change, i.e. an increased current consumption.

...as it is so unstable...

This, at least, could point in that direction.