Zephyr shell "kernel reboot" command and persistent storage

My application uses NVS to store data and it works just fine - no errors reading or writing ,  and saved data persists between device power cycles.

My application also has the Zephyr shell integrated, and if after writing my data  I send "kernel reboot cold" (or warm) command, my data does not persist after device reboots.

Any ideas why and how to fix?
Thank you

  • Sorry about the delay,

    I don't see any obvious issues, though I see you've modified this line:

    Can you see if you are getting the same issue without a card? 

    And are you getting the same issue with the default sample? You are using the nRF52840 right?

    Regards,

    Elfving

  • No problem

    I do not have an dev board, only the custom board.

    The nvs sample code has a config option

    CONFIG_MPU_ALLOW_FLASH_WRITE=y

    I did not have that in my project
    After I added it the problem <seems> to've gone away. I can save data to flash, then use kernel reboot command (cold or warm) and the data persists
     
    I'm still cautious not to say it's completely gone - will need to do more testing, will update you here.
    What does this config option do? I could not find much documentation on it
    Thank you
  • Figured out the problem (actually my colleague did)
    Apparently the settings module that is used by the mesh stack uses the same nvs  "storage" flash partition as my application.

    The fix was to create an application partition to avoid conflict

  • Ah I see. Glad to hear it! And thanks for updating the thread with the solution.

    Regards,

    Elfving

1 2