Why does RCC_APB1ENR:TIM2_EN get cleared in Stop Mode when DBGMCU is set?
We noticed that our TIM2 did not count after our STM32L152 went to Stop Mode and woke up again.
When we analyzed the problem, we found that our debug probe set DBGMCU to DBG_STANDBY | DBG_STOP | DBG_SLEEP. When we power cycled the µC or set DBGMCU to 0 in our start-up code, it worked as expected. A closer look revealed that RCC_APB1ENR:TIM2_EN got cleared by/during Stop Mode when DBGMCU was set. Without DBGMCU it remained set. Is this documented and intended behavior? Did we miss something?
Btw., we use external clock source mode 2, but I think this is not relevant for this issue.
