Simple Pre-Purchase Questions (RTC/memory/flash/NVS)
Posted: Thu Aug 23, 2018 6:40 am
Hello,
I am looking forward to designing a product to run on an ESP32. So far I like what I have seen and found out via research, however, I'm having a bit of trouble finding simple answers to a few relatively simple questions. I have done some research, but keep coming up with technical documentation that provides deep details but simple answers to my simple questions. So please be nice! If you would include links/references to the parts of the documentation that have these clear answers (if available) will help me find these types of answers in the future for myself.
Project Scenario:
I would like to store a relatively simple data structure (made of ints and strings) in non-volatile memory to be retained over any and all power cycles, power failures and resets. It would be ideal if I could store the data structure as-is (so using the NVS library is non-ideal, although technically doable). The data structure is expected to be changed infrequently, on the order of an average of once per week for the lifetime of the product (2-6 years). I expect to develop in C/C++ on Eclipse.
Memory Questions:
1) How much non-volatile memory is available to me to use for storage on the "No embedded flash" versions of the ESP32? (I recognize that the versions with 2mb of embedded flash will have 2mb, of course)
2) Where is this stored? I reviewed the documentation and saw the partitioning, as well as the ROM/RAM/RTC Fast/Slow distribution. If this answer is complex, please give a 30,000 foot overview.
3) Can I use NVM, FAT and SPIFFS to access this area, or are only some of these methods supported/recommended?
4) What is the expected write lifetime of this memory? I have seen multiple answers anywhere from 10k to 100k writes proposed on this forum.
5) Do the provided NVS, FAT, and SPIFFS libraries/functions all automatically use wear leveling, or does it need to be explicitly invoked in code using the wear leveling API? In this case, can NVS even use wear leveling? I have seen conflicting answers to this question on the forum.
6) Will keeping this type of storage impact the ability to do an over the air firmware update?
Other Questions:
1) Are these assumptions correct: The RTC contains the system for managing low power modes, including an actual Real Time Clock. All storage in the RTC is volatile and will be lost upon power failure.
2) Can a battery easily be added to the RTC block to maintain both real time clock and RTC memory in case of a primary power failure?
Thats all I can think of at the moment. I may return with more questions.
Thank you all very much for your help and patience!
I am looking forward to designing a product to run on an ESP32. So far I like what I have seen and found out via research, however, I'm having a bit of trouble finding simple answers to a few relatively simple questions. I have done some research, but keep coming up with technical documentation that provides deep details but simple answers to my simple questions. So please be nice! If you would include links/references to the parts of the documentation that have these clear answers (if available) will help me find these types of answers in the future for myself.
Project Scenario:
I would like to store a relatively simple data structure (made of ints and strings) in non-volatile memory to be retained over any and all power cycles, power failures and resets. It would be ideal if I could store the data structure as-is (so using the NVS library is non-ideal, although technically doable). The data structure is expected to be changed infrequently, on the order of an average of once per week for the lifetime of the product (2-6 years). I expect to develop in C/C++ on Eclipse.
Memory Questions:
1) How much non-volatile memory is available to me to use for storage on the "No embedded flash" versions of the ESP32? (I recognize that the versions with 2mb of embedded flash will have 2mb, of course)
2) Where is this stored? I reviewed the documentation and saw the partitioning, as well as the ROM/RAM/RTC Fast/Slow distribution. If this answer is complex, please give a 30,000 foot overview.
3) Can I use NVM, FAT and SPIFFS to access this area, or are only some of these methods supported/recommended?
4) What is the expected write lifetime of this memory? I have seen multiple answers anywhere from 10k to 100k writes proposed on this forum.
5) Do the provided NVS, FAT, and SPIFFS libraries/functions all automatically use wear leveling, or does it need to be explicitly invoked in code using the wear leveling API? In this case, can NVS even use wear leveling? I have seen conflicting answers to this question on the forum.
6) Will keeping this type of storage impact the ability to do an over the air firmware update?
Other Questions:
1) Are these assumptions correct: The RTC contains the system for managing low power modes, including an actual Real Time Clock. All storage in the RTC is volatile and will be lost upon power failure.
2) Can a battery easily be added to the RTC block to maintain both real time clock and RTC memory in case of a primary power failure?
Thats all I can think of at the moment. I may return with more questions.
Thank you all very much for your help and patience!