What is the size limitation of the nvm storage in module pycom?
-
What is the size limitation of the
nvsfunction?Is it not possible to return the amount that is still free?
pycom.nvs_set(key, value)
pycom.nvs_get(key) -
Well no answer since 3 months. I have tried it myself and filled the
lopyby running:import pycom pycom.nvs_erase_all() ii=0 while True: try: print(ii) pycom.nvs_set('loc'+str(ii), ii) ii+=1 except: OSErr as err: print(err, ii-1) breakIt will run and exit with
"No space available 613", so locations0-613can be used. Every location is filled with its "index number".pycom.nvs_get('loc614') will return None pycom.nvs_get('loc613') will return 613 pycom.nvs_get('loc612') will return 612, etc.UPDATING any location:
pycom.nvs_set('loc612', 0x55aa) gives an error:Will return an error:
"OSError no space available"Removing a single entry:
pycom.nvs_erase('loc613')If it does not exist the error
"KeyError: key not found"is returnedThen when you store the value again:
pycom.nvs_set('loc613', 0x55aa)But when doing it again you end up with the
"OSError: no space available"So there are
614locations available where you can store a 32bit value.There seem to be a BUG when UPDATING an EXISTING parameter when it is filled to the maximum. So there is possible a wrong offset (range) that only is visible when all of the memory is used.
It would be a nice feature to know the begin and end of the flash "NVM" storage space to calculate a checksum to see if there is no corruption of the flash.
Also a function to get a list of all the names of the parameters would be nice.
-
I do not know but it may depend on fw version. Also no idea whether stored data survives fw update or not. I'm missing methods
- get number of total/used indexes
- get list of keys
Also there are some smaller issues with retrieving data with non existing keys, etc.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login