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

Clear LP/RTC RAM #916

Merged
merged 3 commits into from
Nov 9, 2023
Merged

Clear LP/RTC RAM #916

merged 3 commits into from
Nov 9, 2023

Conversation

bjoernQ
Copy link
Contributor

@bjoernQ bjoernQ commented Nov 9, 2023

This clears LP/RTC RAM before loading ULP/LP code to make sure .bss is zeroed.

It could also be done in the runtime of the ULP/LP code but that unnecessarily eats a few bytes from the already scarce RAM.
We could also only clear the memory dedicated to .bss but clearing the whole 8/16k shouldn't make a big difference. If it ever does we can revise this decision.

Additionally while on it this renames the ulp-riscv-hal to esp-ulp-riscv-hal

Fixes #859

@MabezDev
Copy link
Member

MabezDev commented Nov 9, 2023

What happens if the main CPU goes into deep sleep and wakes up? Won't this wipe an already running LP/ULP application if it's running?

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Nov 9, 2023

I think what we should do after deep sleep is checking the reset cause - if it was a cold start the application would load a new binary otherwise let the LP core continue. I admit this case isn't totally thought through or even tested.

But even without this - without any further checks - we would load the binary again into LP ram and overwrite .data. So I guess some care is always needed for this case

Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, we can solve that problem when we get to it :)

@bjoernQ bjoernQ merged commit c612fec into esp-rs:main Nov 9, 2023
17 checks passed
@bjoernQ bjoernQ deleted the clear-lp-ram branch November 9, 2023 13:07
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.

We should rename ulp-riscv-hal before publishing
2 participants