-
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
Fix check for rtc mem sdk api in ESPClass #5330
Conversation
Looks like I messed something up with git, but I think it should be resolved once #5327 is merged. |
I think it should also mention Updater/eboot interaction, see #619 (comment) Arduino/bootloaders/eboot/eboot_command.c Line 48 in 74819a7
Arduino/cores/esp8266/Updater.cpp Line 199 in 055748f
OTA update will overwrite first 128 bytes of user section |
@mcspr I don't think that's correct. I think eboot is using the first 128 bytes (i.e.: first half) of the system data, not part of the user data. |
Per https://github.com/esp8266/esp8266-wiki/wiki/Memory-Map#memmory-mapped-io-registers Arduino/bootloaders/eboot/eboot_command.h Line 15 in 055748f
eboot writes to the user portion here, am i wrong? #define RTC_MEM 0x60001200
uint32_t data = 1751720192;
system_rtc_mem_write(64, &data, 4);
data = ((uint32_t*)RTC_MEM)[0];
Serial.println(data); (nodemcu source used as reference, checking how rtcmem used there) edit: and sorry for hijacking the pr, as it is only partially related. maybe this is better served as a documentation issue instead of adding code comments. |
@mcspr I misread the RTC_MEM define at a glance. Note: comments should be added to the Updater section and ESP-specific APIs section. |
Explain interaction between RTC user mem and OTA, where Updater saves the eboot command in the first 128 bytes of RTC user mem.
Closing in favor of #5372 . |
Also:
-added extra check to disallow zero-size read/writes
-added some comments to explain the rtc mem layout, api, interface
Fixes #2875