diff --git a/arch/arm/src/stm32h7/Kconfig b/arch/arm/src/stm32h7/Kconfig index 91c66280aa..15ba5312c5 100644 --- a/arch/arm/src/stm32h7/Kconfig +++ b/arch/arm/src/stm32h7/Kconfig @@ -293,6 +293,12 @@ config STM32H7_PWR_DIRECT_SMPS_SUPPLY depends on STM32H7_HAVE_SMPS default n +config STM32H7_PWR_EXTERNAL_SOURCE_SUPPLY + bool "Use external source as power supply" + default n + ---help--- + Select this option for using an external power supply connected directly to the VCAP pin. + choice prompt "STM32 H7 Power Supply Selection" default STM32H7_PWR_DEFAULT_SUPPLY diff --git a/arch/arm/src/stm32h7/stm32h7x3xx_rcc.c b/arch/arm/src/stm32h7/stm32h7x3xx_rcc.c index da7af1f59c..51031027ae 100644 --- a/arch/arm/src/stm32h7/stm32h7x3xx_rcc.c +++ b/arch/arm/src/stm32h7/stm32h7x3xx_rcc.c @@ -148,12 +148,18 @@ # if defined(CONFIG_STM32H7_PWR_DIRECT_SMPS_SUPPLY) # define STM32_PWR_CR3_SELECTION STM32_PWR_CR3_SDEN +# elif defined(CONFIG_STM32H7_PWR_EXTERNAL_SOURCE_SUPPLY) +# define STM32_PWR_CR3_SELECTION STM32_PWR_CR3_BYPASS # else # define STM32_PWR_CR3_SELECTION STM32_PWR_CR3_LDOEN # endif #else # define STM32_PWR_CR3_MASK 0xffffffff -# define STM32_PWR_CR3_SELECTION (STM32_PWR_CR3_LDOEN | STM32_PWR_CR3_SCUEN) +# if defined(CONFIG_STM32H7_PWR_EXTERNAL_SOURCE_SUPPLY) +# define STM32_PWR_CR3_SELECTION (STM32_PWR_CR3_BYPASS | STM32_PWR_CR3_SCUEN) +# else +# define STM32_PWR_CR3_SELECTION (STM32_PWR_CR3_LDOEN | STM32_PWR_CR3_SCUEN) +# endif #endif