🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5 stack paper stop storing data in preferences?

    PRODUCTS
    1
    1
    201
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ScheduleDisplayS
      ScheduleDisplay
      last edited by

      Hello,

      I am using Preferences.h to store data on my M5 Stack Paper, such as Wi-Fi credentials, during my application's setup. It was working fine.
      During development and testing, I have rewritten the data in Preferences multiple times on this device. However, I recently noticed that new data is no longer being stored in Preferences, even though there is still available space, as confirmed by running the following code.

      #include <Preferences.h>
      .
      .
      .
      
      void checkWifiCredentialsAndDecide(){
        preferences.begin("wifiCredentials", false);
      
       if(debugFlag){
          size_t whatsLeft = preferences.freeEntries();   
          Serial.printf("Available enteries in the namespace table.\n" );
          Serial.println(whatsLeft);
          preferences.putString("test1", "test 1 value"); 
          Serial.println("preferences.getString(test1): " + String(preferences.getString("test1", "Default value")));
       }
      .
      .
      .
      }
      
      Output
      
      Available enteries in the namespace table.
      127
      preferences.getString(test1): Default value // I am expecting to see "test 1 value"
      

      I have read that the NVS (Non-Volatile Storage) has a write cycle limitation of approximately 10,000 to 100,000 cycles.
      I have a few questions:
      Is there a way to check how many write cycles are remaining?
      Can I check if my flash memory is healthy or corrupted?
      Is it possible that the flash memory of my M5 Stack Paper has worn out?

      Thank you

      1 Reply Last reply Reply Quote 0
      • First post
        Last post