AnsweredAssumed Answered

Watchdog reset when changing SYSCLK

Question asked by rasmussen.brian on Oct 20, 2011
Hi

I have a strange and annoying problem with an STM32L151CB uC.

I'm putting the device into STOP mode, and I wake it up again either by an RTC WakeUp IRQ (on EXTI20) or by two other EXTI's (button inputs).
In "normal mode" the device is waked up by the RTC for 300ms and in STOP mode for 2,7s. This cycle is running fine and it is running on the MSI clock.

If I then press the button, the uC wakes up and selects the HSI clock as SYSCLK. In 95% of the time this works as expected but in the last 5% of the times, the uC gets stucked in the "RCC_SYSCLKConfig" function. As soon as the uC writes to the "RCC->CFGR" register it never returns again and the watchdog will reset it after a few secs.

Watchdog time is set to 5s and it is always "kick'ed" just before the uC goes into STOP mode. All EXTI's are recognized correct and the uC wakes up as expected. I have verified the troublesome instruction above by toggling an output pin.

Anyone seen behavior like this before?

Any ideas / help would be great.

Thanks in advance.

Best regards
Brian Rasmussen

Outcomes