-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Implement interface to: system_rtc_mem_write #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I had a few long thoughts about this. Maybe you could just use EEPROM to store your state instead.... Just about the only difference would be - one state lasts past a power outage, the other would not. |
Has anyone done anything on this yet? |
Imroy: Is there a specific application where using the EEPROM would not work? (I guess using RTC would use fewer EEPROM cycles, but that's about the most convincing argument I can think of to spend time on that.) |
I figure if it's available it should be supported. Let programmers decide which one they want to use. |
👍 - I'd like to use the RTC memory for short-term storage of data while the system is in deep sleep. In my application I'm using EEPROM for storing other stuff long-term and I'd rather not use it. |
Another upvote for RTC RAM read write feature. |
I have attempted to add RTC user memory access in PR #1836. Please feel free to comment on the API implementation. |
Uh oh!
There was an error while loading. Please reload this page.
I propose making a "ESP.rtcMemWrite" that would pass things to "system_rtc_mem_write". Unless your program can start at any point and continue there (a routine like: wake, get temp, send to internet, deepsleep, repeat), you need to write data to the RTC before deep sleep or else you have no way of knowing what you were doing when the processor resets (wakes) after deep sleep.
Write data into RTC, see if the data exists when you boot back up (will also need: ESP.rtcMemRead/system_rtc_mem_read), then continue from there.
The first parameter, des_addr, needs to be between 64 and 128. (Block index, blocks are 4 bytes long, only bytes 256 to 512 are usable by the user.) I propose encapsulating all of this into something easy to use. (Maybe just pass in a byte/number from 0 to 256 and translate that into a "RTC storage slot" or something.)
Maybe... even have just 256 bytes passed into ESP.deepSleep (as a third parameter pointer?), and provide some other function to access them after the restart. Maybe that's messy though, not sure.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: