Skip to content

Commit

Permalink
drivers: clock_control: stm32 ll common: fix RCC pll disable
Browse files Browse the repository at this point in the history
The clock_stm32_ll_common.c function set_up_plls calls LL_RCC_PLL_Disable(); and it was not waiting for the disable to complete before trying to configure the pll sysclock which creates a race condition for pll configuration. The wait for re-enabling the RCC pll is already there, it was just missing the wait for the disable before configuration.

Signed-off-by: Benjamin Curtis Byers <[email protected]>
  • Loading branch information
bbyers-UBCO committed Dec 16, 2024
1 parent c96c143 commit b070786
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/clock_control/clock_stm32_ll_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,11 @@ static void set_up_plls(void)
stm32_clock_switch_to_hsi();
LL_RCC_SetAHBPrescaler(ahb_prescaler(1));
}
/* Disable PLL */
LL_RCC_PLL_Disable();
while (LL_RCC_PLL_IsReady() != 0U) {

Check warning on line 574 in drivers/clock_control/clock_stm32_ll_common.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

drivers/clock_control/clock_stm32_ll_common.c:574 please, no spaces at the start of a line
/* Wait for PLL to be disabled */
}

#endif

Expand Down

0 comments on commit b070786

Please sign in to comment.