From c46a940c3a522c35dbf390bc54ba0fc4d133d884 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Mon, 16 Dec 2019 19:10:51 +0200 Subject: [PATCH] Enable DBGMCU in sleep modes. --- src/cmsis/src/st/system_stm32fxxx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cmsis/src/st/system_stm32fxxx.c b/src/cmsis/src/st/system_stm32fxxx.c index a4e8801a6..ad752220d 100644 --- a/src/cmsis/src/st/system_stm32fxxx.c +++ b/src/cmsis/src/st/system_stm32fxxx.c @@ -167,6 +167,12 @@ void SystemInit(void) /* dpgeorge: enable 8-byte stack alignment for IRQ handlers, in accord with EABI */ SCB->CCR |= SCB_CCR_STKALIGN_Msk; + + #if defined(MCU_SERIES_4) || defined(MCU_SERIES_F7) + DBGMCU->CR |= DBGMCU_CR_DBG_SLEEP; + #elif defined(MCU_SERIES_H7) + DBGMCU->CR |= DBGMCU_CR_DBG_SLEEPD1; + #endif } void SystemClock_Config(void)