Skip to main content

init_with_flash

Function init_with_flash 

Source
pub async fn init_with_flash<F: NorFlash>(
    flash: F,
    range: Range<u32>,
) -> FlashStorage<F>
Expand description

Initializes the NIB and AIB backed by the given flash region.

Restores all persisted fields on boot; fields never stored (or stored by an incompatible firmware) keep their defaults. Must be called instead of — not in addition to — the plain init() functions. Spawn a task running FlashStorage::run to persist changes.

range must be erase-sector aligned and span at least two sectors so sequential-storage has a spare sector for garbage collection, and must not overlap the firmware image or partition table.