Skip to content

Commit 22186c7

Browse files
manoj153carlescufi
authored andcommitted
soc: arm: st_stm32: use SMPS power supply only if enabled
Use SMPS power supply only if enabled. The default power supply configuration for the NUCLEO board with -Q subfix is SMPS, so it's essential to match with hardware configuration to avoid deadlocks due to mismatch. if a custom board with LDO configuration is in use, then no need to enable `CONFIG_POWER_SUPPLY_SMPS` Signed-off-by: Manojkumar Subramaniam <[email protected]>
1 parent 86a6280 commit 22186c7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

soc/arm/st_stm32/stm32h7/soc_m7.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ static int stm32h7_init(const struct device *arg)
8080
SystemCoreClock = 64000000;
8181

8282
/* Power Configuration */
83-
#ifdef SMPS
83+
#if defined(SMPS) && defined(CONFIG_POWER_SUPPLY_SMPS)
8484
LL_PWR_ConfigSupply(LL_PWR_DIRECT_SMPS_SUPPLY);
85+
#elif defined(CONFIG_POWER_SUPPLY_SMPS)
86+
#error Unsupported configuration: Selected SoC do not support SMPS
8587
#else
8688
LL_PWR_ConfigSupply(LL_PWR_LDO_SUPPLY);
8789
#endif

0 commit comments

Comments
 (0)