Merge pull request #2786 from andelf/fix/stm32wl-msi-crash
Fix crash caused by using higher MSI range as sysclk on STM32WL
This commit is contained in:
commit
7a26cc3764
1 changed files with 7 additions and 0 deletions
|
@ -159,6 +159,13 @@ pub(crate) unsafe fn init(config: Config) {
|
||||||
while RCC.cfgr().read().sws() != Sysclk::MSI {}
|
while RCC.cfgr().read().sws() != Sysclk::MSI {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(stm32wl)]
|
||||||
|
{
|
||||||
|
// Set max latency
|
||||||
|
FLASH.acr().modify(|w| w.set_prften(true));
|
||||||
|
FLASH.acr().modify(|w| w.set_latency(2));
|
||||||
|
}
|
||||||
|
|
||||||
// Set voltage scale
|
// Set voltage scale
|
||||||
#[cfg(any(stm32l0, stm32l1))]
|
#[cfg(any(stm32l0, stm32l1))]
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue