Module nvm

Source
Expand description

§Non-volatile Memory Controller

This module allows users to interact with non-volatile memory controller.

Nvmctrl is an intermediary between memory buses and physical non-volatile memory. It provides means of managing a flash memory content, its properties (cache, wait states, bootloader blocks protection), power management and address remapping if necessary (in case bank mechanism is used). It also provides an indirection mechanism to achieve non-volatile RAM-like memory within last sectors of a physical flash (More in smart_eeprom module).

NVM supports splitting flash into two sections (opt-in feature) called banks. Bank considered active is mapped to virtual address 0x0, meaning it contains currently executed application. Through NVM command & control interface, banks can be swapped and MCU reset, so the firmware from the other bank will run after restart.

Module features:

  • Erase & write over non-volatile memory in a device.
  • Swap banks

Modules§

smart_eeprom
SmartEEPROM

Structs§

CalibrationArea
POD-style struct representing NVM calibration area
Nvm
Non-volatile memory controller
RawUserpage
Raw userpage POD struct that exposes bitfields via methods
TemperaturesCalibrationArea
POD-style struct representing NVM calibration area for temperature calibration

Enums§

Bank
Flash banks identified by which one we boot from.
Error
Driver errors
PeripheralError
Errors generated by the NVM peripheral
PhysicalBank
Physical flash banks
Prmselect
Power Reduction Mode during Sleep
UserpageStatus
The outcome of Nvm::modify_userpage
WriteGranularity
Data written per command

Constants§

BLOCKSIZE
Size of one block
PAGESIZE
Size of a page in bytes
QUADWORDSIZE
Size of a quad word

Functions§

retrieve_bank_size
Retrieve a bank size using HW registers
retrieve_flash_size
Retrieve a total NVM size using HW registers

Type Aliases§

Result
NVM result type
Userpage
Type alias to the userpage with a concrete underlying storage type