Skip to content
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

Add Host stubs for RTC mem read/write #2588

Merged
merged 1 commit into from
Dec 2, 2022

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Dec 2, 2022

This PR adds stubs for the system_rtc_mem_read and system_rtc_mem_write functions so that code compiles for the Host arch.

No immediate use-cases fo this, but for future consideration it might be useful to make these functional using a backing file, similar to how flash memory is handled. One area where this might be useful is improving System.restart() behaviour, perhaps by forking a separate process which can be restarted.

TODO: RTC memory can be emulated using a backing file.
Could improve restart behaviour, perhaps by forking a separate process which can be managed.
@what-the-diff
Copy link

what-the-diff bot commented Dec 2, 2022

  • Added system_rtc_mem_read and system_rtc_mem_write functions to esp-hal.
  • These are used by the ESP8266 SDK for reading/writing RTC memory, which is not supported in Sming yet (and probably never will be).
  • The return value of these functions was changed from void* to bool so that they can indicate success or failure when called with invalid parameters (e.g., srcAddr > 127) without crashing the program due to a NULL pointer dereference on line 122 of rboot-ota.cpp: memset(data->buffer + data->length, 0xFF, len);

@slaff slaff added this to the 4.7.0 milestone Dec 2, 2022
@slaff slaff merged commit 74c7a9c into SmingHub:develop Dec 2, 2022
@slaff slaff mentioned this pull request Dec 6, 2022
5 tasks
@mikee47 mikee47 deleted the feature/host-rtc branch April 12, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants