STM32H7: adjust flash latency and programming delay for series in RM0468

This commit is contained in:
Oliver Rockstedt 2023-12-15 14:14:30 +01:00 committed by Dario Nieuwenhuis
parent ac28d39b95
commit abbc2d73c3

View File

@ -832,7 +832,7 @@ fn flash_setup(clk: Hertz, vos: VoltageScale) {
_ => unreachable!(), _ => unreachable!(),
}; };
#[cfg(flash_h7)] #[cfg(all(flash_h7, not(pwr_h7rm0468)))]
let (latency, wrhighfreq) = match (vos, clk.0) { let (latency, wrhighfreq) = match (vos, clk.0) {
// VOS 0 range VCORE 1.26V - 1.40V // VOS 0 range VCORE 1.26V - 1.40V
(VoltageScale::Scale0, ..=70_000_000) => (0, 0), (VoltageScale::Scale0, ..=70_000_000) => (0, 0),
@ -861,6 +861,30 @@ fn flash_setup(clk: Hertz, vos: VoltageScale) {
_ => unreachable!(), _ => unreachable!(),
}; };
// See RM0468 Rev 3 Table 16. FLASH recommended number of wait
// states and programming delay
#[cfg(all(flash_h7, pwr_h7rm0468))]
let (latency, wrhighfreq) = match (vos, clk.0) {
// VOS 0 range VCORE 1.26V - 1.40V
(VoltageScale::Scale0, ..=70_000_000) => (0, 0),
(VoltageScale::Scale0, ..=140_000_000) => (1, 1),
(VoltageScale::Scale0, ..=210_000_000) => (2, 2),
(VoltageScale::Scale0, ..=275_000_000) => (3, 3),
// VOS 1 range VCORE 1.15V - 1.26V
(VoltageScale::Scale1, ..=67_000_000) => (0, 0),
(VoltageScale::Scale1, ..=133_000_000) => (1, 1),
(VoltageScale::Scale1, ..=200_000_000) => (2, 2),
// VOS 2 range VCORE 1.05V - 1.15V
(VoltageScale::Scale2, ..=50_000_000) => (0, 0),
(VoltageScale::Scale2, ..=100_000_000) => (1, 1),
(VoltageScale::Scale2, ..=150_000_000) => (2, 2),
// VOS 3 range VCORE 0.95V - 1.05V
(VoltageScale::Scale3, ..=35_000_000) => (0, 0),
(VoltageScale::Scale3, ..=70_000_000) => (1, 1),
(VoltageScale::Scale3, ..=85_000_000) => (2, 2),
_ => unreachable!(),
};
// See RM0455 Rev 10 Table 16. FLASH recommended number of wait // See RM0455 Rev 10 Table 16. FLASH recommended number of wait
// states and programming delay // states and programming delay
#[cfg(flash_h7ab)] #[cfg(flash_h7ab)]