This is an automated email from the ASF dual-hosted git repository. davids5 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push: new 517f179f8d stm32h7: Adds the ability to choose the HSI divider, which must be indicated in board.h if used. 517f179f8d is described below commit 517f179f8d7960836e339d80e2e2b92384ede78c Author: Sebastien Lorquet <sebast...@lorquet.fr> AuthorDate: Tue May 17 15:20:35 2022 +0200 stm32h7: Adds the ability to choose the HSI divider, which must be indicated in board.h if used. --- arch/arm/src/stm32h7/stm32h7x3xx_rcc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm/src/stm32h7/stm32h7x3xx_rcc.c b/arch/arm/src/stm32h7/stm32h7x3xx_rcc.c index c6a5f457b8..9462ae2352 100644 --- a/arch/arm/src/stm32h7/stm32h7x3xx_rcc.c +++ b/arch/arm/src/stm32h7/stm32h7x3xx_rcc.c @@ -98,6 +98,10 @@ # define USE_PLL3 #endif +#if defined(STM32_BOARD_USEHSI) && !defined(STM32_BOARD_HSIDIV) +#error When HSI is used, you have to define STM32_BOARD_HSIDIV in board/include/board.h +#endif + /**************************************************************************** * Private Data ****************************************************************************/ @@ -600,6 +604,11 @@ void stm32_stdclockconfig(void) regval = getreg32(STM32_RCC_CR); regval |= RCC_CR_HSION; /* Enable HSI */ + + /* Set HSI predivider to board specific value */ + + regval |= STM32_BOARD_HSIDIV; + putreg32(regval, STM32_RCC_CR); /* Wait until the HSI is ready (or until a timeout elapsed) */