soc: arm: st_stm32: add config to allow debugger attach in sleep/stop modes

Adds CONFIG_STM32_ENABLE_DEBUG_SLEEP_STOP to allow debugger attaching in
sleep/stop mode of STM32 parts. Mainly useful for debugging. Move DBGMCU
from part-sepcific power.c to common soc_config.c. CONFIG_USE_SEGGER_RTT
depends on this as well.

Signed-off-by: Roland Lezuo <roland.lezuo@embedded-solutions.at>
This commit is contained in:
Roland Lezuo 2023-09-14 15:48:43 +02:00 committed by Carles Cufí
commit f4c901b82d
12 changed files with 56 additions and 56 deletions

View file

@ -87,13 +87,6 @@ static int stm32_power_init(void)
/* enable Power clock */
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR);
#ifdef CONFIG_DEBUG
/* Enable the Debug Module during all and any Low power mode */
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_DBGMCU);
LL_DBGMCU_EnableDBGStopMode();
LL_APB1_GRP1_DisableClock(LL_APB1_GRP1_PERIPH_DBGMCU);
#endif /* CONFIG_DEBUG */
return 0;
}