Closed EdMlt closed 2 years ago
First of all, what I am going to say is based on a quick read of the specs of the ESP32 RTC memory: if you post your question anywhere with a higher number of viewers (like StackOveflow) you might get a more accurate answer.
I believe the library, as it is, is not compatible with RTC memory because while you are using the RTC_DATA_ATTR
on the CircularBuffer instance, the same does not apply to the internal variables of the buffer.
My understanding is that you will have to add the RTC_DATA_ATTR
modifier to all internal variables, and to test if my assumption is correct you can open the CircularBuffer.h
file and add the modifier to these variables:
If that is the case and your test is successful, I can find a proper way to deliver this functionality in a new release.
Thanks for your quick answer ! Yes I have posted the question on StackOverflow too: https://stackoverflow.com/questions/70520984/circularbuffer-in-rtc-memory-while-deepsleep-on-esp32 I tried to add it, it doesn't want to compile because this atribute is for when you want to create the buffer I think
For what I have seen, each piece of data that should end into RTCmemory has to be marked with that attribute and the CircularBuffer uses 4 different pieces of data: a pointer to the internal buffer, a pointer to the head, a pointer to the tail and a number counting the stored items. If any of those pieces are lost then the whole CircularBuffer is unable to operate.
By marking the test_SensorsDatas
as RTC I believe you will only be storing the pointer the instance in RTC memory, but I might be wrong. Let's see what SO says on this...
This issue is being marked as stale as it has not been updated in the past 15 days and it will be closed in a week unless it receives the requested attention.
Issue is being closed due to lack of interaction
Hi,
I was trying to save my circular buffer in the RTC memory of my ESP32 while it is in DeepSleep. So I tried this simple function where I have struct and a circular buffer that are modified before going to Deep-sleep. The struct is modified, the ID_msg is incremented every time but the buffer size is still 1 even is I push a new value at every wake up:
The circular buffer seem to be save in the RTC memory because if it's size is too large (>200) it can't compile because it's too big for the RTC memory. So I don't know if it comes from my code or the library isn't compatible with RTC memory. Some advise or help would be appreciated. Thank you !