-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
system_rtc_mem_write not working in latest code #619
Comments
Yes, i think while adding a workaround for "RTC MEM CHECK FAIL", i made it wipe user data as well:
|
Just as an FYI - this is still not working in the latest trunk code |
I guess for a work around i can change to use EEPROM. What are the pros and cons of EEPROM compared to the RTC memory? EEPROM seems quite a lot slower for one thing. |
Playing around with this some more just now and i find that the example code at the top of this issue works ok if the RTC memory address is changed from 64 to be 65. Thats odd isn't it? The ESP8266 SDK Guide is pretty clear that 64 is the start of the user area. |
Still an issue in a current release. But... using to the next segment (not 64) works... |
sure enough starting at 65 works, i had spend hours and hours trying to figure out why it doesn't work! |
Hi, The is also an issue at address 124. (124th byte of the user memory. If you run the following code, you will see that the "address" 0,1,2,3 (expected as reported by torntrousers ) and 124,125,126,127 are cleared.
|
I'm confirming that too ! So, the word 64 and word 95 are prohibited area ! 😧 |
no i don't think espressif is anywhere near running out of their systemspace, and besides that rtcmem is in a totally different memory :) that isn't shared by anything else. (correct me if i am wrong:) |
If it is not my own sketch, it is either Arduino framework, which I doubt, or Espressif SDK itself, which reserved the first 64 words but in fact it is already known that the 65th word is used by them. |
Hi guys, I'm debug this bug! That is debug sketch with hexdump the complete RTC mem (all 512 user bytes) Memory map in Arduino Serial Console look like this The code to get RTC memory working throught reboot typedef struct { void setup(){ |
You code is starting wirting/reading at word 0, which is not the UserSpace, it is SystemSpace reserved by Espressif. Simply start reading at word 64, and continue until the end of 512 bytes. |
Doh! I forgot that my bootloader clears the command passed through RTC memory even if there was no valid command there: |
Hi @igrr, Looking at #define RTC_MEM ((volatile uint32_t*)0x60001200) |
@igrr, inspired by eboot CRC, I can do the same to user_data. https://gist.github.com/murix/b7ec396c8876f44cdcc757b08de5b180 <script src="https://gist.github.com/murix/b7ec396c8876f44cdcc757b08de5b180.js"></script>RTC User data store into offset range 32 up to 127 seems do not corrupt CRC through deep-sleep cycles. So, I think RTC mem is safe if offset is correct. |
finally I found this page....this bug sucks. wastes my hours!!! |
Has something change in how to use system_rtc_mem_write?
The following sketch works with the old 1.6.1 release and the serial prints show the rtc byte incrementing, but with the latest code it doesn't work and always outputs "first time".
The text was updated successfully, but these errors were encountered: