soc: st: warn if running with debug on sleep enabled

Add a compiler warning when building for an STM32 series MCU with PM
enabled but STM32_ENABLE_DEBUG_SLEEP_STOP=y. That option greatly
increases the power consumption during sleep, which is probably
undesirable when building with PM=y, and it can be activated silently
as a side effect of other options (namely RTT) making it tricky to find
out.

Add a warning to expose the situation.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
Fabio Baltieri 2024-12-17 23:28:52 +00:00 committed by Benjamin Cabé
commit b33b3b17f7

View file

@ -16,6 +16,15 @@
#include <stm32_ll_bus.h>
#include <stm32_ll_pwr.h>
#if CONFIG_PM
#if !defined(CONFIG_DEBUG) && defined(CONFIG_STM32_ENABLE_DEBUG_SLEEP_STOP)
#warning "Running with PM=y and STM32_ENABLE_DEBUG_SLEEP_STOP=y, \
this will result in increased power consumption during sleep."
#endif
#endif /* CONFIG_PM */
/**
* @brief Perform SoC configuration at boot.
*