diff options
| author | iabdalkader | 2020-12-08 00:22:17 +0200 |
|---|---|---|
| committer | Damien George | 2020-12-17 23:04:42 +1100 |
| commit | 32d76e5de66237eba456975095f998434413467a (patch) | |
| tree | 81199e72a63c4c6b971dbdffc6bd9446e50671fb | |
| parent | 20f8ce19825d1a976f8d61e79e661e67509681bd (diff) | |
stm32/system_stm32: Enable DBGMCU in low-power modes for debug builds.
| -rw-r--r-- | ports/stm32/system_stm32.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ports/stm32/system_stm32.c b/ports/stm32/system_stm32.c index 00b721386..2160e0ac9 100644 --- a/ports/stm32/system_stm32.c +++ b/ports/stm32/system_stm32.c @@ -425,6 +425,11 @@ void SystemClock_Config(void) { HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); NVIC_SetPriority(SysTick_IRQn, NVIC_EncodePriority(NVIC_PRIORITYGROUP_4, TICK_INT_PRIORITY, 0)); #endif + + #if defined(STM32H7) && !defined(NDEBUG) + // Enable the Debug Module in low-power modes. + DBGMCU->CR |= (DBGMCU_CR_DBG_SLEEPD1 | DBGMCU_CR_DBG_STOPD1 | DBGMCU_CR_DBG_STANDBYD1); + #endif } #endif |
