Skip to content

Commit

Permalink
stm32/powerctrlboot: Allow PLL1 Q and R outputs to be enabled on H5.
Browse files Browse the repository at this point in the history
If a board needs these outputs then it can define MICROPY_HW_CLK_PLLQ/R.

It saves power to not enable them if they are not needed.

Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed Sep 20, 2023
1 parent fa68523 commit a3862e7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ports/stm32/powerctrlboot.c
Expand Up @@ -218,13 +218,21 @@ void SystemClock_Config(void) {

// Configure PLL1 for use as system clock.
LL_RCC_PLL1_ConfigDomain_SYS(pll1_source, MICROPY_HW_CLK_PLLM, MICROPY_HW_CLK_PLLN, MICROPY_HW_CLK_PLLP);
LL_RCC_PLL1_SetQ(MICROPY_HW_CLK_PLLQ);
LL_RCC_PLL1_SetR(MICROPY_HW_CLK_PLLR);
LL_RCC_PLL1_SetFRACN(MICROPY_HW_CLK_PLLFRAC);
LL_RCC_PLL1_SetVCOInputRange(MICROPY_HW_CLK_PLLVCI_LL);
LL_RCC_PLL1_SetVCOOutputRange(MICROPY_HW_CLK_PLLVCO_LL);
LL_RCC_PLL1P_Enable();

#if defined(MICROPY_HW_CLK_PLLQ)
LL_RCC_PLL1_SetQ(MICROPY_HW_CLK_PLLQ);
LL_RCC_PLL1Q_Enable();
#endif

#if defined(MICROPY_HW_CLK_PLLR)
LL_RCC_PLL1_SetR(MICROPY_HW_CLK_PLLR);
LL_RCC_PLL1R_Enable();
#endif

// Enable PLL1.
LL_RCC_PLL1_Enable();
while (!LL_RCC_PLL1_IsReady()) {
Expand Down

0 comments on commit a3862e7

Please sign in to comment.