-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stm32f412 and stm32f413 have a 48MHz clock for SDMMC or USB #82259
base: main
Are you sure you want to change the base?
Conversation
from the stm32f412 refman: |
3ad12a8
to
e310f52
Compare
r = -ENOTSUP; | ||
} | ||
break; | ||
#endif /* STM32_SRC_PLLI2S_R */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#endif /* STM32_SRC_PLLI2S_R */ | |
#endif /* STM32_SRC_PLLI2S_Q */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
e18880e
to
a3a6547
Compare
Adding a testcase for the 48MHz clock configuration
Tested on a stm32f413h_disco,
|
1bd032d
to
9445b8c
Compare
|
9445b8c
to
5838848
Compare
#if STM32_PLLI2S_Q_ENABLED | ||
/* There is a Q divider on the PLLI2S to configure the PLL48CK */ | ||
LL_RCC_PLLI2S_ConfigDomain_48M(get_pll_source(), | ||
plli2sm(STM32_PLLI2S_M_DIVISOR), | ||
STM32_PLLI2S_N_MULTIPLIER, | ||
plli2sq(STM32_PLLI2S_Q_DIVISOR)); | ||
#endif /* STM32_PLLI2S_Q_ENABLED */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is currently no configuration of main PLL Q channel. You should also add the LL_RCC_PLL_ConfigDomain_48M function in the config_pll_sysclock function.
5838848
to
842950e
Compare
with new commit 7ffa15a to get the 48MHz freq |
94d53ee
to
a0cb61f
Compare
Add the configuration of the PLL I2S_Q of the PLLI2S to set the PLL48MHz clock which feeds the USB, SDMMC, RNG through the RCC_DCKCFGR2 register. Signed-off-by: Francois Ramu <[email protected]>
There is a Q-divider factor [2..15] for the stm32f412 serie which supplies the 48MHz clock. Signed-off-by: Francois Ramu <[email protected]>
Add a clk48Mhz node to the stm32f412 serie. This clock is sourced by PLL_Q (default) or PLLI2S_Q That 48MHz clock is used by the USB /SDMMC/RNG peripherals. Signed-off-by: Francois Ramu <[email protected]>
Add a function to compute the clock48 from the clock tree of a stm32f412/f413 mcu. The value depends on its clock source Requires to identify the PLL source HSE or HSI. Signed-off-by: Francois Ramu <[email protected]>
Add a testcase for the stm32F412 or stm32F413 configuring the SDIO clock at 48MHz from the PLLI2S Tested on the stm32f413h disco kit. Signed-off-by: Francois Ramu <[email protected]>
a0cb61f
to
9c145f9
Compare
Add the clock configuration for the 48MHz for the stm32f412 or stm32f413 devices
Both have a clock 48MHz which source is PLL Q or PLL I2S Q
This 48MHz clock is feeding the USB or RNG or SDMCC peripherals
Fixes #78816