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 <jordan@embeint.com>
This commit is contained in:
Jordan Yates 2025-03-17 20:37:23 +10:00 committed by Benjamin Cabé
commit 65bc07c95e

View file

@ -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()