2012-07-01 01:01 AM
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 ONRCC_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-up2012-07-02 01:14 AM
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.