Adafruit is open, safely ... and shipping all orders at this time! Read more!

non volatile storage
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

non volatile storage

by gingle on Thu Aug 15, 2019 5:44 pm

I am using a metro-m4-express. I would like to be able to store numbers and be able to access them on a reboot. I see where the logging methods use the flash file system. I noticed that a mechanical switch, installed in, is required to change from a read only to read/write from python. Is there a way to use any of the os routines to change read/write without the mechanical switch? Is there any way to store numbers in EEPROM and recover them on reboot?

Posts: 30
Joined: Tue Mar 07, 2017 2:46 pm

Re: non volatile storage

by adafruit_support_mike on Fri Aug 16, 2019 10:44 pm

It's a tradeoff.

If you want to be able to edit files in the Metro's Flash array from a computer, the filesystem has to be read-only to the microcontroller. The filesystem has to be read-write for the microcontroller to store information to the array itself. Trying to do both at the same time can scramble the contents of the array.

As long as you don't plan to edit files on the computer, you can leave the filesystem read-write to the microcontroller. The switch just makes it easier to change from one to the other.

Posts: 61107
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.