Skip to content

Commit

Permalink
stm32/powerctrlboot: Allow using PLL3 for USB clock on H5 MCU's.
Browse files Browse the repository at this point in the history
A board should enable MICROPY_HW_CLK_USE_PLL3_FOR_USB to use this feature.

Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed Sep 13, 2023
1 parent 60e0ef6 commit 67b1c81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ports/stm32/powerctrlboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ void SystemClock_Config(void) {
powerctrl_config_systick();

// USB clock configuration, either HSI48 or PLL3.
#if 1
#if MICROPY_HW_ENABLE_USB && !MICROPY_HW_CLK_USE_PLL3_FOR_USB

// Enable HSI48.
LL_RCC_HSI48_Enable();
Expand All @@ -267,7 +267,7 @@ void SystemClock_Config(void) {
| __HAL_RCC_CRS_RELOADVALUE_CALCULATE(48000000, 1000) << CRS_CFGR_RELOAD_Pos;
CRS->CR = 0x20 << CRS_CR_TRIM_Pos | CRS_CR_AUTOTRIMEN | CRS_CR_CEN;

#else
#elif MICROPY_HW_ENABLE_USB && MICROPY_HW_CLK_USE_PLL3_FOR_USB

// Configure PLL3 for use by USB at Q=48MHz.
LL_RCC_PLL3_SetSource(LL_RCC_PLL3SOURCE_HSE);
Expand Down

0 comments on commit 67b1c81

Please sign in to comment.