Non-Volatile Memory Version 3 (NVM3) Usage Scenarios#
The Non-Volatile Memory Version 3 (NVM3) driver provides a robust and efficient mechanism for persistent data storage on embedded systems such as SiWx917.
It supports wear leveling, fault tolerance, and multiprotocol access while allowing developers to store configuration data, logs, counters, and cryptographic credentials across power cycles.
The following examples illustrate how NVM3 can be applied in real-world IoT and multiprotocol applications.
1. Storing Device Configuration and Settings#
Use NVM3 to store Wi-Fi credentials, network configurations, device IDs, calibration data, and operational parameters.
This approach ensures that critical configuration data is retained across resets or firmware upgrades.
Example: Storing Wi-Fi credentials on SiWx917.
// Define a unique key for your WiFi configuration
#define NVM3_KEY_WIFI_CONFIG 0x1001
typedef struct {
    char ssid[32];
    char password[64];
    uint8_t securityMode;
} WifiConfig_t;
//Configuration data
WifiConfig_t myConfig = {
    .ssid = "MyNetwork",
    .password = "MySecurePassword",
    .securityMode = 2 
};
//Function to store Configs
err_code = nvm3_writeData(nvm3Handle, NVM3_KEY_WIFI_CONFIG, &myConfig, sizeof(myConfig));
if (err_code != ECODE_OK) {
    // Handle error: Write failed
}2. Persisting Application State and User Data#
Use NVM3 to preserve essential application data that must survive power cycles or system resets. Examples include user preferences, device pairing information, application-specific settings, and usage history.
Example Use Cases:
Saving user profiles and preferences in connected devices.
Retaining Bluetooth pairing data after reboot.
Storing configuration settings for industrial or consumer IoT devices.
Keeping operational counters and system runtime statistics persistent across sessions.
Tip: Organize NVM3 keys by functional category (such as,
0x1000–0x1FFFfor configuration or0x2000–0x2FFFfor user data) to simplify versioning and data management.
3. Data Logging and Event Recording#
NVM3 provides an efficient mechanism for data logging and event tracking, even with frequent writes. Using counter objects allows incremental updates while minimizing flash wear and maintaining consistent performance.
Typical Use Cases:
Logging sensor readings, time stamps, or error events.
Tracking power consumption, temperature variations, or usage patterns.
Storing periodic operational statistics for analysis or diagnostics.
Example Applications:
Smart meters or energy monitors recording usage over time.
Environmental sensors storing temperature or humidity trends.
Industrial machines logging maintenance or failure events.
Tip: Use smaller objects and counters for frequent updates to extend flash life and optimize performance.
4. Security and Encryption Key Storage#
Use NVM3 to store cryptographic keys, certificates, and sensitive credentials securely in flash memory. This ensures secure device authentication and encryption, even after power cycles or firmware upgrades.
Example Use Cases:
Storing Wi-Fi or TLS credentials for secure network connectivity.
Managing device certificates for cloud authentication.
Retaining API keys or encryption tokens used by secure applications.
When using external flash, enable hardware encryption or access control mechanisms for additional security.
Note: Always encrypt sensitive data before storing it in NVM3 if hardware protection is not enabled.
5. Multiprotocol Applications#
NVM3 supports shared storage instances across multiple communication stacks (for example, Wi-Fi, Bluetooth LE, and Matter).
This unified storage model enables different subsystems to access and manage persistent data efficiently.
Example Applications:
Wi-Fi + BLE combo devices sharing provisioning data between stacks.
Matter-over-Wi-Fi applications using shared credentials across protocols.
IoT gateways maintaining centralized configuration data accessible to multiple communication modules.
Advantage:
Unified NVM3 storage reduces redundancy, simplifies synchronization, and saves flash memory in multiprotocol systems.
Overview of NVM3 and LittleFS#
In addition to NVM3, developers can use the Little File System (LittleFS) for file-based storage. Both solutions provide persistent data management but target different use cases:
Feature  | NVM3  | LittleFS  | 
|---|---|---|
Data Organization  | Key–value pairs  | File system  | 
Primary Use  | Configuration data, parameters, counters  | General-purpose file storage  | 
Target Platform  | Optimized for Silicon Labs devices and stacks  | Portable across various MCUs with flash storage  | 
Object/File Size  | Up to 4 KB per object  | Files up to ~1 MB on SiWx917 devices  | 
API Style  | Dedicated NVM3 APIs (compatible with Silicon Labs Token/PSM APIs)  | Standard file APIs (  | 
Memory Usage  | Configurable cache, application-managed buffers  | Small footprint with built-in memory management  |