From 65bc07c95e319f64e3c5813f8aba7c63da5a2a2d Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Mon, 17 Mar 2025 20:37:23 +1000 Subject: [PATCH] soc: st: stm32: build warning for `STM32_ENABLE_DEBUG_SLEEP_STOP` Add a warning in the build system if both `CONFIG_PM` and `STM32_ENABLE_DEBUG_SLEEP_STOP` are enabled at the same time. The first is likely only enabled if the SoC is intended to be driven into low power states to save power, while the later prevents the SoC from being as low power as it can be. Signed-off-by: Jordan Yates --- soc/st/stm32/common/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/soc/st/stm32/common/CMakeLists.txt b/soc/st/stm32/common/CMakeLists.txt index 965200f1cfd..6d97ebd9ac0 100644 --- a/soc/st/stm32/common/CMakeLists.txt +++ b/soc/st/stm32/common/CMakeLists.txt @@ -26,3 +26,10 @@ endif() if (CONFIG_STM32_WKUP_PINS) zephyr_sources(stm32_wkup_pins.c) endif() + +if (CONFIG_PM AND CONFIG_STM32_ENABLE_DEBUG_SLEEP_STOP) + message(WARNING "\ +SoC Power Management (CONFIG_PM) enabled but the DBGMCU is still enabled \ +(CONFIG_STM32_ENABLE_DEBUG_SLEEP_STOP). The SoC will use more power than expected \ +in STOP modes due to internal oscillators that remain active.") +endif()