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

Fix restoring of CPENABLE #2315

Merged
merged 4 commits into from
Oct 9, 2024
Merged

Fix restoring of CPENABLE #2315

merged 4 commits into from
Oct 9, 2024

Conversation

bugadani
Copy link
Contributor

@bugadani bugadani commented Oct 9, 2024

esp-wifi did not save the CPENABLE state, which sometimes resulted in the FPU being turned off. This can happen if esp-wifi decides to switch context in a lower-priority ISR, without float-save-restore being enabled.

The original issue is tricky to reproduce because previously we didn't change the word in the stack frame at all, so esp-wifi "restored" what was there before.

With float-save-restore this issue shouldn't happen since we don't disable the FPU.

@@ -254,7 +284,7 @@ generic-queue = [
integrated-timers = [
"esp-hal-embassy/integrated-timers",
]
octal-psram = ["esp-hal/octal-psram", "dep:esp-alloc"]
octal-psram = ["esp-hal/octal-psram", "esp-alloc"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

dep: meant there was no implicit esp-alloc feature, which I need in the new test.

Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

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

Thanks! Nice you were able to create a test for this!

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.

Thanks! I tried using this in my project where I was running into this and it now works correctly without the float-save-restore feature enabled 🎉

@MabezDev MabezDev added this pull request to the merge queue Oct 9, 2024
Merged via the queue into esp-rs:main with commit be9dc0e Oct 9, 2024
28 checks passed
@bugadani bugadani deleted the float branch October 9, 2024 10:49
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.

3 participants