Expand description
Flash memory controller.
The wait states are not set from here: they have to be raised before the
system clock speeds up, so
UnfrozenRcu::freeze borrows this type
and writes them itself.
Erasing and programming need CTL unlocked, which happens for the body of
Fmc::with_unlocked and no longer. The option bytes are covered too, as a
block: OptionBytes is read, changed and written back whole, because
erasing them takes every byte at once. A written block only takes effect on
the next load, Fmc::reload_option_bytes or a power-up.
ⓘ
let mut fmc = dp.fmc.constrain();
let config = ClockConfig::default().sysclk(SysClk::Pll(PllFreq::Mhz48));
let mut rcu = dp.rcu.constrain().freeze(&mut fmc, config);
fmc.with_unlocked(|f| {
f.erase_page(Page::P63)?;
f.program(Page::P63, 0, 0xDEAD_BEEF)
})?;Structs§
- Fmc
- Owns the flash memory controller.
- Option
Bytes - The option byte block as a whole, read with
Fmc::read_option_bytesand written back withUnlockedFmc::write_option_bytes. - Unlocked
Fmc - The flash controller with
CTLunlocked, borrowed for the body ofFmc::with_unlockedand locked again when that call returns.
Enums§
- Boot1
- The level
BOOT1is taken to have (BOOT1_n, stored inverted). - Error
- What an erase or a program operation failed on.
- Event
- An FMC event that can raise an interrupt.
- Free
Watchdog - Which free watchdog the part starts with (
nWDG_SW). - LowPower
Entry - What entering deep-sleep or standby does (
nRST_DPSLP,nRST_STDBY). - Page
- An erasable 1 KB page of the main flash.
- Protection
Level - How far the option bytes lock the flash against being read out.
- Sram
Parity - Whether the SRAM parity check is on (
SRAM_PARITY_CHECK, stored inverted). - Vdda
Monitor - Whether the supply monitor watches VDDA (
VDDA_VISOR).
Traits§
- FmcExt
- Entry point on the raw peripheral.