stm32l1/rcc: set required flash bits for high frequencies
As is done for lots of other families
This commit is contained in:
parent
2310003f39
commit
456b56d4fd
@ -1,5 +1,5 @@
|
|||||||
use crate::pac::rcc::vals::{Hpre, Msirange, Plldiv, Pllmul, Pllsrc, Ppre, Sw};
|
use crate::pac::rcc::vals::{Hpre, Msirange, Plldiv, Pllmul, Pllsrc, Ppre, Sw};
|
||||||
use crate::pac::RCC;
|
use crate::pac::{FLASH, RCC};
|
||||||
use crate::rcc::{set_freqs, Clocks};
|
use crate::rcc::{set_freqs, Clocks};
|
||||||
use crate::time::Hertz;
|
use crate::time::Hertz;
|
||||||
use crate::time::U32Ext;
|
use crate::time::U32Ext;
|
||||||
@ -274,6 +274,13 @@ pub(crate) unsafe fn init(config: Config) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Set flash 64-bit access, prefetch and wait states
|
||||||
|
if sys_clk >= 16_000_000 {
|
||||||
|
FLASH.acr().write(|w| w.set_acc64(true));
|
||||||
|
FLASH.acr().modify(|w| w.set_prften(true));
|
||||||
|
FLASH.acr().modify(|w| w.set_latency(true));
|
||||||
|
}
|
||||||
|
|
||||||
RCC.cfgr().modify(|w| {
|
RCC.cfgr().modify(|w| {
|
||||||
w.set_sw(sw);
|
w.set_sw(sw);
|
||||||
w.set_hpre(config.ahb_pre.into());
|
w.set_hpre(config.ahb_pre.into());
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit c66033b9d220ce6d148a4c90f72acd1118861bb1
|
Subproject commit 97877b42a7b14e753dcb3153221dc1f3865070d1
|
Loading…
Reference in New Issue
Block a user